This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to get matrixL/matrixU from CholmodSupernodalLLT/Pardiso

Tags: None
(comma "," separated)
tienhung
Registered Member
Posts
29
Karma
0
Hi all, I am new with Cholesky decomposition, just started with it today. Can anyone tell me how to get matrixL and matrixU from CholmodSupernodalLLT and PardisoLLT/PardisoLDLT? If it is not easy for users to implement these functions, should we consider it as a feature request for next Eigen? Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
If you really need access to the factor to do your own cooking, then better use the built-in SimplicialL{D}LT<> class. Extracting the factors from the supernodal internal represations of Cholmod/Pardiso is indeed not straightforward and very rarely needed. We have to check, but if Cholmod/Pardiso provide routines to manipulate the factors, like applying it to a vector, then we could let matrix{L,U}() returns a pseudo expression wrapping these routines.... What do you need to do with the factors?
tienhung
Registered Member
Posts
29
Karma
0
ggael wrote:If you really need access to the factor to do your own cooking, then better use the built-in SimplicialL{D}LT<> class. Extracting the factors from the supernodal internal represations of Cholmod/Pardiso is indeed not straightforward and very rarely needed. We have to check, but if Cholmod/Pardiso provide routines to manipulate the factors, like applying it to a vector, then we could let matrix{L,U}() returns a pseudo expression wrapping these routines.... What do you need to do with the factors?


Thanks for your help. I am trying to speedup the update process of sparse direct solver in some special cases of rank-one update. The first step is breaking matrix L into blocks after permutation. I did a comparison and realized that CholmodSupernodalLLT/PardisoLLT beat all other solvers in term of running time , so I want to stick with the winners.
tienhung
Registered Member
Posts
29
Karma
0
Hi ggael,

How can we access parameter m_cholmodFactor in CholmodSupport.h? I tried a small example with Eigen::viewAsEigen() and got errors

First I added a normal function in CholmodSupport.h
Code: Select all
cholmod_factor* factor()
{
   eigen_assert(m_factorizationIsOk && "you must first call either compute() or factorize()");
   return m_cholmodFactor;
}


And then call it later as follow:

Code: Select all
typedef Eigen::SparseMatrix<double, 0, int>         EigenSparse;
typedef Eigen::CholmodSimplicialLLT<EigenSparse>   CholmodLLTSolver;
.........
CholmodLLTSolver dec;
dec.compute(A); //matrix A is SPD
      
cholmod_common com = dec.cholmod();
cholmod_factor* lower_factor = dec.factor();
cholmod_sparse* lower_cholmod_sparse = cholmod_factor_to_sparse(lower_factor, &com);
EigenSparse lower_eigen_sparse = Eigen::viewAsEigen(lower_cholmod_sparse); //Error here, can't convert argument from EigenSparse* from Eigen::SparseMatrix


Since Eigen::viewAsEigen() gives us only shared data, how to use it safely in my case?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
The factor is stored through supernodes using an internal representation of Cholmod, so you first need to look at Cholmod to see how to convert it to a standard sparse representation..


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], q.ignora, watchstar