|
| | hyb_matrix_view (void) |
| |
| template<typename OtherMatrixType1 , typename OtherMatrixType2 > |
| | hyb_matrix_view (OtherMatrixType1 &ell, OtherMatrixType2 &coo) |
| |
| template<typename OtherMatrixType1 , typename OtherMatrixType2 > |
| | hyb_matrix_view (const OtherMatrixType1 &ell, const OtherMatrixType2 &coo) |
| |
| | hyb_matrix_view (hyb_matrix< IndexType, ValueType, MemorySpace > &matrix) |
| |
| | hyb_matrix_view (const hyb_matrix< IndexType, ValueType, MemorySpace > &matrix) |
| |
| | hyb_matrix_view (hyb_matrix_view &matrix) |
| |
| | hyb_matrix_view (const hyb_matrix_view &matrix) |
| |
| void | resize (size_t num_rows, size_t num_cols, size_t num_ell_entries, size_t num_coo_entries, size_t num_entries_per_row, size_t alignment=32) |
| |
template<typename MatrixType1, typename MatrixType2, typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
class cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >
View of a hyb_matrix.
- Template Parameters
-
| MatrixType1 | Type of ell |
| MatrixType2 | Type of coo |
| 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
hyb_matrix_view is a sparse matrix view of a hyb_matrix constructed from existing data or iterators. See ell_matrix and coo_matrix for format constraints.
- 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
hyb_matrix_view on the host with 6 nonzeros.
int main()
{
ell.column_indices(0,1) = 1;
ell.values(0,1) = 20;
ell.column_indices(1,0) = 1;
ell.values(1,0) = 50;
ell.column_indices(1,1) = X;
ell.values(1,1) = 0;
ell.column_indices(2,0) = 0;
ell.values(2,0) = 60;
ell.column_indices(2,1) = 2;
ell.values(2,1) = 70;
coo.row_indices[0] = 0;
coo.column_indices[0] = 2;
coo.values[0] = 30;
coo.row_indices[1] = 0;
coo.column_indices[1] = 3;
coo.values[1] = 40;
coo.row_indices[2] = 2;
coo.column_indices[2] = 3;
coo.values[2] = 80;
}
Coordinate (COO) representation a sparse matrix.
Packed row (ELLPACK/ITPACK) representation of a sparse matrix.
column_indices_array_type column_indices
void print(const Printable &p)
print a textual representation of an object
ell_matrix_view< ArrayType1, ArrayType2 > make_ell_matrix_view(size_t num_rows, size_t num_cols, size_t num_entries, ArrayType1 column_indices, ArrayType2 values)
coo_matrix_view< ArrayType1, ArrayType2, ArrayType3 > make_coo_matrix_view(const size_t num_rows, const size_t num_cols, const size_t num_entries, ArrayType1 row_indices, ArrayType2 column_indices, ArrayType3 values)
Hybrid ELL/COO matrix format.
Print textual representation of an object.
Definition at line 348 of file hyb_matrix.h.
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::hyb_matrix_view |
( |
void |
| ) |
|
|
inline |
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
template<typename OtherMatrixType1 , typename OtherMatrixType2 >
| cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::hyb_matrix_view |
( |
OtherMatrixType1 & |
ell, |
|
|
OtherMatrixType2 & |
coo |
|
) |
| |
|
inline |
Construct a hyb_matrix_view with a specific shape and number of nonzero entries from existing ell_matrix and coo_matrix matrices.
- Template Parameters
-
| OtherMatrixType1 | Type of ell_matrix used to construct view |
| OtherMatrixType2 | Type of coo_matrix used to construct view |
- Parameters
-
| ell | Matrix containing ELL portion of hyb_format. |
| coo | Matrix containing COO portion of hyb_format. |
Definition at line 396 of file hyb_matrix.h.
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
template<typename OtherMatrixType1 , typename OtherMatrixType2 >
| cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::hyb_matrix_view |
( |
const OtherMatrixType1 & |
ell, |
|
|
const OtherMatrixType2 & |
coo |
|
) |
| |
|
inline |
Construct a hyb_matrix_view with a specific shape and number of nonzero entries from existing const ell_matrix and const coo_matrix matrices.
- Template Parameters
-
| OtherMatrixType1 | Type of ell_matrix used to construct view |
| OtherMatrixType2 | Type of coo_matrix used to construct view |
- Parameters
-
| ell | Matrix containing ELL portion of hyb_format. |
| coo | Matrix containing COO portion of hyb_format. |
Definition at line 409 of file hyb_matrix.h.
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::hyb_matrix_view |
( |
hyb_matrix< IndexType, ValueType, MemorySpace > & |
matrix | ) |
|
|
inline |
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::hyb_matrix_view |
( |
const hyb_matrix< IndexType, ValueType, MemorySpace > & |
matrix | ) |
|
|
inline |
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::hyb_matrix_view |
( |
hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace > & |
matrix | ) |
|
|
inline |
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::hyb_matrix_view |
( |
const hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace > & |
matrix | ) |
|
|
inline |
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| void cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::resize |
( |
size_t |
num_rows, |
|
|
size_t |
num_cols, |
|
|
size_t |
num_ell_entries, |
|
|
size_t |
num_coo_entries, |
|
|
size_t |
num_entries_per_row, |
|
|
size_t |
alignment = 32 |
|
) |
| |
Resize matrix dimensions and underlying storage
- Parameters
-
| num_rows | Number of rows. |
| num_cols | Number of columns. |
| num_ell_entries | Number of nonzero matrix entries in the ELL portion. |
| num_coo_entries | Number of nonzero matrix entries in the ELL portion. |
| num_entries_per_row | Maximum number of nonzeros per row in the ELL portion. |
| alignment | Amount of padding used to align the ELL data structure (default 32). |
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| coo_matrix_type cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::coo |
View to the COO portion of the HYB structure.
Definition at line 380 of file hyb_matrix.h.
template<typename MatrixType1 , typename MatrixType2 , typename IndexType = typename MatrixType1::index_type, typename ValueType = typename MatrixType1::value_type, typename MemorySpace = typename cusp::minimum_space<typename MatrixType1::memory_space, typename MatrixType2::memory_space>::type>
| ell_matrix_type cusp::hyb_matrix_view< MatrixType1, MatrixType2, IndexType, ValueType, MemorySpace >::ell |
View to the ELL portion of the HYB structure.
Definition at line 376 of file hyb_matrix.h.