ConstrainedOptPack::DecompositionSystemTester Class Reference

Testing class for DecompositionSystem interface. More...

#include <ConstrainedOptPack_DecompositionSystemTester.hpp>

List of all members.

Set and access options

enum  EPrintTestLevel {
  PRINT_NOT_SELECTED = 0, PRINT_NONE = 1, PRINT_BASIC = 2, PRINT_MORE = 3,
  PRINT_ALL = 4
}
  More...
void print_tests (const EPrintTestLevel &print_tests)
 Set the level of output produced durring tests.
const EPrintTestLevelprint_tests () const
void dump_all (const bool &dump_all)
 Set whether matrices, vectors ect. are printed (warning, this may be a lot of output for larger systems).
const bool & dump_all () const
void throw_exception (const bool &throw_exception)
 Set whether an exception that is thrown is thrown clear out of the testing function or not.
const bool & throw_exception () const
void num_random_tests (const size_type &num_random_tests)
 Set the number of random test cases created.
const size_typenum_random_tests () const
void mult_warning_tol (const value_type &mult_warning_tol)
 Set the relative tolerance for numerical tests of matrix-vector multiplication above which to print a warning.
const value_typemult_warning_tol () const
void mult_error_tol (const value_type &mult_error_tol)
 Set the relative tolerance for numerical tests of matrix-vector multiplication above which to return false from the testing function.
const value_typemult_error_tol () const
void solve_warning_tol (const value_type &solve_warning_tol)
 Set the relative tolerance for numerical tests of matrix-vector solves above which to print a warning.
const value_typesolve_warning_tol () const
void solve_error_tol (const value_type &solve_error_tol)
 Set the relative tolerance for numerical tests of matrix-vector solves above which to return false from the testing function.
const value_typesolve_error_tol () const
EPrintTestLevel print_tests_
bool dump_all_
bool throw_exception_
size_type num_random_tests_
value_type mult_warning_tol_
value_type mult_error_tol_
value_type solve_warning_tol_
value_type solve_error_tol_

Public Member Functions

 DecompositionSystemTester (EPrintTestLevel print_tests=PRINT_NOT_SELECTED, bool dump_all=false, bool throw_exception=true, size_type num_random_tests=1, value_type mult_warning_tol=1e-14, value_type mult_error_tol=1e-8, value_type solve_warning_tol=1e-14, value_type solve_error_tol=1e-8)
 Constructor (default options).
bool test_decomp_system (const DecompositionSystem &decomp_sys, const MatrixOp &Gc, const MatrixOp *Z, const MatrixOp *Y, const MatrixOpNonsing *R, const MatrixOp *Uz, const MatrixOp *Uy, std::ostream *out)
 Test a DecompositionSystem object after DecompositionSystem::update_basis() is called.


Detailed Description

Testing class for DecompositionSystem interface.

This testing class is basically a unit tester for DecompositionSystem. The method test_decomp_system() runs many different tests to validate the interface and the matrix objects associated with the interface. The method test_decomp_system() should only be called after decomp_sys.update_decomp(...) is called on the DecompositionSystem object decomp_sys. The output decomposition matrices are passed through a series of tests. The compatibility of the matrices described in the postconditions for DecompositionSytem::update_decomp() are also checked in a series of tests. If the method test_decomp_system() returns true, then the client can feel fairly confident that the things are functioning properly (but this is not guaranteed of course).

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

ToDo: Finish documentation!

Definition at line 56 of file ConstrainedOptPack_DecompositionSystemTester.hpp.


Member Enumeration Documentation

enum ConstrainedOptPack::DecompositionSystemTester::EPrintTestLevel
 

Enumeration values:
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 ConstrainedOptPack_DecompositionSystemTester.hpp.


Constructor & Destructor Documentation

ConstrainedOptPack::DecompositionSystemTester::DecompositionSystemTester EPrintTestLevel  print_tests = PRINT_NOT_SELECTED,
bool  dump_all = false,
bool  throw_exception = true,
size_type  num_random_tests = 1,
value_type  mult_warning_tol = 1e-14,
value_type  mult_error_tol = 1e-8,
value_type  solve_warning_tol = 1e-14,
value_type  solve_error_tol = 1e-8
 

Constructor (default options).

Definition at line 49 of file ConstrainedOptPack_DecompositionSystemTester.cpp.


Member Function Documentation

void ConstrainedOptPack::DecompositionSystemTester::print_tests const EPrintTestLevel print_tests  )  [inline]
 

Set the level of output produced durring tests.

Definition at line 71 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const EPrintTestLevel& ConstrainedOptPack::DecompositionSystemTester::print_tests  )  const [inline]
 

Definition at line 71 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

void ConstrainedOptPack::DecompositionSystemTester::dump_all const bool &  dump_all  )  [inline]
 

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

Definition at line 73 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const bool& ConstrainedOptPack::DecompositionSystemTester::dump_all  )  const [inline]
 

Definition at line 73 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

void ConstrainedOptPack::DecompositionSystemTester::throw_exception const bool &  throw_exception  )  [inline]
 

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

Definition at line 75 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const bool& ConstrainedOptPack::DecompositionSystemTester::throw_exception  )  const [inline]
 

Definition at line 75 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

void ConstrainedOptPack::DecompositionSystemTester::num_random_tests const size_type num_random_tests  )  [inline]
 

Set the number of random test cases created.

Definition at line 77 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const size_type& ConstrainedOptPack::DecompositionSystemTester::num_random_tests  )  const [inline]
 

Definition at line 77 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

void ConstrainedOptPack::DecompositionSystemTester::mult_warning_tol const value_type mult_warning_tol  )  [inline]
 

Set the relative tolerance for numerical tests of matrix-vector multiplication above which to print a warning.

Definition at line 79 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const value_type& ConstrainedOptPack::DecompositionSystemTester::mult_warning_tol  )  const [inline]
 

Definition at line 79 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

void ConstrainedOptPack::DecompositionSystemTester::mult_error_tol const value_type mult_error_tol  )  [inline]
 

Set the relative tolerance for numerical tests of matrix-vector multiplication above which to return false from the testing function.

Definition at line 81 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const value_type& ConstrainedOptPack::DecompositionSystemTester::mult_error_tol  )  const [inline]
 

Definition at line 81 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

void ConstrainedOptPack::DecompositionSystemTester::solve_warning_tol const value_type solve_warning_tol  )  [inline]
 

Set the relative tolerance for numerical tests of matrix-vector solves above which to print a warning.

Definition at line 83 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const value_type& ConstrainedOptPack::DecompositionSystemTester::solve_warning_tol  )  const [inline]
 

Definition at line 83 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

void ConstrainedOptPack::DecompositionSystemTester::solve_error_tol const value_type solve_error_tol  )  [inline]
 

Set the relative tolerance for numerical tests of matrix-vector solves above which to return false from the testing function.

Definition at line 85 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

const value_type& ConstrainedOptPack::DecompositionSystemTester::solve_error_tol  )  const [inline]
 

Definition at line 85 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

bool ConstrainedOptPack::DecompositionSystemTester::test_decomp_system const DecompositionSystem decomp_sys,
const MatrixOp &  Gc,
const MatrixOp *  Z,
const MatrixOp *  Y,
const MatrixOpNonsing *  R,
const MatrixOp *  Uz,
const MatrixOp *  Uy,
std::ostream *  out
 

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

Parameters:
decomp_sys [in] The DecompositionSystem object that DecompositionSystem::update_basis() was called on.
Gc [in] Must be matrix that was passed to decomp_sys.update_decomp(Gc,...).
Z [in] Must be matrix that was passed to and returned from decomp_sys.update_decomp(...,Z,...).
Y [in] Must be matrix that was passed to and returned from decomp_sys.update_decomp(...,Y,...).
R [in] Must be matrix that was passed to and returned from decomp_sys.update_decomp(...,R,...).
Uz [in] If Uz!=NULL then Must be matrix that was passed to and returned from decomp_sys.update_decomp(...,Uz,...).
Uy [in] If Uy!=NULL then Must be matrix that was passed to and returned from decomp_sys.update_decomp(...,Uy,...).
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 69 of file ConstrainedOptPack_DecompositionSystemTester.cpp.


Member Data Documentation

EPrintTestLevel ConstrainedOptPack::DecompositionSystemTester::print_tests_ [private]
 

Definition at line 71 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

bool ConstrainedOptPack::DecompositionSystemTester::dump_all_ [private]
 

Definition at line 73 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

bool ConstrainedOptPack::DecompositionSystemTester::throw_exception_ [private]
 

Definition at line 75 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

size_type ConstrainedOptPack::DecompositionSystemTester::num_random_tests_ [private]
 

Definition at line 77 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

value_type ConstrainedOptPack::DecompositionSystemTester::mult_warning_tol_ [private]
 

Definition at line 79 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

value_type ConstrainedOptPack::DecompositionSystemTester::mult_error_tol_ [private]
 

Definition at line 81 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

value_type ConstrainedOptPack::DecompositionSystemTester::solve_warning_tol_ [private]
 

Definition at line 83 of file ConstrainedOptPack_DecompositionSystemTester.hpp.

value_type ConstrainedOptPack::DecompositionSystemTester::solve_error_tol_ [private]
 

Definition at line 85 of file ConstrainedOptPack_DecompositionSystemTester.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:36:13 2008 for MOOCHO (Single Doxygen Collection) by doxygen 1.3.9.1