I frequently get an array out of bounds exception using the Matrix.solve method. It occurs at the line "while ((Math.abs(mat.el)<1e-15)&&(p<=nRows))." This while loop appears to allow the value of "p" to exceed the array bounds for the mat.el expression. I think maybe it was meant for the "if" statement that follows the while loop to be part of the while loop so the method exits when p grows too large.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi again,
I think the problem was in the condition testing. I have made an update (you can get it via checkout). But I think that if you got the exception, this is a problem of a non-invertible matrix, and you will still have the problem. Have you tried to check matrix rank before computing ?
regards,
david
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I frequently get an array out of bounds exception using the Matrix.solve method. It occurs at the line "while ((Math.abs(mat.el)<1e-15)&&(p<=nRows))." This while loop appears to allow the value of "p" to exceed the array bounds for the mat.el expression. I think maybe it was meant for the "if" statement that follows the while loop to be part of the while loop so the method exits when p grows too large.
Hi,
thanks for reporting the problem.
I will investigate this.
regards,
Hi again,
I think the problem was in the condition testing. I have made an update (you can get it via checkout). But I think that if you got the exception, this is a problem of a non-invertible matrix, and you will still have the problem. Have you tried to check matrix rank before computing ?
regards,
david