23 #include <cusp/detail/config.h>
25 #include <thrust/execution_policy.h>
37 template <
typename DerivedPolicy,
typename OffsetArray,
typename IndexArray>
38 void offsets_to_indices(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
39 const OffsetArray& offsets,
78 template <
typename OffsetArray,
typename IndexArray>
83 template <
typename DerivedPolicy,
typename IndexArray,
typename OffsetArray>
84 void indices_to_offsets(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
85 const IndexArray& indices,
86 OffsetArray& offsets);
125 template <
typename IndexArray,
typename OffsetArray>
127 OffsetArray& offsets);
130 template <
typename DerivedPolicy,
typename MatrixType,
typename ArrayType>
131 void extract_diagonal(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
173 template <
typename MatrixType,
typename ArrayType>
177 template <
typename DerivedPolicy,
typename ArrayType1,
typename ArrayType2>
178 size_t count_diagonals(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
179 const size_t num_rows,
180 const size_t num_cols,
181 const ArrayType1& row_indices,
182 const ArrayType2& column_indices );
220 template <
typename ArrayType1,
typename ArrayType2>
222 const size_t num_cols,
223 const ArrayType1& row_indices,
224 const ArrayType2& column_indices);
227 template <
typename DerivedPolicy,
typename ArrayType>
229 const ArrayType& row_offsets);
260 template <
typename ArrayType>
264 template <
typename DerivedPolicy,
typename ArrayType>
266 const ArrayType& row_offsets,
267 float relative_speed = 3.0f,
268 size_t breakeven_threshold = 4096);
303 template <
typename ArrayType>
305 float relative_speed = 3.0f,
306 size_t breakeven_threshold = 4096);
312 #include <cusp/detail/format_utils.inl>
size_t compute_optimal_entries_per_row(const ArrayType &row_offsets, float relative_speed=3.0f, size_t breakeven_threshold=4096)
Compute the optimal number of entries per row of HYB matrix.
void offsets_to_indices(const OffsetArray &offsets, IndexArray &indices)
Expand CSR row offsets to COO row indices.
size_t count_diagonals(const size_t num_rows, const size_t num_cols, const ArrayType1 &row_indices, const ArrayType2 &column_indices)
Count the number of occupied diagonals in the input matrix.
void extract_diagonal(const MatrixType &A, ArrayType &output)
Extract the main diagonal of a matrix.
void indices_to_offsets(const IndexArray &indices, OffsetArray &offsets)
Compress COO row indices to CSR row offsets.
size_t compute_max_entries_per_row(const ArrayType &row_offsets)
Compute the maximum row length of a matrix.