Go to the source code of this file.
◆ main()
Definition at line 13 of file SparseVector.cpp.
14{
15
16 cout << "\n";
17 cout << "=== Vector: sparse class example ===================\n";
18 cout << "\n";
19
22 double oneA = vecA.one_norm();
23
26 double oneB = vecB.one_norm();
27
29 vecC = vecA * 2. + vecB * 2.;
30
31 double tol = 1.e-13;
32 if ( vecC.one_norm() - ( 2 * oneA + 2 * oneB ) > tol )
33 {
34 cout << "\033[1;31;48m * FAILED \033[0m\n";
35 return 1;
36 }
37 cout << "\033[1;32;48m * PASSED \033[0m\n";
38 return 0;
39
40}
An SparseVector class – a sparse vector object.
void fill_random(CppNoddy::SparseVector< double > &V, const unsigned &num_of_elts)
References Utils_Fill::fill_random(), and CppNoddy::SparseVector< _Type >::one_norm().