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 //
4 // Thyra: Interfaces and Support for Abstract Numerical Algorithms
5 // Copyright (2004) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (bartlettra@ornl.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #ifndef THYRA_MULTI_VECTOR_TESTER_DECL_HPP
43 #define THYRA_MULTI_VECTOR_TESTER_DECL_HPP
44 
45 #include "Thyra_OperatorVectorTypes.hpp"
46 #include "Thyra_LinearOpTester.hpp"
47 #include "Teuchos_Describable.hpp"
48 
49 
50 namespace Thyra {
51 
52 
59 template<class Scalar>
61 public:
62 
65 
74 
82 
88  void warning_tol( const ScalarMag &warning_tol );
89 
91  ScalarMag warning_tol() const;
92 
98  void error_tol( const ScalarMag &error_tol );
99 
101  ScalarMag error_tol() const;
102 
107  void num_random_vectors( const int num_random_vectors );
108 
112  int num_random_vectors() const;
113 
119  void show_all_tests( const bool show_all_tests );
120 
124  bool show_all_tests() const;
125 
131  void dump_all( const bool dump_all );
132 
136  bool dump_all() const;
137 
159  const ScalarMag warning_tol = 1e-13,
160  const ScalarMag error_tol = 1e-10,
161  const int num_random_vectors = 1,
162  const bool show_all_tests = false,
163  const bool dump_all = false
164  );
165 
168  const Ptr<Teuchos::FancyOStream> &out) const;
169 
201  bool check(
202  const MultiVectorBase<Scalar> &mv,
203  const Ptr<Teuchos::FancyOStream> &out
204  ) const;
205 
206 private:
207 
208  LinearOpTester<Scalar> linearOpTester_;
209 
210  ScalarMag warning_tol_;
211  ScalarMag error_tol_;
212  int num_random_vectors_;
213  bool show_all_tests_;
214  bool dump_all_;
215 
216 }; // class MultiVectorTester
217 
218 
219 // //////////////////////////////////
220 // Inline members
221 
222 
223 template<class Scalar>
224 inline
226 {
227  return linearOpTester_;
228 }
229 
230 
231 template<class Scalar>
232 inline
234 {
235  return linearOpTester_;
236 }
237 
238 
239 template<class Scalar>
240 inline
242 {
243  warning_tol_ = warning_tol_in;
244  linearOpTester_.set_all_warning_tol(warning_tol_in);
245 }
246 
247 
248 template<class Scalar>
249 inline
252 {
253  return warning_tol_;
254 }
255 
256 
257 template<class Scalar>
258 inline
260 {
261  error_tol_ = error_tol_in;
262  linearOpTester_.set_all_error_tol(error_tol_in);
263 }
264 
265 
266 template<class Scalar>
267 inline
270 {
271  return error_tol_;
272 }
273 
274 
275 template<class Scalar>
276 inline
277 void MultiVectorTester<Scalar>::num_random_vectors( const int num_random_vectors_in )
278 {
279  num_random_vectors_ = num_random_vectors_in;
280  linearOpTester_.num_random_vectors(num_random_vectors_in);
281 }
282 
283 
284 template<class Scalar>
285 inline
287 {
288  return num_random_vectors_;
289 }
290 
291 
292 template<class Scalar>
293 inline
294 void MultiVectorTester<Scalar>::show_all_tests( const bool show_all_tests_in )
295 {
296  show_all_tests_ = show_all_tests_in;
297  linearOpTester_.show_all_tests(show_all_tests_in);
298 }
299 
300 
301 template<class Scalar>
302 inline
304 {
305  return show_all_tests_;
306 }
307 
308 
309 template<class Scalar>
310 inline
311 void MultiVectorTester<Scalar>::dump_all( const bool dump_all_in )
312 {
313  dump_all_ = dump_all_in;
314  linearOpTester_.dump_all(dump_all_in);
315 }
316 
317 
318 template<class Scalar>
319 inline
321 {
322  return dump_all_;
323 }
324 
325 
326 } // namespace Thyra
327 
328 
329 #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.