Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_VectorTester_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_TESTER_DECL_HPP
11#define THYRA_VECTOR_TESTER_DECL_HPP
12
13#include "Thyra_OperatorVectorTypes.hpp"
14#include "Thyra_MultiVectorTester.hpp"
15
16namespace Thyra {
17
24template<class Scalar>
26public:
27
30
39
47
53 void warning_tol( const ScalarMag &warning_tol );
54
56 ScalarMag warning_tol() const;
57
63 void error_tol( const ScalarMag &error_tol );
64
66 ScalarMag error_tol() const;
67
72 void num_random_vectors( const int num_random_vectors );
73
77 int num_random_vectors() const;
78
84 void show_all_tests( const bool show_all_tests );
85
89 bool show_all_tests() const;
90
96 void dump_all( const bool dump_all );
97
101 bool dump_all() const;
102
124 const ScalarMag warning_tol = 1e-13
125 ,const ScalarMag error_tol = 1e-10
126 ,const int num_random_vectors = 1
127 ,const bool show_all_tests = false
128 ,const bool dump_all = false
129 );
130
162 bool check(
163 const VectorBase<Scalar> &v
165 ) const;
166
167private:
168
169 MultiVectorTester<Scalar> multiVectorTester_;
170
171 ScalarMag warning_tol_;
172 ScalarMag error_tol_;
173 int num_random_vectors_;
174 bool show_all_tests_;
175 bool dump_all_;
176
177}; // class VectorTester
178
179// //////////////////////////////////
180// Inline members
181
182template<class Scalar>
183inline
185{
186 return multiVectorTester_;
187}
188
189template<class Scalar>
190inline
192{
193 return multiVectorTester_;
194}
195
196template<class Scalar>
197inline
198void VectorTester<Scalar>::warning_tol( const ScalarMag &warning_tol_in )
199{
200 warning_tol_ = warning_tol_in;
201 multiVectorTester_.warning_tol(warning_tol_in);
202}
203
204template<class Scalar>
205inline
208{
209 return warning_tol_;
210}
211
212template<class Scalar>
213inline
215{
216 error_tol_ = error_tol_in;
217 multiVectorTester_.error_tol(error_tol_in);
218}
219
220template<class Scalar>
221inline
224{
225 return error_tol_;
226}
227
228template<class Scalar>
229inline
230void VectorTester<Scalar>::num_random_vectors( const int num_random_vectors_in )
231{
232 num_random_vectors_ = num_random_vectors_in;
233 multiVectorTester_.num_random_vectors(num_random_vectors_in);
234}
235
236template<class Scalar>
237inline
239{
240 return num_random_vectors_;
241}
242
243template<class Scalar>
244inline
245void VectorTester<Scalar>::show_all_tests( const bool show_all_tests_in )
246{
247 show_all_tests_ = show_all_tests_in;
248 multiVectorTester_.show_all_tests(show_all_tests_in);
249}
250
251template<class Scalar>
252inline
254{
255 return show_all_tests_;
256}
257
258template<class Scalar>
259inline
260void VectorTester<Scalar>::dump_all( const bool dump_all_in )
261{
262 dump_all_ = dump_all_in;
263 multiVectorTester_.dump_all(dump_all_in);
264}
265
266template<class Scalar>
267inline
269{
270 return dump_all_;
271}
272
273} // namespace Thyra
274
275#endif // THYRA_VECTOR_TESTER_DECL_HPP
Unit testing class for a MultiVectorBase object.
void warning_tol(const ScalarMag &warning_tol)
Set the tolerance above which a relative error will generate a warning message.
Abstract interface for finite-dimensional dense vectors.
Unit testing class for a VectorBase object.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for scalar magnitude.
int num_random_vectors() const
Return the number of random vectors used for *this objects tests.
bool dump_all() const
Return the number of random vectors used for *this objects tests.
bool show_all_tests() const
Return the number of random vectors used for *this objects tests.
ScalarMag error_tol() const
Return the error tolerance for *this.
ScalarMag warning_tol() const
Return the warning tolerance for *this.
bool check(const VectorBase< Scalar > &v, Teuchos::FancyOStream *out) const
Check a vector object in a set of comprehensive tests.
MultiVectorTester< Scalar > & multiVectorTester()
Expose a non-const reference to the MultiVectorTester object used to test the MultiVectorBase interfa...