adamaulia / efficient-java-matrix-library

Automatically exported from code.google.com/p/efficient-java-matrix-library
0 stars 0 forks source link

LinearSolverChol::solve(B,X) - obvious BUG in dimensions check #44

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
in LinearSolverChol.java:78:

if( B.numCols != X.numCols && B.numRows != n && X.numRows != n) {
            throw new IllegalArgumentException("Unexpected matrix size");
}

obviosuly, must be:
if( B.numCols != X.numCols || B.numRows != n || X.numRows != n) {
...

otherwise, the exception is thrown only if ALL preconditions fail.

Original issue reported on code.google.com by illya.ko...@gmail.com on 26 Apr 2014 at 11:18

GoogleCodeExporter commented 9 years ago
Fixed the check and added unit tests which can catch the error.  Code has been 
updated on the new GitHub repository.  Thanks!

Original comment by peter.ab...@gmail.com on 27 Apr 2014 at 2:48