13#include "../Utils_Fill.h"
22 cout <<
"=== Vector: (dense) double/complex Example =========\n";
25 const unsigned N = 1000000;
27 cout <<
" Using vectors of size " << N <<
" \n";
29 const double tol = 1.e-13;
43 const unsigned M = 100;
44 for (
unsigned i = 0; i < M; ++i )
49 cout <<
" \nComplex vectors \n";
50 cout <<
" Testing norms, nearest_index, max/minabs_index\n";
54 std::cout <<
" - Failed inf_norm/nearest_index Example" <<
"\n";
60 std::cout <<
" - Failed inf_norm/maxabs_index Example" <<
"\n";
69 cout <<
" Double vectors \n";
71 cout <<
" Testing norms, nearest_index, max/minabs_index\n";
75 std::cout <<
" - Failed inf_norm/nearest_index Example" <<
"\n";
81 std::cout <<
" - Failed inf_norm/maxabs_index Example" <<
"\n";
91 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
96 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
Some Function Objects that CppNoddy makes use of in algorithms applied to STL containers.
A spec for the CppNoddy Timer object.
A spec for a collection of utility functions.
An DenseVector class – a dense vector object.
double one_norm() const
l1-norm.
double inf_norm() const
Infinity norm.
elt_iter begin()
Pass through to the storage container.
double two_norm() const
l2-norm.
elt_iter end()
Pass through to the storage container.
A function object predicate that first computes the absolute difference between two elements and a sp...
A function object predicate that compares the absolute value of two elements and returns a true of el...
_Type dot(const DenseVector< _Type > &X, const DenseVector< _Type > &Y)
Templated dot product.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...
void time_seed()
initialise RNG
void fill_random(CppNoddy::SparseVector< double > &V, const unsigned &num_of_elts)