Registered Member
|
Hi,
I'm trying to use Eigen with SuiteSparse for matrix inversion. I've included header files and linked with the libraries in Visual Studio on Windows using suitesparse-metis-for-windows. (https://code.google.com/p/suitesparse-m ... r-windows/) When I "compute" the Cholesky factor with Eigen::CholmodSupernodalLLT, it works fine. But when I add a line of code to "solve" a linear equation, it produces compile errors. I don't know what to do. Please, help! Thank you very much in advance.
[Error] Error 1 error C2440: '=' : cannot convert from 'void' to 'size_t' e:\documents\eigen-3.1.0\eigen\src\CholmodSupport\CholmodSupport.h 125 Error 2 error C2039: 'data' : is not a member of 'Eigen::CwiseNullaryOp<NullaryOp,PlainObjectType>' e:\documents\eigen-3.1.0\eigen\src\CholmodSupport\CholmodSupport.h 126 The errors come from the function, viewAsCholmod in CholmodSuppurt.h
|
Registered Member
|
Could you explain how to "compute" and "solve" with Eigen::CholmodSupernodalLLT?
Simple codes or reference URLs are welcomed. Thank you so much. |
Registered Member
|
I just found that it only works well with a vector argument.
That is, instead of denseMatrix = cholmodCholLLT.solve(Eigen::MatrixXd::Identity(n, n)); this works well, VectorXd x(n); VectorXd b(n); x = cholmodCholLLT.solve(b); So, I think that the choleskey solvers are only for linear equations, not for matrix inversion. |
Moderator
|
no, the problem is more likely that is does not accept expression. Doing MatrixXd I = MatrixXd::Identity(n,n); and then call solve on I should do the job. However, internally, cholmod only deals with right hand side vectors, so the solving will happen one column at once.
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]