00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_GENERICRIGHTPRECONDITIONER_HPP 00006 #define PLAYA_GENERICRIGHTPRECONDITIONER_HPP 00007 00008 #include "PlayaDefs.hpp" 00009 #include "PlayaVectorDecl.hpp" 00010 #include "PlayaLinearOperatorDecl.hpp" 00011 #include "PlayaPreconditionerBase.hpp" 00012 00013 00014 namespace Playa 00015 { 00016 using namespace Teuchos; 00017 00022 template <class Scalar> 00023 class GenericRightPreconditioner : public PreconditionerBase<Scalar> 00024 { 00025 public: 00027 GenericRightPreconditioner(const LinearOperator<Scalar>& right) 00028 : PreconditionerBase<Scalar>(), right_(right) {;} 00029 00031 virtual ~GenericRightPreconditioner(){;} 00032 00033 00035 virtual LinearOperator<Scalar> right() const {return right_;} 00036 00038 virtual LinearOperator<Scalar> left() const 00039 { 00040 TEUCHOS_TEST_FOR_EXCEPTION(true, std::logic_error, "left() called for a " 00041 "preconditioner known to be a right precond"); 00042 return LinearOperator<Scalar>(); 00043 } 00044 00047 virtual bool hasRight() const {return true;} 00048 00051 virtual bool hasLeft() const {return false;} 00052 00053 /* Handleable boilerplate */ 00054 GET_RCP(PreconditionerBase<Scalar>); 00055 00056 private: 00057 LinearOperator<Scalar> right_; 00058 }; 00059 00060 00061 00062 } 00063 00064 #endif