AbstractLinAlgPack::BasisSystemTester Class Reference

Testing class for BasisSystem interface. More...

#include <AbstractLinAlgPack_BasisSystemTester.hpp>

List of all members.

Public types



enum  EPrintTestLevel {
  PRINT_NOT_SELECTED = 0, PRINT_NONE = 1, PRINT_BASIC = 2, PRINT_MORE = 3,
  PRINT_ALL = 4
}
  More...

Set and access options



 STANDARD_MEMBER_COMPOSITION_MEMBERS (EPrintTestLevel, print_tests)
 Set the level of output produced durring tests.
 STANDARD_MEMBER_COMPOSITION_MEMBERS (bool, dump_all)
 Set whether matrices, vectors ect. 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



 BasisSystemTester (EPrintTestLevel print_tests=PRINT_NOT_SELECTED, 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 basis system



bool test_basis_system (const BasisSystem &basis_sys, const MatrixOp *Gc, const MatrixOpNonsing *C, const MatrixOp *N, const MatrixOp *D, const MatrixOp *GcUP, std::ostream *out)
 Test a BasisSystem object after BasisSystem::update_basis() is called.

Detailed Description

Testing class for BasisSystem interface.

This testing class is basically a unit tester for BasisSystem. The method test_basis_system() runs many different tests to validate the interface and the objects allocated with the interface. The method test_basis_system() should only be called after basis_sys.update_basis(...) is called on the BasisSystem object basis_sys. The output basis matrix C and/or direct sensitivity matrix D are passed through a series of tests using the testing classes MatrixOpNonsingTester and MatrixWithOpTester respectively. The compatibility of the matrices Gc, C and/or D are also checked in a series of tests. If the method test_basis_system() returns true, then the client can feel fairly confident that the basis matrix object is functioning properly.

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 56 of file AbstractLinAlgPack_BasisSystemTester.hpp.


Member Enumeration Documentation

Enumerator:
PRINT_NOT_SELECTED 

The print option has not been selected (will default to PRINT_NONE if not set).

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_BasisSystemTester.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::BasisSystemTester::BasisSystemTester ( EPrintTestLevel  print_tests = PRINT_NOT_SELECTED,
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 37 of file AbstractLinAlgPack_BasisSystemTester.cpp.


Member Function Documentation

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

Set the level of output produced durring tests.

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

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

AbstractLinAlgPack::BasisSystemTester::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::BasisSystemTester::STANDARD_MEMBER_COMPOSITION_MEMBERS ( size_type  ,
num_random_tests   
)

Set the number of random test cases created.

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

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

AbstractLinAlgPack::BasisSystemTester::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::BasisSystemTester::test_basis_system ( const BasisSystem basis_sys,
const MatrixOp Gc,
const MatrixOpNonsing C,
const MatrixOp N,
const MatrixOp D,
const MatrixOp GcUP,
std::ostream *  out 
)

Test a BasisSystem object after BasisSystem::update_basis() is called.

Parameters:
basis_sys [in] The BasisSystem object that BasisSystem::update_basis() was called on.
Gc [in] Matrix Gc that was passed into basis_sys.update_basis() (if not NULL).
C [in] Matrix C that was passed in and out of basis_sys.update_basis() (if not NULL).
N [in] If not NULL, then this must the matrix N described in the documentation for BasisSystem. This allows a matrix object created by the client to be check out here also.
D [in] Matrix D that was passed in and out of basis_sys.update_basis() (if not NULL). Actually, this can be any matrix object that the client may want to define that takes the role of D. Such a matrix object can be tested here in this function along with the rest of the matrices.
GcUP [in] Matrix GcUP that was passed in and out of basis_sys.update_basis() (if not NULL). Actually, this can be any matrix object that the client may want to define that takes the role of GcUP. Such a matrix object can be tested here in this function along with the rest of the matrices.
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 53 of file AbstractLinAlgPack_BasisSystemTester.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:17:29 2011 for MOOCHO (Single Doxygen Collection) by  doxygen 1.6.3