Registered Member
|
Hi,
I am currently dealing with two problems: 1. I have to calculate a LU decomposition for somewhat ill defined matrices. Python and Mathematica however to do not have any problems dealing with them. If you run the following the code, L for example is not unit diagonal. What am I doing wrong here?
2. When doing the QR decomposition, is there any way to gain access to the pivot vector that is available in the equivalent matlab routine? Thanks a lot! |
Moderator
|
1- The Idendity() function is a static member of the class Matrix that returns an identity matrix. to set the matrix l to the identity, use l.setIdentity(sites,sites);
2- Use qr.colsPermutation() to get the respective PermutationMatrix. Now what's the numerical issue you are hitting? I tried your matrix and with FullPivLU, the reconstructed matrix just match the input, and solving with a random right hand side, works well too. |
Registered Member
|
Hello,
I am having a similar problem with JacobiSVD where when i am trying to compute using the FullPivHouseholderQRPreconditioner and since it does not run with Thin U|V , i compute Full U|V to finally use solve . This leads me to an error stating that the assertion for U & V has failed . Can you please point me in the direction as how to use Full PivQR with Jacobi SVD to get the decomposition . |
Registered Member
|
Hi,
sorry for the delay and thanks for the answers! There were two issues: 1. I expected the LU decomposition to give me the LDU decomposition and 2. I missed the last digit when copying the file, giving errorneous results in my code compared to numpy and mathematica. It's all good now! |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]