Thyra Version of the Day
Loading...
Searching...
No Matches
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
50namespace Thyra {
51
52
59template<class Scalar>
61public:
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,
204 ) const;
205
206private:
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
223template<class Scalar>
224inline
226{
227 return linearOpTester_;
228}
229
230
231template<class Scalar>
232inline
234{
235 return linearOpTester_;
236}
237
238
239template<class Scalar>
240inline
242{
243 warning_tol_ = warning_tol_in;
244 linearOpTester_.set_all_warning_tol(warning_tol_in);
245}
246
247
248template<class Scalar>
249inline
252{
253 return warning_tol_;
254}
255
256
257template<class Scalar>
258inline
260{
261 error_tol_ = error_tol_in;
262 linearOpTester_.set_all_error_tol(error_tol_in);
263}
264
265
266template<class Scalar>
267inline
270{
271 return error_tol_;
272}
273
274
275template<class Scalar>
276inline
277void 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
284template<class Scalar>
285inline
287{
288 return num_random_vectors_;
289}
290
291
292template<class Scalar>
293inline
294void 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
301template<class Scalar>
302inline
304{
305 return show_all_tests_;
306}
307
308
309template<class Scalar>
310inline
311void 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
318template<class Scalar>
319inline
321{
322 return dump_all_;
323}
324
325
326} // namespace Thyra
327
328
329#endif // THYRA_MULTI_VECTOR_TESTER_DECL_HPP
Testing class for LinearOpBase.
Interface for a collection of column vectors called a multi-vector.
Unit testing class for a MultiVectorBase object.
ScalarMag error_tol() const
Return the error tolerance for *this.
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 checkMultiVector(const VectorSpaceBase< Scalar > &vs, const Ptr< Teuchos::FancyOStream > &out) const
Check a multi-vector as created by a VectorSpaceBase object.
LinearOpTester< Scalar > & linearOpTester()
Expose a non-const reference to the LinearOpTester object used to test the LinearOpBase interface sup...
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.
bool check(const MultiVectorBase< Scalar > &mv, const Ptr< Teuchos::FancyOStream > &out) const
Check a multi-vector object in a set of comprehensive teats.
Abstract interface for objects that represent a space for vectors.