39 typedef memory::shared_ptr<gsProductOp>
Ptr;
42 typedef memory::unique_ptr<gsProductOp>
uPtr;
51 const index_t sz = m_ops.size();
55 "Dimensions of the operators do not fit." );
64 "Dimensions of the operators do not fit." );
65 m_ops[0]=
give(op0); m_ops[1]=
give(op1);
71 GISMO_ASSERT ( op0->rows() == op1->cols() && op1->rows() == op2->cols(),
72 "Dimensions of the operators do not fit." );
73 m_ops[0]=
give(op0); m_ops[1]=
give(op1); m_ops[2]=
give(op2);
89 static uPtr make(BasePtr op0, BasePtr op1, BasePtr op2)
95 GISMO_ASSERT ( m_ops.empty() || m_ops.back()->rows() == op->cols(),
96 "Dimensions of the operators do not fit." );
97 m_ops.push_back(
give(op));
103 if ( m_ops.empty() ) { x = input;
return; }
107 const size_t sz = m_ops.size();
109 m_ops[0]->apply(input,x);
110 for(
size_t i=1; i<sz;++i)
113 m_ops[i]->apply(temp,x);
118 GISMO_ASSERT( !m_ops.empty(),
"gsProductOp::rows does not work for 0 operators.");
119 return m_ops.back()->rows();
124 GISMO_ASSERT( !m_ops.empty(),
"gsProductOp::cols does not work for 0 operators.");
125 return m_ops.front()->cols();
129 const std::vector<BasePtr>&
getOps()
const {
return m_ops; }
132 std::vector<BasePtr> m_ops;
Simple abstract class for discrete operators.
Definition gsLinearOperator.h:29
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
Class for representing the product of objects of type gsLinearOperator as gsLinearOperator.
Definition gsProductOp.h:34
index_t rows() const
Returns the number of rows of the operator.
Definition gsProductOp.h:117
static uPtr make(BasePtr op0, BasePtr op1, BasePtr op2)
Make command returning a smart pointer.
Definition gsProductOp.h:89
gsProductOp(BasePtr op0, BasePtr op1, BasePtr op2)
Constructor taking three Linear Operators.
Definition gsProductOp.h:69
void addOperator(BasePtr op)
Add another operator at the end.
Definition gsProductOp.h:93
const std::vector< BasePtr > & getOps() const
Return a vector of shared pointers to all operators.
Definition gsProductOp.h:129
memory::unique_ptr< gsProductOp > uPtr
Unique pointer for gsProductOp.
Definition gsProductOp.h:42
static uPtr make(std::vector< BasePtr > ops)
Make command returning a smart pointer.
Definition gsProductOp.h:81
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
apply the operator on the input vector and store the result in x
Definition gsProductOp.h:100
gsProductOp()
Empty constructor. To be filled with addOperator()
Definition gsProductOp.h:45
static uPtr make(BasePtr op0, BasePtr op1)
Make command returning a smart pointer.
Definition gsProductOp.h:85
index_t cols() const
Returns the number of columns of the operator.
Definition gsProductOp.h:123
gsProductOp(BasePtr op0, BasePtr op1)
Constructor taking two Linear Operators.
Definition gsProductOp.h:61
gsProductOp(std::vector< BasePtr > ops)
Constructor taking a vector of Linear Operators.
Definition gsProductOp.h:48
static uPtr make()
Make command returning a smart pointer.
Definition gsProductOp.h:77
memory::shared_ptr< gsProductOp > Ptr
Shared pointer for gsProductOp.
Definition gsProductOp.h:39
#define index_t
Definition gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
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