aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cholesky.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-06-09 23:30:04 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-06-09 23:30:04 +0200
commit4811b4526c93f4f28c57a085ee02b0eba0806afa (patch)
tree7478add6facfea22ec7cae70b20ceda0184fcb61 /test/cholesky.cpp
parenta69b4b092beec7caf87f1fe13cbba0781c651852 (diff)
Add regression test for bug #608
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()