19 #include "../_definitions/debugging.h"
29 template <
typename DataType>
31 const DataType* A_data_,
36 const int num_gpu_devices_):
42 A(A_data_, A_indices_, A_index_pointer_, num_rows_, num_columns_,
60 template <
typename DataType>
62 const DataType* A_data_,
67 const DataType* B_data_,
70 const int num_gpu_devices_):
76 A(A_data_, A_indices_, A_index_pointer_, num_rows_, num_columns_,
78 B(B_data_, B_indices_, B_index_pointer_, num_rows_, num_columns_,
82 if (this->
B.is_identity_matrix())
97 template <
typename DataType>
123 template <
typename DataType>
125 const DataType* vector,
129 this->A.dot(vector, product);
133 if (this->B_is_identity)
136 ASSERT((this->parameters != NULL),
"Parameter is not set.");
140 (this->num_rows < this->num_columns) ? \
141 this->num_rows : this->num_columns;
144 this->_add_scaled_vector(vector, min_vector_size,
145 this->parameters[0], product);
150 ASSERT((this->parameters != NULL),
"Parameter is not set.");
153 this->B.dot_plus(vector, this->parameters[0], product);
179 template <
typename DataType>
181 const DataType* vector,
185 this->A.transpose_dot(vector, product);
189 if (this->B_is_identity)
192 ASSERT((this->parameters != NULL),
"Parameter is not set.");
196 (this->num_rows < this->num_columns) ? \
197 this->num_rows : this->num_columns;
200 this->_add_scaled_vector(vector, min_vector_size,
201 this->parameters[0], product);
206 ASSERT((this->parameters != NULL),
"Parameter is not set.");
209 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 void transpose_dot(const DataType *vector, DataType *product)
Computes the matrix vector product:
cuCSRMatrix< DataType > B
cuCSRAffineMatrixFunction(const DataType *A_data_, const LongIndexType *A_indices_, const LongIndexType *A_index_pointer_, const LongIndexType num_rows_, const LongIndexType num_columns_, const int num_gpu_devices_)
Constructor. Matrix B is assumed to be the identity matrix.
virtual ~cuCSRAffineMatrixFunction()
void initialize_cusparse_handle()
Creates a cusparseHandle_t object, if not created already.
#define ASSERT(condition, message)