diff options
author | Matthieu Vigne <matthieu.vigne@laposte.net> | 2018-10-31 20:28:18 +0100 |
---|---|---|
committer | Matthieu Vigne <matthieu.vigne@laposte.net> | 2018-10-31 20:28:18 +0100 |
commit | 8d7a73e48e82b41f8e8b90afb434c98452556990 (patch) | |
tree | e974f6944458c71097e272ab70d899ad215caea9 /test/lu.cpp | |
parent | 66b28e290d426899bda932fa3b0617d63b3a2a75 (diff) |
bug #1617: Fix SolveTriangular.solveInPlace crashing for empty matrix.
This made FullPivLU.kernel() crash when used on the zero matrix.
Add unit test for FullPivLU.kernel() on the zero matrix.
Diffstat (limited to 'test/lu.cpp')
-rw-r--r-- | test/lu.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/lu.cpp b/test/lu.cpp index 144496e91..effde6060 100644 --- a/test/lu.cpp +++ b/test/lu.cpp @@ -57,6 +57,10 @@ template<typename MatrixType> void lu_non_invertible() // The image of the zero matrix should consist of a single (zero) column vector VERIFY((MatrixType::Zero(rows,cols).fullPivLu().image(MatrixType::Zero(rows,cols)).cols() == 1)); + // The kernel of the zero matrix is the entire space, and thus is an invertible matrix of dimensions cols. + KernelMatrixType kernel = MatrixType::Zero(rows,cols).fullPivLu().kernel(); + VERIFY((kernel.fullPivLu().isInvertible())); + MatrixType m1(rows, cols), m3(rows, cols2); CMatrixType m2(cols, cols2); createRandomPIMatrixOfRank(rank, rows, cols, m1); |