Coordinate (COO) representation a sparse matrix.
IndexType | Type used for matrix indices (e.g. int ). |
ValueType | Type used for matrix values (e.g. float ). |
MemorySpace | A memory space (e.g. cusp::host_memory or cusp::device_memory ) |
coo_matrix
is a sparse matrix container that stores one row and column entry per nonzero. The matrix may reside in either "host" or "device" memory depending on the MemorySpace. All entries in the coo_matrix
are sorted according to row indices and internally within each row sorted by column indices.coo_matrix
on the host with 6 nonzeros and then copies the matrix to the device.Definition at line 106 of file coo_matrix.h.
#include <coo_matrix.h>
Public Methods | |
coo_matrix (void) | |
coo_matrix (const size_t num_rows, const size_t num_cols, const size_t num_entries) | |
template<typename MatrixType > | |
coo_matrix (const MatrixType &matrix) | |
void | resize (size_t num_rows, size_t num_cols, size_t num_entries) |
void | swap (coo_matrix &matrix) |
template<typename MatrixType > | |
coo_matrix & | operator= (const MatrixType &matrix) |
void | sort_by_row (void) |
void | sort_by_row_and_column (void) |
bool | is_sorted_by_row (void) |
bool | is_sorted_by_row_and_column (void) |
Public Members | |
row_indices_array_type | row_indices |
column_indices_array_type | column_indices |
values_array_type | values |
|
inline |
Construct an empty coo_matrix
.
Definition at line 157 of file coo_matrix.h.
|
inline |
Construct a coo_matrix
with a specific shape and number of nonzero entries.
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
Definition at line 165 of file coo_matrix.h.
cusp::coo_matrix< IndexType, ValueType, MemorySpace >::coo_matrix | ( | const MatrixType & | matrix | ) |
Construct a coo_matrix
from another matrix.
matrix | Another sparse or dense matrix. |
bool cusp::coo_matrix< IndexType, ValueType, MemorySpace >::is_sorted_by_row | ( | void | ) |
Determine whether matrix elements are sorted by row index
false
, if the row indices are unsorted; true
, otherwise. bool cusp::coo_matrix< IndexType, ValueType, MemorySpace >::is_sorted_by_row_and_column | ( | void | ) |
Determine whether matrix elements are sorted by row and column index
false
, if the row and column indices are unsorted; true
, otherwise. coo_matrix& cusp::coo_matrix< IndexType, ValueType, MemorySpace >::operator= | ( | const MatrixType & | matrix | ) |
Assignment from another matrix.
matrix | Another sparse or dense matrix. |
coo_matrix
constructed from existing matrix. void cusp::coo_matrix< IndexType, ValueType, MemorySpace >::resize | ( | size_t | num_rows, |
size_t | num_cols, | ||
size_t | num_entries | ||
) |
Resize matrix dimensions and underlying storage
void cusp::coo_matrix< IndexType, ValueType, MemorySpace >::sort_by_row | ( | void | ) |
Sort matrix elements by row index
void cusp::coo_matrix< IndexType, ValueType, MemorySpace >::sort_by_row_and_column | ( | void | ) |
Sort matrix elements by row and column index
void cusp::coo_matrix< IndexType, ValueType, MemorySpace >::swap | ( | coo_matrix< IndexType, ValueType, MemorySpace > & | matrix | ) |
Swap the contents of two coo_matrix
objects.
matrix | Another coo_matrix with the same IndexType and ValueType. |
column_indices_array_type cusp::coo_matrix< IndexType, ValueType, MemorySpace >::column_indices |
Storage for the column indices of the COO data structure.
Definition at line 149 of file coo_matrix.h.
row_indices_array_type cusp::coo_matrix< IndexType, ValueType, MemorySpace >::row_indices |
Storage for the row indices of the COO data structure.
Definition at line 145 of file coo_matrix.h.
values_array_type cusp::coo_matrix< IndexType, ValueType, MemorySpace >::values |
Storage for the nonzero entries of the COO data structure.
Definition at line 153 of file coo_matrix.h.