23 #include <cusp/detail/config.h>
25 #include <thrust/execution_policy.h>
37 template <
typename DerivedPolicy,
typename ArrayType>
38 void counting_sort(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
40 typename ArrayType::value_type min,
typename ArrayType::value_type max);
91 template <
typename ArrayType>
92 void counting_sort(ArrayType& keys,
typename ArrayType::value_type min,
typename ArrayType::value_type max);
95 template <
typename DerivedPolicy,
typename ArrayType1,
typename ArrayType2>
97 ArrayType1& keys, ArrayType2& vals,
98 typename ArrayType1::value_type min,
99 typename ArrayType1::value_type max);
157 template <
typename ArrayType1,
typename ArrayType2>
159 typename ArrayType1::value_type min,
160 typename ArrayType1::value_type max);
164 template <
typename DerivedPolicy,
typename ArrayType1,
typename ArrayType2,
typename ArrayType3>
165 void sort_by_row(
const thrust::detail::execution_policy_base<DerivedPolicy> &exec,
166 ArrayType1& row_indices, ArrayType2& column_indices, ArrayType3& values,
167 typename ArrayType1::value_type min_row = 0,
168 typename ArrayType1::value_type max_row = 0);
215 template <
typename ArrayType1,
typename ArrayType2,
typename ArrayType3>
216 void sort_by_row(ArrayType1& row_indices, ArrayType2& column_indices, ArrayType3& values,
217 typename ArrayType1::value_type min_row = 0,
218 typename ArrayType1::value_type max_row = 0);
221 template <
typename DerivedPolicy,
typename ArrayType1,
typename ArrayType2,
typename ArrayType3>
223 ArrayType1& row_indices, ArrayType2& column_indices, ArrayType3& values,
224 typename ArrayType1::value_type min_row = 0,
225 typename ArrayType1::value_type max_row = 0,
226 typename ArrayType2::value_type min_col = 0,
227 typename ArrayType2::value_type max_col = 0);
277 template <
typename ArrayType1,
typename ArrayType2,
typename ArrayType3>
279 typename ArrayType1::value_type min_row = 0,
280 typename ArrayType1::value_type max_row = 0,
281 typename ArrayType2::value_type min_col = 0,
282 typename ArrayType2::value_type max_col = 0);
288 #include <cusp/detail/sort.inl>
void sort_by_row(ArrayType1 &row_indices, ArrayType2 &column_indices, ArrayType3 &values, typename ArrayType1::value_type min_row=0, typename ArrayType1::value_type max_row=0)
Sort matrix indices by row.
void sort_by_row_and_column(ArrayType1 &row_indices, ArrayType2 &column_indices, ArrayType3 &values, typename ArrayType1::value_type min_row=0, typename ArrayType1::value_type max_row=0, typename ArrayType2::value_type min_col=0, typename ArrayType2::value_type max_col=0)
Sort matrix indices by row and column.
void counting_sort(ArrayType &keys, typename ArrayType::value_type min, typename ArrayType::value_type max)
Use counting sort to order an array.
void counting_sort_by_key(ArrayType1 &keys, ArrayType2 &vals, typename ArrayType1::value_type min, typename ArrayType1::value_type max)
Use counting sort to order an array and permute an array of values.