Thyra::VectorSpaceTester< Scalar > Class Template Reference
[Development of linear Abstract Numerical Algorithms (ANAs)]

Testing class for VectorSpace and the VectorBase and MultiVectorBase objects that it creates. More...

#include <Thyra_VectorSpaceTesterDecl.hpp>

List of all members.

Public Types

typedef Teuchos::ScalarTraits<
Scalar >::magnitudeType 
ScalarMag
 Local typedef for scalar magnitude.

Public Member Functions

VectorTester< Scalar > & vectorTester ()
 Expose a non-const reference to the VectorTester object used to test the MultiVectorBase interface supported by VectorBase.
const VectorTester< Scalar > & vectorTester () const
 Expose a const reference to the VectorTester object used to test the MultiVectorBase interface supported by VectorBase.
void warning_tol (const ScalarMag &warning_tol)
 Set the tolerance above which a relative error will generate a warning message.
ScalarMag warning_tol () const
 Return the warning tolerance for *this.
void error_tol (const ScalarMag &error_tol)
 Set the error above which a relative error will generate a an message and cause the test to fail.
ScalarMag error_tol () const
 Return the error tolerance for *this.
void num_random_vectors (const int num_random_vectors)
 Set the number random vectors that is generated during each test.
int num_random_vectors () const
 Return the number of random vectors used for *this objects tests.
void num_mv_cols (const int &num_mv_cols)
 Set the number of columns to use to create test MultiVectorBase objects.
const int & num_mv_cols () const
void show_all_tests (const bool show_all_tests)
 Set whether all of the tests will be printed independent if they pass or fail.
bool show_all_tests () const
 Return the number of random vectors used for *this objects tests.
void dump_all (const bool dump_all)
 Set whether all of the vectors and multi-vectors will be dumped or not.
bool dump_all () const
 Return the number of random vectors used for *this objects tests.
 VectorSpaceTester (const ScalarMag warning_tol=1e-13, const ScalarMag error_tol=1e-10, const int num_random_vectors=1, const int num_mv_cols=4, const bool show_all_tests=false, const bool dump_all=false)
 Default constructor which sets default parameter values.
bool check (const VectorSpaceBase< Scalar > &vs, Teuchos::FancyOStream *out) const
 Check a vector space and the objects it creates through a set of comprehensive tests.

Private Attributes

int num_mv_cols_
VectorTester< Scalar > vectorTester_
ScalarMag warning_tol_
ScalarMag error_tol_
int num_random_vectors_
bool show_all_tests_
bool dump_all_


Detailed Description

template<class Scalar>
class Thyra::VectorSpaceTester< Scalar >

Testing class for VectorSpace and the VectorBase and MultiVectorBase objects that it creates.

The testing function check() calls all of the methods defined in the interfaces VectorSpace, VectorBase, MultiVectorBase and VectorSpaceFactoryBase and checks may (but perhaps not all) of the postconditions. It would be very difficult to completely verify every postcondition in every situation.

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

When writing new concrete implementations of VectorSpace, VectorBase, MultiVectorBase and VectorSpaceFactoryBase, a developer is likely to spend a lot of time debugging while in this testing function.

Definition at line 57 of file Thyra_VectorSpaceTesterDecl.hpp.


Member Typedef Documentation

template<class Scalar>
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Thyra::VectorSpaceTester< Scalar >::ScalarMag
 

Local typedef for scalar magnitude.

Definition at line 61 of file Thyra_VectorSpaceTesterDecl.hpp.


Constructor & Destructor Documentation

template<class Scalar>
Thyra::VectorSpaceTester< Scalar >::VectorSpaceTester const ScalarMag  warning_tol = 1e-13,
const ScalarMag  error_tol = 1e-10,
const int  num_random_vectors = 1,
const int  num_mv_cols = 4,
const bool  show_all_tests = false,
const bool  dump_all = false
 

Default constructor which sets default parameter values.

Note: It is not recommended that the client pass in values in this constructor since the argument list may change in the near future but instead use the above set functions to change an option after construction.

Definition at line 38 of file Thyra_VectorSpaceTester.hpp.


Member Function Documentation

template<class Scalar>
VectorTester< Scalar > & Thyra::VectorSpaceTester< Scalar >::vectorTester  )  [inline]
 

Expose a non-const reference to the VectorTester object used to test the MultiVectorBase interface supported by VectorBase.

Clients can use this interface to override options directly set on *this.

Definition at line 210 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
const VectorTester< Scalar > & Thyra::VectorSpaceTester< Scalar >::vectorTester  )  const [inline]
 

Expose a const reference to the VectorTester object used to test the MultiVectorBase interface supported by VectorBase.

Clients can use this interface to query (but not change) options.

Definition at line 217 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
void Thyra::VectorSpaceTester< Scalar >::warning_tol const ScalarMag warning_tol  )  [inline]
 

Set the tolerance above which a relative error will generate a warning message.

Also calls this->vectorTester().set_all_warning_tol(warning_tol).

Definition at line 224 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
VectorSpaceTester< Scalar >::ScalarMag Thyra::VectorSpaceTester< Scalar >::warning_tol  )  const [inline]
 

Return the warning tolerance for *this.

Definition at line 233 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
void Thyra::VectorSpaceTester< Scalar >::error_tol const ScalarMag error_tol  )  [inline]
 

Set the error above which a relative error will generate a an message and cause the test to fail.

Also calls this->vectorTester().set_all_error_tol(error_tol).

Definition at line 240 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
VectorSpaceTester< Scalar >::ScalarMag Thyra::VectorSpaceTester< Scalar >::error_tol  )  const [inline]
 

Return the error tolerance for *this.

Definition at line 249 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
void Thyra::VectorSpaceTester< Scalar >::num_random_vectors const int  num_random_vectors  )  [inline]
 

Set the number random vectors that is generated during each test.

Also calls this->vectorTester().num_random_vectors(num_random_vectors).

Definition at line 256 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
int Thyra::VectorSpaceTester< Scalar >::num_random_vectors  )  const [inline]
 

Return the number of random vectors used for *this objects tests.

Definition at line 264 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
void Thyra::VectorSpaceTester< Scalar >::num_mv_cols const int &  num_mv_cols  )  [inline]
 

Set the number of columns to use to create test MultiVectorBase objects.

Definition at line 113 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
const int& Thyra::VectorSpaceTester< Scalar >::num_mv_cols  )  const [inline]
 

Definition at line 113 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
void Thyra::VectorSpaceTester< Scalar >::show_all_tests const bool  show_all_tests  )  [inline]
 

Set whether all of the tests will be printed independent if they pass or fail.

Also calls this->vectorTester().show_all_tests(show_all_tests).

Definition at line 271 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
bool Thyra::VectorSpaceTester< Scalar >::show_all_tests  )  const [inline]
 

Return the number of random vectors used for *this objects tests.

Definition at line 279 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
void Thyra::VectorSpaceTester< Scalar >::dump_all const bool  dump_all  )  [inline]
 

Set whether all of the vectors and multi-vectors will be dumped or not.

Also calls this->vectorTester().dump_all(dump_all).

Definition at line 286 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
bool Thyra::VectorSpaceTester< Scalar >::dump_all  )  const [inline]
 

Return the number of random vectors used for *this objects tests.

Definition at line 294 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
bool Thyra::VectorSpaceTester< Scalar >::check const VectorSpaceBase< Scalar > &  vs,
Teuchos::FancyOStream *  out
const
 

Check a vector space and the objects it creates through a set of comprehensive tests.

Parameters:
vs [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):

  • 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.
  • dump_all(bool): If dump_all() == true, then all of the vectors will be printed that are created during the tests. This option is really only needed during initial debugging and should only be used with small vector spaces since it will produce a lot of O(space.dim()) output.
  • 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(ScalarMag): Any test with a relative error greater than warning_tol() will result in a warning message printed to *out but will not result in a filed test.
  • error_tol(Scalar): Any test with a relative error greater than error_tol() will result in an error message printed to *out and will result in a failed test.

Returns:
The function returns true if all of the tests where within the error_tol() and returns false if not.
The best way to see what this testing function is doing is to run the test with out!=NULL and to look at the implementation by clicking on the following link to the source code:

Definition at line 61 of file Thyra_VectorSpaceTester.hpp.


Member Data Documentation

template<class Scalar>
int Thyra::VectorSpaceTester< Scalar >::num_mv_cols_ [private]
 

Definition at line 113 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
VectorTester<Scalar> Thyra::VectorSpaceTester< Scalar >::vectorTester_ [private]
 

Definition at line 195 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
ScalarMag Thyra::VectorSpaceTester< Scalar >::warning_tol_ [private]
 

Definition at line 197 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
ScalarMag Thyra::VectorSpaceTester< Scalar >::error_tol_ [private]
 

Definition at line 198 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
int Thyra::VectorSpaceTester< Scalar >::num_random_vectors_ [private]
 

Definition at line 199 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
bool Thyra::VectorSpaceTester< Scalar >::show_all_tests_ [private]
 

Definition at line 200 of file Thyra_VectorSpaceTesterDecl.hpp.

template<class Scalar>
bool Thyra::VectorSpaceTester< Scalar >::dump_all_ [private]
 

Definition at line 201 of file Thyra_VectorSpaceTesterDecl.hpp.


The documentation for this class was generated from the following files:
Generated on Thu Sep 18 12:33:14 2008 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1