summaryrefslogtreecommitdiff
path: root/utils/sv_test.cc
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2014-06-15 04:26:08 +0200
committerPatrick Simianer <p@simianer.de>2014-06-15 04:26:08 +0200
commit001804edef29549dc49b2adf6bab88cd7f24760a (patch)
treebb75ae54b21e265383f24cc3cecae4c394a9cdda /utils/sv_test.cc
parent244971287003d079e46193b8a209c28955f90134 (diff)
parentb4ce7c0b51d8615abf84c022ec3a981bee3277fe (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'utils/sv_test.cc')
-rw-r--r--utils/sv_test.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/utils/sv_test.cc b/utils/sv_test.cc
index c7ac9e54..67df8c57 100644
--- a/utils/sv_test.cc
+++ b/utils/sv_test.cc
@@ -5,6 +5,17 @@
using namespace std;
+BOOST_AUTO_TEST_CASE(Dot) {
+ SparseVector<double> x;
+ SparseVector<double> y;
+ x.set_value(1,0.8);
+ y.set_value(1,5);
+ x.set_value(2,-2);
+ y.set_value(2,1);
+ x.set_value(3,80);
+ BOOST_CHECK_CLOSE(x.dot(y), 2.0, 1e-9);
+}
+
BOOST_AUTO_TEST_CASE(Equality) {
SparseVector<double> x;
SparseVector<double> y;