|
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_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 #include "Teuchos_Describable.hpp" 00035 00036 00037 namespace Thyra { 00038 00039 00046 template<class Scalar> 00047 class MultiVectorTester : public Teuchos::Describable { 00048 public: 00049 00051 typedef typename Teuchos::ScalarTraits<Scalar>::magnitudeType ScalarMag; 00052 00060 LinearOpTester<Scalar>& linearOpTester(); 00061 00068 const LinearOpTester<Scalar>& linearOpTester() const; 00069 00075 void warning_tol( const ScalarMag &warning_tol ); 00076 00078 ScalarMag warning_tol() const; 00079 00085 void error_tol( const ScalarMag &error_tol ); 00086 00088 ScalarMag error_tol() const; 00089 00094 void num_random_vectors( const int num_random_vectors ); 00095 00099 int num_random_vectors() const; 00100 00106 void show_all_tests( const bool show_all_tests ); 00107 00111 bool show_all_tests() const; 00112 00118 void dump_all( const bool dump_all ); 00119 00123 bool dump_all() const; 00124 00145 MultiVectorTester( 00146 const ScalarMag warning_tol = 1e-13, 00147 const ScalarMag error_tol = 1e-10, 00148 const int num_random_vectors = 1, 00149 const bool show_all_tests = false, 00150 const bool dump_all = false 00151 ); 00152 00154 bool checkMultiVector(const VectorSpaceBase<Scalar> &vs, 00155 const Ptr<Teuchos::FancyOStream> &out) const; 00156 00188 bool check( 00189 const MultiVectorBase<Scalar> &mv, 00190 const Ptr<Teuchos::FancyOStream> &out 00191 ) const; 00192 00195 00197 THYRA_DEPRECATED bool check( 00198 const MultiVectorBase<Scalar> &mv, 00199 Teuchos::FancyOStream *out 00200 ) const 00201 { 00202 return check(mv, Teuchos::ptr(out)); 00203 } 00204 00206 00207 00208 private: 00209 00210 LinearOpTester<Scalar> linearOpTester_; 00211 00212 ScalarMag warning_tol_; 00213 ScalarMag error_tol_; 00214 int num_random_vectors_; 00215 bool show_all_tests_; 00216 bool dump_all_; 00217 00218 }; // class MultiVectorTester 00219 00220 00221 // ////////////////////////////////// 00222 // Inline members 00223 00224 00225 template<class Scalar> 00226 inline 00227 LinearOpTester<Scalar>& MultiVectorTester<Scalar>::linearOpTester() 00228 { 00229 return linearOpTester_; 00230 } 00231 00232 00233 template<class Scalar> 00234 inline 00235 const LinearOpTester<Scalar>& MultiVectorTester<Scalar>::linearOpTester() const 00236 { 00237 return linearOpTester_; 00238 } 00239 00240 00241 template<class Scalar> 00242 inline 00243 void MultiVectorTester<Scalar>::warning_tol( const ScalarMag &warning_tol_in ) 00244 { 00245 warning_tol_ = warning_tol_in; 00246 linearOpTester_.set_all_warning_tol(warning_tol_in); 00247 } 00248 00249 00250 template<class Scalar> 00251 inline 00252 typename MultiVectorTester<Scalar>::ScalarMag 00253 MultiVectorTester<Scalar>::warning_tol() const 00254 { 00255 return warning_tol_; 00256 } 00257 00258 00259 template<class Scalar> 00260 inline 00261 void MultiVectorTester<Scalar>::error_tol( const ScalarMag &error_tol_in ) 00262 { 00263 error_tol_ = error_tol_in; 00264 linearOpTester_.set_all_error_tol(error_tol_in); 00265 } 00266 00267 00268 template<class Scalar> 00269 inline 00270 typename MultiVectorTester<Scalar>::ScalarMag 00271 MultiVectorTester<Scalar>::error_tol() const 00272 { 00273 return error_tol_; 00274 } 00275 00276 00277 template<class Scalar> 00278 inline 00279 void MultiVectorTester<Scalar>::num_random_vectors( const int num_random_vectors_in ) 00280 { 00281 num_random_vectors_ = num_random_vectors_in; 00282 linearOpTester_.num_random_vectors(num_random_vectors_in); 00283 } 00284 00285 00286 template<class Scalar> 00287 inline 00288 int MultiVectorTester<Scalar>::num_random_vectors() const 00289 { 00290 return num_random_vectors_; 00291 } 00292 00293 00294 template<class Scalar> 00295 inline 00296 void MultiVectorTester<Scalar>::show_all_tests( const bool show_all_tests_in ) 00297 { 00298 show_all_tests_ = show_all_tests_in; 00299 linearOpTester_.show_all_tests(show_all_tests_in); 00300 } 00301 00302 00303 template<class Scalar> 00304 inline 00305 bool MultiVectorTester<Scalar>::show_all_tests() const 00306 { 00307 return show_all_tests_; 00308 } 00309 00310 00311 template<class Scalar> 00312 inline 00313 void MultiVectorTester<Scalar>::dump_all( const bool dump_all_in ) 00314 { 00315 dump_all_ = dump_all_in; 00316 linearOpTester_.dump_all(dump_all_in); 00317 } 00318 00319 00320 template<class Scalar> 00321 inline 00322 bool MultiVectorTester<Scalar>::dump_all() const 00323 { 00324 return dump_all_; 00325 } 00326 00327 00328 } // namespace Thyra 00329 00330 00331 #endif // THYRA_MULTI_VECTOR_TESTER_DECL_HPP
1.7.4