Registered Member
|
I'm trying to solve something using the Conjugate Gradient method:
both iX and iB are of type VectorXd I'm quite confident the sizes of the matrices and vectors match. The problem I'm facing is I crash on this assert somewhere in the solve method. assert:
stacktrace:
Does anybody have an idea what is going wrong? Thanks a lot |
Registered Member
|
It only seems to happen when the lower triangle of the A matrix is used. If I explicitly specify to use the upper triangle:
the assert isn't fired. Kind regards |
Moderator
|
How is your matrix? Is it complete, i.e., both the upper and lower parts are stored? only the lower? only the upper?
|
Moderator
|
either way, I cannot reproduce. Make sure you have the latest development version.
If you still get the issue, could you send us your matrix: #include <unsupported/Eigen/SparseExtra> ... saveMarket(iA, "iA.mtx"); and send a gzipped version of the iA.mtx file to me. thanks |
Registered Member
|
I'm working with Eigen 3.1.0-alpha1 from the mainpage. Is this the latest version or should I get some version somewhere else. If so, where do I find this version?
The matrix I'm using is completely filled. It is constructed by multiplying the transpose of a SparseMatrix with the SparseMatrix itself. Thanks |
Registered Member
|
Solving using SimplicialLDLt does work. But the matrix could grow quite large, so I expect performance issues with this method, which is the reason I would prefer to use the conjugate gradient method.
Regarding a matrix with which I have issues, as I couldn't find your e-mail address immediately and this forums do not allow attachments as far as I know I'v copy-pasted the contents of the mtx file here:
|
Moderator
|
I cannot reproduce, here is the code I used:
|
Registered Member
|
mmm, weird.. I do basically the same thing, except my b-vector entries are mostly zeros.
One thing I could think of is that I do something wrong here, which results in an invalid matrix or so:
Maybe if it would help somehow, I'm on a mac compiling using llvm. Are there still any changes in the cg code since the 3.1.0-alpha1 release that could maybe explain the difference? Thanks for your help |
Moderator
|
The default compiler on mac is known to sometime produce invalid piece of codes, you should give a try to gcc 4.6 of macport. Note that you can simply write:
iB = iA.transpose() * iB; iA = iA.transpose() * iA; |
Registered Member
|
Thanksm I'll give gcc a try. Do you plan to fix issues with llvm in the future?
|
Moderator
|
the issues I'm talking about are on apple's side
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]