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

Detailed Description

template<class shape_storage_type, class matrix_type, class rhs_type>
template<typename derived_t>
class mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >

Base class for all elementary implicit vector 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 82 of file ImplicitVectorOperators_fwd.hpp.

+ Collaboration diagram for mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >:

Public Member Functions

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

Friends

RowVecOp operator* (scalar_t alpha, const VecOpBase &op)
 Multiply with scalar from the left. More...
 

Protected Member Functions

 VecOpBase (ImplicitVectorOperators &op, int node, int row)
 Construct operation for a given node. More...
 

Protected Attributes

ImplicitVectorOperatorsop
 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

◆ VecOpBase()

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

Construct operation for a given node.

Definition at line 137 of file ImplicitVectorOperators_fwd.hpp.

Member Function Documentation

◆ eval() [1/2]

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowVecOp mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::eval ( ) const
inline

Eval with alpha = 1.0.

Definition at line 149 of file ImplicitVectorOperators_fwd.hpp.

◆ eval() [2/2]

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowVecOp mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< 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 RowVecOp for the appropriate matrix row.

Definition at line 145 of file ImplicitVectorOperators_fwd.hpp.

◆ operator*()

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowVecOp mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::operator* ( scalar_t  alpha)
inline

Multiply this operation by a scalar.

Definition at line 153 of file ImplicitVectorOperators_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 >
RowVecOp mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::operator+ ( const VecOpBase< other_derived_t > &  right)
inline

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

Definition at line 160 of file ImplicitVectorOperators_fwd.hpp.

◆ operator+() [2/2]

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowVecOp mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::operator+ ( RowVecOp  right)
inline

Combine this operation with another row operation.

Definition at line 155 of file ImplicitVectorOperators_fwd.hpp.

◆ operator-()

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowVecOp mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::operator- ( )
inline

Multiply this operation by -1.

Definition at line 157 of file ImplicitVectorOperators_fwd.hpp.

◆ operator=()

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
void mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::operator= ( const vector_t x)
inline

Evaluates *this and sets rhs to x.

Definition at line 151 of file ImplicitVectorOperators_fwd.hpp.

Friends And Related Function Documentation

◆ operator*

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
RowVecOp operator* ( scalar_t  alpha,
const VecOpBase< derived_t > &  op 
)
friend

Multiply with scalar from the left.

Definition at line 162 of file ImplicitVectorOperators_fwd.hpp.

Member Data Documentation

◆ node

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
int mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::node
protected

Index of the point for which to apply the operation.

Definition at line 134 of file ImplicitVectorOperators_fwd.hpp.

◆ op

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
ImplicitVectorOperators& mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::op
protected

Reference to underlying operators.

Definition at line 133 of file ImplicitVectorOperators_fwd.hpp.

◆ row

template<class shape_storage_type , class matrix_type , class rhs_type >
template<typename derived_t >
int mm::ImplicitVectorOperators< shape_storage_type, matrix_type, rhs_type >::VecOpBase< derived_t >::row
protected

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

Definition at line 135 of file ImplicitVectorOperators_fwd.hpp.


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