1

Let's say I have a matrix MatrixXd A and its LLT factorization:

LLT<MatrixXd> llt(A);

How can I save the factorization result to a file and load it later, so that we don't need to do the factorization again in the future runs?

I know we can obtain the L matrix via MatrixXd L = llt.matrixL() and save L to file, but I don't see a way to reconstruct the llt object from the L matrix.

hklel
  • 1,624
  • 23
  • 45
  • 3
    Eigen doesn't provide serialization mechanisms, so the answer is probably there is no such routine. – Matthieu Brucher Dec 17 '18 at 09:33
  • @MatthieuBrucher Thanks! I guess I will have to store and load the `L` matrix, and manually solve the system using `L.triangularView().solve()` – hklel Dec 17 '18 at 10:01
  • 1
    If you just want to solve linear systems, you can indeed write two triangular solves (making sure the order is correct, of course. For re-constructing an LLT object from a triangular matrix, there is an [open feature request](http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1599) which currently mostly needs an API-decision -- the implementation would be trivial. And as @MatthieuBrucher said, Eigen provides no serialization, so that part still needs to be done by yourself. – chtz Dec 17 '18 at 10:24

0 Answers0