23#include <cusp/detail/config.h>
25#include <cusp/detail/format.h>
26#include <cusp/detail/matrix_base.h>
34template<
typename RowArray,
typename ColumnArray,
typename ValueArray,
typename FormatTag =
void>
40template <
typename ArrayType1,
115template <
typename IndexType,
typename ValueType,
class MemorySpace>
116class coo_matrix :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format>
120 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format> Parent;
132 typename row_indices_array_type::view,
133 typename column_indices_array_type::view,
134 typename values_array_type::view,
135 IndexType, ValueType, MemorySpace> view;
138 typename row_indices_array_type::const_view,
139 typename column_indices_array_type::const_view,
140 typename values_array_type::const_view,
141 IndexType, ValueType, MemorySpace> const_view;
143 typedef view coo_view_type;
144 typedef const_view
const const_coo_view_type;
146 template<
typename MemorySpace2>
175 coo_matrix(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries)
176 : Parent(num_rows, num_cols, num_entries),
185 template <
typename MatrixType>
190 void resize(
size_t num_rows,
size_t num_cols,
size_t num_entries);
203 template <
typename MatrixType>
308template <
typename ArrayType1,
311 typename IndexType =
typename ArrayType2::value_type,
312 typename ValueType =
typename ArrayType3::value_type,
313 typename MemorySpace =
typename cusp::minimum_space<
314 typename ArrayType1::memory_space,
315 typename ArrayType2::memory_space,
316 typename ArrayType3::memory_space>::type >
317class coo_matrix_view :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format>
321 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format> Parent;
326 typedef ArrayType1 row_indices_array_type;
327 typedef ArrayType2 column_indices_array_type;
328 typedef ArrayType3 values_array_type;
334 typedef view coo_view_type;
335 typedef view
const const_coo_view_type;
376 const size_t num_cols,
377 const size_t num_entries,
381 : Parent(num_rows, num_cols, num_entries),
433 template<
typename MatrixType>
441 template<
typename MatrixType>
450 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries);
477 template<
typename MatrixType>
484 template<
typename MatrixType>
491 template<
typename MatrixType>
498 template<
typename MatrixType>
520template <
typename ArrayType1,
525 const size_t num_cols,
526 const size_t num_entries,
527 ArrayType1 row_indices,
528 ArrayType2 column_indices,
532 view(num_rows, num_cols, num_entries, row_indices, column_indices, values);
553template <
typename ArrayType1,
558 typename MemorySpace>
559coo_matrix_view<ArrayType1,ArrayType2,ArrayType3,IndexType,ValueType,MemorySpace>
575template <
typename MatrixType>
576typename MatrixType::coo_view_type
579 typedef typename MatrixType::coo_view_type View;
594template <
typename MatrixType>
595typename MatrixType::const_coo_view_type
598 typedef typename MatrixType::const_coo_view_type View;
608#include <cusp/detail/type_traits.h>
1D array of elements that may reside in "host" or "device" memory space
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
void construct_from(MatrixType &matrix, hyb_format)
void construct_from(MatrixType &matrix, dia_format)
coo_matrix_view(MatrixType &matrix)
coo_matrix_view(view &matrix)
coo_matrix_view(const view &matrix)
coo_matrix_view(const coo_matrix< IndexType, ValueType, MemorySpace > &matrix)
bool is_sorted_by_row_and_column(void)
void sort_by_row_and_column(void)
row_indices_array_type row_indices
coo_matrix_view(coo_matrix< IndexType, ValueType, MemorySpace > &matrix)
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)
void construct_from(MatrixType &matrix, ell_format)
cusp::array1d< typename ::cuda::std::remove_const< IndexType >::type, MemorySpace > indices
void resize(const size_t num_rows, const size_t num_cols, const size_t num_entries)
void construct_from(MatrixType &matrix, csr_format)
column_indices_array_type column_indices
coo_matrix_view(const MatrixType &matrix)
bool is_sorted_by_row(void)
Coordinate (COO) representation a sparse matrix.
void resize(size_t num_rows, size_t num_cols, size_t num_entries)
coo_matrix & operator=(const MatrixType &matrix)
coo_matrix(const MatrixType &matrix)
bool is_sorted_by_row_and_column(void)
void sort_by_row_and_column(void)
bool is_sorted_by_row(void)
void swap(coo_matrix &matrix)
column_indices_array_type column_indices
row_indices_array_type row_indices
coo_matrix(const size_t num_rows, const size_t num_cols, const size_t num_entries)
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)