00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef THYRA_LINEAR_OP_TESTER_DECL_HPP
00031 #define THYRA_LINEAR_OP_TESTER_DECL_HPP
00032
00033
00034 #include "Thyra_OperatorVectorTypes.hpp"
00035 #include "Thyra_MultiVectorRandomizerBase.hpp"
00036 #include "Teuchos_ScalarTraits.hpp"
00037 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00038 #include "Teuchos_FancyOStream.hpp"
00039
00040
00041 namespace Thyra {
00042
00043
00060 template<class RangeScalar, class DomainScalar = RangeScalar>
00061 class LinearOpTester {
00062 public:
00063
00065 typedef typename Teuchos::PromotionTraits<RangeScalar,DomainScalar>::promote Scalar;
00066
00068 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00069
00077 LinearOpTester(
00078 const bool check_linear_properties = true,
00079 const ScalarMag linear_properties_warning_tol = 1e-13,
00080 const ScalarMag linear_properties_error_tol = 1e-10,
00081 const bool check_adjoint = true,
00082 const ScalarMag adjoint_warning_tol = 1e-13,
00083 const ScalarMag adjoint_error_tol = 1e-10,
00084 const bool check_for_symmetry = false,
00085 const ScalarMag symmetry_warning_tol = 1e-13,
00086 const ScalarMag symmetry_error_tol = 1e-10,
00087 const int num_random_vectors = 1,
00088 const bool show_all_tests = false,
00089 const bool dump_all = false,
00090 const int num_rhs = 1
00091 );
00092
00096 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_linear_properties );
00097
00101 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_warning_tol );
00102
00107 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_error_tol );
00108
00112 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint );
00113
00117 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_warning_tol );
00118
00122 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_error_tol );
00123
00127 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_for_symmetry );
00128
00132 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_warning_tol );
00133
00137 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_error_tol );
00138
00141 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors );
00142
00145 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests );
00146
00150 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all );
00151
00154 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs );
00155
00164 void enable_all_tests( const bool enable_all_tests );
00165
00174 void set_all_warning_tol( const ScalarMag warning_tol );
00175
00184 void set_all_error_tol( const ScalarMag error_tol );
00185
00255 bool check(
00256 const LinearOpBase<RangeScalar,DomainScalar> &op,
00257 MultiVectorRandomizerBase<RangeScalar> *rangeRandomizer,
00258 MultiVectorRandomizerBase<DomainScalar> *domainRandomizer,
00259 Teuchos::FancyOStream *out
00260 ) const;
00261
00263 bool check(
00264 const LinearOpBase<RangeScalar,DomainScalar> &op,
00265 Teuchos::FancyOStream *out
00266 ) const;
00267
00306 bool compare(
00307 const LinearOpBase<RangeScalar,DomainScalar> &op1,
00308 const LinearOpBase<RangeScalar,DomainScalar> &op2,
00309 MultiVectorRandomizerBase<DomainScalar> *domainRandomizer,
00310 Teuchos::FancyOStream *out
00311 ) const;
00312
00316 bool compare(
00317 const LinearOpBase<RangeScalar,DomainScalar> &op1,
00318 const LinearOpBase<RangeScalar,DomainScalar> &op2,
00319 Teuchos::FancyOStream *out
00320 ) const;
00321
00322 };
00323
00324
00325 }
00326
00327
00328 #endif // THYRA_LINEAR_OP_TESTER_DECL_HPP