Registered Member
|
Hello!
I am the author of a symbolic package called CasADi and I am considering to integrate it a bit tighter with Eigen. In CasADi, there is a template based sparse matrix type where the entries are stored in the same row compressed format that you are using in Eigen. This means that in addition two the dimension and an std::vector< > with the nonzeros, I have two std::vector<int> containing the columns of each nonzero and the nonzero offset for each row. Just standard row compressed format. Is there some simple way to create an Eigen matrix out of this, without allocating new vectors for the sparsity and the data and copying the entries? Best, Joel |
Moderator
|
yes, you can use a MappedSparseMatrix<Scalar,_Flags,_Index> mat(Index rows, Index cols, Index nnz, Index* outerIndexPtr, Index* innerIndexPtr, Scalar* valuePtr)
in the future I'll probably move this feature into SparseMatrix<> itself. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]