diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-10-14 18:02:16 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-10-14 18:02:16 +0000 |
commit | f355ef2df0f51fc80565285a907f48925a554505 (patch) | |
tree | 26b7ce13814790d593e790e63e4c9bdeabe96e9f /test/basicstuff.cpp | |
parent | a94a8c68e8d66fa2b06e37f3a47f1b7e1ddfa1bc (diff) |
Merge WrapArray into FromArray. Less code. The downside is that we're using one more
const_cast. But I think that anyway trying to maintain const strictness in Eigen2 is not
worth the hassle.
Konstantin: so the code snippet I sent you won't work anymore, replace wrapArray with fromArray.
CCMAIL:konst.heil@stud.uni-heidelberg.de
Diffstat (limited to 'test/basicstuff.cpp')
-rw-r--r-- | test/basicstuff.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 3e734a498..02ebb2343 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -87,6 +87,13 @@ template<typename MatrixType> void basicStuff(const MatrixType& m) QVERIFY(v1.isApprox(identity * v1)); QVERIFY((square * (m1 + m2)).isApprox(square * m1 + square * m2)); + + Scalar* array1 = new Scalar[rows]; + Scalar* array2 = new Scalar[rows]; + Matrix<Scalar, Dynamic, 1>::fromArray(array1, rows) = Matrix<Scalar, Dynamic, 1>::random(rows); + Matrix<Scalar, Dynamic, 1>::fromArray(array2, rows) = Matrix<Scalar, Dynamic, 1>::fromArray(array1, rows); + bool b = Matrix<Scalar, Dynamic, 1>::fromArray(array1, rows).isApprox(Matrix<Scalar, Dynamic, 1>::fromArray(array2, rows)); + QVERIFY(b); } void EigenTest::testBasicStuff() |