AbstractLinAlgPack::VectorSpaceTester Class Reference

Testing class for VectorSpace, Vector and VectorMutable. More...

#include <AbstractLinAlgPack_VectorSpaceTester.hpp>

List of all members.

Public Member Functions

void print_all_tests (const bool &print_all_tests)
 Members for option print_all_tests() (see Teuchos_StandardMemberCompositionMacros.hpp).
const bool & print_all_tests () const
void print_vectors (const bool &print_vectors)
 Members for option print_vectors() (see Teuchos_StandardMemberCompositionMacros.hpp).
const bool & print_vectors () const
void throw_exception (const bool &throw_exception)
 Members for option throw_exception() (see Teuchos_StandardMemberCompositionMacros.hpp).
const bool & throw_exception () const
void num_random_tests (const size_type &num_random_tests)
 Members for option num_random_tests() (see Teuchos_StandardMemberCompositionMacros.hpp).
const size_typenum_random_tests () const
void warning_tol (const value_type &warning_tol)
 Members for option () warning_tol(see Teuchos_StandardMemberCompositionMacros.hpp).
const value_typewarning_tol () const
void error_tol (const value_type &error_tol)
 Members for option error_tol() (see Teuchos_StandardMemberCompositionMacros.hpp).
const value_typeerror_tol () const
 VectorSpaceTester (bool print_all_tests=false, bool print_vectors=false, bool throw_exception=true, size_type num_random_tests=4, value_type warning_tol=1e-14, value_type error_tol=1e-10)
 Constructor (set default options).
virtual ~VectorSpaceTester ()
 
virtual bool check_vector_space (const VectorSpace &space, std::ostream *out) const
 Run a vector space and the vectors it creates through a set of comprehensive tets.

Private Member Functions

void check_test (value_type err, std::ostream *out, bool *success) const
 

Private Attributes

bool print_all_tests_
bool print_vectors_
bool throw_exception_
size_type num_random_tests_
value_type warning_tol_
value_type error_tol_


Detailed Description

Testing class for VectorSpace, Vector and VectorMutable.

The purpose of this class is to test a VectorSpace object and the VectorMutable objects that it creates. The testing function check_vector_space() calls all of the methods defined in the interfaces VectorSpace, Vector and VectorMutable and checks many of the post conditions but not all. It would be very difficult to completely verify every postcondition in every situation.

The behavior of the testing function check_vector_space() is strongly influenced by a set of options (see VectorSpaceTester()).

When writting new vector implementations, a developer is likely to spend a lot of time debuggin while in this testing function.

Definition at line 54 of file AbstractLinAlgPack_VectorSpaceTester.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::VectorSpaceTester::VectorSpaceTester bool  print_all_tests = false,
bool  print_vectors = false,
bool  throw_exception = true,
size_type  num_random_tests = 4,
value_type  warning_tol = 1e-14,
value_type  error_tol = 1e-10
 

Constructor (set default options).

These default options are appropriate for even the largest vector spaces.

Definition at line 52 of file AbstractLinAlgPack_VectorSpaceTester.cpp.

virtual AbstractLinAlgPack::VectorSpaceTester::~VectorSpaceTester  )  [inline, virtual]
 

Definition at line 102 of file AbstractLinAlgPack_VectorSpaceTester.hpp.


Member Function Documentation

void AbstractLinAlgPack::VectorSpaceTester::print_all_tests const bool &  print_all_tests  )  [inline]
 

Members for option print_all_tests() (see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 58 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

const bool& AbstractLinAlgPack::VectorSpaceTester::print_all_tests  )  const [inline]
 

Definition at line 58 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

void AbstractLinAlgPack::VectorSpaceTester::print_vectors const bool &  print_vectors  )  [inline]
 

Members for option print_vectors() (see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 63 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

const bool& AbstractLinAlgPack::VectorSpaceTester::print_vectors  )  const [inline]
 

Definition at line 63 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

void AbstractLinAlgPack::VectorSpaceTester::throw_exception const bool &  throw_exception  )  [inline]
 

Members for option throw_exception() (see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 68 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

const bool& AbstractLinAlgPack::VectorSpaceTester::throw_exception  )  const [inline]
 

Definition at line 68 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

void AbstractLinAlgPack::VectorSpaceTester::num_random_tests const size_type num_random_tests  )  [inline]
 

Members for option num_random_tests() (see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 73 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

const size_type& AbstractLinAlgPack::VectorSpaceTester::num_random_tests  )  const [inline]
 

Definition at line 73 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

void AbstractLinAlgPack::VectorSpaceTester::warning_tol const value_type warning_tol  )  [inline]
 

Members for option () warning_tol(see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 78 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

const value_type& AbstractLinAlgPack::VectorSpaceTester::warning_tol  )  const [inline]
 

Definition at line 78 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

void AbstractLinAlgPack::VectorSpaceTester::error_tol const value_type error_tol  )  [inline]
 

Members for option error_tol() (see Teuchos_StandardMemberCompositionMacros.hpp).

Definition at line 83 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

const value_type& AbstractLinAlgPack::VectorSpaceTester::error_tol  )  const [inline]
 

Definition at line 83 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

bool AbstractLinAlgPack::VectorSpaceTester::check_vector_space const VectorSpace space,
std::ostream *  out
const [virtual]
 

Run a vector space and the vectors it creates through a set of comprehensive tets.

Parameters:
space [in] The vector space object to test.
out [in/out] If out != NULL then output will be sent to *out.
The behavior of this function greatly depends on a number of options (see VectorSpaceTester() for the default values for these options). Access functions to set these options are provided by the prototypes of the macro STANDARD_MEMBER_COMPOSITION_MEMBERS().
  • print_all_tests(bool): If print_all_tests() == true, then some output will be sent to *out for every test performed. This is useful to see all of tests that are performed and in debugging.
  • print_vectors(bool): If print_vectors() == true, then all of the vectors will be printed that are created durring the tests. This option is really only needed durring initial debugging and should only be used with small vector spaces since it will produce a lot of O(space.dim()) output.
  • throw_exception(bool): If throw_exception() == true, then any object that throws an unexpected exception will cause that exception to be thrown clear of of this function. If out != NULL then the what() string will be printed to *out before the exception is rethrown. If throw_exception() == false, then all exceptions will be caught, printed to *out and then false is returned from the function.
  • num_random_tests(int): This is the number of random tests to perform per category of test. A higher number will result is better validation but will consume more CPU time.
  • warning_tol(value_type): Any test with a relative error greater than warning_tol() will result in a warning message printed to *out.
  • error_tol(value_type): Any test with a relative error greater than erfor_tol() will result in an error message printed to *out and the function will immediatly return false.

Definition at line 68 of file AbstractLinAlgPack_VectorSpaceTester.cpp.

void AbstractLinAlgPack::VectorSpaceTester::check_test value_type  err,
std::ostream *  out,
bool *  success
const [private]
 

Definition at line 511 of file AbstractLinAlgPack_VectorSpaceTester.cpp.


Member Data Documentation

bool AbstractLinAlgPack::VectorSpaceTester::print_all_tests_ [private]
 

Definition at line 58 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

bool AbstractLinAlgPack::VectorSpaceTester::print_vectors_ [private]
 

Definition at line 63 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

bool AbstractLinAlgPack::VectorSpaceTester::throw_exception_ [private]
 

Definition at line 68 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

size_type AbstractLinAlgPack::VectorSpaceTester::num_random_tests_ [private]
 

Definition at line 73 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

value_type AbstractLinAlgPack::VectorSpaceTester::warning_tol_ [private]
 

Definition at line 78 of file AbstractLinAlgPack_VectorSpaceTester.hpp.

value_type AbstractLinAlgPack::VectorSpaceTester::error_tol_ [private]
 

Definition at line 83 of file AbstractLinAlgPack_VectorSpaceTester.hpp.


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