Thyra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
18 namespace Thyra {
19 
20 
27 template<class Scalar>
29 public:
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,
171  const Ptr<Teuchos::FancyOStream> &out
172  ) const;
173 
174 private:
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 
191 template<class Scalar>
192 inline
194 {
195  return linearOpTester_;
196 }
197 
198 
199 template<class Scalar>
200 inline
202 {
203  return linearOpTester_;
204 }
205 
206 
207 template<class Scalar>
208 inline
210 {
211  warning_tol_ = warning_tol_in;
212  linearOpTester_.set_all_warning_tol(warning_tol_in);
213 }
214 
215 
216 template<class Scalar>
217 inline
220 {
221  return warning_tol_;
222 }
223 
224 
225 template<class Scalar>
226 inline
228 {
229  error_tol_ = error_tol_in;
230  linearOpTester_.set_all_error_tol(error_tol_in);
231 }
232 
233 
234 template<class Scalar>
235 inline
238 {
239  return error_tol_;
240 }
241 
242 
243 template<class Scalar>
244 inline
245 void 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 
252 template<class Scalar>
253 inline
255 {
256  return num_random_vectors_;
257 }
258 
259 
260 template<class Scalar>
261 inline
262 void 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 
269 template<class Scalar>
270 inline
272 {
273  return show_all_tests_;
274 }
275 
276 
277 template<class Scalar>
278 inline
279 void 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 
286 template<class Scalar>
287 inline
289 {
290  return dump_all_;
291 }
292 
293 
294 } // namespace Thyra
295 
296 
297 #endif // THYRA_MULTI_VECTOR_TESTER_DECL_HPP
ScalarMag error_tol() const
Return the error tolerance for *this.
Testing class for LinearOpBase.
Abstract interface for objects that represent a space for vectors.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for scalar magnitude.
Interface for a collection of column vectors called a multi-vector.
bool check(const MultiVectorBase< Scalar > &mv, const Ptr< Teuchos::FancyOStream > &out) const
Check a multi-vector object in a set of comprehensive teats.
bool dump_all() const
Return the number of random vectors used for *this objects tests.
MultiVectorTester(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.
int num_random_vectors() const
Return the number of random vectors used for *this objects tests.
bool checkMultiVector(const VectorSpaceBase< Scalar > &vs, const Ptr< Teuchos::FancyOStream > &out) const
Check a multi-vector as created by a VectorSpaceBase object.
ScalarMag warning_tol() const
Return the warning tolerance for *this.
bool show_all_tests() const
Return the number of random vectors used for *this objects tests.
LinearOpTester< Scalar > & linearOpTester()
Expose a non-const reference to the LinearOpTester object used to test the LinearOpBase interface sup...
Unit testing class for a MultiVectorBase object.