Registered Member
|
Recently, I tried to use Eigen 3.3.3 to calculate acoustic finite element problem, but I have a problem to use SimplicialLDLT solver to solve sparse matrix.
For the equation Ax=v, A is the sparse matrix, v is the sparse vector. 1. The code of LU solver is:
The value of LU solver info is zero, the results of LU agree well with results of SkyLine solver coded by Fortran. 2. The code of SimplicialLDLT solver is:
LDLT solver info is zero, but the results of the LDLT solver is inconsistent with expectations. 3. Then I try to use LDLT with upper triangular matrix, and the code is:
LDLT solver info is zero and the results of method 2 and 3 are the same. Ps: Sparse Matrix A is symmetrical can be identified. By the way, how to inquire the number of nonezero elements in a sparse matrix? how to install suitesparse with Qt in windows? Thanks |
Moderator
|
Your code looks fine, but LDLT or LLT assumes that your matrix is self-adjoint (aka hermitian), that is not the same as symmetric for complexes:
symmetric: A == A.transpose() selfadjoint: A == A.transpose().conjugate() == A.adjoint() For the number of non zeros: A.nonZeros() |
Registered Member
|
Get it, thanks |
Registered Member
|
Is there a way to copy the upper triangular part of a sparse martix to the lower part by calling function? |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]