- Notifications
You must be signed in to change notification settings - Fork55
Fix the problem in slot "p" in "dgCMatrix". close #149#150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
eddelbuettel commentedJul 24, 2017
So ... from the example and tests it looks like you nailed this on the head? Read to merge now? |
dmbates commentedJul 24, 2017
I think it is peculiar that Armadillo allows for the column pointers to be decreasing in this case. You may want to check with the author if that is intentional. It is quite common to have code that checks the last element of the column pointers (position n + 1 in R and index n in C++) to determine the number of non-zeros in the sparse matrix. |
d8b4169 to3a4b69aComparethirdwing commentedJul 24, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
There is some slight difference in column pointers between Armadillo and Matrix pkg in R. In a matrix below: 3x5sparseMatrixofclass"dgCMatrix" [1,]1....[2,].1...[3,]..1.. The I think this can be intentional since we only have three nonzero elements. I will double check with the author. |
eddelbuettel commentedJul 29, 2017
Any news on checking with Conrad or other experts on sparse matrices? |
thirdwing commentedJul 29, 2017
The sparse matrix in armadillo is by Ryan (our MLPACK hero) and he is on travel. |
eddelbuettel commentedAug 1, 2017
@thirdwing Where are we on this and the off-list reply from Ryan? What's next to move this forward? |
thirdwing commentedAug 1, 2017
I am afraid we didn't get any reply from Ryan. |
eddelbuettel commentedAug 1, 2017
So what is next? Is it conceivable that Armadillo and Matrix have different ideas about corner cases of the DSC (or other) formats? Shall we document that / create test cases? |
dmbates commentedAug 1, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Every description of the compressed sparse row/column format that I have read states that the non-zeros for row/column j are in positions Another way of saying this is that, in 0-based indices the pointer array is recursively defined as It is common to determine the number of non-zeros in each column as the successive differences in the column pointers, which is why To me the solution is to convince Conrad to modify the Armadillo representation so that it is in keeping with other sparse matrix representations. |
eddelbuettel commentedAug 1, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
rcurtin commentedAug 2, 2017
Sure, no problem from my end. |
eddelbuettel commentedAug 2, 2017
From an earlier email by@rcurtin :
and by now we already have some new code to test thanks to@conradsnicta. |
thirdwing commentedAug 2, 2017
I think this has been fixed byconradsnicta/armadillo-code@763ed1a |
eddelbuettel commentedAug 2, 2017
That would be awesome. I haven't had a chance to look into the diff but I may then apply this to the pending RcppArmadillo release based on 7.960.0 (as well as all of the changes by@binxiangni). |
thirdwing commentedAug 2, 2017
I have applied that patch locally.@eddelbuettel |
eddelbuettel commentedAug 2, 2017
You mean you added it to this (pending) PR? That's very helpful. And I presume the unit test fails without it, but now passes? |
thirdwing commentedAug 2, 2017
I add that patch in this PR and it just fixed the problem and passed new tests. |
Please don't merge this. I need to double check the definition of slot "p" and "col_ptrs".
Before this PR:
Now: