template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
class cusp::ell_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >
View of a ell_matrix
.
- Template Parameters
-
ArrayType1 | Type of column_indices array view |
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
- Note
- The matrix entries must be sorted by column index.
-
The matrix entries within each row should be shifted to the left.
-
The matrix should not contain duplicate entries.
- Example
- The following code snippet demonstrates how to create a 4-by-3
ell_matrix_view
on the host with 3 nonzeros per row.
int main()
{
typedef typename IndexArray::view IndexArrayView;
typedef typename ValueArray::view ValueArrayView;
4,3,6,
}
Definition at line 318 of file ell_matrix.h.
#include <ell_matrix.h>
|
| ell_matrix_view (void) |
|
template<typename OtherArrayType1 , typename OtherArrayType2 > |
| ell_matrix_view (const size_t num_rows, const size_t num_cols, const size_t num_entries, const OtherArrayType1 &column_indices, const OtherArrayType2 &values) |
|
| ell_matrix_view (ell_matrix< IndexType, ValueType, MemorySpace > &matrix) |
|
| ell_matrix_view (const ell_matrix< IndexType, ValueType, MemorySpace > &matrix) |
|
| ell_matrix_view (ell_matrix_view &matrix) |
|
| ell_matrix_view (const ell_matrix_view &matrix) |
|
void | resize (size_t num_rows, size_t num_cols, size_t num_entries, size_t num_entries_per_row) |
|
void | resize (size_t num_rows, size_t num_cols, size_t num_entries, size_t num_entries_per_row, size_t alignment) |
|
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
template<typename OtherArrayType1 , typename OtherArrayType2 >
cusp::ell_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::ell_matrix_view |
( |
const size_t |
num_rows, |
|
|
const size_t |
num_cols, |
|
|
const size_t |
num_entries, |
|
|
const OtherArrayType1 & |
column_indices, |
|
|
const OtherArrayType2 & |
values |
|
) |
| |
|
inline |
Construct a ell_matrix_view
with a specific shape and number of nonzero entries from existing arrays denoting the column indices and values.
- Parameters
-
num_rows | Number of rows. |
num_cols | Number of columns. |
num_entries | Number of nonzero matrix entries. |
column_indices | Array containing the column indices. |
values | Array containing the values. |
Definition at line 368 of file ell_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
void cusp::ell_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::resize |
( |
size_t |
num_rows, |
|
|
size_t |
num_cols, |
|
|
size_t |
num_entries, |
|
|
size_t |
num_entries_per_row |
|
) |
| |
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_entries_per_row | Maximum number of nonzeros per row. |
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
void cusp::ell_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::resize |
( |
size_t |
num_rows, |
|
|
size_t |
num_cols, |
|
|
size_t |
num_entries, |
|
|
size_t |
num_entries_per_row, |
|
|
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_entries_per_row | Maximum number of nonzeros per row. |
alignment | Amount of padding used to align the data structure (default 32). |
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
column_indices_array_type cusp::ell_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::column_indices |
View to column indices of the ELL data structure.
Definition at line 346 of file ell_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
const IndexType cusp::ell_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::invalid_index = container::invalid_index |
|
static |
Value used to pad the rows of the column_indices array.
Definition at line 341 of file ell_matrix.h.
template<typename ArrayType1, typename ArrayType2, typename IndexType = typename ArrayType1::value_type, typename ValueType = typename ArrayType2::value_type, typename MemorySpace = typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type>
values_array_type cusp::ell_matrix_view< ArrayType1, ArrayType2, IndexType, ValueType, MemorySpace >::values |
View to nonzero entries of the ELL data structure.
Definition at line 351 of file ell_matrix.h.