FlexBox - A Flexible Primal-Dual ToolBox
Public Member Functions | Public Attributes | List of all members
flexLinearOperator< T > Class Template Referenceabstract

abstract base class for linear operators More...

#include <flexLinearOperator.h>

Inheritance diagram for flexLinearOperator< T >:
flexConcatOperator< T > flexDiagonalOperator< T > flexFullMatrix< T > flexGradientOperator< T > flexIdentityOperator< T > flexMatrix< T > flexMatrixGPU< T > flexMatrixLogical< T > flexSuperpixelOperator< T > flexZeroOperator< T >

Public Member Functions

 flexLinearOperator (int aNumRows, int aNumCols, linOp aType, bool aIsMinus)
 initializes the linear operator More...
 
int getNumCols () const
 returns number of columns of the linear operator More...
 
int getNumRows () const
 returns number of rows of the linear operator More...
 
void setNumCols (int aNumCols)
 sets the number of columns of the linear operator More...
 
void setNumRows (int aNumRows)
 sets the number of rows of the linear operator More...
 
void setMinus (bool aIsMinus)
 constrols if operator should be negated or not More...
 
virtual flexLinearOperator< T > * copy ()=0
 copies the linear operator More...
 
virtual void times (bool transposed, const Tdata &input, Tdata &output)=0
 applies linear operator on vector More...
 
virtual void timesPlus (bool transposed, const Tdata &input, Tdata &output)=0
 applies linear operator on vector and adds its result to y More...
 
virtual void timesMinus (bool transposed, const Tdata &input, Tdata &output)=0
 applies linear operator on vector and substracts its result from y More...
 
virtual std::vector< T > getAbsRowSum (bool transposed)=0
 returns a vector of sum of absolute values per row used for preconditioning More...
 
virtual thrust::device_vector< T > getAbsRowSumCUDA (bool transposed)=0
 same function as getAbsRowSum() but implemented in CUDA More...
 
virtual T getMaxRowSumAbs (bool transposed)=0
 returns the maximum sum of absolute values per row used for preconditioning More...
 

Public Attributes

linOp type
 type of linear operator More...
 
bool isMinus
 determines if operator is negated
 

Detailed Description

template<typename T>
class flexLinearOperator< T >

abstract base class for linear operators

flexLinearOperator combines the interface for all usable operators

Constructor & Destructor Documentation

◆ flexLinearOperator()

template<typename T>
flexLinearOperator< T >::flexLinearOperator ( int  aNumRows,
int  aNumCols,
linOp  aType,
bool  aIsMinus 
)
inline

initializes the linear operator

Parameters
aNumRowsnumber of rows of liner operator
aNumColsnumber of columns of liner operator
aTypetype of linear operator sa type
See also
type
Parameters
aIsMinusdetermines if operator is negated
See also
isMinus

Member Function Documentation

◆ copy()

template<typename T>
virtual flexLinearOperator<T>* flexLinearOperator< T >::copy ( )
pure virtual

◆ getAbsRowSum()

template<typename T>
virtual std::vector<T> flexLinearOperator< T >::getAbsRowSum ( bool  transposed)
pure virtual

returns a vector of sum of absolute values per row used for preconditioning

Parameters
transposedis true if operator should be (temporarily) transposed before usage
Returns
vector of sum of absolute values per row

Implemented in flexGradientOperator< T >, flexMatrixGPU< T >, flexConcatOperator< T >, flexMatrix< T >, flexMatrixLogical< T >, flexDiagonalOperator< T >, flexIdentityOperator< T >, flexFullMatrix< T >, flexSuperpixelOperator< T >, and flexZeroOperator< T >.

◆ getAbsRowSumCUDA()

template<typename T>
virtual thrust::device_vector<T> flexLinearOperator< T >::getAbsRowSumCUDA ( bool  transposed)
pure virtual

same function as getAbsRowSum() but implemented in CUDA

Parameters
transposedis true if operator should be (temporarily) transposed before usage
Returns
vector of sum of absolute values per row

Implemented in flexGradientOperator< T >, flexMatrixGPU< T >, flexConcatOperator< T >, flexMatrix< T >, flexMatrixLogical< T >, flexFullMatrix< T >, flexDiagonalOperator< T >, flexIdentityOperator< T >, flexSuperpixelOperator< T >, and flexZeroOperator< T >.

◆ getMaxRowSumAbs()

template<typename T>
virtual T flexLinearOperator< T >::getMaxRowSumAbs ( bool  transposed)
pure virtual

returns the maximum sum of absolute values per row used for preconditioning

Parameters
transposedis true if operator should be (temporarily) transposed before usage
Returns
maximum sum of absolute values per row

Implemented in flexGradientOperator< T >, flexMatrixGPU< T >, flexConcatOperator< T >, flexMatrix< T >, flexDiagonalOperator< T >, flexMatrixLogical< T >, flexIdentityOperator< T >, flexFullMatrix< T >, flexSuperpixelOperator< T >, and flexZeroOperator< T >.

◆ getNumCols()

template<typename T>
int flexLinearOperator< T >::getNumCols ( ) const
inline

returns number of columns of the linear operator

Returns
number of columns

◆ getNumRows()

template<typename T>
int flexLinearOperator< T >::getNumRows ( ) const
inline

returns number of rows of the linear operator

Returns
number of rows

◆ setMinus()

template<typename T>
void flexLinearOperator< T >::setMinus ( bool  aIsMinus)
inline

constrols if operator should be negated or not

Parameters
aIsMinustrue if operator should be negated, otherwise false.

◆ setNumCols()

template<typename T>
void flexLinearOperator< T >::setNumCols ( int  aNumCols)
inline

sets the number of columns of the linear operator

Parameters
aNumColsnumber of columns

◆ setNumRows()

template<typename T>
void flexLinearOperator< T >::setNumRows ( int  aNumRows)
inline

sets the number of rows of the linear operator

Parameters
aNumRowsnumber of rows

◆ times()

template<typename T>
virtual void flexLinearOperator< T >::times ( bool  transposed,
const Tdata &  input,
Tdata &  output 
)
pure virtual

applies linear operator on vector

equals $ y = Ax $

Parameters
transposedis true if operator should be (temporarily) transposed before usage
inputdata to be processed
outputoutput data

Implemented in flexGradientOperator< T >, flexMatrixGPU< T >, flexDiagonalOperator< T >, flexConcatOperator< T >, flexMatrix< T >, flexMatrixLogical< T >, flexSuperpixelOperator< T >, flexFullMatrix< T >, flexIdentityOperator< T >, and flexZeroOperator< T >.

◆ timesMinus()

template<typename T>
virtual void flexLinearOperator< T >::timesMinus ( bool  transposed,
const Tdata &  input,
Tdata &  output 
)
pure virtual

applies linear operator on vector and substracts its result from y

equals $ y = y - Ax $

Parameters
transposedis true if operator should be (temporarily) transposed before usage
inputdata to be processed
outputoutput data

Implemented in flexGradientOperator< T >, flexMatrixGPU< T >, flexConcatOperator< T >, flexDiagonalOperator< T >, flexIdentityOperator< T >, flexMatrix< T >, flexMatrixLogical< T >, flexSuperpixelOperator< T >, flexFullMatrix< T >, and flexZeroOperator< T >.

◆ timesPlus()

template<typename T>
virtual void flexLinearOperator< T >::timesPlus ( bool  transposed,
const Tdata &  input,
Tdata &  output 
)
pure virtual

applies linear operator on vector and adds its result to y

equals $ y = y + Ax $

Parameters
transposedis true if operator should be (temporarily) transposed before usage
inputdata to be processed
outputoutput data

Implemented in flexGradientOperator< T >, flexMatrixGPU< T >, flexDiagonalOperator< T >, flexIdentityOperator< T >, flexConcatOperator< T >, flexMatrix< T >, flexMatrixLogical< T >, flexSuperpixelOperator< T >, flexFullMatrix< T >, and flexZeroOperator< T >.

Member Data Documentation

◆ type

template<typename T>
linOp flexLinearOperator< T >::type

type of linear operator

See also
linOp

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