diff options
author | Gael Guennebaud <g.gael@free.fr> | 2015-06-08 15:42:15 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2015-06-08 15:42:15 +0200 |
commit | e6c5723dcdf81154c9d1bc0f7e4a1a18f2a4ef98 (patch) | |
tree | e18346461aea2faec1480d6aae41c1522ecb33d8 | |
parent | 274b1f5d7ec2efff07712fec5157f1740ee78d4c (diff) |
Add unit test for m.replicate(...)(index).
-rw-r--r-- | test/array_replicate.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/array_replicate.cpp b/test/array_replicate.cpp index f412d1aed..779c8fc2f 100644 --- a/test/array_replicate.cpp +++ b/test/array_replicate.cpp @@ -44,6 +44,19 @@ template<typename MatrixType> void replicate(const MatrixType& m) x2 << m2, m2, m2, m2, m2, m2; VERIFY_IS_APPROX(x2, (m2.template replicate<2,3>())); + + x2.resize(rows,3*cols); + x2 << m2, m2, m2; + VERIFY_IS_APPROX(x2, (m2.template replicate<1,3>())); + + vx1.resize(3*rows,cols); + vx1 << m2, m2, m2; + VERIFY_IS_APPROX(vx1+vx1, vx1+(m2.template replicate<3,1>())); + + vx1=m2+(m2.colwise().replicate(1)); + + if(m2.cols()==1) + VERIFY_IS_APPROX(m2.coeff(0), (m2.template replicate<3,1>().coeff(m2.rows()))); x2.resize(rows,f1); for (int j=0; j<f1; ++j) |