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

represents a gradient operator More...

#include <flexGradientOperator.h>

Inheritance diagram for flexGradientOperator< T >:
flexLinearOperator< T >

Public Member Functions

 flexGradientOperator (std::vector< int > AInputDimension, int aGradDirection, gradientType aType, bool aMinus)
 initializes the gradient operator More...
 
flexGradientOperator< T > * copy ()
 copies the linear operator More...
 
void updateValue (T *ptr, mySign s, T value)
 
void dxp3d (const Tdata &input, Tdata &output, mySign s)
 
void dyp3d (const Tdata &input, Tdata &output, mySign s)
 
void dzp3d (const Tdata &input, Tdata &output, mySign s)
 
void dxp3dTransposed (const Tdata &input, Tdata &output, mySign s)
 
void dyp3dTransposed (const Tdata &input, Tdata &output, mySign s)
 
void dzp3dTransposed (const Tdata &input, Tdata &output, mySign s)
 
void dxp2d (const Tdata &input, Tdata &output, mySign s)
 
void dyp2d (const Tdata &input, Tdata &output, mySign s)
 
void dxp2dTransposed (const Tdata &input, Tdata &output, mySign s)
 
void dyp2dTransposed (const Tdata &input, Tdata &output, mySign s)
 
void doTimesCPU (bool transposed, const Tdata &input, Tdata &output, mySign s)
 
void doTimesCUDA (bool transposed, const Tdata &input, Tdata &output, mySign s)
 
void doTimes (bool transposed, const Tdata &input, Tdata &output, mySign s)
 
void timesPlus (bool transposed, const Tdata &input, Tdata &output)
 applies linear operator on vector and adds its result to y More...
 
void timesMinus (bool transposed, const Tdata &input, Tdata &output)
 applies linear operator on vector and substracts its result from y More...
 
void times (bool transposed, const Tdata &input, Tdata &output)
 applies linear operator on vector More...
 
getMaxRowSumAbs (bool transposed)
 returns the maximum sum of absolute values per row used for preconditioning More...
 
std::vector< T > getAbsRowSum (bool transposed)
 returns a vector of sum of absolute values per row used for preconditioning More...
 
int index3DtoLinear (int i, int j, int k)
 
int index2DtoLinear (int i, int j)
 
thrust::device_vector< T > getAbsRowSumCUDA (bool transposed)
 same function as getAbsRowSum() but implemented in CUDA More...
 
- Public Member Functions inherited from flexLinearOperator< T >
 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...
 

Additional Inherited Members

- Public Attributes inherited from flexLinearOperator< T >
linOp type
 type of linear operator More...
 
bool isMinus
 determines if operator is negated
 

Detailed Description

template<typename T>
class flexGradientOperator< T >

represents a gradient operator

Constructor & Destructor Documentation

◆ flexGradientOperator()

template<typename T >
flexGradientOperator< T >::flexGradientOperator ( std::vector< int >  AInputDimension,
int  aGradDirection,
gradientType  aType,
bool  aMinus 
)
inline

initializes the gradient operator

Parameters
AInputDimensionvector of dimensions
aGradDirectiondirection of gradient. 0 for first dimension and so on.
aTypetype of gradient. Possible values are forward, backward and central.
aMinusdetermines if operator is negated
See also
isMinus

Member Function Documentation

◆ copy()

template<typename T >
flexGradientOperator<T>* flexGradientOperator< T >::copy ( )
inlinevirtual

copies the linear operator

Returns
copy of linear operator

Implements flexLinearOperator< T >.

◆ getAbsRowSum()

template<typename T >
std::vector<T> flexGradientOperator< T >::getAbsRowSum ( bool  transposed)
inlinevirtual

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

Implements flexLinearOperator< T >.

◆ getAbsRowSumCUDA()

template<typename T >
thrust::device_vector<T> flexGradientOperator< T >::getAbsRowSumCUDA ( bool  transposed)
inlinevirtual

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

Implements flexLinearOperator< T >.

◆ getMaxRowSumAbs()

template<typename T >
T flexGradientOperator< T >::getMaxRowSumAbs ( bool  transposed)
inlinevirtual

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

Implements flexLinearOperator< T >.

◆ times()

template<typename T >
void flexGradientOperator< T >::times ( bool  transposed,
const Tdata &  input,
Tdata &  output 
)
inlinevirtual

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

Implements flexLinearOperator< T >.

◆ timesMinus()

template<typename T >
void flexGradientOperator< T >::timesMinus ( bool  transposed,
const Tdata &  input,
Tdata &  output 
)
inlinevirtual

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

Implements flexLinearOperator< T >.

◆ timesPlus()

template<typename T >
void flexGradientOperator< T >::timesPlus ( bool  transposed,
const Tdata &  input,
Tdata &  output 
)
inlinevirtual

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

Implements flexLinearOperator< T >.


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