Medusa  1.1
Coordinate Free Mehless Method implementation
mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t > Class Template Reference

Detailed Description

template<class shape_storage_type, class matrix_type, class rhs_type>
template<typename derived_t>
class mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >

Base class for all elementary implicit operations.

This class enables multiplication with scalar, addition and evaluation of implicit operations. The method eval() is the implementation of the actual operation that writes coefficients to the matrix. CRTP is used for compile time polymorphism of eval(), so that concrete operations only need to define this method.

Definition at line 71 of file ImplicitOperators_fwd.hpp.

+ Collaboration diagram for mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >:

Public Member Functions

RowOp eval (scalar_t alpha) const
 Write appropriate coefficients for this operation to the matrix. More...
 
RowOp eval () const
 Eval with alpha = 1.0. More...
 
void operator= (scalar_t x)
 Evaluates *this and sets rhs to x. More...
 
RowOp operator* (scalar_t alpha)
 Multiply this operation by a scalar. More...
 
RowOp operator+ (RowOp right)
 Combine this operation with another row operation. More...
 
RowOp operator- ()
 Multiply this operation by -1. More...
 
template<typename other_derived_t >
RowOp operator+ (const OpBase< other_derived_t > &right)
 Combine tho operation with another operation. Both operations are evaluated. More...
 

Friends

RowOp operator* (scalar_t alpha, const OpBase &o)
 Multiply with scalar from the left. More...
 

Protected Member Functions

 OpBase (ImplicitOperators &op, int node, int row)
 Construct operation for a given node. More...
 

Protected Attributes

ImplicitOperatorsop
 Reference to underlying operators. More...
 
int node
 Index of the point for which to apply the operation. More...
 
int row
 Matrix row to which the operation should be applied (without offset). More...
 

Constructor & Destructor Documentation

◆ OpBase()

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::OpBase ( ImplicitOperators op,
int  node,
int  row 
)
inlineprotected

Construct operation for a given node.

Definition at line 125 of file ImplicitOperators_fwd.hpp.

Member Function Documentation

◆ eval() [1/2]

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowOp mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::eval ( ) const
inline

Eval with alpha = 1.0.

Definition at line 137 of file ImplicitOperators_fwd.hpp.

◆ eval() [2/2]

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowOp mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::eval ( scalar_t  alpha) const
inline

Write appropriate coefficients for this operation to the matrix.

Parameters
alphaScalar to multiply the coefficients with.
Returns
A RowOp for the appropriate matrix row.

Definition at line 133 of file ImplicitOperators_fwd.hpp.

◆ operator*()

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowOp mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::operator* ( scalar_t  alpha)
inline

Multiply this operation by a scalar.

Definition at line 141 of file ImplicitOperators_fwd.hpp.

◆ operator+() [1/2]

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
template<typename other_derived_t >
RowOp mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::operator+ ( const OpBase< other_derived_t > &  right)
inline

Combine tho operation with another operation. Both operations are evaluated.

Definition at line 148 of file ImplicitOperators_fwd.hpp.

◆ operator+() [2/2]

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowOp mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::operator+ ( RowOp  right)
inline

Combine this operation with another row operation.

Definition at line 143 of file ImplicitOperators_fwd.hpp.

◆ operator-()

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowOp mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::operator- ( )
inline

Multiply this operation by -1.

Definition at line 145 of file ImplicitOperators_fwd.hpp.

◆ operator=()

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
void mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::operator= ( scalar_t  x)
inline

Evaluates *this and sets rhs to x.

Definition at line 139 of file ImplicitOperators_fwd.hpp.

Friends And Related Function Documentation

◆ operator*

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowOp operator* ( scalar_t  alpha,
const OpBase< derived_t > &  o 
)
friend

Multiply with scalar from the left.

Definition at line 150 of file ImplicitOperators_fwd.hpp.

Member Data Documentation

◆ node

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
int mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::node
protected

Index of the point for which to apply the operation.

Definition at line 122 of file ImplicitOperators_fwd.hpp.

◆ op

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
ImplicitOperators& mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::op
protected

Reference to underlying operators.

Definition at line 121 of file ImplicitOperators_fwd.hpp.

◆ row

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
int mm::ImplicitOperators< shape_storage_type, matrix_type, rhs_type >::OpBase< derived_t >::row
protected

Matrix row to which the operation should be applied (without offset).

Definition at line 123 of file ImplicitOperators_fwd.hpp.


The documentation for this class was generated from the following file: