diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-12-18 08:56:18 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-12-18 08:56:18 +0000 |
commit | 2c656c51e6fd833c2b75d91d46c2d6539a3a578f (patch) | |
tree | 360ac8a0a12c5b112e50f0deeeac857618e70daa /test/basicstuff.cpp | |
parent | 53040f53d97f1f4a85a7a90586189240176276ea (diff) |
add matrix constructor taking an array. update unit-tests.
Diffstat (limited to 'test/basicstuff.cpp')
-rw-r--r-- | test/basicstuff.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 85793e254..a1723a429 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -150,12 +150,14 @@ template<typename MatrixType> void basicStuff(const MatrixType& m) // test Map.h Scalar* array1 = new Scalar[rows]; Scalar* array2 = new Scalar[rows]; - Matrix<Scalar, Dynamic, 1>::map(array1, rows) = Matrix<Scalar, Dynamic, 1>::random(rows); - Matrix<Scalar, Dynamic, 1>::map(array2, rows) - = Matrix<Scalar, Dynamic, 1>::map(array1, rows); - Matrix<Scalar, Dynamic, 1> ma1 = Matrix<Scalar, Dynamic, 1>::map(array1, rows); - Matrix<Scalar, Dynamic, 1> ma2 = Matrix<Scalar, Dynamic, 1>::map(array2, rows); + typedef Matrix<Scalar, Dynamic, 1> VectorX; + VectorX::map(array1, rows) = VectorX::random(rows); + VectorX::map(array2, rows) = VectorX::map(array1, rows); + VectorX ma1 = VectorX::map(array1, rows); + VectorX ma2 = VectorX::map(array2, rows); VERIFY_IS_APPROX(ma1, ma2); + VERIFY_IS_APPROX(ma1, VectorX(array2, rows)); + delete[] array1; delete[] array2; } |