Dimension swap from cube to matrix
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
Piste de recherche
Start by reproducing the R examples with RcppArmadillo, especially the arma::cube::row() case where one remaining dimension is 1. Compare the returned dimensions for Rarray1 and Rarray2, then inspect the cube-to-matrix conversion used by arma::mat. Done means row extraction preserves the intended dimensions without regressing the column and slice examples.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
I encountered a bug in RcppArmadillo when saving a row of a cube to a matrix. If one of the remaining dimensions is just of dimension 1, then dimensions are swapped. I'll illustrate the bug with an example
cppFunction("arma::mat test_row(arma::cube Rarray) {
arma::mat test = Rarray.row(0);
return test;
}", depends="RcppArmadillo")
Rarray1 <- array(NA, dim=c(100,1,2))
dim(test_row(Rarray1))
> 1 2
Rarray2 <- array(NA, dim=c(100,2,1))
dim(test_row(Rarray2))
> 1 2
When pulling out the first row and saving it to a matrix, dimensions are not kept in the second example, but swapped. I'll tested also whether this happens also when pulling out the first column or slice, but there everything seems fine. I'll just attach the code
cppFunction("arma::mat test_col(arma::cube Rarray) {
arma::mat test = Rarray.col(0);
return test;
}", depends="RcppArmadillo")
Rarray3 <- array(NA, dim=c(1,100,2))
dim(test_col(Rarray3))
> 1 2
Rarray4 <- array(NA, dim=c(2,100,1))
dim(test_col(Rarray4))
> 2 1
cppFunction("arma::mat test_slice(arma::cube Rarray) {
arma::mat test = Rarray.slice(0);
return test;
}", depends="RcppArmadillo")
Rarray5 <- array(NA, dim=c(1,2,100))
dim(test_slice(Rarray5))
> 1 2
Rarray6 <- array(NA, dim=c(2,1,100))
dim(test_slice(Rarray6))
> 2 1
- Langage dominant
- C++
- Étoiles
- 210
- Forks
- 54
- Merge moyen
- 1 h 37 min
- PR mergées (30 j)
- 1
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de RcppCore/RcppArmadillo
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
RcppCore/RcppArmadillo#454 · 3 commentaires ·
-
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
RcppCore/RcppArmadillo#364 · 10 commentaires ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
RcppCore/RcppArmadillo#268 · 3 réactions ·
-
enhancement help wanted
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
RcppCore/RcppArmadillo#263 · 3 commentaires · 2 réactions ·
-
enhancement help wanted
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
RcppCore/RcppArmadillo#250 · 1 commentaire ·
Toutes les issues de RcppCore/RcppArmadillo
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
godotengine/godot#125913 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 90/100
-
期待增加虚线线条样式Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
-
bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 94/100
vllm-project/vllm#70568 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
mw00/project-maya#1368 ·
Les mainteneurs répondent en général sous 2 jours