33 typedef memory::shared_ptr<gsLinearOperator>
Ptr;
36 typedef memory::unique_ptr<gsLinearOperator>
uPtr;
48 virtual void apply(
const gsMatrix<T> & input, gsMatrix<T> & x)
const = 0;
57 void toMatrix(gsMatrix<T>& result)
59 gsMatrix<T> eye = gsMatrix<T>::Identity(
cols(),
cols());
60 this->
apply(eye, result);
81 typedef memory::shared_ptr<gsScaledOp>
Ptr;
84 typedef memory::unique_ptr<gsScaledOp>
uPtr;
98 m_op->apply(input, x);
123 typedef memory::shared_ptr<gsIdentityOp>
Ptr;
126 typedef memory::unique_ptr<gsIdentityOp>
uPtr;
150 template<
class T,
class L>
156 : m_lambda(lambda), m_rows(rows), m_cols(cols) {}
176 template<
class T=real_t,
class L>
index_t rows() const
Returns the number of rows of the operator.
Definition: gsLinearOperator.h:161
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
apply the operator on the input vector and store the result in x
Definition: gsLinearOperator.h:157
index_t cols() const
Returns the number of columns of the operator.
Definition: gsLinearOperator.h:141
Identity operator.
Definition: gsLinearOperator.h:118
gsLinearOperator< T >::Ptr BasePtr
Shared pointer for gsLinearOperator.
Definition: gsLinearOperator.h:87
virtual index_t rows() const =0
Returns the number of rows of the operator.
static gsOptionList defaultOptions()
Get the default options as gsOptionList object.
Definition: gsLinearOperator.h:65
gsLinearOperator< T >::uPtr makeLinearOp(L lambda, index_t rows, index_t cols)
Wrapper that allows to use lambdas as a gsLinearOperator.
Definition: gsLinearOperator.h:177
Wrapper that allows to use lambdas as a gsLinearOperator.
Definition: gsLinearOperator.h:151
S give(S &x)
Definition: gsMemory.h:266
static uPtr make(index_t dim)
Make function returning a smart pointer.
Definition: gsLinearOperator.h:132
#define index_t
Definition: gsConfig.h:32
virtual void setOptions(const gsOptionList &)
Set options based on a gsOptionList object.
Definition: gsLinearOperator.h:69
static uPtr make(BasePtr op, T scalar=1)
Make function returning a smart pointer.
Definition: gsLinearOperator.h:93
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
apply the operator on the input vector and store the result in x
Definition: gsLinearOperator.h:134
index_t cols() const
Returns the number of columns of the operator.
Definition: gsLinearOperator.h:162
Provides a list of labeled parameters/options that can be set and accessed easily.
memory::shared_ptr< gsLinearOperator > Ptr
Shared pointer for gsLinearOperator.
Definition: gsLinearOperator.h:33
memory::shared_ptr< gsScaledOp > Ptr
Shared pointer for gsScaledOp.
Definition: gsLinearOperator.h:81
memory::unique_ptr< gsLinearOperator > uPtr
Unique pointer for gsLinearOperator.
Definition: gsLinearOperator.h:36
gsScaledOp(BasePtr op, T scalar=1)
Constructor taking a shared pointer to a linear operator and a scalar.
Definition: gsLinearOperator.h:90
index_t cols() const
Returns the number of columns in the preconditioner.
Definition: gsLinearOperator.h:106
index_t rows() const
Returns the number of rows in the preconditioner.
Definition: gsLinearOperator.h:103
memory::unique_ptr< gsIdentityOp > uPtr
Unique pointer for gsIdentityOp.
Definition: gsLinearOperator.h:126
static gsIdentityOp< T > Identity(const index_t dim)
Identity operator.
Definition: gsLinearOperator.h:39
Simple abstract class for discrete operators.
Definition: gsLinearOperator.h:28
This is the main header file that collects wrappers of Eigen for linear algebra.
virtual void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const =0
apply the operator on the input vector and store the result in x
virtual index_t cols() const =0
Returns the number of columns of the operator.
memory::unique_ptr< gsScaledOp > uPtr
Unique pointer for gsScaledOp.
Definition: gsLinearOperator.h:84
Class which holds a list of parameters/options, and provides easy access to them. ...
Definition: gsOptionList.h:32
index_t rows() const
Returns the number of rows of the operator.
Definition: gsLinearOperator.h:139
memory::shared_ptr< gsIdentityOp > Ptr
Shared pointer for gsIdentityOp.
Definition: gsLinearOperator.h:123
gsLinearLambdaOp(L lambda, index_t rows, index_t cols)
Constructor; see makeLinearOp for details.
Definition: gsLinearOperator.h:155
Allows an operator to be multiplied with a scalar.
Definition: gsLinearOperator.h:77
virtual void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
apply the operator on the input vector and store the result in x
Definition: gsLinearOperator.h:96
gsIdentityOp(index_t dim)
Constructor taking the dimension of the identity operator.
Definition: gsLinearOperator.h:129