23 #include <cusp/detail/config.h>
25 #include <cusp/detail/format.h>
27 #include <cusp/detail/matrix_base.h>
34 template <
typename ArrayType1,
typename ArrayType2,
typename ArrayType3,
35 typename IndexType,
typename ValueType,
typename MemorySpace>
class coo_matrix_view;
105 template <
typename IndexType,
typename ValueType,
class MemorySpace>
106 class coo_matrix :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format>
110 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format> Parent;
122 typename row_indices_array_type::view,
123 typename column_indices_array_type::view,
124 typename values_array_type::view,
125 IndexType, ValueType, MemorySpace> view;
128 typename row_indices_array_type::const_view,
129 typename column_indices_array_type::const_view,
130 typename values_array_type::const_view,
131 IndexType, ValueType, MemorySpace> const_view;
133 typedef view coo_view_type;
134 typedef const_view
const const_coo_view_type;
136 template<
typename MemorySpace2>
165 coo_matrix(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries)
166 : Parent(num_rows, num_cols, num_entries),
175 template <
typename MatrixType>
180 void resize(
size_t num_rows,
size_t num_cols,
size_t num_entries);
193 template <
typename MatrixType>
298 template <
typename ArrayType1,
301 typename IndexType =
typename ArrayType2::value_type,
302 typename ValueType =
typename ArrayType3::value_type,
303 typename MemorySpace =
typename cusp::minimum_space<
304 typename ArrayType1::memory_space,
305 typename ArrayType2::memory_space,
306 typename ArrayType3::memory_space>::type >
307 class coo_matrix_view :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format>
311 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::coo_format> Parent;
316 typedef ArrayType1 row_indices_array_type;
317 typedef ArrayType2 column_indices_array_type;
318 typedef ArrayType3 values_array_type;
324 typedef view coo_view_type;
325 typedef view
const const_coo_view_type;
366 const size_t num_cols,
367 const size_t num_entries,
371 : Parent(num_rows, num_cols, num_entries),
423 template<
typename MatrixType>
431 template<
typename MatrixType>
440 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries);
467 template<
typename MatrixType>
474 template<
typename MatrixType>
481 template<
typename MatrixType>
488 template<
typename MatrixType>
510 template <
typename ArrayType1,
515 const size_t num_cols,
516 const size_t num_entries,
517 ArrayType1 row_indices,
518 ArrayType2 column_indices,
522 view(num_rows, num_cols, num_entries, row_indices, column_indices, values);
543 template <
typename ArrayType1,
548 typename MemorySpace>
565 template <
typename MatrixType>
566 typename MatrixType::coo_view_type
569 typedef typename MatrixType::coo_view_type View;
584 template <
typename MatrixType>
585 typename MatrixType::const_coo_view_type
588 typedef typename MatrixType::const_coo_view_type View;
598 #include <cusp/detail/coo_matrix.inl>
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
column_indices_array_type column_indices
void swap(coo_matrix &matrix)
MatrixType::const_coo_view_type make_coo_matrix_view(const MatrixType &m)
bool is_sorted_by_row_and_column(void)
bool is_sorted_by_row(void)
coo_matrix(const size_t num_rows, const size_t num_cols, const size_t num_entries)
void sort_by_row_and_column(void)
column_indices_array_type column_indices
Coordinate (COO) representation a sparse matrix.
void sort_by_row_and_column(void)
row_indices_array_type row_indices
void construct_from(MatrixType &matrix, csr_format)
bool is_sorted_by_row_and_column(void)
row_indices_array_type row_indices
coo_matrix & operator=(const MatrixType &matrix)
void resize(size_t num_rows, size_t num_cols, size_t num_entries)
1D array of elements that may reside in "host" or "device" memory space
bool is_sorted_by_row(void)
cusp::array1d< typename thrust::detail::remove_const< IndexType >::type, MemorySpace > indices
void resize(const size_t num_rows, const size_t num_cols, const size_t num_entries)