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 
00052 namespace Belos {
00053 
00055 
00056 
00059   class StatusTestError : public BelosError 
00060   {public: StatusTestError(const std::string& what_arg) : BelosError(what_arg) {}};
00061 
00063 
00064 template <class ScalarType, class MV, class OP>
00065 class StatusTest {
00066 
00067  public:
00069 
00070 
00072   StatusTest() {};
00073 
00075   virtual ~StatusTest() {};
00077 
00079 
00080 
00081 
00089   virtual StatusType checkStatus( Iteration<ScalarType,MV,OP>* iSolver ) = 0;
00090 
00092   virtual StatusType getStatus() const = 0;
00094 
00096 
00097 
00098 
00103   virtual void reset() = 0;
00105 
00107 
00108 
00110   virtual void print(std::ostream& os, int indent = 0) const = 0;
00111  
00113   virtual void printStatus(std::ostream& os, StatusType type) const {
00114     os << std::left << std::setw(13) << std::setfill('.');
00115     switch (type) {
00116     case  Passed:
00117       os << "Passed";
00118       break;
00119     case  Failed:
00120       os << "Failed";
00121       break;
00122     case  Undefined:  
00123     default:
00124       os << "**";
00125       break;
00126     }
00127     os << std::left << std::setfill(' ');
00128     return;
00129   };
00131 
00132 };
00133 
00134 } // end of Belos namespace
00135 
00136 #endif /* BELOS_STATUS_TEST_HPP */

Generated on Wed May 12 21:45:51 2010 for Belos by  doxygen 1.4.7