Dimension swap from cube to matrix
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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
- Vorherrschende Sprache
- C++
- Sterne
- 210
- Forks
- 54
- Ø Merge
- 1 Std. 37 Min.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus RcppCore/RcppArmadillo
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
RcppCore/RcppArmadillo#454 · 3 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
RcppCore/RcppArmadillo#364 · 10 Kommentare ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
RcppCore/RcppArmadillo#268 · 3 Reaktionen ·
-
enhancement help wanted
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
RcppCore/RcppArmadillo#263 · 3 Kommentare · 2 Reaktionen ·
-
enhancement help wanted
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
RcppCore/RcppArmadillo#250 · 1 Kommentar ·
Alle Issues in RcppCore/RcppArmadillo
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
godotengine/godot#125913 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
-
期待增加虚线线条样式Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
-
bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 94/100
vllm-project/vllm#70568 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
mw00/project-maya#1368 ·
Maintainer antworten meist innerhalb von 2 Tagen