Registered Member
|
I'm trying to test the library and I've some files that I use to populate six square sparse matrices that I try to solve with BiCGStab and ILUT preconditioner, their sizes are 1891, 5781, 10671, 16561, 23451 and 46902.
I generate a X0 Dense Vector that contains all elements from 0 to size-1, i.e. X0_1891 = {0,1,....,1890}. Then I find
Finally using different kinds of solvers I should get the solutions and, in case of iterative solvers, the relative error. I've done this program (I'm not confident with C++ so it might not be so optimized), but just the first matrix seems to converge and the time it takes to solve the problem is quite high, about 12-13 seconds, when it takes only few seconds with another Java library that I expected to be slower.
|
Moderator
|
Performance wise, make sure you compiled with optimization ON. Then convergence with ILUT highly depends on the parameters you use. For symmetric problem, a simple Jacobi preconditioner (default one) might also be faster. For benchmarking purpose, you can try our bench routine: http://eigen.tuxfamily.org/dox-devel/gr ... tml#title3
|
Registered Member
|
Hello ggael and thanks for answering. I've some preset matrices, some are simmetric, some aren't, but all of them are square and sparse. I now have the same issue with a second program with a bit tidier code and I got the slowdowns and convergence issues again, I can't really understand where the issue is. It only solves the smaller non-symmetric matrix (square sparse 1891x1891), the others return solver.info() = 2. I don't have any issues with the symmetric ones. How should I set the solver and preconditioner to make it more likely to converge? This is the new code:
|
Registered Member
|
Hi, All, i have the same convergence issue too. It does not converage even for small matrix such as 200 * 200. The following is my code:
Eigen::BiCGSTAB<Eigen::SparseMatrix<double> , Eigen::IncompleteLUT<double>> BCGSTCOND; BCGSTCOND.preconditioner().setFillfactor (10000); BCGSTCOND.preconditioner().setDroptol(.001); BCGSTCOND.setMaxIterations(iteration_max); BCGSTCOND.setTolerance(converageTol); BCGSTCOND.compute(*eigenSparMatrix_); if(BCGSTCOND.info() != Eigen::Success) return false; Eigen::VectorXd x = BCGSTCOND.solve(b); if(BCGSTCOND.info() != Eigen::Success) return false; |
Moderator
|
Regarding BiCGSTAB, you might try the current 3.2 branch (https://bitbucket.org/eigen/eigen/get/3.2.tar.gz, future 3.2.2). I fixed a regression a few hours ago. Nonetheless, note that the convergence of the BiCGSTAB algorithm is not guaranteed and it depends a lot on the kind of problem and preconditionner.
|
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]