Thyra_VectorSpaceTesterDecl.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_SPACE_TESTER_DECL_HPP
00030 #define THYRA_VECTOR_SPACE_TESTER_DECL_HPP
00031 
00032 #include "Thyra_OperatorVectorTypes.hpp"
00033 #include "Thyra_VectorTester.hpp"
00034 
00035 namespace Thyra {
00036 
00056 template<class Scalar>
00057 class VectorSpaceTester {
00058 public:
00059 
00061   typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag;
00062 
00070   VectorTester<Scalar>& vectorTester();
00071 
00078   const VectorTester<Scalar>& vectorTester() const;
00079 
00085   void warning_tol( const ScalarMag &warning_tol );
00086 
00088   ScalarMag warning_tol() const;
00089 
00095   void error_tol( const ScalarMag &error_tol );
00096 
00098   ScalarMag error_tol() const;
00099 
00104   void num_random_vectors( const int num_random_vectors );
00105 
00109   int num_random_vectors() const;
00110 
00113   STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_mv_cols );
00114 
00120   void show_all_tests( const bool show_all_tests );
00121 
00125   bool show_all_tests() const;
00126 
00132   void dump_all( const bool dump_all );
00133 
00137   bool dump_all() const;
00138 
00146   VectorSpaceTester(
00147     const ScalarMag     warning_tol            = 1e-13
00148     ,const ScalarMag    error_tol              = 1e-10
00149     ,const int          num_random_vectors     = 1
00150     ,const int          num_mv_cols            = 4
00151     ,const bool         show_all_tests         = false
00152     ,const bool         dump_all               = false
00153     );
00154 
00188   bool check(
00189     const VectorSpaceBase<Scalar>  &vs
00190     ,Teuchos::FancyOStream         *out
00191     ) const;
00192 
00193 private:
00194 
00195   VectorTester<Scalar> vectorTester_;
00196 
00197   ScalarMag    warning_tol_;
00198   ScalarMag    error_tol_;
00199   int          num_random_vectors_;
00200   bool         show_all_tests_;
00201   bool         dump_all_;
00202 
00203 }; // class VectorSpaceTester
00204 
00205 // ///////////////////////////
00206 // Inline members
00207 
00208 template<class Scalar>
00209 inline
00210 VectorTester<Scalar>& VectorSpaceTester<Scalar>::vectorTester()
00211 {
00212   return vectorTester_;
00213 }
00214 
00215 template<class Scalar>
00216 inline
00217 const VectorTester<Scalar>& VectorSpaceTester<Scalar>::vectorTester() const
00218 {
00219   return vectorTester_;
00220 }
00221 
00222 template<class Scalar>
00223 inline
00224 void VectorSpaceTester<Scalar>::warning_tol( const ScalarMag &warning_tol )
00225 {
00226   warning_tol_ = warning_tol;
00227   vectorTester_.warning_tol(warning_tol);
00228 }
00229 
00230 template<class Scalar>
00231 inline
00232 typename VectorSpaceTester<Scalar>::ScalarMag
00233 VectorSpaceTester<Scalar>::warning_tol() const
00234 {
00235   return warning_tol_;
00236 }
00237 
00238 template<class Scalar>
00239 inline
00240 void VectorSpaceTester<Scalar>::error_tol( const ScalarMag &error_tol )
00241 {
00242   error_tol_ = error_tol;
00243   vectorTester_.error_tol(error_tol);
00244 }
00245 
00246 template<class Scalar>
00247 inline
00248 typename VectorSpaceTester<Scalar>::ScalarMag
00249 VectorSpaceTester<Scalar>::error_tol() const
00250 {
00251   return error_tol_;
00252 }
00253 
00254 template<class Scalar>
00255 inline
00256 void VectorSpaceTester<Scalar>::num_random_vectors( const int num_random_vectors )
00257 {
00258   num_random_vectors_ = num_random_vectors;
00259   vectorTester_.num_random_vectors(num_random_vectors);
00260 }
00261 
00262 template<class Scalar>
00263 inline
00264 int VectorSpaceTester<Scalar>::num_random_vectors() const
00265 {
00266   return num_random_vectors_;
00267 }
00268 
00269 template<class Scalar>
00270 inline
00271 void VectorSpaceTester<Scalar>::show_all_tests( const bool show_all_tests )
00272 {
00273   show_all_tests_ = show_all_tests;
00274   vectorTester_.show_all_tests(show_all_tests);
00275 }
00276 
00277 template<class Scalar>
00278 inline
00279 bool VectorSpaceTester<Scalar>::show_all_tests() const
00280 {
00281   return show_all_tests_;
00282 }
00283 
00284 template<class Scalar>
00285 inline
00286 void VectorSpaceTester<Scalar>::dump_all( const bool dump_all )
00287 {
00288   dump_all_ = dump_all;
00289   vectorTester_.dump_all(dump_all);
00290 }
00291 
00292 template<class Scalar>
00293 inline
00294 bool VectorSpaceTester<Scalar>::dump_all() const
00295 {
00296   return dump_all_;
00297 }
00298 
00299 } // namespace Thyra
00300 
00301 #endif // THYRA_VECTOR_SPACE_TESTER_DECL_HPP

Generated on Tue Oct 20 12:47:27 2009 for Thyra Package Browser (Single Doxygen Collection) by doxygen 1.4.7