19 #include "../_definitions/debugging.h"
29 template <
typename DataType>
35 const int num_gpu_devices_):
41 A(A_, num_rows_, num_columns_, A_is_row_major_, num_gpu_devices_)
58 template <
typename DataType>
66 const int num_gpu_devices_):
72 A(A_, num_rows_, num_columns_, A_is_row_major_, num_gpu_devices_),
73 B(B_, num_rows_, num_columns_, B_is_row_major_, num_gpu_devices_)
76 if (this->
B.is_identity_matrix())
91 template <
typename DataType>
117 template <
typename DataType>
119 const DataType* vector,
123 this->A.dot(vector, product);
127 if (this->B_is_identity)
130 ASSERT((this->parameters != NULL),
"Parameter is not set.");
134 (this->num_rows < this->num_columns) ? \
135 this->num_rows : this->num_columns;
138 this->_add_scaled_vector(vector, min_vector_size,
139 this->parameters[0], product);
144 ASSERT((this->parameters != NULL),
"Parameter is not set.");
147 this->B.dot_plus(vector, this->parameters[0], product);
173 template <
typename DataType>
175 const DataType* vector,
179 this->A.transpose_dot(vector, product);
183 if (this->B_is_identity)
186 ASSERT((this->parameters != NULL),
"Parameter is not set.");
190 (this->num_rows < this->num_columns) ? \
191 this->num_rows : this->num_columns;
194 this->_add_scaled_vector(vector, min_vector_size,
195 this->parameters[0], product);
200 ASSERT((this->parameters != NULL),
"Parameter is not set.");
203 this->B.transpose_dot_plus(vector, this->parameters[0], product);
Base class for linear operators. This class serves as interface for all derived classes.
FlagType eigenvalue_relation_known
virtual void dot(const DataType *vector, DataType *product)
Computes the matrix vector product:
virtual ~cuDenseAffineMatrixFunction()
cuDenseAffineMatrixFunction(const DataType *A_, const FlagType A_is_row_major_, const LongIndexType num_rows_, const LongIndexType num_colums_, const int num_gpu_devices_)
Constructor. Matrix B is assumed to be the identity matrix.
cuDenseMatrix< DataType > B
virtual void transpose_dot(const DataType *vector, DataType *product)
Computes the matrix vector product:
void initialize_cublas_handle()
Creates a cublasHandle_t object, if not created already.
#define ASSERT(condition, message)