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).
void print_vectors (const bool &print_vectors)
 Members for option print_vectors() (see Teuchos_StandardMemberCompositionMacros.hpp).
void throw_exception (const bool &throw_exception)
 Members for option throw_exception() (see Teuchos_StandardMemberCompositionMacros.hpp).
void num_random_tests (const size_type &num_random_tests)
 Members for option num_random_tests() (see Teuchos_StandardMemberCompositionMacros.hpp).
void warning_tol (const value_type &warning_tol)
 Members for option () warning_tol(see Teuchos_StandardMemberCompositionMacros.hpp).
void error_tol (const value_type &error_tol)
 Members for option error_tol() (see Teuchos_StandardMemberCompositionMacros.hpp).
 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.

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.

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.

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.

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.

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.

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.

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.

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.

The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:33:55 2008 for AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects by doxygen