Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_LinearOpTester_decl.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
4 //
5 // Copyright 2004 NTESS and the Thyra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef THYRA_LINEAR_OP_TESTER_DECL_HPP
11 #define THYRA_LINEAR_OP_TESTER_DECL_HPP
12 
13 
14 #include "Thyra_OperatorVectorTypes.hpp"
15 #include "Thyra_MultiVectorRandomizerBase.hpp"
16 #include "Teuchos_ScalarTraits.hpp"
17 #include "Teuchos_PromotionTraits.hpp"
18 #include "Teuchos_StandardMemberCompositionMacros.hpp"
19 #include "Teuchos_FancyOStream.hpp"
20 
21 
22 namespace Thyra {
23 
24 
41 template<class Scalar>
43 public:
44 
47 
53 
57  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_linear_properties );
58 
62  STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_warning_tol );
63 
68  STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, linear_properties_error_tol );
69 
73  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_adjoint );
74 
78  STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_warning_tol );
79 
83  STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, adjoint_error_tol );
84 
88  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_for_symmetry );
89 
93  STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_warning_tol );
94 
98  STANDARD_MEMBER_COMPOSITION_MEMBERS( ScalarMag, symmetry_error_tol );
99 
102  STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors );
103 
106  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests );
107 
111  STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, dump_all );
112 
115  STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_rhs );
116 
125  void enable_all_tests( const bool enable_all_tests );
126 
135  void set_all_warning_tol( const ScalarMag warning_tol );
136 
145  void set_all_error_tol( const ScalarMag error_tol );
146 
216  bool check(
217  const LinearOpBase<Scalar> &op,
218  const Ptr<MultiVectorRandomizerBase<Scalar> > &rangeRandomizer,
219  const Ptr<MultiVectorRandomizerBase<Scalar> > &domainRandomizer,
220  const Ptr<FancyOStream> &out
221  ) const;
222 
224  bool check(
225  const LinearOpBase<Scalar> &op,
226  const Ptr<FancyOStream> &out
227  ) const;
228 
267  bool compare(
268  const LinearOpBase<Scalar> &op1,
269  const LinearOpBase<Scalar> &op2,
270  const Ptr<MultiVectorRandomizerBase<Scalar> > &domainRandomizer,
271  const Ptr<FancyOStream> &out_arg
272  ) const;
273 
277  bool compare(
278  const LinearOpBase<Scalar> &op1,
279  const LinearOpBase<Scalar> &op2,
280  const Ptr<FancyOStream> &out_arg
281  ) const;
282 
283 private:
284 
285  void setDefaultTols();
286 
287 }; // class LinearOpTester
288 
289 
290 } // namespace Thyra
291 
292 
293 #endif // THYRA_LINEAR_OP_TESTER_DECL_HPP
void enable_all_tests(const bool enable_all_tests)
Enable or disable all tests.
Testing class for LinearOpBase.
bool compare(const LinearOpBase< Scalar > &op1, const LinearOpBase< Scalar > &op2, const Ptr< MultiVectorRandomizerBase< Scalar > > &domainRandomizer, const Ptr< FancyOStream > &out_arg) const
Check if two linear operators are the same or not.
Base class for all linear operators.
void set_all_warning_tol(const ScalarMag warning_tol)
Set all the warning tolerances to the same value.
bool check(const LinearOpBase< Scalar > &op, const Ptr< MultiVectorRandomizerBase< Scalar > > &rangeRandomizer, const Ptr< MultiVectorRandomizerBase< Scalar > > &domainRandomizer, const Ptr< FancyOStream > &out) const
Check a linear operator.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for promoted scalar magnitude.
LinearOpTester()
Default constructor which sets default parameter values.
Base interface for a strategy object for randomizing a multi-vector.
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_linear_properties)
Set if to check for linear properties alpha*op*(x + y) == op(alpha*x) + op(alpha*y) ...
void set_all_error_tol(const ScalarMag error_tol)
Set all the error tolerances to the same value.