From 72ef434a1e4b507d1252e39074f26226f236c83d Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Thu, 12 Jun 2014 23:10:00 -0400 Subject: move string_piece to utils/ from inside klm --- utils/sv_test.cc | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'utils/sv_test.cc') 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 x; + SparseVector 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 x; SparseVector y; -- cgit v1.2.3