Thyra Version of the Day
Loading...
Searching...
No Matches
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
22namespace Thyra {
23
24
41template<class Scalar>
43public:
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
74
79
84
88 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, check_for_symmetry );
89
94
99
102 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_random_vectors );
103
106 STANDARD_MEMBER_COMPOSITION_MEMBERS( bool, show_all_tests );
107
112
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
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
278 const LinearOpBase<Scalar> &op1,
279 const LinearOpBase<Scalar> &op2,
280 const Ptr<FancyOStream> &out_arg
281 ) const;
282
283private:
284
285 void setDefaultTols();
286
287}; // class LinearOpTester
288
289
290} // namespace Thyra
291
292
293#endif // THYRA_LINEAR_OP_TESTER_DECL_HPP
Base class for all linear operators.
Testing class for LinearOpBase.
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)
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_warning_tol)
Set the tolerance above which a relative error will generate a warning message for the check of the a...
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_adjoint)
Set if to check for adjoint property x'*(op*y) == y'*(op'*x) if adjoint is supported.
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.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, symmetry_error_tol)
Set the tolerance above which a relative error will generate a error message and result in test failu...
LinearOpTester()
Default constructor which sets default parameter values.
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, adjoint_error_tol)
Set the tolerance above which a relative error will generate a error message and result in test failu...
STANDARD_MEMBER_COMPOSITION_MEMBERS(int, num_random_vectors)
Set the number random vectors that is generated during each test.
void set_all_warning_tol(const ScalarMag warning_tol)
Set all the warning tolerances to the same value.
bool compare(const LinearOpBase< Scalar > &op1, const LinearOpBase< Scalar > &op2, const Ptr< FancyOStream > &out_arg) const
Calls this->compare(op1,op2,NULL,out,leadingIndent,indentSpacer).
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, symmetry_warning_tol)
Set the tolerance above which a relative error will generate a warning message for the check of symme...
void enable_all_tests(const bool enable_all_tests)
Enable or disable all tests.
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, check_for_symmetry)
Set if to check for symmetry property x'*(op*y) == y'*(op*x) for symmetric operators.
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, show_all_tests)
Set if all tests are shown or just summaries.
void set_all_error_tol(const ScalarMag error_tol)
Set all the error tolerances to the same value.
STANDARD_MEMBER_COMPOSITION_MEMBERS(int, num_rhs)
Set the number of right-hand-sides in the multivectors.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for promoted scalar magnitude.
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.
bool check(const LinearOpBase< Scalar > &op, const Ptr< FancyOStream > &out) const
Calls this->check(op,null,null,out,leadingIndent,indentSpacer)
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, linear_properties_warning_tol)
Set the tolerance above which a relative error will generate a warning message for the check of the l...
STANDARD_MEMBER_COMPOSITION_MEMBERS(ScalarMag, linear_properties_error_tol)
Set the tolerance above which a relative error will generate a error message and result in test failu...
STANDARD_MEMBER_COMPOSITION_MEMBERS(bool, dump_all)
Set if all of the vectors are dumped or not (only relevant if show_all_tests()==true).
Base interface for a strategy object for randomizing a multi-vector.