Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
16 namespace Thyra {
17 
24 template<class Scalar>
25 class VectorTester {
26 public:
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 
123  VectorTester(
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 
167 private:
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 
182 template<class Scalar>
183 inline
185 {
186  return multiVectorTester_;
187 }
188 
189 template<class Scalar>
190 inline
192 {
193  return multiVectorTester_;
194 }
195 
196 template<class Scalar>
197 inline
198 void 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 
204 template<class Scalar>
205 inline
208 {
209  return warning_tol_;
210 }
211 
212 template<class Scalar>
213 inline
214 void VectorTester<Scalar>::error_tol( const ScalarMag &error_tol_in )
215 {
216  error_tol_ = error_tol_in;
217  multiVectorTester_.error_tol(error_tol_in);
218 }
219 
220 template<class Scalar>
221 inline
224 {
225  return error_tol_;
226 }
227 
228 template<class Scalar>
229 inline
230 void 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 
236 template<class Scalar>
237 inline
239 {
240  return num_random_vectors_;
241 }
242 
243 template<class Scalar>
244 inline
245 void 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 
251 template<class Scalar>
252 inline
254 {
255  return show_all_tests_;
256 }
257 
258 template<class Scalar>
259 inline
260 void 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 
266 template<class Scalar>
267 inline
269 {
270  return dump_all_;
271 }
272 
273 } // namespace Thyra
274 
275 #endif // THYRA_VECTOR_TESTER_DECL_HPP
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 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...
ScalarMag error_tol() const
Return the error tolerance for *this.
Unit testing class for a VectorBase object.
Abstract interface for finite-dimensional dense vectors.
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.
VectorTester(const ScalarMag warning_tol=1e-13, const ScalarMag error_tol=1e-10, const int num_random_vectors=1, const bool show_all_tests=false, const bool dump_all=false)
Default constructor which sets default parameter values.
Unit testing class for a MultiVectorBase object.