finitediff
Functions | Variables
Utilities.h File Reference
#include <sstream>
#include <iostream>
Include dependency graph for Utilities.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<class T >
unsigned int value_length (const T &value)
 
void echo_function_test (const std::string &s)
 
void echo_single_test (const std::string &s)
 
template<class M >
void debug_matrix_print (const std::string &name, const M &mtr)
 
template<class T >
void debug_value_print (const std::string &text, const T &v)
 Print a small message and a value, for debug purpose. More...
 
void tooGenericWarning (const std::string &message)
 Display a small warning. More...
 

Variables

std::ostream & debug_print
 

Function Documentation

template<class M >
void debug_matrix_print ( const std::string &  name,
const M &  mtr 
)

Print a small message and a matrix, for debug purpose.

Parameters
nameA small description of the matrix that will be printed.
mtrthe matrix to print.
template<class T >
void debug_value_print ( const std::string &  text,
const T &  v 
)

Print a small message and a value, for debug purpose.

Parameters
textA small description of the value that will be printed.
vThe value to be printed.
void echo_function_test ( const std::string &  s)

The test functions use this function to announce (output) that they are starting

void echo_single_test ( const std::string &  s)

Use this function to announce (output) that a CPPUNIT_ASSERT is about to be launched.

void tooGenericWarning ( const std::string &  message)

Display a small warning.

Parameters
messageThe message to be displayed.

We have several type of matrices and several overloading of the operators like == and *. These overloads are optimized for the particular structure of our matrices.

However generic overloads are also implemented. We use tooGenericWarning to print a warning when a generic overload is used because it could be a sign that we are lacking an overload (or that the matrices types are not the ones we believe).

See also
operator*(const SNgeneric<U,s>& A, const SNgeneric<V,t>& B)
template<class T >
unsigned int value_length ( const T &  value)

This file consists in a bunch of small functions. return the length of a value supposed to be a numerical type.

Note :

1 double a=4;
2 std::string s=std::to_string(a);

in that case, s is something like "4.000000", and its size will be like 8 or 9.

This function does not act like that and return the length of value as printed by std::cout.

Variable Documentation

std::ostream& debug_print

So I can put debug_print<<blahblah everywhere in my code (for debugging purpose) and found them back with a simple ack.