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_PromotionTraits.hpp"
00038 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00039 #include "Teuchos_FancyOStream.hpp"
00040
00041
00042 namespace Thyra {
00043
00044
00061 template<class Scalar>
00062 class LinearOpTester {
00063 public:
00064
00066 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00067
00072 LinearOpTester();
00073
00077 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_linear_properties );
00078
00082 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_warning_tol );
00083
00088 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_error_tol );
00089
00093 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint );
00094
00098 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_warning_tol );
00099
00103 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_error_tol );
00104
00108 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_for_symmetry );
00109
00113 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_warning_tol );
00114
00118 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_error_tol );
00119
00122 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors );
00123
00126 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests );
00127
00131 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all );
00132
00135 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs );
00136
00145 void enable_all_tests( const bool enable_all_tests );
00146
00155 void set_all_warning_tol( const ScalarMag warning_tol );
00156
00165 void set_all_error_tol( const ScalarMag error_tol );
00166
00236 bool check(
00237 const LinearOpBase<Scalar> &op,
00238 const Ptr<MultiVectorRandomizerBase<Scalar> > &rangeRandomizer,
00239 const Ptr<MultiVectorRandomizerBase<Scalar> > &domainRandomizer,
00240 const Ptr<Teuchos::FancyOStream> &out
00241 ) const;
00242
00244 bool check(
00245 const LinearOpBase<Scalar> &op,
00246 const Ptr<Teuchos::FancyOStream> &out
00247 ) const;
00248
00287 bool compare(
00288 const LinearOpBase<Scalar> &op1,
00289 const LinearOpBase<Scalar> &op2,
00290 const Ptr<MultiVectorRandomizerBase<Scalar> > &domainRandomizer,
00291 const Ptr<Teuchos::FancyOStream> &out_arg
00292 ) const;
00293
00297 bool compare(
00298 const LinearOpBase<Scalar> &op1,
00299 const LinearOpBase<Scalar> &op2,
00300 const Ptr<Teuchos::FancyOStream> &out_arg
00301 ) const;
00302
00305
00307 bool check(
00308 const LinearOpBase<Scalar> &op,
00309 MultiVectorRandomizerBase<Scalar> *rangeRandomizer,
00310 MultiVectorRandomizerBase<Scalar> *domainRandomizer,
00311 Teuchos::FancyOStream *out
00312 ) const
00313 {
00314 using Teuchos::ptr;
00315 return check(op, ptr(rangeRandomizer), ptr(domainRandomizer), ptr(out));
00316 }
00317
00319 bool check(
00320 const LinearOpBase<Scalar> &op,
00321 Teuchos::FancyOStream *out
00322 ) const
00323 {
00324 return check(op, Teuchos::ptr(out));
00325 }
00326
00328 bool compare(
00329 const LinearOpBase<Scalar> &op1,
00330 const LinearOpBase<Scalar> &op2,
00331 MultiVectorRandomizerBase<Scalar> *domainRandomizer,
00332 Teuchos::FancyOStream *out_arg
00333 ) const
00334 {
00335 using Teuchos::ptr;
00336 return compare(op1, op2, ptr(domainRandomizer), ptr(out_arg));
00337 }
00338
00340 bool compare(
00341 const LinearOpBase<Scalar> &op1,
00342 const LinearOpBase<Scalar> &op2,
00343 Teuchos::FancyOStream *out_arg
00344 ) const
00345 {
00346 return compare(op1, op2, Teuchos::ptr(out_arg));
00347 }
00348
00350
00351 private:
00352
00353 void setDefaultTols();
00354
00355 };
00356
00357
00358 }
00359
00360
00361 #endif // THYRA_LINEAR_OP_TESTER_DECL_HPP