-
Notifications
You must be signed in to change notification settings - Fork 56
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in creating a unit diagonal sparse matrix #149
Comments
Actually, this has nothing to do with your code in this GSOC. This is a corner case we didn't think about. Another smaller example to reproduce this error: #include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
//
using namespace Rcpp;
using namespace arma;
//[[Rcpp::export]]
sp_mat test() {
return speye(4, 5);
}
/*
> Rcpp::sourceCpp("test.cpp")
> library(Matrix)
> test()
4 x 5 sparse Matrix of class "dgCMatrix"
Error in validObject(x) :
invalid class “dgCMatrix” object: slot p must be non-decreasing
*/ |
But after loading the package "Matrix", your error message disappeared while mine came out.
Your example might prove there might not be a problem in as<>(), but the problem might exist in wrap(). |
I have updated my error message. The problem is in |
I think we met the error because the |
Error occurred when creating a unit diagonal sparse matrix whose size is the same as another sparse matrix's. The error message is:
The text was updated successfully, but these errors were encountered: