Thyra_LinearOpTesterDecl.hpp

Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
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 }; // class LinearOpTester
00312 
00313 } // namespace Thyra
00314 
00315 #endif // THYRA_LINEAR_OP_TESTER_DECL_HPP

Generated on Thu Sep 18 12:33:02 2008 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.3.9.1