Thyra_MultiVectorTesterDecl.hpp

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_MULTI_VECTOR_TESTER_DECL_HPP
00030 #define THYRA_MULTI_VECTOR_TESTER_DECL_HPP
00031 
00032 #include "Thyra_OperatorVectorTypes.hpp"
00033 #include "Thyra_LinearOpTester.hpp"
00034 
00035 namespace Thyra {
00036 
00043 template<class Scalar>
00044 class MultiVectorTester {
00045 public:
00046 
00048   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00049 
00057   LinearOpTester<Scalar>& linearOpTester();
00058 
00065   const LinearOpTester<Scalar>& linearOpTester() 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   MultiVectorTester(
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 
00185   bool check(
00186     const MultiVectorBase<Scalar>  &mv
00187     ,std::ostream                  *out
00188     ,const std::string             &leadingIndent  = ""
00189     ,const std::string             &indentSpacer   = "  "
00190     ) const;
00191 
00192 private:
00193 
00194   LinearOpTester<Scalar> linearOpTester_;
00195 
00196   ScalarMag    warning_tol_;
00197   ScalarMag    error_tol_;
00198   int          num_random_vectors_;
00199   bool         show_all_tests_;
00200   bool         dump_all_;
00201 
00202 }; // class MultiVectorTester
00203 
00204 // //////////////////////////////////
00205 // Inline members
00206 
00207 template<class Scalar>
00208 inline
00209 LinearOpTester<Scalar>& MultiVectorTester<Scalar>::linearOpTester()
00210 {
00211   return linearOpTester_;
00212 }
00213 
00214 template<class Scalar>
00215 inline
00216 const LinearOpTester<Scalar>& MultiVectorTester<Scalar>::linearOpTester() const
00217 {
00218   return linearOpTester_;
00219 }
00220 
00221 template<class Scalar>
00222 inline
00223 void MultiVectorTester<Scalar>::warning_tol( const ScalarMag &warning_tol )
00224 {
00225   warning_tol_ = warning_tol;
00226   linearOpTester_.set_all_warning_tol(warning_tol);
00227 }
00228 
00229 template<class Scalar>
00230 inline
00231 typename MultiVectorTester<Scalar>::ScalarMag
00232 MultiVectorTester<Scalar>::warning_tol() const
00233 {
00234   return warning_tol_;
00235 }
00236 
00237 template<class Scalar>
00238 inline
00239 void MultiVectorTester<Scalar>::error_tol( const ScalarMag &error_tol )
00240 {
00241   error_tol_ = error_tol;
00242   linearOpTester_.set_all_error_tol(error_tol);
00243 }
00244 
00245 template<class Scalar>
00246 inline
00247 typename MultiVectorTester<Scalar>::ScalarMag
00248 MultiVectorTester<Scalar>::error_tol() const
00249 {
00250   return error_tol_;
00251 }
00252 
00253 template<class Scalar>
00254 inline
00255 void MultiVectorTester<Scalar>::num_random_vectors( const int num_random_vectors )
00256 {
00257   num_random_vectors_ = num_random_vectors;
00258   linearOpTester_.num_random_vectors(num_random_vectors);
00259 }
00260 
00261 template<class Scalar>
00262 inline
00263 int MultiVectorTester<Scalar>::num_random_vectors() const
00264 {
00265   return num_random_vectors_;
00266 }
00267 
00268 template<class Scalar>
00269 inline
00270 void MultiVectorTester<Scalar>::show_all_tests( const bool show_all_tests )
00271 {
00272   show_all_tests_ = show_all_tests;
00273   linearOpTester_.show_all_tests(show_all_tests);
00274 }
00275 
00276 template<class Scalar>
00277 inline
00278 bool MultiVectorTester<Scalar>::show_all_tests() const
00279 {
00280   return show_all_tests_;
00281 }
00282 
00283 template<class Scalar>
00284 inline
00285 void MultiVectorTester<Scalar>::dump_all( const bool dump_all )
00286 {
00287   dump_all_ = dump_all;
00288   linearOpTester_.dump_all(dump_all);
00289 }
00290 
00291 template<class Scalar>
00292 inline
00293 bool MultiVectorTester<Scalar>::dump_all() const
00294 {
00295   return dump_all_;
00296 }
00297 
00298 } // namespace Thyra
00299 
00300 #endif // THYRA_MULTI_VECTOR_TESTER_DECL_HPP

Generated on Thu Sep 18 12:39:52 2008 for Thyra ANA Operator/VectorBase Interfaces and Related Software by doxygen 1.3.9.1