template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
class cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >
View of a csr_matrix
.
- Template Parameters
-
ArrayType1 | Type of row_offsets array view |
ArrayType2 | Type of column_indices array view |
ArrayType3 | Type of values array view |
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 ) |
- Overview
- A
csr_matrix_view
is a sparse matrix view of a matrix in CSR format constructed from existing data or iterators. All entries in the csr_matrix
are sorted according to rows and internally within each row sorted by column indices.
- Note
- The matrix entries must be sorted by row index.
-
The matrix should not contain duplicate entries.
- Example
- The following code snippet demonstrates how to create a 4-by-3
csr_matrix_view
on the host with 6 nonzeros.
int main()
{
typedef typename IndexArray::view IndexArrayView;
typedef typename ValueArray::view ValueArrayView;
4,3,6,
}
- Examples:
- csr_raw.cu, and csr_view.cu.
Definition at line 34 of file csr_matrix.h.
#include <csr_matrix.h>
|
| csr_matrix_view (void) |
|
| csr_matrix_view (const size_t num_rows, const size_t num_cols, const size_t num_entries, ArrayType1 row_offsets, ArrayType2 column_indices, ArrayType3 values) |
|
| csr_matrix_view (csr_matrix< IndexType, ValueType, MemorySpace > &matrix) |
|
| csr_matrix_view (const csr_matrix< IndexType, ValueType, MemorySpace > &matrix) |
|
| csr_matrix_view (csr_matrix_view &matrix) |
|
| csr_matrix_view (const csr_matrix_view &matrix) |
|
void | resize (const size_t num_rows, const size_t num_cols, const size_t num_entries) |
|
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >::csr_matrix_view |
( |
const size_t |
num_rows, |
|
|
const size_t |
num_cols, |
|
|
const size_t |
num_entries, |
|
|
ArrayType1 |
row_offsets, |
|
|
ArrayType2 |
column_indices, |
|
|
ArrayType3 |
values |
|
) |
| |
|
inline |
Construct a csr_matrix_view
with a specific shape and number of nonzero entries from existing arrays denoting the row offsets, column indices, and values.
- Parameters
-
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
row_offsets | Array containing the row offsets. |
column_indices | Array containing the column indices. |
values | Array containing the values. |
Definition at line 352 of file csr_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >::csr_matrix_view |
( |
csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace > & |
matrix | ) |
|
|
inline |
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >::csr_matrix_view |
( |
const csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace > & |
matrix | ) |
|
|
inline |
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
void cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >::resize |
( |
const size_t |
num_rows, |
|
|
const size_t |
num_cols, |
|
|
const size_t |
num_entries |
|
) |
| |
Resize matrix dimensions and underlying storage
- Parameters
-
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
column_indices_array_type cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >::column_indices |
View of the column indices of the CSR data structure.
Definition at line 328 of file csr_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
row_offsets_array_type cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >::row_offsets |
View of the row_offsets of the CSR data structure.
Definition at line 323 of file csr_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename ArrayType3, typename IndexType, typename ValueType, typename MemorySpace>
values_array_type cusp::csr_matrix_view< ArrayType1, ArrayType2, ArrayType3, IndexType, ValueType, MemorySpace >::values |
View for the nonzero entries of the CSR data structure.
Definition at line 333 of file csr_matrix.h.