Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
16 namespace Thyra {
17 
18 
38 template<class Scalar>
40 public:
41 
44 
53 
60  const VectorTester<Scalar>& vectorTester() const;
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 
95  STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_mv_cols );
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 
187 private:
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 
204 template<class Scalar>
205 inline
207 {
208  return vectorTester_;
209 }
210 
211 
212 template<class Scalar>
213 inline
215 {
216  return vectorTester_;
217 }
218 
219 
220 template<class Scalar>
221 inline
223 {
224  warning_tol_ = warning_tol_in;
225  vectorTester_.warning_tol(warning_tol_in);
226 }
227 
228 
229 template<class Scalar>
230 inline
233 {
234  return warning_tol_;
235 }
236 
237 
238 template<class Scalar>
239 inline
241 {
242  error_tol_ = error_tol_in;
243  vectorTester_.error_tol(error_tol_in);
244 }
245 
246 
247 template<class Scalar>
248 inline
251 {
252  return error_tol_;
253 }
254 
255 
256 template<class Scalar>
257 inline
258 void 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 
265 template<class Scalar>
266 inline
268 {
269  return num_random_vectors_;
270 }
271 
272 
273 template<class Scalar>
274 inline
275 void 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 
282 template<class Scalar>
283 inline
285 {
286  return show_all_tests_;
287 }
288 
289 
290 template<class Scalar>
291 inline
292 void 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 
299 template<class Scalar>
300 inline
302 {
303  return dump_all_;
304 }
305 
306 
307 } // namespace Thyra
308 
309 
310 #endif // THYRA_VECTOR_SPACE_TESTER_DECL_HPP
ScalarMag warning_tol() const
Return the warning tolerance for *this.
int num_random_vectors() const
Return the number of random vectors used for *this objects tests.
Testing class for VectorSpace and the VectorBase and MultiVectorBase objects that it creates...
VectorTester< Scalar > & vectorTester()
Expose a non-const reference to the VectorTester object used to test the MultiVectorBase interface su...
STANDARD_MEMBER_COMPOSITION_MEMBERS(int, num_mv_cols)
Set the number of columns to use to create test MultiVectorBase objects.
Abstract interface for objects that represent a space for vectors.
Unit testing class for a VectorBase object.
ScalarMag error_tol() const
Return the error tolerance for *this.
VectorSpaceTester(const ScalarMag warning_tol=1e-13, const ScalarMag error_tol=1e-10, const int num_random_vectors=1, const int num_mv_cols=4, const bool show_all_tests=false, const bool dump_all=false)
Default constructor which sets default parameter values.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for scalar magnitude.
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.
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.