1 #ifndef flexLinearOperator_H 2 #define flexLinearOperator_H 15 typedef thrust::device_vector<T> Tdata;
17 typedef std::vector<T> Tdata;
34 flexLinearOperator(
int aNumRows,
int aNumCols,
linOp aType,
bool aIsMinus) : numRows(aNumRows), numCols(aNumCols), type(linearOp), isMinus(aIsMinus)
41 if (VERBOSE > 0) printf(
"Linear operator destructor");
86 this->isMinus = aIsMinus;
102 virtual void times(
bool transposed,
const Tdata &input, Tdata &output) = 0;
111 virtual void timesPlus(
bool transposed,
const Tdata &input, Tdata &output) = 0;
120 virtual void timesMinus(
bool transposed,
const Tdata &input, Tdata &output) = 0;
127 virtual std::vector<T>
getAbsRowSum(
bool transposed) = 0;
int getNumRows() const
returns number of rows of the linear operator
Definition: flexLinearOperator.h:57
bool isMinus
determines if operator is negated
Definition: flexLinearOperator.h:25
virtual T getMaxRowSumAbs(bool transposed)=0
returns the maximum sum of absolute values per row used for preconditioning
linOp type
type of linear operator
Definition: flexLinearOperator.h:24
int getNumCols() const
returns number of columns of the linear operator
Definition: flexLinearOperator.h:48
void setMinus(bool aIsMinus)
constrols if operator should be negated or not
Definition: flexLinearOperator.h:84
void setNumCols(int aNumCols)
sets the number of columns of the linear operator
Definition: flexLinearOperator.h:66
virtual void times(bool transposed, const Tdata &input, Tdata &output)=0
applies linear operator on vector
virtual void timesPlus(bool transposed, const Tdata &input, Tdata &output)=0
applies linear operator on vector and adds its result to y
virtual thrust::device_vector< T > getAbsRowSumCUDA(bool transposed)=0
same function as getAbsRowSum() but implemented in CUDA
void setNumRows(int aNumRows)
sets the number of rows of the linear operator
Definition: flexLinearOperator.h:75
virtual std::vector< T > getAbsRowSum(bool transposed)=0
returns a vector of sum of absolute values per row used for preconditioning
virtual flexLinearOperator< T > * copy()=0
copies the linear operator
flexLinearOperator(int aNumRows, int aNumCols, linOp aType, bool aIsMinus)
initializes the linear operator
Definition: flexLinearOperator.h:34
virtual void timesMinus(bool transposed, const Tdata &input, Tdata &output)=0
applies linear operator on vector and substracts its result from y
abstract base class for linear operators
Definition: flexLinearOperator.h:12