summaryrefslogtreecommitdiff
path: root/fast/test_sparse_vector.cc
blob: f48648686162e6a27629340039907132a658bde5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "sparse_vector.hh"


int
main(void)
{
  Sv::SparseVector<string, weight_t> a;
  a.insert("1", 1);
  a.insert("2", 2);
  cout << "a:" << a << endl;

  Sv::SparseVector<string, weight_t> b;
  b.insert("2", 2);
  cout << "b:" << b << endl;

  Sv::SparseVector<string, weight_t> 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;

  return 0;
}