Registered Member
|
Hello,
in my simulation I need a large (and sparse) electrical equivalent circuit. At the Moment I am using the Eigen library for Managing the matrixes and solving the equations Systems. However I found that for the case of a unsymmetrical Matrix KLU is much faster than SuperLU. Since Eigen works well I want to keep using it. Can I use the Eigen::SparseMatrx class with KLU? My guess is yes, since you can bring the SparseMatrix Class in the compressed-column form. The question is what are the needed Arrays for KLU (I refer to the KLU User Guide chapter 5.4 ):
I wont answer until 21.07, but be free to discuss |
Moderator
|
You guessed right, and you can find similar example in the code of the CholmodSupport and SPQRSupport modules. I'd also be curious to know how does BICGSTAB<MatrixXd,IncompleteLUT<double> > would perform on such problems.
|
Registered Member
|
|
Registered Member
|
I'm running in some trouble with KLU.
I try to do the sample in the KLU Userguide p18 with a Eigen Matrix (the sample itself with C Arrays works fine) my code:
where test is a Eigen::SparseMatrix<double>. The Output ist:
Then it crashes in the klu_analyze function. What I have noticed ist that in the KLU sample there is an additional outerIndex : 12 , is there a reason why it isnt there in Eigen ? |
Registered Member
|
Everything seems normal in your output. We don't just output the last term (which is the number of nonzeros). But you can find it in the array test.outerIndexPtr()
|
Registered Member
|
I found my error: test.size is the number of elements but I need the number of columns /rows.
Sorry and thanks. |
Moderator
|
Feel free to share your KLU wrapper once it's ready! I'm sure it will be useful to many people.
|
Registered Member
|
Ok here is my wrapper. It is not sophisticated, because I have no time to test it with various templates.
At the current state it works only for x,b as vector (in Ax=b) but I think you can expand it to matrices if you Change the "1" in :
I hope it helps some one.
|
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]