18 #include "../_c_basic_algebra/c_matrix_operations.h"
25 template <
typename DataType>
38 template <
typename DataType>
40 const DataType* A_data_,
51 A_indices(A_indices_),
52 A_index_pointer(A_index_pointer_)
61 template <
typename DataType>
80 template <
typename DataType>
90 for (index_pointer=this->A_index_pointer[row];
91 index_pointer < this->A_index_pointer[row+1];
94 column = this->A_indices[index_pointer];
96 if ((row == column) && \
97 (this->A_data[index_pointer] != 1.0))
99 matrix_is_identity = 0;
100 return matrix_is_identity;
102 else if (this->A_data[index_pointer] != 0.0)
104 matrix_is_identity = 0;
105 return matrix_is_identity;
110 return matrix_is_identity;
126 template <
typename DataType>
129 return this->A_index_pointer[this->num_rows];
137 template <
typename DataType>
139 const DataType* vector,
145 this->A_index_pointer,
156 template <
typename DataType>
158 const DataType* vector,
159 const DataType alpha,
165 this->A_index_pointer,
177 template <
typename DataType>
179 const DataType* vector,
185 this->A_index_pointer,
197 template <
typename DataType>
199 const DataType* vector,
200 const DataType alpha,
206 this->A_index_pointer,
virtual void transpose_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)
LongIndexType get_nnz() const
Returns the number of non-zero elements of the sparse matrix.
virtual FlagType is_identity_matrix() const
Checks whether the matrix is identity.
virtual void dot_plus(const DataType *vector, const DataType alpha, DataType *product)
Base class for linear operators. This class serves as interface for all derived classes.
static void csr_transposed_matvec(const DataType *A_data, const LongIndexType *A_column_indices, const LongIndexType *A_index_pointer, const DataType *b, const LongIndexType num_rows, const LongIndexType num_columns, DataType *c)
Computes where is compressed sparse row (CSR) matrix and is a dense vector. The output is a dense...
static void csr_matvec(const DataType *A_data, const LongIndexType *A_column_indices, const LongIndexType *A_index_pointer, const DataType *b, const LongIndexType num_rows, DataType *c)
Computes where is compressed sparse row (CSR) matrix and is a dense vector. The output is a dense...
static void csr_matvec_plus(const DataType *A_data, const LongIndexType *A_column_indices, const LongIndexType *A_index_pointer, const DataType *b, const DataType alpha, const LongIndexType num_rows, DataType *c)
Computes where is compressed sparse row (CSR) matrix and is a dense vector. The output is a dense...
static void csr_transposed_matvec_plus(const DataType *A_data, const LongIndexType *A_column_indices, const LongIndexType *A_index_pointer, const DataType *b, const DataType alpha, const LongIndexType num_rows, DataType *c)
Computes where is compressed sparse row (CSR) matrix and is a dense vector. The output is a dense...