|
|
| sparse_csr_mat (const sparse_csr_mat &other) |
| |
|
| sparse_csr_mat (sparse_csr_mat &&)=delete |
| |
|
sparse_csr_mat & | operator= (const sparse_csr_mat &)=delete |
| |
|
sparse_csr_mat & | operator= (sparse_csr_mat &&)=default |
| |
|
| sparse_csr_mat (const IT n, const IT nnz, IT *const row_ptr, IT *const col_idx, DT *const data) |
| |
| template<data_t DT2, index_t IT2> |
| | sparse_csr_mat (const sparse_coo_mat< DT2, IT2 > &coo, const bool one_based=false, const bool full=false) |
| |
| template<data_t DT2, index_t IT2> |
| auto | condense (const sparse_coo_mat< DT2, IT2 > &coo, const std::vector< IT2 > &index, const bool one_based, const bool full) |
| |
| auto | insert_missing_diagonals (const IT shift) |
| |
|
auto | is_valid () |
| |
|
|
IT | n {} |
| |
|
IT | nnz {} |
| |
|
IT * | row_ptr {nullptr} |
| |
|
IT * | col_idx {nullptr} |
| |
|
DT * | data {nullptr} |
| |
|
std::vector< IT > | row_storage |
| |
|
std::vector< IT > | col_storage |
| |
|
std::vector< DT > | data_storage |
| |
◆ sparse_csr_mat()
template<data_t DT, index_t IT>
template<data_t DT2, index_t IT2>
Construct a CSR matrix from a COO matrix. The input matrix will be sorted, duplicated entries will be summed.
- Parameters
-
| coo | The input matrix in the COO format. |
| one_based | Indicate if the input matrix uses one based indexing (if true) or zero based indexing (if false). This flag will be used to generate correct row indexing. |
| full | Some solvers require diagonal entries to be explicitly present even if they are trivial, if true, all diagonal entries will be explicitly set regardless of the actual values. |
◆ condense()
template<data_t DT, index_t IT>
template<data_t DT2, index_t IT2>
Sum duplicated entries, drop trivial entries and build the row pointer in a single pass.
- Parameters
-
| coo | The input matrix in the COO format. |
| index | The permutation that sorts the COO entries by row then by column. |
| one_based | Indicate if the input matrix uses one based indexing. |
| full | If true, explicitly present diagonal entries are kept even if they are trivial. |
◆ insert_missing_diagonals()
template<data_t DT, index_t IT>
Ensure every diagonal entry is explicitly present. The main pass above can only keep a diagonal entry that already appears (with any value, including a trivial one) in the input COO matrix. If a diagonal entry is entirely absent from the input, it must be synthesized here with a value of zero, as documented for the full flag.
- Parameters
-
| shift | The indexing shift (0 or 1) used for row/col pointers. |
The documentation for this struct was generated from the following file: