mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
bug #1617: add unit tests for empty triangular solve.
This commit is contained in:
@@ -98,6 +98,19 @@ template<typename Scalar> void sparse_solvers(int rows, int cols)
|
||||
initSparse<Scalar>(density, refMat2, m2, ForceNonZeroDiag|MakeLowerTriangular, &zeroCoords, &nonzeroCoords);
|
||||
VERIFY_IS_APPROX(refMat2.template triangularView<Lower>().solve(vec2),
|
||||
m2.template triangularView<Lower>().solve(vec3));
|
||||
|
||||
// test empty triangular matrix
|
||||
{
|
||||
m2.resize(0,0);
|
||||
refMatB.resize(0,refMatB.cols());
|
||||
DenseMatrix res = m2.template triangularView<Lower>().solve(refMatB);
|
||||
VERIFY_IS_EQUAL(res.rows(),0);
|
||||
VERIFY_IS_EQUAL(res.cols(),refMatB.cols());
|
||||
res = refMatB;
|
||||
m2.template triangularView<Lower>().solveInPlace(res);
|
||||
VERIFY_IS_EQUAL(res.rows(),0);
|
||||
VERIFY_IS_EQUAL(res.cols(),refMatB.cols());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user