1 #ifndef flexZeroOperator_H 2 #define flexZeroOperator_H 5 #include "flexLinearOperator.h" 13 typedef thrust::device_vector<T> Tdata;
15 typedef std::vector<T> Tdata;
36 void times(
bool transposed,
const Tdata &input, Tdata &output)
38 vectorScalarSet(output, (T)0);
41 void timesPlus(
bool transposed,
const Tdata &input, Tdata &output){}
43 void timesMinus(
bool transposed,
const Tdata &input, Tdata &output){}
47 return static_cast<T
>(1);
52 std::vector<T> result;
54 result = std::vector<T>(this->
getNumCols(),(T)0);
56 result = std::vector<T>(this->
getNumRows(),(T)0);
int getNumRows() const
returns number of rows of the linear operator
Definition: flexLinearOperator.h:57
T getMaxRowSumAbs(bool transposed)
returns the maximum sum of absolute values per row used for preconditioning
Definition: flexZeroOperator.h:45
bool isMinus
determines if operator is negated
Definition: flexLinearOperator.h:25
int getNumCols() const
returns number of columns of the linear operator
Definition: flexLinearOperator.h:48
flexZeroOperator(int aNumRows, int aNumCols, bool aMinus)
initializes the zero operator
Definition: flexZeroOperator.h:25
thrust::device_vector< T > getAbsRowSumCUDA(bool transposed)
same function as getAbsRowSum() but implemented in CUDA
Definition: flexZeroOperator.h:63
void timesMinus(bool transposed, const Tdata &input, Tdata &output)
applies linear operator on vector and substracts its result from y
Definition: flexZeroOperator.h:43
void timesPlus(bool transposed, const Tdata &input, Tdata &output)
applies linear operator on vector and adds its result to y
Definition: flexZeroOperator.h:41
std::vector< T > getAbsRowSum(bool transposed)
returns a vector of sum of absolute values per row used for preconditioning
Definition: flexZeroOperator.h:50
represents a zero operator (empty matrix)
Definition: flexZeroOperator.h:9
void times(bool transposed, const Tdata &input, Tdata &output)
applies linear operator on vector
Definition: flexZeroOperator.h:36
abstract base class for linear operators
Definition: flexLinearOperator.h:12
flexZeroOperator< T > * copy()
copies the linear operator
Definition: flexZeroOperator.h:27