00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_PRECONDITIONERBASE_HPP 00006 #define PLAYA_PRECONDITIONERBASE_HPP 00007 00008 #include "PlayaDefs.hpp" 00009 #include "PlayaVectorDecl.hpp" 00010 #include "PlayaLinearOperatorDecl.hpp" 00011 #include "Teuchos_ParameterList.hpp" 00012 00013 00014 namespace Playa 00015 { 00016 using namespace Teuchos; 00017 00018 /** 00019 * Base class for preconditioners. A general preconditioner object 00020 * is split into a left preconditioner M1^-1 and a right 00021 * preconditioner M2^-1. To solve A x = b, we define the auxiliary 00022 * system M2^-1 y = x, and solve M1^-1 A M2^-1 y = M1^-1 b to obtain y. 00023 * Having y, we can quickly recover x by applying M2^-1 to y. 00024 * 00025 * The base class implements neither a left nor a right preconditioner. 00026 */ 00027 template <class Scalar> 00028 class PreconditionerBase : public Playa::Handleable<PreconditionerBase<Scalar> > 00029 { 00030 public: 00031 /** empty ctor */ 00032 PreconditionerBase() {;} 00033 00034 /** virtual dtor */ 00035 virtual ~PreconditionerBase(){;} 00036 00037 00038 /** */ 00039 virtual LinearOperator<Scalar> left() const = 0 ; 00040 00041 /** */ 00042 virtual LinearOperator<Scalar> right() const = 0 ; 00043 00044 /** return true if this preconditioner has a nontrivial left component */ 00045 virtual bool hasLeft() const = 0 ; 00046 00047 /** return true if this preconditioner has 00048 * a nontrivial right component */ 00049 virtual bool hasRight() const = 0 ; 00050 00051 private: 00052 }; 00053 00054 } 00055 00056 #endif