Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_LinearOpWithSolveTester_decl.hpp
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
43 #define THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
44 
45 
46 #include "Thyra_LinearOpWithSolveBase.hpp"
47 #include "Teuchos_StandardMemberCompositionMacros.hpp"
48 #include "Teuchos_ParameterListAcceptorDefaultBase.hpp"
49 #include "Teuchos_FancyOStream.hpp"
50 
51 
52 namespace Thyra {
53 
54 
91 template<class Scalar>
94 {
95 public:
96 
99 
102 
104 
107 
110 
112  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_default );
115  forward_default_residual_warning_tol );
118  forward_default_residual_error_tol );
121  forward_default_solution_error_warning_tol );
124  forward_default_solution_error_error_tol );
125 
127  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_forward_residual );
131  forward_residual_solve_tol );
134  forward_residual_slack_warning_tol );
137  forward_residual_slack_error_tol );
138 
140  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_default );
143  adjoint_default_residual_warning_tol );
146  adjoint_default_residual_error_tol );
149  adjoint_default_solution_error_warning_tol );
152  adjoint_default_solution_error_error_tol );
153 
156  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint_residual );
160  adjoint_residual_solve_tol );
163  adjoint_residual_slack_warning_tol );
166  adjoint_residual_slack_error_tol );
167 
170  STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors );
171 
174  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests );
175 
179  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all );
180 
183  STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs );
184 
191  void turn_off_all_tests();
192 
199  void set_all_solve_tol( const ScalarMag solve_tol );
200 
207  void set_all_slack_warning_tol( const ScalarMag slack_warning_tol );
208 
215  void set_all_slack_error_tol( const ScalarMag slack_error_tol );
216 
218 
221 
223  void setParameterList(const RCP<ParameterList>& paramList);
224 
227 
229 
232 
237  bool check(
240  ) const;
241 
243 
244 private:
245 
246  static const bool check_forward_default_default_;
247  static const bool check_forward_residual_default_;
248  static const bool check_adjoint_default_default_;
249  static const bool check_adjoint_residual_default_;
250 
251  static const ScalarMag warning_tol_default_;
252  static const ScalarMag error_tol_default_;
253  static const ScalarMag solve_tol_default_;
254  static const ScalarMag slack_warning_tol_default_;
255  static const ScalarMag slack_error_tol_default_;
256 
257  static const int num_random_vectors_default_;
258  static const bool show_all_tests_default_;
259  static const bool dump_all_default_;
260  static const int num_rhs_default_;
261 
262  static const std::string AllSolveTol_name_;
263  static const std::string AllSlackWarningTol_name_;
264  static const std::string AllSlackErrorTol_name_;
265  static const std::string ShowAllTests_name_;
266  static const std::string DumpAll_name_;
267 
268 }; // class LinearOpWithSolveTester
269 
270 
271 } // namespace Thyra
272 
273 
274 #endif // THYRA_LINEAR_OP_WITH_SOLVE_TESTER_DECL_HPP
Testing class for LinearOpWithSolveBase.
void turn_off_all_tests()
Turn off all tests so that individual tests can be set.
void set_all_slack_warning_tol(const ScalarMag slack_warning_tol)
Set all the warning tolerances to the same value.
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_forward_default)
Set if a default forward solve will be performed on not.
Base class for all linear operators that can support a high-level solve operation.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
RCP< const ParameterList > getValidParameters() const
bool check(const LinearOpWithSolveBase< Scalar > &op, Teuchos::FancyOStream *out) const
Check a LinearOpWithSolveBase object.
void set_all_solve_tol(const ScalarMag solve_tol)
Set all the solve tolerances to the same value.
void set_all_slack_error_tol(const ScalarMag slack_error_tol)
Set all the error tolerances to the same value.
void setParameterList(const RCP< ParameterList > &paramList)