Thyra Version of the Day
Loading...
Searching...
No Matches
Thyra_VectorSpaceTester_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_SPACE_TESTER_DECL_HPP
43#define THYRA_VECTOR_SPACE_TESTER_DECL_HPP
44
45#include "Thyra_OperatorVectorTypes.hpp"
46#include "Thyra_VectorTester.hpp"
47
48namespace Thyra {
49
50
70template<class Scalar>
72public:
73
76
85
93
99 void warning_tol( const ScalarMag &warning_tol );
100
102 ScalarMag warning_tol() const;
103
109 void error_tol( const ScalarMag &error_tol );
110
112 ScalarMag error_tol() const;
113
118 void num_random_vectors( const int num_random_vectors );
119
123 int num_random_vectors() const;
124
128
134 void show_all_tests( const bool show_all_tests );
135
139 bool show_all_tests() const;
140
146 void dump_all( const bool dump_all );
147
151 bool dump_all() const;
152
161 const ScalarMag warning_tol = 1e-13
162 ,const ScalarMag error_tol = 1e-10
163 ,const int num_random_vectors = 1
164 ,const int num_mv_cols = 4
165 ,const bool show_all_tests = false
166 ,const bool dump_all = false
167 );
168
214 bool check(
215 const VectorSpaceBase<Scalar> &vs,
217 ) const;
218
219private:
220
221 VectorTester<Scalar> vectorTester_;
222
223 ScalarMag warning_tol_;
224 ScalarMag error_tol_;
225 int num_random_vectors_;
226 bool show_all_tests_;
227 bool dump_all_;
228
229}; // class VectorSpaceTester
230
231
232// ///////////////////////////
233// Inline members
234
235
236template<class Scalar>
237inline
242
243
244template<class Scalar>
245inline
247{
248 return vectorTester_;
249}
250
251
252template<class Scalar>
253inline
255{
256 warning_tol_ = warning_tol_in;
257 vectorTester_.warning_tol(warning_tol_in);
258}
259
260
261template<class Scalar>
262inline
265{
266 return warning_tol_;
267}
268
269
270template<class Scalar>
271inline
273{
274 error_tol_ = error_tol_in;
275 vectorTester_.error_tol(error_tol_in);
276}
277
278
279template<class Scalar>
280inline
283{
284 return error_tol_;
285}
286
287
288template<class Scalar>
289inline
290void VectorSpaceTester<Scalar>::num_random_vectors( const int num_random_vectors_in )
291{
292 num_random_vectors_ = num_random_vectors_in;
293 vectorTester_.num_random_vectors(num_random_vectors_in);
294}
295
296
297template<class Scalar>
298inline
300{
301 return num_random_vectors_;
302}
303
304
305template<class Scalar>
306inline
307void VectorSpaceTester<Scalar>::show_all_tests( const bool show_all_tests_in )
308{
309 show_all_tests_ = show_all_tests_in;
310 vectorTester_.show_all_tests(show_all_tests_in);
311}
312
313
314template<class Scalar>
315inline
317{
318 return show_all_tests_;
319}
320
321
322template<class Scalar>
323inline
324void VectorSpaceTester<Scalar>::dump_all( const bool dump_all_in )
325{
326 dump_all_ = dump_all_in;
327 vectorTester_.dump_all(dump_all_in);
328}
329
330
331template<class Scalar>
332inline
334{
335 return dump_all_;
336}
337
338
339} // namespace Thyra
340
341
342#endif // THYRA_VECTOR_SPACE_TESTER_DECL_HPP
Abstract interface for objects that represent a space for vectors.
Testing class for VectorSpace and the VectorBase and MultiVectorBase objects that it creates.
Teuchos::ScalarTraits< Scalar >::magnitudeType ScalarMag
Local typedef for scalar magnitude.
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.
ScalarMag warning_tol() const
Return the warning tolerance for *this.
VectorTester< Scalar > & vectorTester()
Expose a non-const reference to the VectorTester object used to test the MultiVectorBase interface su...
bool dump_all() const
Return the number of random vectors used for *this objects tests.
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.
STANDARD_MEMBER_COMPOSITION_MEMBERS(int, num_mv_cols)
Set the number of columns to use to create test MultiVectorBase objects.
int num_random_vectors() const
Return the number of random vectors used for *this objects tests.
ScalarMag error_tol() const
Return the error tolerance for *this.
bool show_all_tests() const
Return the number of random vectors used for *this objects tests.
Unit testing class for a VectorBase object.
void warning_tol(const ScalarMag &warning_tol)
Set the tolerance above which a relative error will generate a warning message.