Registered Member
|
Hi there!
We have been recently adapting our code that worked with Eigen versions 3.2.2 - 3.2.5 to work with Eigen 3.3-alpha1 (I also tried with the mercurial of today without success). And I am running into issues when assigning (= operator) SparseMatrix, the compiler main complaint being "/usr/include/eigen3/Eigen/src/SparseCore/SparseMatrixBase.h:376:34: error: ‘void Eigen::SparseMatrixBase<Derived>::evalTo(Dest&) const [with Dest = Eigen::Matrix<double, -1, -1>; Derived = Eigen::TriangularView<const Eigen::SparseMatrix<double>, 2u>]’ is private". A bigger snapshot of the offending code is below, but the compilation problem is in these lines using the = operator:
I think I can get away in the case of SqrJT (first line above), by using the standard constructor and then calling compute(). However, I have not managed to get away with the assignation of the R matrix. For the sake of completeness, this code does compile perfectly:
But as you can imagine, my R matrix does not have the result of the QR decomposition, as the assignation is commented out. This is the larger code snapshot I was referring to:
In case you find it useful, the whole code file is available here: https://github.com/abdullahtahiriyo/Fre ... cs/GCS.cpp The relevant member function is "int System::diagnose(Algorithm alg)" and starts in line 1793. The whole relevant compiler output is:
I wonder if this is a bug in Eigen 3.3 as this used to work fine in Eigen 3.2, or it is intended and I should change my code somehow. Thanks in advance, Abdullah |
Moderator
|
|
Registered Member
|
You are welcome!!
I have just tested it. Thank you very much for fixing it so fast Regards, Abdullah |
Registered Member
|
Just one thing you might want to fix. This was working in Eigen 3.2.2-3.2.5:
Now it does not, with this compiler error:
For our project I can get it work-around by using:
instead, but I think you may consider it a bug Thanks again, abdullah |
Moderator
|
This is on purpose. Factorisations are not copyable, the fact it worked with 3.2 is just luck (and that we forgot to make it non-copyable). This syntax is also more expensive in c++98 (memory copy and consumption).
|
Registered Member
|
Ok. Thank you very much for the explanation.
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]