AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects
Version of the Day
|
Testing class for MatrixOpNonsing
interface.
More...
#include <AbstractLinAlgPack_MatrixOpNonsingTester.hpp>
Public types | |
enum | ETestLevel { TEST_LEVEL_2_BLAS = 1, TEST_LEVEL_3_BLAS = 2 } |
enum | EPrintTestLevel { PRINT_NONE = 0, PRINT_BASIC = 1, PRINT_MORE = 2, PRINT_ALL = 3 } |
Set and access options | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (ETestLevel, test_level) | |
Set the level of testing. More... | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (EPrintTestLevel, print_tests) | |
Set the level of output produced durring tests. More... | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, dump_all) | |
Set whether vectors etc. are printed (warning, this may be a lot of output for larger systems). More... | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, throw_exception) | |
Set whether an exception that is thrown is thrown clear out of the testing function or not. More... | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (size_type, num_random_tests) | |
Set the number of random test cases created. More... | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, warning_tol) | |
Set the relative tolerance for numerical tests above which to print a warning. More... | |
STANDARD_MEMBER_COMPOSITION_MEMBERS (value_type, error_tol) | |
Set the relative tolerance for numerical tests above which to return false from the testing function. More... | |
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) More... | |
Test MatrixOpNonsing | |
bool | test_matrix (const MatrixOpNonsing &M, const char M_name[], std::ostream *out) |
Test a MatrixOpNonsing object. More... | |
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 and 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 64 of file AbstractLinAlgPack_MatrixOpNonsingTester.hpp.
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 71 of file AbstractLinAlgPack_MatrixOpNonsingTester.hpp.
Definition at line 76 of file AbstractLinAlgPack_MatrixOpNonsingTester.hpp.
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 61 of file AbstractLinAlgPack_MatrixOpNonsingTester.cpp.
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.
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. |
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 79 of file AbstractLinAlgPack_MatrixOpNonsingTester.cpp.