#include "sparse_vector.hh" int main(void) { Sv::SparseVector a; a.insert("1", 1); a.insert("2", 2); cout << "a:" << a << endl; Sv::SparseVector b; b.insert("2", 2); cout << "b:" << b << endl; Sv::SparseVector c = a + b; cout << "a+b:" << c << endl; a += b; cout << "a+=b:" << a << endl; a -= b; cout << "a-=b:" << a << endl; cout << "a*2:" << a*2 << endl; a *= 2; cout << "a*=2:" << a << endl; string s("\"a\"=2 \"b\"=3"); Sv::SparseVector* sv = new Sv::SparseVector(s); cout << *sv << endl; cout << sv->dot(*sv) << endl; return 0; }