G+Smo
24.08.0
Geometry + Simulation Modules
|
Simple adapter class to use a matrix (or matrix-like object) as a linear operator. Needed for the iterative method classes.
Public Types | |
typedef memory::shared_ptr < gsMatrixOp > | Ptr |
Shared pointer for gsMatrixOp. | |
typedef memory::unique_ptr < gsMatrixOp > | uPtr |
Unique pointer for gsMatrixOp. | |
Public Member Functions | |
void | apply (const gsMatrix< T > &input, gsMatrix< T > &x) const |
apply the operator on the input vector and store the result in x More... | |
index_t | cols () const |
Returns the number of columns of the operator. | |
gsMatrixOp (const MatrixType &mat) | |
Constructor taking a reference. More... | |
gsMatrixOp (MatrixPtr mat) | |
Constructor taking a shared pointer. | |
NestedMatrix | matrix () const |
Returns the matrix. | |
MatrixPtr | matrixPtr () const |
Returns a shared pinter to the matrix. | |
index_t | rows () const |
Returns the number of rows of the operator. | |
virtual void | setOptions (const gsOptionList &) |
Set options based on a gsOptionList object. | |
Static Public Member Functions | |
static gsOptionList | defaultOptions () |
Get the default options as gsOptionList object. | |
static gsIdentityOp < MatrixType::Scalar > | Identity (const index_t dim) |
Identity operator. | |
static uPtr | make (const MatrixType &mat) |
Make function returning a smart pointer. More... | |
static uPtr | make (MatrixPtr mat) |
Make function returning a smart pointer. | |
Private Attributes | |
NestedMatrix | m_expr |
Nested Eigen expression. | |
const MatrixPtr | m_mat |
Shared pointer to matrix (if needed) | |
Related Functions | |
(Note that these are not member functions.) | |
template<class Derived > | |
gsMatrixOp< Derived >::uPtr | makeMatrixOp (const gsEigen::EigenBase< Derived > &mat) |
This essentially just calls the gsMatrixOp constructor, but the use of a template functions allows us to let the compiler do type inference, so we don't need to type out the matrix type explicitly. More... | |
template<class Derived > | |
gsMatrixOp< Derived >::uPtr | makeMatrixOp (memory::shared_ptr< Derived > mat) |
This essentially just calls the gsMatrixOp constructor, but the use of a template functions allows us to let the compiler do type inference, so we don't need to type out the matrix type explicitly. More... | |
|
inline |
Constructor taking a reference.
apply the operator on the input vector and store the result in x
input | Input vector |
x | result vector |
Implements gsLinearOperator< MatrixType::Scalar >.
|
inlinestatic |
Make function returning a smart pointer.
|
related |
This essentially just calls the gsMatrixOp constructor, but the use of a template functions allows us to let the compiler do type inference, so we don't need to type out the matrix type explicitly.
Examples:
Note that
will re-compute the inverse of the matrix every time the operator opInv is applied, so this is not advised.
|
related |
This essentially just calls the gsMatrixOp constructor, but the use of a template functions allows us to let the compiler do type inference, so we don't need to type out the matrix type explicitly.
Example:
Alternatively: