Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_VectorSpaceTester_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_VECTOR_SPACE_TESTER_DECL_HPP
11#define THYRA_VECTOR_SPACE_TESTER_DECL_HPP
12
13#include "Thyra_OperatorVectorTypes.hpp"
14#include "Thyra_VectorTester.hpp"
15
16namespace Thyra {
17
18
38template<class Scalar>
40public:
41
44
53
61
67 void warning_tol( const ScalarMag &warning_tol );
68
70 ScalarMag warning_tol() const;
71
77 void error_tol( const ScalarMag &error_tol );
78
80 ScalarMag error_tol() const;
81
86 void num_random_vectors( const int num_random_vectors );
87
91 int num_random_vectors() const;
92
96
102 void show_all_tests( const bool show_all_tests );
103
107 bool show_all_tests() const;
108
114 void dump_all( const bool dump_all );
115
119 bool dump_all() const;
120
129 const ScalarMag warning_tol = 1e-13
130 ,const ScalarMag error_tol = 1e-10
131 ,const int num_random_vectors = 1
132 ,const int num_mv_cols = 4
133 ,const bool show_all_tests = false
134 ,const bool dump_all = false
135 );
136
182 bool check(
183 const VectorSpaceBase<Scalar> &vs,
185 ) const;
186
187private:
188
189 VectorTester<Scalar> vectorTester_;
190
191 ScalarMag warning_tol_;
192 ScalarMag error_tol_;
193 int num_random_vectors_;
194 bool show_all_tests_;
195 bool dump_all_;
196
197}; // class VectorSpaceTester
198
199
200// ///////////////////////////
201// Inline members
202
203
204template<class Scalar>
205inline
210
211
212template<class Scalar>
213inline
215{
216 return vectorTester_;
217}
218
219
220template<class Scalar>
221inline
223{
224 warning_tol_ = warning_tol_in;
225 vectorTester_.warning_tol(warning_tol_in);
226}
227
228
229template<class Scalar>
230inline
233{
234 return warning_tol_;
235}
236
237
238template<class Scalar>
239inline
241{
242 error_tol_ = error_tol_in;
243 vectorTester_.error_tol(error_tol_in);
244}
245
246
247template<class Scalar>
248inline
251{
252 return error_tol_;
253}
254
255
256template<class Scalar>
257inline
258void VectorSpaceTester<Scalar>::num_random_vectors( const int num_random_vectors_in )
259{
260 num_random_vectors_ = num_random_vectors_in;
261 vectorTester_.num_random_vectors(num_random_vectors_in);
262}
263
264
265template<class Scalar>
266inline
268{
269 return num_random_vectors_;
270}
271
272
273template<class Scalar>
274inline
275void VectorSpaceTester<Scalar>::show_all_tests( const bool show_all_tests_in )
276{
277 show_all_tests_ = show_all_tests_in;
278 vectorTester_.show_all_tests(show_all_tests_in);
279}
280
281
282template<class Scalar>
283inline
285{
286 return show_all_tests_;
287}
288
289
290template<class Scalar>
291inline
292void VectorSpaceTester<Scalar>::dump_all( const bool dump_all_in )
293{
294 dump_all_ = dump_all_in;
295 vectorTester_.dump_all(dump_all_in);
296}
297
298
299template<class Scalar>
300inline
302{
303 return dump_all_;
304}
305
306
307} // namespace Thyra
308
309
310#endif // THYRA_VECTOR_SPACE_TESTER_DECL_HPP
Abstract interface for objects that represent a space for vectors.
Testing class for VectorSpace and the VectorBase and MultiVectorBase objects that it creates.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for scalar magnitude.
ScalarMag warning_tol() const
Return the warning tolerance for *this.
VectorTester< Scalar > & vectorTester()
Expose a non-const reference to the VectorTester object used to test the MultiVectorBase interface su...
bool dump_all() const
Return the number of random vectors used for *this objects tests.
bool check(const VectorSpaceBase< Scalar > &vs, Teuchos::FancyOStream *out) const
Check a vector space and the objects it creates through a set of comprehensive tests.
STANDARD_MEMBER_COMPOSITION_MEMBERS(int, num_mv_cols)
Set the number of columns to use to create test MultiVectorBase objects.
int num_random_vectors() const
Return the number of random vectors used for *this objects tests.
ScalarMag error_tol() const
Return the error tolerance for *this.
bool show_all_tests() const
Return the number of random vectors used for *this objects tests.
Unit testing class for a VectorBase object.
void warning_tol(const ScalarMag &warning_tol)
Set the tolerance above which a relative error will generate a warning message.