Registered Member
|
[SOLVED] SuperLU produces wrong result when using /01, /02 or /Ox with VC++2005SP1
Thu Mar 26, 2009 2:46 pm
When using the Eigen wrapper for SuperLU with optimizations enabled in Visual C++ 2005 SP1, the result vector doesn't contain the solution to the problem. The initial value of the x vector determines what it contains after the the solve function is finished. I've used SuperLU before in other projects (but without Eigen) and never had this problem.
Both succeeded() and solve() returns true. When using: x = Eigen::VectorXf::Constant(b.rows(), 5.0f); I get: ... 23.3701 80.9484 56.7775 35.2517 18.4563 100.196 12.018 119.995 When using x = DenseVector(b.rows()); x.setZero(); I get: ... -0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 This only happens when /O1,/O2 or /Ox are enabled. When these are not enabled (/Od) I get the correct result: ... 0.0168678 0.0747107 0.0517906 0.0197386 0.0289349 0.00835007 0.0805177 0.0658547 0.0773363 0.0338781 0.0553986 0.034374 0.0601 Edit: It works when I use x = b, but why it this necessary?
Last edited by swx on Thu Mar 26, 2009 3:32 pm, edited 1 time in total.
|
Registered Member
|
[SOLVED] SuperLU produces wrong result when using /01, /02 or /Ox with VC++2005SP1
Thu Mar 26, 2009 7:57 pm
I added the following code to the solver routine ( in sgssvx.c ):
if( Bstore->nzval && Xstore->nzval ) { assert( Bstore->nzval != Xstore->nzval ); } The assert is only triggered when using any of the optimization modes. |
Registered Member
|
[SOLVED] SuperLU produces wrong result when using /01, /02 or /Ox with VC++2005SP1
Thu Mar 26, 2009 9:10 pm
The problem: SluMatrix needs an operator=
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell