summaryrefslogtreecommitdiff
path: root/fast/test_sparse_vector.cc
diff options
context:
space:
mode:
Diffstat (limited to 'fast/test_sparse_vector.cc')
-rw-r--r--fast/test_sparse_vector.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/fast/test_sparse_vector.cc b/fast/test_sparse_vector.cc
index f486486..426bed1 100644
--- a/fast/test_sparse_vector.cc
+++ b/fast/test_sparse_vector.cc
@@ -4,16 +4,16 @@
int
main(void)
{
- Sv::SparseVector<string, weight_t> a;
+ Sv::SparseVector<string, score_t> a;
a.insert("1", 1);
a.insert("2", 2);
cout << "a:" << a << endl;
- Sv::SparseVector<string, weight_t> b;
+ Sv::SparseVector<string, score_t> b;
b.insert("2", 2);
cout << "b:" << b << endl;
- Sv::SparseVector<string, weight_t> c = a + b;
+ Sv::SparseVector<string, score_t> c = a + b;
cout << "a+b:" << c << endl;
a += b;
@@ -27,6 +27,11 @@ main(void)
a *= 2;
cout << "a*=2:" << a << endl;
+ string s("\"a\"=2 \"b\"=3");
+ Sv::SparseVector<string, score_t>* sv = new Sv::SparseVector<string, score_t>(s);
+ cout << *sv << endl;
+ cout << sv->dot(*sv) << endl;
+
return 0;
}