Registered Member
|
Hello,
I use BiCGSTAB solver. When I use solve method, it works fine. But when I use solveWithGuess it cannot solve the problem (comes out with 100 iterations and not Success). It is somehow strange because providing an initial guess should help the solver. Here is my code:
What should I do? |
Moderator
|
which Eigen version? what about the residual with x0 and the resulting x?
|
Registered Member
|
I am using Eigen 3. I am using Ubuntu package.
I did not check residuals etc., because in the first place I expect a decrease in the number of iterations. |
Moderator
|
In Eigen3.2 we have a restart strategy such that if your initial guess is problematic, we restart with another guess. Checking the residuals will also help to understand what is wrong with your guess. It's easy to compute: (A*x-b).norm()/b.norm()
|
Registered Member
|
The norm of x0 is something between 0.0055 and 0.0065 in different time steps. Meanwhile, the norm of produced x is between 5e-17 to 3e-15.
|
Moderator
|
it cannot be better with double, so it should report Success. Could you try with Eigen 3.2 because I see there has been a few fixes in BiCGSTAB. |
Registered Member
|
Thank you ggael. I installed version 3.2 and now everything works fine and in a logical manner.
|
Registered Member
|
I've been having a similar problem with BiCGSTAB.
Here is an example where I solve a system and use the solution as a subsequent guess. On the first solve I get a very reasonable answer with a very low residual (5.3084e-011) in a short time On solvewithguess however, I get a completely unreasonable answer with a huge residual (8.29119e+016) in about 10x the time as the original solve. I would have expected solvewithguess to return (about) the same result after the first iteration. Why doesn't this happen? This problem persists in Eigen 3.2.1 and 3.2.2
|
Moderator
|
We cannot help without the matrix or a way to reproduce the issue. See this example (http://eigen.tuxfamily.org/dox-devel/gr ... tml#title3) to export 'mat' and 'b' to files.
|
Moderator
|
nevermind:
|
Registered Member
|
Sorry, I missed this response earlier. Thank you! Bug is fixed!
|
Registered Member
|
I am facing a similar issue.
@ggael, What is your point about "Do not apply the preconditioner before starting the iterations as this might destroy a very good initial guess." I am not able to figure out where tvt173 is applying it before starting the iterations. I am seeing only compute being called, which computes the preconditioner. @tvt173, how did you fix the bug? |
Moderator
|
This is the summary of the commit that fixed the bug within Eigen! Download the latest version (https://bitbucket.org/eigen/eigen/get/3.2.tar.gz) to get the fix.
|
Registered Member
|
Thanks for your reply. I am using the latest version of Eigen and still getting the error. Here is a toy example:
Here is a typical output: problem case 0 83.66 0.22452 problem case 1 21.7196 0.170796 problem case 2 -7.39731 0.065385 problem case 3 12.3621 -0.0844874 problem case 4 -32.8539 0.0880718 problem case 5 -28.2271 0.0705384 problem case 6 -14.0711 0.272096 |
Moderator
|
How is your example relevant? It does only one iteration starting from a different initial position (b versus 0).
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]