nalgebra
nalgebra copied to clipboard
Issue with lu solver
I think there's a gotcha situation in which the LU solver fails.
let decomp = mat.lu();
let res = decomp.solve(&b).expect(format!("{} {}", mat, b).as_str());
Consider the following linear system:
┌ ┐
│ -0 -120.864365 0 1 │
│ 0 -120.864365 0 1 │
│ 173502.55 -120.86603 45485.008 1 │
│ 1 0 0 0 │
└ ┘
┌ ┐
│ 0 │
│ 0 │
│ 0 │
│ 0 │
└ ┘
Since the matrix has a repeated row, there are classes of inputs for which a solution does not exist. However, since it is asking for $b=0$, there is at least one trivial solution of x=0;
I don't know if this is something that wants to be taken into account but I will mention it just in case.