diff options
author | Gael Guennebaud <g.gael@free.fr> | 2010-04-13 10:40:55 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2010-04-13 10:40:55 +0200 |
commit | a2324d626524852851e8b4b35c504bbdbc1a648e (patch) | |
tree | 04152be0ecb167e1f49f6c6d4113547fac62a8ca /test/sparse_vector.cpp | |
parent | 614fbe497d139ddb8242070d0c44c2356ec7c7a5 (diff) |
fix sparse squared norm
Diffstat (limited to 'test/sparse_vector.cpp')
-rw-r--r-- | test/sparse_vector.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp index 5c6dadc00..a5101398c 100644 --- a/test/sparse_vector.cpp +++ b/test/sparse_vector.cpp @@ -79,13 +79,15 @@ template<typename Scalar> void sparse_vector(int rows, int cols) VERIFY_IS_APPROX(v1*=s1, refV1*=s1); VERIFY_IS_APPROX(v1/=s1, refV1/=s1); - + VERIFY_IS_APPROX(v1+=v2, refV1+=refV2); VERIFY_IS_APPROX(v1-=v2, refV1-=refV2); VERIFY_IS_APPROX(v1.dot(v2), refV1.dot(refV2)); VERIFY_IS_APPROX(v1.dot(refV2), refV1.dot(refV2)); + VERIFY_IS_APPROX(v1.squaredNorm(), refV1.squaredNorm()); + } void test_sparse_vector() |