Thyra_LinearOpWithSolveTesterDecl.hpp

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_WITH_SOLVE_TESTER_DECL_HPP
00030 #define THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
00031 
00032 
00033 #include "Thyra_LinearOpWithSolveBase.hpp"
00034 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00035 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
00036 #include "Teuchos_FancyOStream.hpp"
00037 
00038 
00039 namespace Thyra {
00040 
00041 
00078 template<class RangeScalar, class DomainScalar = RangeScalar>
00079 class LinearOpWithSolveTester
00080   : virtual public Teuchos::ParameterListAcceptorDefaultBase
00081 {
00082 public:
00083 
00086 
00088   typedef typename Teuchos::ScalarTraits<RangeScalar>::magnitudeType RangeScalarMag;
00090   typedef typename Teuchos::ScalarTraits<DomainScalar>::magnitudeType DomainScalarMag;
00092   typedef typename Teuchos::PromotionTraits<RangeScalar,DomainScalar>::promote Scalar;
00094   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00095 
00097 
00100 
00102   LinearOpWithSolveTester();
00103   
00105   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_default  );
00107   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag,
00108     forward_default_residual_warning_tol  );
00110   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag,
00111     forward_default_residual_error_tol  );
00113   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag,
00114     forward_default_solution_error_warning_tol  );
00116   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag,
00117     forward_default_solution_error_error_tol  );
00118 
00120   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_residual  );
00123   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag,
00124     forward_residual_solve_tol  );
00126   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag,
00127     forward_residual_slack_warning_tol  );
00129   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag,
00130     forward_residual_slack_error_tol  );
00131 
00133   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_default  );
00135   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag,
00136     adjoint_default_residual_warning_tol  );
00138   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag,
00139     adjoint_default_residual_error_tol  );
00141   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag,
00142     adjoint_default_solution_error_warning_tol  );
00144   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag,
00145     adjoint_default_solution_error_error_tol  );
00146 
00149   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_residual  );
00152   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag,
00153     adjoint_residual_solve_tol  );
00155   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag,
00156     adjoint_residual_slack_warning_tol  );
00158   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag,
00159     adjoint_residual_slack_error_tol  );
00160 
00163   STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors );
00164 
00167   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests );
00168 
00172   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all );
00173 
00176   STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs );
00177 
00184   void turn_off_all_tests();
00185 
00192   void set_all_solve_tol( const ScalarMag solve_tol );
00193 
00200   void set_all_slack_warning_tol( const ScalarMag slack_warning_tol );
00201 
00208   void set_all_slack_error_tol( const ScalarMag slack_error_tol );
00209 
00211 
00214 
00216   void setParameterList(const RCP<ParameterList>& paramList);
00217 
00219   RCP<const ParameterList> getValidParameters() const;
00220 
00222 
00225   
00230   bool check(
00231     const LinearOpWithSolveBase<RangeScalar,DomainScalar> &op,
00232     Teuchos::FancyOStream *out
00233     ) const;
00234 
00236 
00237 private:
00238 
00239   static const bool check_forward_default_default_;
00240   static const bool check_forward_residual_default_;
00241   static const bool check_adjoint_default_default_;
00242   static const bool check_adjoint_residual_default_;
00243 
00244   static const ScalarMag warning_tol_default_;
00245   static const ScalarMag error_tol_default_;
00246   static const ScalarMag solve_tol_default_;
00247   static const ScalarMag slack_warning_tol_default_;
00248   static const ScalarMag slack_error_tol_default_;
00249 
00250   static const int num_random_vectors_default_;
00251   static const bool show_all_tests_default_;
00252   static const bool dump_all_default_;
00253   static const int num_rhs_default_;
00254 
00255   static const std::string AllSolveTol_name_;
00256   static const std::string AllSlackWarningTol_name_;
00257   static const std::string AllSlackErrorTol_name_;
00258   static const std::string ShowAllTests_name_;
00259   static const std::string DumpAll_name_;
00260 
00261 }; // class LinearOpWithSolveTester
00262 
00263 
00264 } // namespace Thyra
00265 
00266 
00267 #endif // THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP

Generated on Wed May 12 21:42:47 2010 for Thyra Operator Solve Support by  doxygen 1.4.7