BelosStatusTest.hpp

Go to the documentation of this file.
00001 
00002 // @HEADER
00003 // ***********************************************************************
00004 //
00005 //                 Belos: Block Linear Solvers Package
00006 //                 Copyright (2004) Sandia Corporation
00007 //
00008 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00009 // license for use of this work by or on behalf of the U.S. Government.
00010 //
00011 // This library is free software; you can redistribute it and/or modify
00012 // it under the terms of the GNU Lesser General Public License as
00013 // published by the Free Software Foundation; either version 2.1 of the
00014 // License, or (at your option) any later version.
00015 //
00016 // This library is distributed in the hope that it will be useful, but
00017 // WITHOUT ANY WARRANTY; without even the implied warranty of
00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019 // Lesser General Public License for more details.
00020 //
00021 // You should have received a copy of the GNU Lesser General Public
00022 // License along with this library; if not, write to the Free Software
00023 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00024 // USA
00025 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00026 //
00027 // ***********************************************************************
00028 // @HEADER
00029 //
00030 
00031 #ifndef BELOS_STATUS_TEST_HPP
00032 #define BELOS_STATUS_TEST_HPP
00033 
00039 #include "BelosTypes.hpp"
00040 #include "BelosIteration.hpp"
00041 #include "BelosConfigDefs.hpp"
00042 #include "Teuchos_Describable.hpp"
00043 
00053 namespace Belos {
00054 
00056 
00057 
00060   class StatusTestError : public BelosError 
00061   {public: StatusTestError(const std::string& what_arg) : BelosError(what_arg) {}};
00062 
00064 
00065 template <class ScalarType, class MV, class OP>
00066 class StatusTest : public Teuchos::Describable {
00067 
00068  public:
00070 
00071 
00073   StatusTest() {};
00074 
00076   virtual ~StatusTest() {};
00078 
00080 
00081 
00082 
00090   virtual StatusType checkStatus( Iteration<ScalarType,MV,OP>* iSolver ) = 0;
00091 
00093   virtual StatusType getStatus() const = 0;
00095 
00097 
00098 
00099 
00104   virtual void reset() = 0;
00106 
00108 
00109 
00111   virtual void print(std::ostream& os, int indent = 0) const = 0;
00112  
00114   virtual void printStatus(std::ostream& os, StatusType type) const {
00115     os << std::left << std::setw(13) << std::setfill('.');
00116     switch (type) {
00117     case  Passed:
00118       os << "Passed";
00119       break;
00120     case  Failed:
00121       os << "Failed";
00122       break;
00123     case  Undefined:  
00124     default:
00125       os << "**";
00126       break;
00127     }
00128     os << std::left << std::setfill(' ');
00129     return;
00130   };
00132 
00133 };
00134 
00135 } // end of Belos namespace
00136 
00137 #endif /* BELOS_STATUS_TEST_HPP */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Wed Apr 13 10:05:15 2011 for Belos Package Browser (Single Doxygen Collection) by  doxygen 1.6.3