Template Class COO

Inheritance Relationships

Base Type

Class Documentation

template<typename IDType, typename NNZType, typename ValueType>
class sparsebase::format::COO : public sparsebase::utils::IdentifiableImplementation<COO<IDType, NNZType, ValueType>, FormatOrderTwo<IDType, NNZType, ValueType>>

Coordinate List Sparse Data Format.

Coordinate List format keeps 3 arrays row, col, vals. The i-th element is at the coordinate row[i], col[i] in the matrix. The value for the i-th element is vals[i].

N. Sato and W. F. Tinney, “Techniques for Exploiting the Sparsity or the

Network Admittance Matrix,” in IEEE Transactions on Power Apparatus and Systems, vol. 82, no. 69, pp. 944-950, Dec. 1963, doi: 10.1109/TPAS.1963.291477.

tparam IDType

type used for the dimensions

tparam NNZType

type used for non-zeros and the number of non-zeros

tparam ValueType

type used for the stored values

Public Functions

COO(IDType n, IDType m, NNZType nnz, IDType *row, IDType *col, ValueType *vals, Ownership own = kNotOwned, bool ignore_sort = false)
COO(const COO<IDType, NNZType, ValueType>&)
COO(COO<IDType, NNZType, ValueType>&&)
COO<IDType, NNZType, ValueType> &operator=(const COO<IDType, NNZType, ValueType>&)
Format *Clone() const override
virtual ~COO()
IDType *get_col() const
IDType *get_row() const
ValueType *get_vals() const
IDType *release_col()
IDType *release_row()
ValueType *release_vals()
void set_row(IDType*, Ownership own = kNotOwned)
void set_col(IDType*, Ownership own = kNotOwned)
void set_vals(ValueType*, Ownership own = kNotOwned)
virtual bool RowIsOwned()
virtual bool ColIsOwned()
virtual bool ValsIsOwned()

Protected Attributes

std::unique_ptr<IDType, std::function<void(IDType*)>> col_
std::unique_ptr<IDType, std::function<void(IDType*)>> row_
std::unique_ptr<ValueType, std::function<void(ValueType*)>> vals_