39 typedef memory::shared_ptr<gsCompositePrecOp>
Ptr;
42 typedef memory::unique_ptr<gsCompositePrecOp>
uPtr;
55 m_ops[0] =
give(op0); m_ops[1] =
give(op1);
62 m_ops[0] =
give(op0); m_ops[1] =
give(op1); m_ops[2] =
give(op2);
78 static uPtr make(BasePtr op0, BasePtr op1, BasePtr op2)
86 m_ops.push_back(
give(op));
92 const size_t sz = m_ops.size();
93 for (
size_t i=0; i<sz; ++i )
94 m_ops[i]->
step(rhs,x);
100 const index_t sz = m_ops.size();
101 for (
index_t i=sz-1; i>=0; --i )
102 m_ops[i]->
stepT(rhs,x);
110 GISMO_ASSERT( !m_ops.empty(),
"gsCompositePrecOp::rows does not work for 0 operators.");
111 return m_ops[0]->rows();
116 GISMO_ASSERT( !m_ops.empty(),
"gsCompositePrecOp::rows does not work for 0 operators.");
117 return m_ops[0]->cols();
121 std::vector< BasePtr > m_ops;
This class represents the composition of preconditioners of type gsPreconditionerOp.
Definition gsCompositePrecOp.h:34
index_t rows() const
Returns the number of rows of the operator.
Definition gsCompositePrecOp.h:108
memory::unique_ptr< gsCompositePrecOp > uPtr
Unique pointer for gsCompositePrecOp.
Definition gsCompositePrecOp.h:42
gsLinearOperator< T >::Ptr underlyingOp() const
Return the underlying operator .
Definition gsCompositePrecOp.h:105
gsCompositePrecOp(BasePtr op0, BasePtr op1, BasePtr op2)
Convenience constructor taking three preconditioners.
Definition gsCompositePrecOp.h:59
static uPtr make(BasePtr op0, BasePtr op1, BasePtr op2)
Make command returning a smart pointer.
Definition gsCompositePrecOp.h:78
memory::shared_ptr< gsCompositePrecOp > Ptr
Shared pointer for gsCompositePrecOp.
Definition gsCompositePrecOp.h:39
virtual void stepT(const gsMatrix< T > &rhs, gsMatrix< T > &x) const
Apply the transposed smoother for the equation Ax=rhs and update the current iterate x.
Definition gsCompositePrecOp.h:98
void addOperator(BasePtr op)
Add another operator at the end.
Definition gsCompositePrecOp.h:84
gsCompositePrecOp()
Empty constructor. To be filled with addOperator()
Definition gsCompositePrecOp.h:45
gsCompositePrecOp(BasePtr op0, BasePtr op1)
Convenience constructor taking two preconditioners.
Definition gsCompositePrecOp.h:52
virtual void step(const gsMatrix< T > &rhs, gsMatrix< T > &x) const
Apply the smoother for the equation Ax=rhs and update the current iterate x.
Definition gsCompositePrecOp.h:90
static uPtr make(std::vector< BasePtr > ops)
Make command returning a smart pointer.
Definition gsCompositePrecOp.h:66
static uPtr make(BasePtr op0, BasePtr op1)
Make command returning a smart pointer.
Definition gsCompositePrecOp.h:72
index_t cols() const
Returns the number of columns of the operator.
Definition gsCompositePrecOp.h:114
gsCompositePrecOp(std::vector< BasePtr > ops)
Constructor taking a vector of preconditioners.
Definition gsCompositePrecOp.h:48
memory::shared_ptr< gsLinearOperator > Ptr
Shared pointer for gsLinearOperator.
Definition gsLinearOperator.h:33
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Simple abstract class for perconditioners.
Definition gsPreconditioner.h:43
memory::shared_ptr< gsPreconditionerOp > Ptr
Shared pointer for gsLinearOperator.
Definition gsPreconditioner.h:47
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
This is the main header file that collects wrappers of Eigen for linear algebra.
Simple abstract class for (discrete) linear operators.
The G+Smo namespace, containing all definitions for the library.
S give(S &x)
Definition gsMemory.h:266