From cdb7f2b26e717bbfe84dbd73f949c6b06ca2b2d7 Mon Sep 17 00:00:00 2001 From: Chris Dyer Date: Mon, 25 Nov 2013 00:14:16 -0500 Subject: remove dead code, add adagrad crf learner --- utils/sv_test.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 utils/sv_test.cc (limited to 'utils/sv_test.cc') diff --git a/utils/sv_test.cc b/utils/sv_test.cc new file mode 100644 index 00000000..c7ac9e54 --- /dev/null +++ b/utils/sv_test.cc @@ -0,0 +1,24 @@ +#define BOOST_TEST_MODULE WeightsTest +#include +#include +#include "sparse_vector.h" + +using namespace std; + +BOOST_AUTO_TEST_CASE(Equality) { + SparseVector x; + SparseVector y; + x.set_value(1,-1); + y.set_value(1,-1); + BOOST_CHECK(x == y); +} + +BOOST_AUTO_TEST_CASE(Division) { + SparseVector x; + SparseVector y; + x.set_value(1,1); + y.set_value(1,-1); + BOOST_CHECK(!(x == y)); + x /= -1; + BOOST_CHECK(x == y); +} -- cgit v1.2.3