18 #include "../_c_basic_algebra/c_matrix_operations.h"
25 template <
typename DataType>
37 template <
typename DataType>
49 A_is_row_major(A_is_row_major_)
59 template <
typename DataType>
78 template <
typename DataType>
82 DataType matrix_element;
87 for (
LongIndexType column=0; column < this-> num_columns; ++column)
90 if (this->A_is_row_major)
92 matrix_element = this->A[row * this->num_columns + column];
96 matrix_element = this->A[column * this->num_rows + row];
100 if ((row == column) && (matrix_element != 1.0))
102 matrix_is_identity = 0;
103 return matrix_is_identity;
105 else if (matrix_element != 0.0)
107 matrix_is_identity = 0;
108 return matrix_is_identity;
113 return matrix_is_identity;
121 template <
typename DataType>
123 const DataType* vector,
131 this->A_is_row_major,
140 template <
typename DataType>
142 const DataType* vector,
143 const DataType alpha,
152 this->A_is_row_major,
161 template <
typename DataType>
163 const DataType* vector,
171 this->A_is_row_major,
180 template <
typename DataType>
182 const DataType* vector,
183 const DataType alpha,
192 this->A_is_row_major,
virtual void transpose_dot_plus(const DataType *vector, const DataType alpha, DataType *product)
virtual FlagType is_identity_matrix() const
Checks whether the matrix is identity.
virtual void dot_plus(const DataType *vector, const DataType alpha, DataType *product)
virtual void transpose_dot(const DataType *vector, DataType *product)
virtual void dot(const DataType *vector, DataType *product)
Base class for linear operators. This class serves as interface for all derived classes.
static void dense_transposed_matvec_plus(const DataType *A, const DataType *b, const DataType alpha, const LongIndexType num_rows, const LongIndexType num_columns, const FlagType A_is_row_major, DataType *c)
Computes where is dense, and is the transpose of the matrix .
static void dense_transposed_matvec(const DataType *A, const DataType *b, const LongIndexType num_rows, const LongIndexType num_columns, const FlagType A_is_row_major, DataType *c)
Computes matrix vector multiplication where is dense, and is the transpose of the matrix .
static void dense_matvec_plus(const DataType *A, const DataType *b, const DataType alpha, const LongIndexType num_rows, const LongIndexType num_columns, const FlagType A_is_row_major, DataType *c)
Computes the operation where is a dense matrix.
static void dense_matvec(const DataType *A, const DataType *b, const LongIndexType num_rows, const LongIndexType num_columns, const FlagType A_is_row_major, DataType *c)
Computes the matrix vector multiplication where is a dense matrix.