aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cholesky.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/cholesky.cpp')
-rw-r--r--test/cholesky.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/test/cholesky.cpp b/test/cholesky.cpp
index ca7ecb1f4..a3b16bfc2 100644
--- a/test/cholesky.cpp
+++ b/test/cholesky.cpp
@@ -268,10 +268,18 @@ template<typename MatrixType> void cholesky_indefinite(const MatrixType& m)
{
eigen_assert(m.rows() == 2 && m.cols() == 2);
MatrixType mat;
- mat << 1, 0, 0, -1;
- LDLT<MatrixType> ldlt(mat);
- VERIFY(!ldlt.isNegative());
- VERIFY(!ldlt.isPositive());
+ {
+ mat << 1, 0, 0, -1;
+ LDLT<MatrixType> ldlt(mat);
+ VERIFY(!ldlt.isNegative());
+ VERIFY(!ldlt.isPositive());
+ }
+ {
+ mat << 1, 2, 2, 1;
+ LDLT<MatrixType> ldlt(mat);
+ VERIFY(!ldlt.isNegative());
+ VERIFY(!ldlt.isPositive());
+ }
}
template<typename MatrixType> void cholesky_verify_assert()