MOOCHO (Single Doxygen Collection) Version of the Day
AbstractLinAlgPack::MatrixOpNonsingTester Class Reference

Testing class for MatrixOpNonsing interface. More...

#include <AbstractLinAlgPack_MatrixOpNonsingTester.hpp>

List of all members.

Public types

enum  ETestLevel { TEST_LEVEL_2_BLAS = 1, TEST_LEVEL_3_BLAS = 2 }
  More...
enum  EPrintTestLevel { PRINT_NONE = 0, PRINT_BASIC = 1, PRINT_MORE = 2, PRINT_ALL = 3 }
  More...

Set and access options

 STANDARD_MEMBER_COMPOSITION_MEMBERS (ETestLevel, test_level)
 Set the level of testing.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (EPrintTestLevel, print_tests)
 Set the level of output produced durring tests.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, dump_all)
 Set whether vectors etc. are printed (warning, this may be a lot of output for larger systems).
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, throw_exception)
 Set whether an exception that is thrown is thrown clear out of the testing function or not.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (size_type, num_random_tests)
 Set the number of random test cases created.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, warning_tol)
 Set the relative tolerance for numerical tests above which to print a warning.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, error_tol)
 Set the relative tolerance for numerical tests above which to return false from the testing function.

Constructors / initializers

 MatrixOpNonsingTester (ETestLevel test_level=TEST_LEVEL_2_BLAS, EPrintTestLevel print_tests=PRINT_NONE, bool dump_all=false, bool throw_exception=true, size_type num_random_tests=1, value_type warning_tol=1e-14, value_type error_tol=1e-8)
 Constructor (default options)

Test MatrixOpNonsing

bool test_matrix (const MatrixOpNonsing &M, const char M_name[], std::ostream *out)
 Test a MatrixOpNonsing object.

Detailed Description

Testing class for MatrixOpNonsing interface.

This testing class is basically a unit tester for MatrixOpNonsing. The method test_matrix() runs several different tests to check that $ M M^{-1} \approx I $ and $ M^{-T} M^T \approx I $ using randomly generated vectors v and the methods MatrixNonsing::V_InvMtV() and MatrixOp::Vp_StMtV(). These test should only be performed, of course, on a fully initialized MatrixOpNonsing object.

The tests performed by this testing class are designed to allow some validation for even the larges systems and will produce various levels of output so as to be usefull in debugging.

ToDo: Finish documentation!

Definition at line 51 of file AbstractLinAlgPack_MatrixOpNonsingTester.hpp.


Member Enumeration Documentation

Enumerator:
TEST_LEVEL_2_BLAS 

Test Level-2 BLAS operations only.

TEST_LEVEL_3_BLAS 

Test Level-2 and Level-3 BLAS operations.

Definition at line 58 of file AbstractLinAlgPack_MatrixOpNonsingTester.hpp.

Enumerator:
PRINT_NONE 

Don't print anything.

PRINT_BASIC 

Print only very basic info.

PRINT_MORE 

Print greater detail about the tests.

PRINT_ALL 

Print everything all the tests in great detail but output is independent of problem size.

Definition at line 63 of file AbstractLinAlgPack_MatrixOpNonsingTester.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::MatrixOpNonsingTester::MatrixOpNonsingTester ( ETestLevel  test_level = TEST_LEVEL_2_BLAS,
EPrintTestLevel  print_tests = PRINT_NONE,
bool  dump_all = false,
bool  throw_exception = true,
size_type  num_random_tests = 1,
value_type  warning_tol = 1e-14,
value_type  error_tol = 1e-8 
)

Constructor (default options)

Definition at line 48 of file AbstractLinAlgPack_MatrixOpNonsingTester.cpp.


Member Function Documentation

AbstractLinAlgPack::MatrixOpNonsingTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( ETestLevel  ,
test_level   
)

Set the level of testing.

AbstractLinAlgPack::MatrixOpNonsingTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( EPrintTestLevel  ,
print_tests   
)

Set the level of output produced durring tests.

AbstractLinAlgPack::MatrixOpNonsingTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
dump_all   
)

Set whether vectors etc. are printed (warning, this may be a lot of output for larger systems).

AbstractLinAlgPack::MatrixOpNonsingTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( bool  ,
throw_exception   
)

Set whether an exception that is thrown is thrown clear out of the testing function or not.

AbstractLinAlgPack::MatrixOpNonsingTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( size_type  ,
num_random_tests   
)

Set the number of random test cases created.

AbstractLinAlgPack::MatrixOpNonsingTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( value_type  ,
warning_tol   
)

Set the relative tolerance for numerical tests above which to print a warning.

AbstractLinAlgPack::MatrixOpNonsingTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( value_type  ,
error_tol   
)

Set the relative tolerance for numerical tests above which to return false from the testing function.

bool AbstractLinAlgPack::MatrixOpNonsingTester::test_matrix ( const MatrixOpNonsing M,
const char  M_name[],
std::ostream *  out 
)

Test a MatrixOpNonsing object.

Parameters:
M[in] Matrix object being tested.
M_name[in] Name given to the matrix object to be used in outputting and error reporting (i.e. throwing an exception).
out[in/out] If out != NULL any and all output will be sent here. If out == NULL then no output will be produced.
Returns:
Returns true if all of the tests checked out and no unexpected exceptions were thrown.

The behavior of this method depends on a set of options and the input arguments.

  • throw_exception(bool): If throw_exception() == true, then if any of the objects within this function throw exceptions, these exceptions will be be thrown clean out of this function for the caller to handle. If throw_exception() == false, then if any object throws an exception, the exception is caught and this this function will return false. In any case an error message will be printed to *out (if out != NULL</tt) before leaving the function (by return or throw).
  • dump_all(bool): If dump_all() == true then all of the computed quantities will but dumped to out. Note that this is a useful option for initial debugging of small systems but not a good idea for larger systems as it will result in an excessive amount of output.
  • ToDo: Add rest of options!

Definition at line 66 of file AbstractLinAlgPack_MatrixOpNonsingTester.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines