23 #include <cusp/detail/config.h>
24 #include <cusp/detail/format.h>
25 #include <cusp/detail/matrix_base.h>
28 #include <cusp/memory.h>
107 template <
typename IndexType,
typename MemorySpace>
108 class permutation_matrix :
public cusp::detail::matrix_base<IndexType,IndexType,MemorySpace,cusp::permutation_format>
112 typedef cusp::detail::matrix_base<IndexType,IndexType,MemorySpace,cusp::permutation_format> Parent;
122 typename permutation_array_type::view,
127 typename permutation_array_type::const_view,
129 MemorySpace> const_view;
131 template<
typename MemorySpace2>
150 : Parent(num_rows, num_rows, num_rows),
159 template<
typename MemorySpace2>
170 template<
typename ArrayType>
172 : Parent(num_rows, num_rows, num_rows), permutation(permutation) {}
178 void resize(
const size_t num_rows);
192 template<
typename MatrixType>
273 template <
typename ArrayType,
274 typename IndexType =
typename ArrayType::value_type,
275 typename MemorySpace =
typename ArrayType::memory_space>
276 class permutation_matrix_view :
public cusp::detail::matrix_base<IndexType,IndexType,MemorySpace,cusp::permutation_format>
280 typedef cusp::detail::matrix_base<IndexType,IndexType,MemorySpace,cusp::permutation_format> Parent;
285 typedef ArrayType permutation_array_type;
308 : Parent(num_rows, num_rows, num_rows),
309 permutation(permutation) {}
318 : Parent(num_rows, num_rows, num_rows),
319 permutation(permutation) {}
357 void resize(
const size_t num_rows);
363 template<
typename MatrixType>
379 template <
typename ArrayType>
401 template <
typename ArrayType,
typename IndexType,
typename MemorySpace>
419 template <
typename IndexType,
class MemorySpace>
437 template <
typename IndexType,
class MemorySpace>
448 #include <cusp/detail/permutation_matrix.inl>
permutation_matrix_view(void)
The array1d class is a 1D vector container that may contain elements stored in "host" or "device" mem...
permutation_matrix(const permutation_matrix< IndexType, MemorySpace2 > &matrix)
void resize(const size_t num_rows)
void swap(permutation_matrix &matrix)
permutation_matrix(const size_t num_rows, const ArrayType &permutation)
void symmetric_permute(MatrixType &matrix)
void symmetric_permute(MatrixType &matrix)
array1d_view< Iterator > make_array1d_view(Iterator first, Iterator last)
permutation_matrix(const size_t num_rows)
void resize(const size_t num_rows)
View of a permutation_matrix.
Simple representation a permutation matrix.
1D array of elements that may reside in "host" or "device" memory space
permutation_array_type permutation
Specialized array1d_view wrapping thrust::counting_iterator.
permutation_matrix< IndexType, MemorySpace >::const_view make_permutation_matrix_view(const permutation_matrix< IndexType, MemorySpace > &m)
permutation_array_type permutation