Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_VectorTester_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_VECTOR_TESTER_DECL_HPP
43#define THYRA_VECTOR_TESTER_DECL_HPP
44
45#include "Thyra_OperatorVectorTypes.hpp"
46#include "Thyra_MultiVectorTester.hpp"
47
48namespace Thyra {
49
56template<class Scalar>
58public:
59
62
71
79
85 void warning_tol( const ScalarMag &warning_tol );
86
88 ScalarMag warning_tol() const;
89
95 void error_tol( const ScalarMag &error_tol );
96
98 ScalarMag error_tol() const;
99
104 void num_random_vectors( const int num_random_vectors );
105
109 int num_random_vectors() const;
110
116 void show_all_tests( const bool show_all_tests );
117
121 bool show_all_tests() const;
122
128 void dump_all( const bool dump_all );
129
133 bool dump_all() const;
134
156 const ScalarMag warning_tol = 1e-13
157 ,const ScalarMag error_tol = 1e-10
158 ,const int num_random_vectors = 1
159 ,const bool show_all_tests = false
160 ,const bool dump_all = false
161 );
162
194 bool check(
195 const VectorBase<Scalar> &v
197 ) const;
198
199private:
200
201 MultiVectorTester<Scalar> multiVectorTester_;
202
203 ScalarMag warning_tol_;
204 ScalarMag error_tol_;
205 int num_random_vectors_;
206 bool show_all_tests_;
207 bool dump_all_;
208
209}; // class VectorTester
210
211// //////////////////////////////////
212// Inline members
213
214template<class Scalar>
215inline
217{
218 return multiVectorTester_;
219}
220
221template<class Scalar>
222inline
224{
225 return multiVectorTester_;
226}
227
228template<class Scalar>
229inline
230void VectorTester<Scalar>::warning_tol( const ScalarMag &warning_tol_in )
231{
232 warning_tol_ = warning_tol_in;
233 multiVectorTester_.warning_tol(warning_tol_in);
234}
235
236template<class Scalar>
237inline
240{
241 return warning_tol_;
242}
243
244template<class Scalar>
245inline
247{
248 error_tol_ = error_tol_in;
249 multiVectorTester_.error_tol(error_tol_in);
250}
251
252template<class Scalar>
253inline
256{
257 return error_tol_;
258}
259
260template<class Scalar>
261inline
262void VectorTester<Scalar>::num_random_vectors( const int num_random_vectors_in )
263{
264 num_random_vectors_ = num_random_vectors_in;
265 multiVectorTester_.num_random_vectors(num_random_vectors_in);
266}
267
268template<class Scalar>
269inline
271{
272 return num_random_vectors_;
273}
274
275template<class Scalar>
276inline
277void VectorTester<Scalar>::show_all_tests( const bool show_all_tests_in )
278{
279 show_all_tests_ = show_all_tests_in;
280 multiVectorTester_.show_all_tests(show_all_tests_in);
281}
282
283template<class Scalar>
284inline
286{
287 return show_all_tests_;
288}
289
290template<class Scalar>
291inline
292void VectorTester<Scalar>::dump_all( const bool dump_all_in )
293{
294 dump_all_ = dump_all_in;
295 multiVectorTester_.dump_all(dump_all_in);
296}
297
298template<class Scalar>
299inline
301{
302 return dump_all_;
303}
304
305} // namespace Thyra
306
307#endif // THYRA_VECTOR_TESTER_DECL_HPP
Unit testing class for a MultiVectorBase object.
Abstract interface for finite-dimensional dense vectors.
Unit testing class for a VectorBase object.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for scalar magnitude.
int num_random_vectors() const
Return the number of random vectors used for *this objects 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.
ScalarMag error_tol() const
Return the error tolerance for *this.
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...