Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef TSFLINEAROPERATORDECL_HPP
00030 #define TSFLINEAROPERATORDECL_HPP
00031
00032 #include "SundanceDefs.hpp"
00033 #include "SundanceHandle.hpp"
00034 #include "SundanceHandleable.hpp"
00035 #include "Thyra_LinearOpBase.hpp"
00036 #include "TSFLoadableMatrix.hpp"
00037 #include "Teuchos_TimeMonitor.hpp"
00038 #include "TSFRowAccessibleOp.hpp"
00039
00040
00041 namespace TSFExtended
00042 {
00043 using Thyra::Index;
00044 using namespace Teuchos;
00045 using namespace Thyra;
00046 using namespace Sundance;
00047
00048 template <class Scalar> class LinearSolver;
00049 template <class Scalar> class VectorSpace;
00050 template <class Scalar> class Vector;
00051 template <class Scalar> class VectorType;
00052
00053
00054
00055
00056 template <class Scalar>
00057 class LinearOperator : public Sundance::Handle<LinearOpBase<Scalar> >
00058 {
00059 public:
00060
00061
00062
00063 LinearOperator();
00064
00065
00066 LinearOperator(const RCP<LinearOpBase<Scalar> >& smartPtr);
00067
00068
00069
00070 const VectorSpace<Scalar> domain() const ;
00071
00072
00073 const VectorSpace<Scalar> range() const ;
00074
00075
00076
00077
00078
00079
00080
00081
00082 void apply(const Vector<Scalar>& in,
00083 Vector<Scalar>& out,
00084 const Scalar& alpha = 1.0,
00085 const Scalar& beta = 0.0) const ;
00086
00087
00088
00089
00090
00091
00092
00093 void applyTranspose(const Vector<Scalar>& in,
00094 Vector<Scalar>& out,
00095 const Scalar& alpha = 1.0,
00096 const Scalar& beta = 0.0) const ;
00097
00098
00099
00100 LinearOperator<Scalar> form() const {return *this;}
00101
00102
00103
00104 RCP<Time>& opTimer();
00105
00106
00107
00108
00109 LinearOperator<Scalar> transpose() const ;
00110
00111
00112
00113 RCP<LoadableMatrix<Scalar> > matrix();
00114
00115
00116 void getRow(const int& row,
00117 Teuchos::Array<int>& indices,
00118 Teuchos::Array<Scalar>& values) const ;
00119
00120
00121
00122
00123
00124
00125 int numBlockRows() const ;
00126
00127
00128
00129 int numBlockCols() const ;
00130
00131
00132
00133 LinearOperator<Scalar> getBlock(const int &i, const int &j) const ;
00134
00135
00136
00137 LinearOperator<Scalar> getNonconstBlock(const int &i, const int &j) ;
00138
00139
00140
00141
00142
00143 void setBlock(int i, int j,
00144 const LinearOperator<Scalar>& sub);
00145
00146
00147 void endBlockFill();
00148
00149
00150
00151
00152
00153 private:
00154 int verb_;
00155 };
00156
00157 }
00158
00159
00160 #endif