Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_MultiVectorTester_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_MULTI_VECTOR_TESTER_DECL_HPP
11#define THYRA_MULTI_VECTOR_TESTER_DECL_HPP
12
13#include "Thyra_OperatorVectorTypes.hpp"
14#include "Thyra_LinearOpTester.hpp"
15#include "Teuchos_Describable.hpp"
16
17
18namespace Thyra {
19
20
27template<class Scalar>
29public:
30
33
42
50
56 void warning_tol( const ScalarMag &warning_tol );
57
59 ScalarMag warning_tol() const;
60
66 void error_tol( const ScalarMag &error_tol );
67
69 ScalarMag error_tol() const;
70
75 void num_random_vectors( const int num_random_vectors );
76
80 int num_random_vectors() const;
81
87 void show_all_tests( const bool show_all_tests );
88
92 bool show_all_tests() const;
93
99 void dump_all( const bool dump_all );
100
104 bool dump_all() const;
105
127 const ScalarMag warning_tol = 1e-13,
128 const ScalarMag error_tol = 1e-10,
129 const int num_random_vectors = 1,
130 const bool show_all_tests = false,
131 const bool dump_all = false
132 );
133
136 const Ptr<Teuchos::FancyOStream> &out) const;
137
169 bool check(
170 const MultiVectorBase<Scalar> &mv,
172 ) const;
173
174private:
175
176 LinearOpTester<Scalar> linearOpTester_;
177
178 ScalarMag warning_tol_;
179 ScalarMag error_tol_;
180 int num_random_vectors_;
181 bool show_all_tests_;
182 bool dump_all_;
183
184}; // class MultiVectorTester
185
186
187// //////////////////////////////////
188// Inline members
189
190
191template<class Scalar>
192inline
197
198
199template<class Scalar>
200inline
202{
203 return linearOpTester_;
204}
205
206
207template<class Scalar>
208inline
210{
211 warning_tol_ = warning_tol_in;
212 linearOpTester_.set_all_warning_tol(warning_tol_in);
213}
214
215
216template<class Scalar>
217inline
220{
221 return warning_tol_;
222}
223
224
225template<class Scalar>
226inline
228{
229 error_tol_ = error_tol_in;
230 linearOpTester_.set_all_error_tol(error_tol_in);
231}
232
233
234template<class Scalar>
235inline
238{
239 return error_tol_;
240}
241
242
243template<class Scalar>
244inline
245void MultiVectorTester<Scalar>::num_random_vectors( const int num_random_vectors_in )
246{
247 num_random_vectors_ = num_random_vectors_in;
248 linearOpTester_.num_random_vectors(num_random_vectors_in);
249}
250
251
252template<class Scalar>
253inline
255{
256 return num_random_vectors_;
257}
258
259
260template<class Scalar>
261inline
262void MultiVectorTester<Scalar>::show_all_tests( const bool show_all_tests_in )
263{
264 show_all_tests_ = show_all_tests_in;
265 linearOpTester_.show_all_tests(show_all_tests_in);
266}
267
268
269template<class Scalar>
270inline
272{
273 return show_all_tests_;
274}
275
276
277template<class Scalar>
278inline
279void MultiVectorTester<Scalar>::dump_all( const bool dump_all_in )
280{
281 dump_all_ = dump_all_in;
282 linearOpTester_.dump_all(dump_all_in);
283}
284
285
286template<class Scalar>
287inline
289{
290 return dump_all_;
291}
292
293
294} // namespace Thyra
295
296
297#endif // THYRA_MULTI_VECTOR_TESTER_DECL_HPP
Testing class for LinearOpBase.
void set_all_warning_tol(const ScalarMag warning_tol)
Set all the warning tolerances to the same value.
Interface for a collection of column vectors called a multi-vector.
Unit testing class for a MultiVectorBase object.
ScalarMag error_tol() const
Return the error tolerance for *this.
bool dump_all() const
Return the number of random vectors used for *this objects tests.
int num_random_vectors() const
Return the number of random vectors used for *this objects tests.
ScalarMag warning_tol() const
Return the warning tolerance for *this.
bool checkMultiVector(const VectorSpaceBase< Scalar > &vs, const Ptr< Teuchos::FancyOStream > &out) const
Check a multi-vector as created by a VectorSpaceBase object.
LinearOpTester< Scalar > & linearOpTester()
Expose a non-const reference to the LinearOpTester object used to test the LinearOpBase interface sup...
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for scalar magnitude.
bool show_all_tests() const
Return the number of random vectors used for *this objects tests.
bool check(const MultiVectorBase< Scalar > &mv, const Ptr< Teuchos::FancyOStream > &out) const
Check a multi-vector object in a set of comprehensive teats.
Abstract interface for objects that represent a space for vectors.