template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
class cusp::dia_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >
View of a dia_matrix
.
- Template Parameters
-
ArrayType1 | Type of diagonal_offsets |
ArrayType2 | 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
dia_matrix_view
is a sparse matrix view of a matrix in DIA format constructed from existing data or iterators. All entries in the dia_matrix
are sorted according to row indices and internally within each row sorted by column indices.
- Note
- The diagonal offsets should not contain duplicate entries.
- Example
- The following code snippet demonstrates how to create a 4-by-3
dia_matrix_view
on the host with 3 diagonals and 6 nonzeros.
int main()
{
typedef typename IndexArray::view IndexArrayView;
typedef typename ValueArray::view ValueArrayView;
4,3,6,
}
Definition at line 35 of file dia_matrix.h.
#include <dia_matrix.h>
|
| dia_matrix_view (void) |
|
template<typename OtherArrayType1 , typename OtherArrayType2 > |
| dia_matrix_view (size_t num_rows, size_t num_cols, size_t num_entries, OtherArrayType1 &diagonal_offsets, OtherArrayType2 &values) |
|
template<typename OtherArrayType1 , typename OtherArrayType2 > |
| dia_matrix_view (size_t num_rows, size_t num_cols, size_t num_entries, const OtherArrayType1 &diagonal_offsets, const OtherArrayType2 &values) |
|
| dia_matrix_view (dia_matrix< IndexType, ValueType, MemorySpace > &matrix) |
|
| dia_matrix_view (const dia_matrix< IndexType, ValueType, MemorySpace > &matrix) |
|
| dia_matrix_view (dia_matrix_view &matrix) |
|
| dia_matrix_view (const dia_matrix_view &matrix) |
|
void | resize (const size_t num_rows, const size_t num_cols, const size_t num_entries, const size_t num_diagonals) |
|
void | resize (const size_t num_rows, const size_t num_cols, const size_t num_entries, const size_t num_diagonals, const size_t alignment) |
|
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
template<typename OtherArrayType1 , typename OtherArrayType2 >
cusp::dia_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::dia_matrix_view |
( |
size_t |
num_rows, |
|
|
size_t |
num_cols, |
|
|
size_t |
num_entries, |
|
|
OtherArrayType1 & |
diagonal_offsets, |
|
|
OtherArrayType2 & |
values |
|
) |
| |
|
inline |
Construct a dia_matrix_view
with a specific shape and number of nonzero entries from existing arrays denoting the diagonal offsets and values.
- Parameters
-
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
diagonal_offsets | Array containing the diagonal offsets. |
values | Array containing the values. |
Definition at line 361 of file dia_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
template<typename OtherArrayType1 , typename OtherArrayType2 >
cusp::dia_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::dia_matrix_view |
( |
size_t |
num_rows, |
|
|
size_t |
num_cols, |
|
|
size_t |
num_entries, |
|
|
const OtherArrayType1 & |
diagonal_offsets, |
|
|
const OtherArrayType2 & |
values |
|
) |
| |
|
inline |
Construct a dia_matrix_view
with a specific shape and number of nonzero entries from existing const arrays denoting the diagonal offsets and values.
- Parameters
-
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
diagonal_offsets | Array containing the diagonal offsets. |
values | Array containing the values. |
Definition at line 377 of file dia_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
void cusp::dia_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::resize |
( |
const size_t |
num_rows, |
|
|
const size_t |
num_cols, |
|
|
const size_t |
num_entries, |
|
|
const size_t |
num_diagonals |
|
) |
| |
Resize matrix dimensions and underlying storage
- Parameters
-
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
num_diagonals | Number of occupied diagonals. |
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
void cusp::dia_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::resize |
( |
const size_t |
num_rows, |
|
|
const size_t |
num_cols, |
|
|
const size_t |
num_entries, |
|
|
const size_t |
num_diagonals, |
|
|
const size_t |
alignment |
|
) |
| |
Resize matrix dimensions and underlying storage
- Parameters
-
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
num_diagonals | Number of occupied diagonals. |
alignment | Amount of padding used to align the data structure (default 32). |
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
diagonal_offsets_array_type cusp::dia_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::diagonal_offsets |
View of the diagonal_offsets of the DIA data structure.
Definition at line 339 of file dia_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename IndexType, typename ValueType, typename MemorySpace>
values_array_type cusp::dia_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::values |
View for the nonzero entries of the DIA data structure.
Definition at line 344 of file dia_matrix.h.