![]() Registered Member ![]()
|
Hi, developers!
I was used Eigen in my project. I have Sparse Matrix data in CRS or CCS format like next structre
I woudn't use new memory like use SparseMatrix::setFromTriplets or SparseMatrix::resize(newsize1, newsize2); StorageIndex* pIn = SparseMatrix::outerIndexPtr();
I want use my stored data in Eigen::SparseMatrix In my project was created litle fake wrapper, this code
This fake wrapper is work in project for future solving System Linear Algebraic Equation like
On my opinion using external data in Eigen::SparseMatrix maнbe useful many people. But using fake wrapper for it is not very good ! I think that in future realeases you create new special template classes for this feature. Best regards, Majorov S. |
![]() Moderator ![]()
|
You can use Map<SparseMatrix> which is similar in spirit to your wrapper. Then you should still pass SparseMatrix to the solver template parameter:
this won't make any copy. |
![]() Registered Member ![]()
|
Hi, ggael!
Thank's for answer. But I understand, that is mean your code
Let I have matrix [1 0; 0 1]; In code
Can you write working code for construct Ref<SparseMatrix<double,RowMajor> >? |
![]() Moderator ![]()
|
oops, I wrote Ref instead of Map (I've edited my previous comment to fix it, then please refer to the doc: http://eigen.tuxfamily.org/dox-devel/cl ... _01_4.html to see the constructor argument order.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]