aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/sparse_vector.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2009-01-23 13:59:32 +0000
committerGravatar Gael Guennebaud <g.gael@free.fr>2009-01-23 13:59:32 +0000
commite7c48fac9b0fed8bf262e44feccb63671362c845 (patch)
treedfe20aee07bf59aa04348dd81fbe22fe1dbf2a31 /test/sparse_vector.cpp
parent899e2ada15e44923b127df1e552ea0ff487c99f4 (diff)
sparse module: makes -= and += operator working
Question 1: why are *=scalar and /=scalar working right away ? Same weirdness in DynamicSparseMatrix where operators += and -= work wihout having to redefine them ???
Diffstat (limited to 'test/sparse_vector.cpp')
-rw-r--r--test/sparse_vector.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/sparse_vector.cpp b/test/sparse_vector.cpp
index 64f52cbe9..8207e522a 100644
--- a/test/sparse_vector.cpp
+++ b/test/sparse_vector.cpp
@@ -79,6 +79,9 @@ 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));