23 #include <cusp/detail/config.h>
27 #include <cusp/detail/format.h>
28 #include <cusp/detail/matrix_base.h>
29 #include <cusp/detail/utils.h>
35 template <
typename ArrayType1,
typename ArrayType2,
typename IndexType,
typename ValueType,
typename MemorySpace>
class dia_matrix_view;
118 template <
typename IndexType,
typename ValueType,
class MemorySpace>
119 class dia_matrix :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::dia_format>
123 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::dia_format> Parent;
135 typename diagonal_offsets_array_type::view,
136 typename values_array_type::view,
137 IndexType, ValueType, MemorySpace> view;
140 typename diagonal_offsets_array_type::const_view,
141 typename values_array_type::const_view,
142 IndexType, ValueType, MemorySpace> const_view;
144 typedef typename cusp::detail::coo_view_type<container,cusp::dia_format>::view coo_view_type;
145 typedef typename cusp::detail::coo_view_type<container const,cusp::dia_format>::view const_coo_view_type;
147 template<
typename MemorySpace2>
176 dia_matrix(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
177 const size_t num_diagonals,
const size_t alignment = 32);
183 template <
typename MatrixType>
193 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
194 const size_t num_diagonals);
204 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
205 const size_t num_diagonals,
const size_t alignment);
217 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 dia_matrix_view :
public cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::dia_format>
323 typedef cusp::detail::matrix_base<IndexType,ValueType,MemorySpace,cusp::dia_format> Parent;
327 typedef ArrayType1 diagonal_offsets_array_type;
328 typedef ArrayType2 values_array_type;
333 typedef typename cusp::detail::coo_view_type<view,cusp::dia_format>::view coo_view_type;
334 typedef typename cusp::detail::coo_view_type<view const,cusp::dia_format>::view const_coo_view_type;
361 template <
typename OtherArrayType1,
typename OtherArrayType2>
364 : Parent(num_rows, num_cols, num_entries),
365 diagonal_offsets(diagonal_offsets),
377 template <
typename OtherArrayType1,
typename OtherArrayType2>
380 : Parent(num_rows, num_cols, num_entries),
381 diagonal_offsets(diagonal_offsets),
397 dia_matrix_view(
const dia_matrix<IndexType,ValueType,MemorySpace>& matrix)
427 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
428 const size_t num_diagonals);
438 void resize(
const size_t num_rows,
const size_t num_cols,
const size_t num_entries,
439 const size_t num_diagonals,
const size_t alignment);
458 template <
typename ArrayType1,
464 ArrayType1 diagonal_offsets,
468 view(num_rows, num_cols, num_entries, diagonal_offsets, values);
488 template <
typename ArrayType1,
492 typename MemorySpace>
511 template <
typename IndexType,
typename ValueType,
class MemorySpace>
516 (m.num_rows, m.num_cols, m.num_entries,
533 template <
typename IndexType,
typename ValueType,
class MemorySpace>
538 (m.num_rows, m.num_cols, m.num_entries,
548 #include <cusp/detail/dia_matrix.inl>
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
diagonal_offsets_array_type diagonal_offsets
void resize(const size_t num_rows, const size_t num_cols, const size_t num_entries, const size_t num_diagonals)
Diagonal (DIA) representation a sparse matrix.
dia_matrix< IndexType, ValueType, MemorySpace >::const_view make_dia_matrix_view(const dia_matrix< IndexType, ValueType, MemorySpace > &m)
array1d_view< Iterator > make_array1d_view(Iterator first, Iterator last)
diagonal_offsets_array_type diagonal_offsets
void swap(dia_matrix &matrix)
2D array of elements that may reside in "host" or "device" memory space
The array2d class is a 2D vector container that may contain elements stored in "host" or "device" mem...
void resize(const size_t num_rows, const size_t num_cols, const size_t num_entries, const size_t num_diagonals)
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)
1D array of elements that may reside in "host" or "device" memory space
dia_matrix & operator=(const MatrixType &matrix)