Map dgCmatrix as integer sparse matrix
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start with the RcppEigen sparse-matrix mapping entry points used by Eigen::Map and the dgCmatrix/ngCmatrix types described in the issue. Determine whether integer mapping avoids deep copies and define what support for ngCmatrix would require; done should include verified behavior and coverage for the requested mapping.
Written by the indexing model from the issue text.
Description
Dear developers,
I have a dgCmatrix in R and want to call a function as below in cpp to deal with it.
Eigen::SparseMatrix calc_overlap(Eigen::Map<Eigen::SparseMatrix<int>>& cc_adj,
Eigen::Map<Eigen::SparseMatrix<int>>& cg_adj,
double threshold) {
Eigen::SparseMatrix<int> overlap_mat_all = cc_adj * cg_adj;
return overlap_mat_all;
}
The dgCmatrix 'cc_adj' and 'cg_adj' in R are large sparse matrices with integer values. I want to calculate the product of them by cpp. I used 'Map' to get rid of deep copies of these two large matrices. The scalar <int> is used to save memory. There is no error raised up when mapping to a dgCmatrix with <int>. but I'm not sure how it's working exactly. I guess the function makes deep copies instead, so the mapping doesn't work at all. Is it right?
My concern is that since you only allow mapping to dgCmatrix format sparse matrix for now, is there any possibility that you could wrap up a function to deal with 'ngCmatrix'?
Looking forward to your kind reply.
- Dominant language
- C++
- Stars
- 118
- Forks
- 43
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from RcppCore/RcppEigen
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
All issues in RcppCore/RcppEigen
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Sensor initialization takes very long when `--initial-sim-time` is set to current UNIX timestamp Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
gazebosim/gz-sensors#662 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LadybirdBrowser/ladybird#12123 ·