|
Thyra Package Browser (Single Doxygen Collection) Version of the Day
|
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 Scalar> 00079 class LinearOpWithSolveTester 00080 : virtual public Teuchos::ParameterListAcceptorDefaultBase 00081 { 00082 public: 00083 00086 00088 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag; 00089 00091 00094 00096 LinearOpWithSolveTester(); 00097 00099 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_default ); 00101 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00102 forward_default_residual_warning_tol ); 00104 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00105 forward_default_residual_error_tol ); 00107 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00108 forward_default_solution_error_warning_tol ); 00110 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00111 forward_default_solution_error_error_tol ); 00112 00114 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_residual ); 00117 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00118 forward_residual_solve_tol ); 00120 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00121 forward_residual_slack_warning_tol ); 00123 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00124 forward_residual_slack_error_tol ); 00125 00127 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_default ); 00129 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00130 adjoint_default_residual_warning_tol ); 00132 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00133 adjoint_default_residual_error_tol ); 00135 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00136 adjoint_default_solution_error_warning_tol ); 00138 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00139 adjoint_default_solution_error_error_tol ); 00140 00143 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_residual ); 00146 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00147 adjoint_residual_solve_tol ); 00149 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00150 adjoint_residual_slack_warning_tol ); 00152 STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, 00153 adjoint_residual_slack_error_tol ); 00154 00157 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors ); 00158 00161 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests ); 00162 00166 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all ); 00167 00170 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs ); 00171 00178 void turn_off_all_tests(); 00179 00186 void set_all_solve_tol( const ScalarMag solve_tol ); 00187 00194 void set_all_slack_warning_tol( const ScalarMag slack_warning_tol ); 00195 00202 void set_all_slack_error_tol( const ScalarMag slack_error_tol ); 00203 00205 00208 00210 void setParameterList(const RCP<ParameterList>& paramList); 00211 00213 RCP<const ParameterList> getValidParameters() const; 00214 00216 00219 00224 bool check( 00225 const LinearOpWithSolveBase<Scalar> &op, 00226 Teuchos::FancyOStream *out 00227 ) const; 00228 00230 00231 private: 00232 00233 static const bool check_forward_default_default_; 00234 static const bool check_forward_residual_default_; 00235 static const bool check_adjoint_default_default_; 00236 static const bool check_adjoint_residual_default_; 00237 00238 static const ScalarMag warning_tol_default_; 00239 static const ScalarMag error_tol_default_; 00240 static const ScalarMag solve_tol_default_; 00241 static const ScalarMag slack_warning_tol_default_; 00242 static const ScalarMag slack_error_tol_default_; 00243 00244 static const int num_random_vectors_default_; 00245 static const bool show_all_tests_default_; 00246 static const bool dump_all_default_; 00247 static const int num_rhs_default_; 00248 00249 static const std::string AllSolveTol_name_; 00250 static const std::string AllSlackWarningTol_name_; 00251 static const std::string AllSlackErrorTol_name_; 00252 static const std::string ShowAllTests_name_; 00253 static const std::string DumpAll_name_; 00254 00255 }; // class LinearOpWithSolveTester 00256 00257 00258 } // namespace Thyra 00259 00260 00261 #endif // THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
1.7.4