Thyra Package Browser (Single Doxygen Collection) Version of the Day
Thyra_VectorTester_decl.hpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 //    Thyra: Interfaces and Support for Abstract Numerical Algorithms
00005 //                 Copyright (2004) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef THYRA_VECTOR_TESTER_DECL_HPP
00030 #define THYRA_VECTOR_TESTER_DECL_HPP
00031 
00032 #include "Thyra_OperatorVectorTypes.hpp"
00033 #include "Thyra_MultiVectorTester.hpp"
00034 
00035 namespace Thyra {
00036 
00043 template<class Scalar>
00044 class VectorTester {
00045 public:
00046 
00048   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00049 
00057   MultiVectorTester<Scalar>& multiVectorTester();
00058 
00065   const MultiVectorTester<Scalar>& multiVectorTester() const;
00066 
00072   void warning_tol( const ScalarMag &warning_tol );
00073 
00075   ScalarMag warning_tol() const;
00076 
00082   void error_tol( const ScalarMag &error_tol );
00083 
00085   ScalarMag error_tol() const;
00086 
00091   void num_random_vectors( const int num_random_vectors );
00092 
00096   int num_random_vectors() const;
00097 
00103   void show_all_tests( const bool show_all_tests );
00104 
00108   bool show_all_tests() const;
00109 
00115   void dump_all( const bool dump_all );
00116 
00120   bool dump_all() const;
00121 
00142   VectorTester(
00143     const ScalarMag     warning_tol            = 1e-13
00144     ,const ScalarMag    error_tol              = 1e-10
00145     ,const int          num_random_vectors     = 1
00146     ,const bool         show_all_tests         = false
00147     ,const bool         dump_all               = false
00148     );
00149 
00181   bool check(
00182     const VectorBase<Scalar>       &v
00183     ,Teuchos::FancyOStream         *out
00184     ) const;
00185 
00186 private:
00187 
00188   MultiVectorTester<Scalar> multiVectorTester_;
00189 
00190   ScalarMag    warning_tol_;
00191   ScalarMag    error_tol_;
00192   int          num_random_vectors_;
00193   bool         show_all_tests_;
00194   bool         dump_all_;
00195 
00196 }; // class VectorTester
00197 
00198 // //////////////////////////////////
00199 // Inline members
00200 
00201 template<class Scalar>
00202 inline
00203 MultiVectorTester<Scalar>& VectorTester<Scalar>::multiVectorTester()
00204 {
00205   return multiVectorTester_;
00206 }
00207 
00208 template<class Scalar>
00209 inline
00210 const MultiVectorTester<Scalar>& VectorTester<Scalar>::multiVectorTester() const
00211 {
00212   return multiVectorTester_;
00213 }
00214 
00215 template<class Scalar>
00216 inline
00217 void VectorTester<Scalar>::warning_tol( const ScalarMag &warning_tol_in )
00218 {
00219   warning_tol_ = warning_tol_in;
00220   multiVectorTester_.warning_tol(warning_tol_in);
00221 }
00222 
00223 template<class Scalar>
00224 inline
00225 typename VectorTester<Scalar>::ScalarMag
00226 VectorTester<Scalar>::warning_tol() const
00227 {
00228   return warning_tol_;
00229 }
00230 
00231 template<class Scalar>
00232 inline
00233 void VectorTester<Scalar>::error_tol( const ScalarMag &error_tol_in )
00234 {
00235   error_tol_ = error_tol_in;
00236   multiVectorTester_.error_tol(error_tol_in);
00237 }
00238 
00239 template<class Scalar>
00240 inline
00241 typename VectorTester<Scalar>::ScalarMag
00242 VectorTester<Scalar>::error_tol() const
00243 {
00244   return error_tol_;
00245 }
00246 
00247 template<class Scalar>
00248 inline
00249 void VectorTester<Scalar>::num_random_vectors( const int num_random_vectors_in )
00250 {
00251   num_random_vectors_ = num_random_vectors_in;
00252   multiVectorTester_.num_random_vectors(num_random_vectors_in);
00253 }
00254 
00255 template<class Scalar>
00256 inline
00257 int VectorTester<Scalar>::num_random_vectors() const
00258 {
00259   return num_random_vectors_;
00260 }
00261 
00262 template<class Scalar>
00263 inline
00264 void VectorTester<Scalar>::show_all_tests( const bool show_all_tests_in )
00265 {
00266   show_all_tests_ = show_all_tests_in;
00267   multiVectorTester_.show_all_tests(show_all_tests_in);
00268 }
00269 
00270 template<class Scalar>
00271 inline
00272 bool VectorTester<Scalar>::show_all_tests() const
00273 {
00274   return show_all_tests_;
00275 }
00276 
00277 template<class Scalar>
00278 inline
00279 void VectorTester<Scalar>::dump_all( const bool dump_all_in )
00280 {
00281   dump_all_ = dump_all_in;
00282   multiVectorTester_.dump_all(dump_all_in);
00283 }
00284 
00285 template<class Scalar>
00286 inline
00287 bool VectorTester<Scalar>::dump_all() const
00288 {
00289   return dump_all_;
00290 }
00291 
00292 } // namespace Thyra
00293 
00294 #endif // THYRA_VECTOR_TESTER_DECL_HPP
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines