00001 /* @HEADER@ */ 00002 // 00003 /* @HEADER@ */ 00004 00005 #ifndef PLAYA_LINEAROPERATORDECL_HPP 00006 #define PLAYA_LINEAROPERATORDECL_HPP 00007 00008 #include "PlayaDefs.hpp" 00009 #include "PlayaHandle.hpp" 00010 #include "PlayaHandleable.hpp" 00011 #include "PlayaLinearOperatorBaseDecl.hpp" 00012 #include "PlayaLoadableMatrix.hpp" 00013 #include "Teuchos_TimeMonitor.hpp" 00014 #include "PlayaRowAccessibleOp.hpp" 00015 00016 00017 namespace Playa 00018 { 00019 using namespace Teuchos; 00020 00021 00022 template <class Scalar> class LinearSolver; 00023 template <class Scalar> class VectorSpace; 00024 template <class Scalar> class Vector; 00025 template <class Scalar> class VectorType; 00026 00030 template <class Scalar> 00031 class LinearOperator : public Playa::Handle<LinearOperatorBase<Scalar> > 00032 { 00033 public: 00037 LinearOperator(); 00038 00040 LinearOperator(const RCP<LinearOperatorBase<Scalar> >& smartPtr); 00042 00044 const VectorSpace<Scalar> domain() const ; 00045 00047 const VectorSpace<Scalar> range() const ; 00048 00049 00056 void apply(const Vector<Scalar>& in, 00057 Vector<Scalar>& out) const ; 00058 00065 void applyTranspose(const Vector<Scalar>& in, 00066 Vector<Scalar>& out) const ; 00067 00068 00069 // /** For the moment this does nothing*/ 00070 LinearOperator<Scalar> form() const {return *this;} 00071 00072 00074 RCP<Time>& opTimer(); 00075 00079 LinearOperator<Scalar> transpose() const ; 00080 00081 00083 RCP<LoadableMatrix<Scalar> > matrix(); 00084 00086 void getRow(const int& row, 00087 Teuchos::Array<int>& indices, 00088 Teuchos::Array<Scalar>& values) const ; 00089 00090 00093 00095 int numBlockRows() const ; 00096 00097 00099 int numBlockCols() const ; 00100 00101 00103 LinearOperator<Scalar> getBlock(const int &i, const int &j) const ; 00104 00105 00107 LinearOperator<Scalar> getNonconstBlock(const int &i, const int &j) ; 00108 00113 void setBlock(int i, int j, 00114 const LinearOperator<Scalar>& sub); 00115 00117 void endBlockFill(); 00118 00120 00121 00122 00123 private: 00124 00125 }; 00126 00127 } 00128 00129 00130 #endif