pseudoSqrt() and rankReducedSqrt()

Posted by Li, Peter on
URL: http://quantlib.414.s1.nabble.com/pseudoSqrt-and-rankReducedSqrt-tp9265.html

Hi, Luigi,

in pseudoSqrt.cpp the checking of symmetric matrix may fail due to rounding errors in construction of a matrix.

For safety, line 235 and 343

 

           QL_REQUIRE(matrix[i][j] == matrix[j][i],

                           "matrix not symmetric");

 

should be changed to  QL_REQUIRE(fabs(matrix[i][j] -matrix[j][i])< QL_EPSILON ,

                           "matrix not symmetric");

 

The current check thinks

0.026098788171586292  0.026098788171586288 are different.

 

Thanks.

 

------------------------------------

Peter Li 

 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev