Dimension swap from cube to matrix
まだ誰も着手していません。
評価
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- C++
- スター
- 211
- フォーク
- 54
- 平均マージ
- 5分
- マージ済み PR(30日)
- 1
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RcppCore/RcppArmadillo のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RcppCore/RcppArmadillo#454 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
RcppCore/RcppArmadillo#364 · コメント 10 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
RcppCore/RcppArmadillo#268 · リアクション 3 件 ·
-
enhancement help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
RcppCore/RcppArmadillo#263 · コメント 3 件 · リアクション 2 件 ·
-
enhancement help wanted
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
RcppCore/RcppArmadillo#250 · コメント 1 件 ·
RcppCore/RcppArmadillo の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
AXERA-TECH/ax-llm#77 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
games-on-whales/wolf#509 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
-
bug-unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
NVIDIA/cuda-samples#453 ·