23 cout <<
"=== Matrix: Native/BLAS multiplication =============\n";
42 answer( 0, 0 ) = 22.0;
43 answer( 0, 1 ) = 28.0;
44 answer( 1, 0 ) = 49.0;
45 answer( 1, 1 ) = 64.0;
49 const double tol = 1.e-10;
54 std::cout <<
" Infinity norm of error = " << c.
inf_norm() <<
"\n";
55 std::cout <<
" Native method : Simple (2x3) * (3x2) matrix mult failed\n";
60 std::cout <<
" Native method : Simple (2x3) * (3x2) matrix mult passed \n";
70 std::cout <<
" Infinity norm of error = " << cblas.
inf_norm() <<
"\n";
71 std::cout <<
" BLAS : Simple (2x3) * (3x2) matrix mult failed \n";
76 std::cout <<
" BLAS : Simple (2x3) * (3x2) matrix mult test passed \n";
82 for (
int N = 128; N <= 2048 ; N *= 2 )
84 std::cout <<
"\n --- Filling arrays of size " << N <<
"x" << N <<
"\n";
88 Utility::fill_random( A );
90 Utility::fill_random( B );
96 std::cout <<
"\n Native N^3 multiplication method :\n";
106 std::cout <<
"\n BLAS multiplication method :\n";
113 std::cout <<
" Infinity norm of error = " << Cblas.
inf_norm() <<
"\n";
114 std::cout <<
" BLAS & native matrix multiplication disagree! \n";
124 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
128 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A spec for the CppNoddy Timer object.
A spec for a collection of utility functions.
A matrix class that constructs a DENSE matrix as a row major std::vector of DenseVectors.
DenseVector< _Type > multiply(const DenseVector< _Type > &x) const
Right multiply the matrix by a DENSE vector.
double inf_norm() const
Return the maximum inf_norm of all rows.
void sub(const DenseMatrix< _Type > &b)
Subtract a DENSE matrix from this object.
A simple CPU-clock-tick timer for timing metods.
void start()
Start the timer & reset stored time to zero.
void print() const
Write a string to cout stating the time taken.
void stop()
Stop the clock & add the current time interval to the previously stored values ready for printing.
void reset()
Pause the clock & add the time interval to the stored cumulative time.
DenseMatrix< double > multiply(DenseMatrix< double > &A, DenseMatrix< double > &B)
BLAS wrapper to do DOUBLE DENSE A_{MxK} * B_{KxN} = C_{MxN} Since this is a Fortran library,...
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...