Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upError 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: