|
Thyra Package Browser (Single Doxygen Collection) Version of the Day
|
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 00037 00057 template<class Scalar> 00058 class VectorSpaceTester { 00059 public: 00060 00062 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag; 00063 00071 VectorTester<Scalar>& vectorTester(); 00072 00079 const VectorTester<Scalar>& vectorTester() const; 00080 00086 void warning_tol( const ScalarMag &warning_tol ); 00087 00089 ScalarMag warning_tol() const; 00090 00096 void error_tol( const ScalarMag &error_tol ); 00097 00099 ScalarMag error_tol() const; 00100 00105 void num_random_vectors( const int num_random_vectors ); 00106 00110 int num_random_vectors() const; 00111 00114 STANDARD_MEMBER_COMPOSITION_MEMBERS( int, num_mv_cols ); 00115 00121 void show_all_tests( const bool show_all_tests ); 00122 00126 bool show_all_tests() const; 00127 00133 void dump_all( const bool dump_all ); 00134 00138 bool dump_all() const; 00139 00147 VectorSpaceTester( 00148 const ScalarMag warning_tol = 1e-13 00149 ,const ScalarMag error_tol = 1e-10 00150 ,const int num_random_vectors = 1 00151 ,const int num_mv_cols = 4 00152 ,const bool show_all_tests = false 00153 ,const bool dump_all = false 00154 ); 00155 00201 bool check( 00202 const VectorSpaceBase<Scalar> &vs, 00203 Teuchos::FancyOStream *out 00204 ) const; 00205 00206 private: 00207 00208 VectorTester<Scalar> vectorTester_; 00209 00210 ScalarMag warning_tol_; 00211 ScalarMag error_tol_; 00212 int num_random_vectors_; 00213 bool show_all_tests_; 00214 bool dump_all_; 00215 00216 }; // class VectorSpaceTester 00217 00218 00219 // /////////////////////////// 00220 // Inline members 00221 00222 00223 template<class Scalar> 00224 inline 00225 VectorTester<Scalar>& VectorSpaceTester<Scalar>::vectorTester() 00226 { 00227 return vectorTester_; 00228 } 00229 00230 00231 template<class Scalar> 00232 inline 00233 const VectorTester<Scalar>& VectorSpaceTester<Scalar>::vectorTester() const 00234 { 00235 return vectorTester_; 00236 } 00237 00238 00239 template<class Scalar> 00240 inline 00241 void VectorSpaceTester<Scalar>::warning_tol( const ScalarMag &warning_tol_in ) 00242 { 00243 warning_tol_ = warning_tol_in; 00244 vectorTester_.warning_tol(warning_tol_in); 00245 } 00246 00247 00248 template<class Scalar> 00249 inline 00250 typename VectorSpaceTester<Scalar>::ScalarMag 00251 VectorSpaceTester<Scalar>::warning_tol() const 00252 { 00253 return warning_tol_; 00254 } 00255 00256 00257 template<class Scalar> 00258 inline 00259 void VectorSpaceTester<Scalar>::error_tol( const ScalarMag &error_tol_in ) 00260 { 00261 error_tol_ = error_tol_in; 00262 vectorTester_.error_tol(error_tol_in); 00263 } 00264 00265 00266 template<class Scalar> 00267 inline 00268 typename VectorSpaceTester<Scalar>::ScalarMag 00269 VectorSpaceTester<Scalar>::error_tol() const 00270 { 00271 return error_tol_; 00272 } 00273 00274 00275 template<class Scalar> 00276 inline 00277 void VectorSpaceTester<Scalar>::num_random_vectors( const int num_random_vectors_in ) 00278 { 00279 num_random_vectors_ = num_random_vectors_in; 00280 vectorTester_.num_random_vectors(num_random_vectors_in); 00281 } 00282 00283 00284 template<class Scalar> 00285 inline 00286 int VectorSpaceTester<Scalar>::num_random_vectors() const 00287 { 00288 return num_random_vectors_; 00289 } 00290 00291 00292 template<class Scalar> 00293 inline 00294 void VectorSpaceTester<Scalar>::show_all_tests( const bool show_all_tests_in ) 00295 { 00296 show_all_tests_ = show_all_tests_in; 00297 vectorTester_.show_all_tests(show_all_tests_in); 00298 } 00299 00300 00301 template<class Scalar> 00302 inline 00303 bool VectorSpaceTester<Scalar>::show_all_tests() const 00304 { 00305 return show_all_tests_; 00306 } 00307 00308 00309 template<class Scalar> 00310 inline 00311 void VectorSpaceTester<Scalar>::dump_all( const bool dump_all_in ) 00312 { 00313 dump_all_ = dump_all_in; 00314 vectorTester_.dump_all(dump_all_in); 00315 } 00316 00317 00318 template<class Scalar> 00319 inline 00320 bool VectorSpaceTester<Scalar>::dump_all() const 00321 { 00322 return dump_all_; 00323 } 00324 00325 00326 } // namespace Thyra 00327 00328 00329 #endif // THYRA_VECTOR_SPACE_TESTER_DECL_HPP
1.7.4