awsteiner / o2scl

Object-oriented Scientific Computing Library
https://awsteiner.org/code/o2scl
GNU General Public License v3.0
34 stars 14 forks source link

LU decomposition test fails on 64-bit #9

Closed badshah400 closed 5 years ago

badshah400 commented 5 years ago

Oddly LU decomposition tests fail on x86_64 architectures while passing on i586 (gcc 9.2.1, boost 1.69, armadillo 9.700.2):

[ 1354s] Some tests failed in file: lu.scr
[ 1354s] O2scl range checking on.
[ 1354s] FAIL: relative matrix max=1.240624e+01
[ 1354s]  LU decomp
[ 1354s] FAIL: relative matrix max=1.240624e+01
[ 1354s]  LU decomp
[ 1354s] FAIL: relative matrix max=1.000000e+00
[ 1354s]  LU decomp
[ 1354s] FAIL: relative matrix max=1.032563e+01
[ 1354s]  LU decomp
[ 1354s] FAIL: relative matrix max=1.240624e+01
[ 1354s]  LU decomp
[ 1354s] FAIL: relative matrix max=4.505220e+00
[ 1354s]  LU decomp
[ 1354s] FAIL: relative matrix max=3.671611e+00
[ 1354s]  LU decomp
[ 1354s] 147 tests performed.
[ 1354s] At least one test failed.
[ 1354s] Last failed test: max=3.671611e+00
[ 1354s]  LU decomp
[ 1354s] One or more O2scl tests failed.

Full build log here: https://paste.opensuse.org/78728641

awsteiner commented 5 years ago

This is probably because I haven't kept up with the LU decomposition advances in GSL, so I will look into this next week. Thank you for pointing this out.

awsteiner commented 5 years ago

I made some progress on dtrsv(), but the LU updates will take me awhile. The LU decomposition works, it's just that the answers are a bit different because the algorithm is different (the test matrices are small, so I think GSL uses the level-2 blas results). Thus I've just changed the code that the tests don't fail on small finite-precision errors. I think that should fix it, but let me know if you still have problems. I'll close this issue in a couple weeks if I don't hear back that the problems continued. Thank you for reporting.

awsteiner commented 5 years ago

It turns out that part of the problem was the testing matrix was ill-conditioned, so the tests were too noisy. I just fixed this in 8ec947675d4c6e27c06e2fbf8fa541c7e0df4860 .