Just a quick and simple check that DenseVector operator overloading is functioning.
More...
#include <Types.h>
Go to the source code of this file.
Just a quick and simple check that DenseVector operator overloading is functioning.
Definition in file DenseVectorOpOverloading.cpp.
◆ main()
Definition at line 12 of file DenseVectorOpOverloading.cpp.
13{
14
15 cout << "\n";
16 cout << "=== Vector: operator overloading check ==============\n";
17 cout << "\n";
18
22
23 const double n1 = 10. / 3.;
24
25 C1 = A1 * 10 + B1 * 5;
26 C1 *= n1;
27
31
35
36 C2 = A2 * n2 + B2 * m2;
37 C2 *= n1;
38
39
41 C3 = C3 * l2;
42 C2 = C2 - C3;
43
44 const double tol = 1.e-14;
45 if ( abs( C2.two_norm() ) > tol )
46 {
47 cout << "\033[1;31;48m * FAILED \033[0m\n";
48 return 1;
49 }
50 else
51 {
52 cout << "\033[1;32;48m * PASSED \033[0m\n";
53 return 0;
54 }
55}
An DenseVector class – a dense vector object.
std::complex< double > D_complex
A complex double precision number using std::complex.
References CppNoddy::DenseVector< _Type >::two_norm().