| Description: |
When a matrix has a row consisting of zero's we get an error:
(bin) 49 % package require math::linearalgebra
1.1.7
(bin) 49 % set b {{2 3 4} {-2 3 4} {1 1 1}}
{2 3 4} {-2 3 4} {1 1 1}
(bin) 50 % set M {{0 0 0} {-2 3 4} {1 1 1}}
{0 0 0} {-2 3 4} {1 1 1}
(bin) 51 % math::linearalgebra::solveGauss $M $b
domain error: argument not in valid range
(bin) 52 %
I don't know how this algorithm works, but looking in the code I see division by a factor $sweep_fact where sweep_fact is taken directly from a matrix value, so that would give problems anyhow.
Groeten,
Harm Olthof
|
| User Comments: |
arjenmarkus added on 2024-09-05 06:56:57:
With a row of zeroes the matrix is singular and therefore there is no (ordinary) unique solution. The code might be made more robust, so that such errors are handled more decently.
You might instead look for solutions using singular value decomposition, such as leastSquaresSVD.
|