Registered Member
|
I am dealing with mesh processing, and solving some deformations using matrix equations. Since my matrix is constant, I only need to change right hand side. I used to save the LU decomposition to a file, because calculating it would take some seconds. The problem was in fact least squares fitting, but I boiled it down to normal matrix equation Ax=b.
Now I need to add some regularization (more equations, same number of unknowns), and I intend to switch to JacobiSVD. However, I don't know which class members need to be saved to a file (and later loaded), so that solve() method works correctly. I would guess that m_matrixU, m_matrixV, m_singularValues and m_isInitialized have to be saved/loaded. What about the rest? |
Moderator
|
you also need to save m_nonzeroSingularValues, and restore the values of: m_rows, m_cols, m_diagSize.
|
Registered Member
|
If someone else needs it, here are the functions (to be added into the definition of JacobiSVD):
|
Registered Member
|
Hi dzenanz, I've added this code to the JacobiSvd definition but it will not compile due to ofstream and ifstream. I've added #include <fstream> #include <iostream> but I get a bunch of different errors. Could you please guide me to the correct way of adding this code? Thanks |
Registered Member
|
What kind of other errors are you getting? I was also afraid I will need to include fstream, but I guess I included it before including Eigen so it worked for me.
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot]