diff options
author | Gael Guennebaud <g.gael@free.fr> | 2013-06-09 23:30:04 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2013-06-09 23:30:04 +0200 |
commit | 4811b4526c93f4f28c57a085ee02b0eba0806afa (patch) | |
tree | 7478add6facfea22ec7cae70b20ceda0184fcb61 /test | |
parent | a69b4b092beec7caf87f1fe13cbba0781c651852 (diff) |
Add regression test for bug #608
Diffstat (limited to 'test')
-rw-r--r-- | test/cholesky.cpp | 16 |
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() |