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 #ifndef THYRA_LINEAR_OP_TESTER_DECL_HPP
00030 #define THYRA_LINEAR_OP_TESTER_DECL_HPP
00031
00032 #include "Thyra_OperatorVectorTypes.hpp"
00033 #include "Thyra_MultiVectorRandomizerBase.hpp"
00034 #include "Teuchos_ScalarTraits.hpp"
00035 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00036 #include "Teuchos_FancyOStream.hpp"
00037
00038 namespace Thyra {
00039
00056 template<class RangeScalar, class DomainScalar = RangeScalar>
00057 class LinearOpTester {
00058 public:
00059
00061 typedef typename Teuchos::PromotionTraits<RangeScalar,DomainScalar>::promote Scalar;
00062
00064 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00065
00073 LinearOpTester(
00074 const bool check_linear_properties = true
00075 ,const ScalarMag linear_properties_warning_tol = 1e-13
00076 ,const ScalarMag linear_properties_error_tol = 1e-10
00077 ,const bool check_adjoint = true
00078 ,const ScalarMag adjoint_warning_tol = 1e-13
00079 ,const ScalarMag adjoint_error_tol = 1e-10
00080 ,const bool check_for_symmetry = false
00081 ,const ScalarMag symmetry_warning_tol = 1e-13
00082 ,const ScalarMag symmetry_error_tol = 1e-10
00083 ,const int num_random_vectors = 1
00084 ,const bool show_all_tests = false
00085 ,const bool dump_all = false
00086 ,const int num_rhs = 1
00087 );
00088
00092 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_linear_properties )
00093
00094
00097 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_warning_tol )
00098
00103 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_error_tol )
00104
00108 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint )
00109
00113 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_warning_tol )
00114
00118 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_error_tol )
00119
00123 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_for_symmetry )
00124
00128 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_warning_tol )
00129
00133 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_error_tol )
00134
00137 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors )
00138
00141 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests )
00142
00146 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all )
00147
00150 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs )
00151
00160 void enable_all_tests( const bool enable_all_tests );
00161
00170 void set_all_warning_tol( const ScalarMag warning_tol );
00171
00180 void set_all_error_tol( const ScalarMag error_tol );
00181
00250 bool check(
00251 const LinearOpBase<RangeScalar,DomainScalar> &op
00252 ,MultiVectorRandomizerBase<RangeScalar> *rangeRandomizer
00253 ,MultiVectorRandomizerBase<DomainScalar> *domainRandomizer
00254 ,Teuchos::FancyOStream *out
00255 ) const;
00256
00258 bool check(
00259 const LinearOpBase<RangeScalar,DomainScalar> &op
00260 ,Teuchos::FancyOStream *out
00261 ) const;
00262
00297 bool compare(
00298 const LinearOpBase<RangeScalar,DomainScalar> &op1
00299 ,const LinearOpBase<RangeScalar,DomainScalar> &op2
00300 ,MultiVectorRandomizerBase<DomainScalar> *domainRandomizer
00301 ,Teuchos::FancyOStream *out
00302 ) const;
00303
00305 bool compare(
00306 const LinearOpBase<RangeScalar,DomainScalar> &op1
00307 ,const LinearOpBase<RangeScalar,DomainScalar> &op2
00308 ,Teuchos::FancyOStream *out
00309 ) const;
00310
00311 };
00312
00313 }
00314
00315 #endif