aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/basicstuff.cpp14
-rw-r--r--test/cholesky.cpp2
-rw-r--r--test/product.h2
3 files changed, 16 insertions, 2 deletions
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp
index 40e999c87..75efd4d10 100644
--- a/test/basicstuff.cpp
+++ b/test/basicstuff.cpp
@@ -95,6 +95,20 @@ template<typename MatrixType> void basicStuff(const MatrixType& m)
VERIFY_RAISES_ASSERT(m1 = (m2.block(0,0, rows-1, cols-1)));
}
+ // test set
+ {
+ VERIFY_IS_APPROX(m3.set(m1),m1);
+ MatrixType m4, m5;
+ VERIFY_IS_APPROX(m4.set(m1),m1);
+ if (MatrixType::RowsAtCompileTime==Dynamic && MatrixType::ColsAtCompileTime==Dynamic)
+ {
+ MatrixType m6(rows+1,cols);
+ VERIFY_RAISES_ASSERT(m5 = m1);
+ VERIFY_RAISES_ASSERT(m3 = m5);
+ VERIFY_RAISES_ASSERT(m3 = m6);
+ }
+ }
+
// test swap
m3 = m1;
m1.swap(m2);
diff --git a/test/cholesky.cpp b/test/cholesky.cpp
index f7eb7800e..a64a45c45 100644
--- a/test/cholesky.cpp
+++ b/test/cholesky.cpp
@@ -65,7 +65,7 @@ template<typename MatrixType> void cholesky(const MatrixType& m)
Gsl::cholesky_solve(gMatA, gVecB, gVecX);
VectorType vecX, _vecX, _vecB;
convert(gVecX, _vecX);
- vecX = symm.cholesky().solve(vecB);
+ vecX.set( symm.cholesky().solve(vecB) );
Gsl::prod(gSymm, gVecX, gVecB);
convert(gVecB, _vecB);
// test gsl itself !
diff --git a/test/product.h b/test/product.h
index f1a16cf1f..5ca56d995 100644
--- a/test/product.h
+++ b/test/product.h
@@ -67,7 +67,7 @@ template<typename MatrixType> void product(const MatrixType& m)
RowVectorType v1 = RowVectorType::Random(rows),
v2 = RowVectorType::Random(rows),
vzero = RowVectorType::Zero(rows);
- ColVectorType vc2 = ColVectorType::Random(cols), vcres;
+ ColVectorType vc2 = ColVectorType::Random(cols), vcres(cols);
OtherMajorMatrixType tm1 = m1;
Scalar s1 = ei_random<Scalar>();