|
| | triplet_form ()=default |
| |
| | triplet_form (const triplet_form &) |
| |
| | triplet_form (triplet_form &&) noexcept |
| |
| triplet_form & | operator= (const triplet_form &) |
| |
| triplet_form & | operator= (triplet_form &&) noexcept |
| |
| | ~triplet_form ()=default |
| |
| | triplet_form (const index_t in_rows, const index_t in_cols, const index_t in_elem=index_t(0)) |
| |
| template<sp_d in_dt> |
| | triplet_form (const SpMat< in_dt > &) |
| |
| template<sp_d in_dt, sp_i in_it> |
| | triplet_form (triplet_form< in_dt, in_it > &, SparseBase=SparseBase::ZERO, bool=false) |
| |
| template<sp_d in_dt, sp_i in_it> |
| | triplet_form (triplet_form< in_dt, in_it > &&in_mat, const SparseBase in_base=SparseBase::ZERO, const bool in_full=false) |
| |
| const index_t * | row_mem () const |
| |
| const index_t * | col_mem () const |
| |
| const data_t * | val_mem () const |
| |
| index_t * | row_mem () |
| |
| index_t * | col_mem () |
| |
| data_t * | val_mem () |
| |
| index_t | row (const index_t I) const |
| |
| index_t | col (const index_t I) const |
| |
| data_t | val (const index_t I) const |
| |
| bool | is_csr_sorted () const |
| |
| bool | is_csc_sorted () const |
| |
| bool | is_empty () const |
| |
| data_t | max () const |
| |
| void | zeros () |
| |
| void | init (const index_t in_elem) |
| |
| void | init (const index_t in_rows, const index_t in_cols, const index_t in_elem) |
| |
| data_t | operator() (const index_t row, const index_t col) const |
| |
| data_t & | at (index_t, index_t) |
| |
| auto | nullify (const index_t idx) |
| |
| void | hack_size (const index_t in_elem) |
| | Adjusts the size of the container by reserving space and updating the element count.
|
| |
| void | print () const |
| |
| void | save (const std::string &) const |
| | Saves the triplet form matrix to a file.
|
| |
| void | csr_sort () |
| | Sorts the COO format into the CSR (Compressed Sparse Row) order.
|
| |
| void | csc_sort () |
| | Sorts the COO format into the CSC (Compressed Sparse Column) order.
|
| |
| void | csr_condense () |
| |
| void | csc_condense () |
| |
| void | full_csr_condense () |
| |
| void | full_csc_condense () |
| |
| void | assemble (const Mat< data_t > &, const Col< uword > &) |
| |
| template<sp_d in_dt, sp_i in_it> |
| void | assemble (const triplet_form< in_dt, in_it > &, index_t, index_t, data_t) |
| |
| template<sp_d in_dt, sp_i in_it> |
| void | assemble (const triplet_form< in_dt, in_it > &in_mat, const std::vector< index_t > &row_shift, const std::vector< index_t > &col_shift, const std::vector< data_t > &scalar) |
| |
| Mat< data_t > | operator* (const Col< data_t > &in_mat) const |
| |
| Mat< data_t > | operator* (const Mat< data_t > &in_mat) const |
| |
| template<sp_d T2> |
| triplet_form | operator* (T2) const |
| |
| template<sp_d T2> |
| triplet_form | operator/ (T2) const |
| |
| template<sp_d T2> |
| triplet_form & | operator*= (T2) |
| |
| template<sp_d T2> |
| triplet_form & | operator/= (T2) |
| |
| triplet_form | operator+ (const triplet_form &in_mat) const |
| |
| triplet_form | operator- (const triplet_form &in_mat) const |
| |
| triplet_form & | operator+= (const triplet_form &) |
| |
| triplet_form & | operator-= (const triplet_form &) |
| |
| Col< data_t > | diag () const |
| |
| triplet_form | diagonal () const |
| |
| triplet_form | strictly_upper () const |
| |
| triplet_form | strictly_lower () const |
| |
| triplet_form | upper () const |
| |
| triplet_form | lower () const |
| |
| template<sp_d T2> |
| triplet_form< data_t, index_t > | operator* (const T2 scalar) const |
| |
| template<sp_d T2> |
| triplet_form< data_t, index_t > | operator/ (const T2 scalar) const |
| |
| template<sp_d T2> |
| triplet_form< data_t, index_t > & | operator*= (const T2 scalar) |
| |
| template<sp_d T2> |
| triplet_form< data_t, index_t > & | operator/= (const T2 scalar) |
| |
| void triplet_form< data_t, index_t >::hack_size |
( |
const index_t |
in_elem | ) |
|
|
inline |
Adjusts the size of the container by reserving space and updating the element count.
This function reserves memory for the specified number of elements and updates the internal element count to match the provided value.
This function is dangerous and should be used with caution. It does not initialize the new elements, and the caller needs to fill them with valid data. Otherwise, the behavior is undefined.
- Parameters
-
| in_elem | The number of elements to reserve and set as the new size. |
| void triplet_form< data_t, index_t >::save |
( |
const std::string & |
file_name | ) |
const |
Saves the triplet form matrix to a file.
This function writes the matrix data stored in triplet form to a file. The file will contain the number of rows, columns, and non-zero elements on the first line, followed by the row indices, column indices, and values of the non-zero elements on subsequent lines. This follows the Matrix Market (MTX) format.
- Template Parameters
-
| data_t | The data type of the matrix values. |
| index_t | The data type of the row and column indices. |
- Parameters
-
| file_name | The name of the file to save the matrix to. |
- Note
- If the file cannot be opened, the function will return without performing any operation.