23 #include <cusp/detail/config.h>
26 #include <cusp/memory.h>
28 #include <cusp/detail/format.h>
29 #include <cusp/detail/matrix_base.h>
30 #include <cusp/detail/type_traits.h>
31 #include <cusp/detail/utils.h>
40 template<
typename,
typename,
typename>
class array2d;
41 template<
typename,
typename>
class array2d_view;
42 template<
typename,
typename,
typename,
typename,
typename>
class ell_matrix_view;
44 template<
typename T,
class MemorySpace,
class Orientation>
45 array2d_view<typename cusp::array1d_view<typename cusp::array1d<T,MemorySpace>::iterator>, Orientation>
48 template<
typename T,
class MemorySpace,
class Orientation>
49 array2d_view<typename cusp::array1d_view<typename cusp::array1d<T,MemorySpace>::const_iterator>, Orientation>
121 template <
typename IndexType,
typename ValueType,
typename MemorySpace>
122 class ell_matrix :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::ell_format>
126 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::ell_format> Parent;
141 typename column_indices_array_type::view,
142 typename values_array_type::view,
143 IndexType, ValueType, MemorySpace> view;
146 typename column_indices_array_type::const_view,
147 typename values_array_type::const_view,
148 IndexType, ValueType, MemorySpace> const_view;
150 typedef typename cusp::detail::coo_view_type<container, cusp::ell_format>::view coo_view_type;
151 typedef typename cusp::detail::coo_view_type<container const, cusp::ell_format>::view const_coo_view_type;
153 template<
typename MemorySpace2>
181 ell_matrix(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
182 const size_t num_entries_per_row,
const size_t alignment = 32);
188 template <
typename MatrixType>
198 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
199 const size_t num_entries_per_row);
209 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
210 const size_t num_entries_per_row,
const size_t alignment);
224 template <
typename MatrixType>
314 template <
typename ArrayType1,
316 typename IndexType =
typename ArrayType1::value_type,
317 typename ValueType =
typename ArrayType2::value_type,
318 typename MemorySpace =
typename cusp::minimum_space<typename ArrayType1::memory_space, typename ArrayType2::memory_space>::type >
319 class ell_matrix_view :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::ell_format>
323 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::ell_format> Parent;
328 typedef ArrayType1 column_indices_array_type;
329 typedef ArrayType2 values_array_type;
335 typedef typename cusp::detail::coo_view_type<view,cusp::ell_format>::view coo_view_type;
336 typedef typename cusp::detail::coo_view_type<view const,cusp::ell_format>::view const_coo_view_type;
342 const static IndexType
invalid_index = container::invalid_index;
368 template <
typename OtherArrayType1,
typename OtherArrayType2>
369 ell_matrix_view(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
371 : Parent(num_rows, num_cols, num_entries),
372 column_indices(column_indices),
388 ell_matrix_view(
const ell_matrix<IndexType,ValueType,MemorySpace>& matrix)
418 void resize(
size_t num_rows,
size_t num_cols,
size_t num_entries,
419 size_t num_entries_per_row);
429 void resize(
size_t num_rows,
size_t num_cols,
size_t num_entries,
430 size_t num_entries_per_row,
size_t alignment);
447 template <
typename ArrayType1,
typename ArrayType2>
450 ArrayType1 column_indices, ArrayType2 values)
453 view(num_rows, num_cols, num_entries, column_indices, values);
473 template <
typename ArrayType1,
477 typename MemorySpace>
496 template <
typename IndexType,
typename ValueType,
typename MemorySpace>
501 (m.num_rows, m.num_cols, m.num_entries,
518 template <
typename IndexType,
typename ValueType,
typename MemorySpace>
523 (m.num_rows, m.num_cols, m.num_entries,
533 #include <cusp/detail/ell_matrix.inl>
static const IndexType invalid_index
void resize(const size_t num_rows, const size_t num_cols, const size_t num_entries, const size_t num_entries_per_row)
void swap(ell_matrix &matrix)
column_indices_array_type column_indices
void resize(size_t num_rows, size_t num_cols, size_t num_entries, size_t num_entries_per_row)
The array2d class is a 2D vector container that may contain elements stored in "host" or "device" mem...
array2d_view< typename cusp::array1d_view< Iterator >, Orientation > make_array2d_view(size_t num_rows, size_t num_cols, size_t pitch, const cusp::array1d_view< Iterator > &values, Orientation)
Packed row (ELLPACK/ITPACK) representation of a sparse matrix.
ell_matrix & operator=(const MatrixType &matrix)
ell_matrix< IndexType, ValueType, MemorySpace >::const_view make_ell_matrix_view(const ell_matrix< IndexType, ValueType, MemorySpace > &m)
static const IndexType invalid_index
1D array of elements that may reside in "host" or "device" memory space
column_indices_array_type column_indices