1#ifndef _chi_math_sparse_matrix_h
2#define _chi_math_sparse_matrix_h
4#include "../chi_math.h"
33 void Insert(
size_t i,
size_t j,
double value);
34 void InsertAdd(
size_t i,
size_t j,
double value);
35 double ValueIJ(
size_t i,
size_t j)
const;
56 const size_t& column_id,
71 const size_t& column_id,
72 const double& in_value) :
117 RowIteratorContext
Row(
size_t row_id);
158 ConstRowIteratorContext
Row(
size_t row_id)
const;
205 EntriesIterator
begin();
206 EntriesIterator
end();
bool operator!=(const It &rhs) const
ConstEntryReference operator*()
const ConstRowIteratorContext & context_
bool operator==(const It &rhs) const
ConstRowIterator(const ConstRowIteratorContext &context, size_t ref_entry)
ConstRowIterator end() const
const std::vector< size_t > & ref_col_ids_
ConstRowIteratorContext(const SparseMatrix &matrix, size_t ref_row)
const std::vector< double > & ref_col_vals_
ConstRowIterator begin() const
EntriesIterator(SparseMatrix &context, size_t row)
bool operator==(const EIt &rhs) const
EntryReference operator*()
bool operator!=(const EIt &rhs) const
RowIterator(RowIteratorContext &context, size_t ref_entry)
bool operator==(const It &rhs) const
bool operator!=(const It &rhs) const
RowIteratorContext & context_
EntryReference operator*()
std::vector< double > & ref_col_vals_
RowIteratorContext(SparseMatrix &matrix, size_t ref_row)
const std::vector< size_t > & ref_col_ids_
size_t col_size_
Maximum number of columns for this matrix.
void Insert(size_t i, size_t j, double value)
std::string PrintStr() const
SparseMatrix(size_t num_rows, size_t num_cols)
RowIteratorContext Row(size_t row_id)
std::vector< std::vector< double > > rowI_values_
void CheckInitialized() const
void InsertAdd(size_t i, size_t j, double value)
double ValueIJ(size_t i, size_t j) const
virtual ~SparseMatrix()=default
std::vector< std::vector< size_t > > rowI_indices_
size_t row_size_
Maximum number of rows for this matrix.
void SetDiagonal(const std::vector< double > &diag)
const size_t & column_index
ConstEntryReference(const size_t &row_id, const size_t &column_id, const double &in_value)
EntryReference(const size_t &row_id, const size_t &column_id, double &in_value)
const size_t & column_index