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 #include "Thyra_LinearOpWithSolveBase.hpp"
00033 #include "Teuchos_StandardMemberCompositionMacros.hpp"
00034 #include "Teuchos_FancyOStream.hpp"
00035 
00036 namespace Thyra {
00037 
00074 template<class RangeScalar, class DomainScalar = RangeScalar>
00075 class LinearOpWithSolveTester {
00076 public:
00077 
00079   typedef typename Teuchos::ScalarTraits<RangeScalar>::magnitudeType              RangeScalarMag;
00081   typedef typename Teuchos::ScalarTraits<DomainScalar>::magnitudeType             DomainScalarMag;
00083   typedef typename Teuchos::PromotionTraits<RangeScalar,DomainScalar>::promote    Scalar;
00085   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType                   ScalarMag;
00086 
00094   LinearOpWithSolveTester(
00095     const bool                 check_forward_default                    = true
00096     ,const RangeScalarMag      forward_default_residual_warning_tol     = 1e-6
00097     ,const RangeScalarMag      forward_default_residual_error_tol       = 1e-5
00098     ,const DomainScalarMag     forward_default_solution_error_warning_tol= 1e-6
00099     ,const DomainScalarMag     forward_default_solution_error_error_tol = 1e-5
00100     ,const bool                check_forward_residual                   = true
00101     ,const RangeScalarMag      forward_residual_solve_tol               = 1e-5
00102     ,const RangeScalarMag      forward_residual_slack_warning_tol       = 1e-6
00103     ,const RangeScalarMag      forward_residual_slack_error_tol         = 1e-5
00104     ,const bool                check_forward_solution_error             = true
00105     ,const RangeScalarMag      forward_solution_error_solve_tol         = 1e-5
00106     ,const RangeScalarMag      forward_solution_error_slack_warning_tol = 1e-6
00107     ,const RangeScalarMag      forward_solution_error_slack_error_tol   = 1e-5
00108     ,const bool                check_adjoint_default                    = true
00109     ,const DomainScalarMag     adjoint_default_residual_warning_tol     = 1e-6
00110     ,const DomainScalarMag     adjoint_default_residual_error_tol       = 1e-5
00111     ,const RangeScalarMag      adjoint_default_solution_error_warning_tol= 1e-6
00112     ,const RangeScalarMag      adjoint_default_solution_error_error_tol = 1e-5
00113     ,const bool                check_adjoint_residual                   = true
00114     ,const DomainScalarMag     adjoint_residual_solve_tol               = 1e-5
00115     ,const DomainScalarMag     adjoint_residual_slack_warning_tol       = 1e-6
00116     ,const DomainScalarMag     adjoint_residual_slack_error_tol         = 1e-5
00117     ,const bool                check_adjoint_solution_error             = true
00118     ,const DomainScalarMag     adjoint_solution_error_solve_tol         = 1e-5
00119     ,const DomainScalarMag     adjoint_solution_error_slack_warning_tol = 1e-6
00120     ,const DomainScalarMag     adjoint_solution_error_slack_error_tol   = 1e-5
00121     ,const int                 num_random_vectors                       = 1
00122     ,const bool                show_all_tests                           = false
00123     ,const bool                dump_all                                 = false
00124     ,const int                 num_rhs                                  = 1
00125     );
00126   
00128   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_default  )
00129 
00130   
00131   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_default_residual_warning_tol  )
00132 
00134   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_default_residual_error_tol  )
00135 
00137   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag, forward_default_solution_error_warning_tol  )
00138 
00140   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag, forward_default_solution_error_error_tol  )
00141 
00143   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_residual  )
00144 
00147   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_residual_solve_tol  )
00148 
00150   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_residual_slack_warning_tol  )
00151 
00153   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_residual_slack_error_tol  )
00154 
00156   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_solution_error  )
00157 
00160   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_solution_error_solve_tol  )
00161 
00163   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_solution_error_slack_warning_tol  )
00164 
00166   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, forward_solution_error_slack_error_tol  )
00167 
00169   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_default  )
00170 
00172   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag, adjoint_default_residual_warning_tol  )
00173 
00175   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag, adjoint_default_residual_error_tol  )
00176 
00178   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, adjoint_default_solution_error_warning_tol  )
00179 
00181   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, adjoint_default_solution_error_error_tol  )
00182 
00185   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_residual  )
00186 
00189   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag, adjoint_residual_solve_tol  )
00190 
00192   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag, adjoint_residual_slack_warning_tol  )
00193 
00195   STANDARD_MEMBER_COMPOSITION_MEMBERS( DomainScalarMag, adjoint_residual_slack_error_tol  )
00196 
00198   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_solution_error  )
00199 
00202   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, adjoint_solution_error_solve_tol  )
00203 
00205   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, adjoint_solution_error_slack_warning_tol  )
00206 
00208   STANDARD_MEMBER_COMPOSITION_MEMBERS( RangeScalarMag, adjoint_solution_error_slack_error_tol  )
00209 
00212   STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors )
00213 
00216   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests )
00217 
00221   STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all )
00222 
00225   STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs )
00226 
00233   void turn_off_all_tests();
00234 
00241   void set_all_solve_tol( const ScalarMag solve_tol );
00242 
00249   void set_all_slack_warning_tol( const ScalarMag slack_warning_tol );
00250 
00257   void set_all_slack_error_tol( const ScalarMag slack_error_tol );
00258   
00263   bool check(
00264     const LinearOpWithSolveBase<RangeScalar,DomainScalar>   &op
00265     ,Teuchos::FancyOStream                                  *out
00266     ) const;
00267 
00268 
00269 }; // class LinearOpWithSolveTester
00270 
00271 } // namespace Thyra
00272 
00273 #endif // THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP

Generated on Thu Sep 18 12:32:45 2008 for Thyra Operator Solve Support by doxygen 1.3.9.1