aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2008-09-03 20:52:26 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2008-09-03 20:52:26 +0000
commitc29c7b0ea95b86f73d77224efb26f96abdc189ac (patch)
tree621b6db8df4a4d9e3f771bc6ffdb455e24bc25e5 /test
parente14aa8c8aa1646bbfdf501a84b0665bb17220229 (diff)
Fix bugs reported by Timothy Hunter:
* CholeskyWithoutSqrt with 1x1 matrices * .part<Diagonal>() Updated unit tests to handle these cases
Diffstat (limited to 'test')
-rw-r--r--test/cholesky.cpp1
-rw-r--r--test/triangular.cpp2
2 files changed, 2 insertions, 1 deletions
diff --git a/test/cholesky.cpp b/test/cholesky.cpp
index 36a11c723..80614346c 100644
--- a/test/cholesky.cpp
+++ b/test/cholesky.cpp
@@ -79,7 +79,6 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
}
#endif
- if (rows>1)
{
CholeskyWithoutSquareRoot<SquareMatrixType> cholnosqrt(symm);
VERIFY(cholnosqrt.isPositiveDefinite());
diff --git a/test/triangular.cpp b/test/triangular.cpp
index 22a19f974..2ada0dd90 100644
--- a/test/triangular.cpp
+++ b/test/triangular.cpp
@@ -81,6 +81,8 @@ template<typename MatrixType> void triangular(const MatrixType& m)
m1.template part<Eigen::Lower>() = (m2.transpose() * m2).lazy();
VERIFY_IS_APPROX(m3.template part<Eigen::Lower>(), m1);
+ VERIFY_IS_APPROX(m3.template part<Diagonal>(), m3.diagonal().asDiagonal());
+
m1 = MatrixType::Random(rows, cols);
for (int i=0; i<rows; ++i)
while (ei_abs2(m1(i,i))<1e-3) m1(i,i) = ei_random<Scalar>();