Fermat
Functions
Algorithms

Detailed Description

This module implements several host/device STL-like algorithms.

Functions

template<typename Iterator , typename Predicate >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator cugar::find_pivot (Iterator begin, const uint32 n, const Predicate predicate)
 
template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator cugar::lower_bound (const Value x, Iterator begin, const index_type n)
 
template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator cugar::upper_bound (const Value x, Iterator begin, const index_type n)
 
template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE index_type cugar::lower_bound_index (const Value x, Iterator begin, const index_type n)
 
template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE index_type cugar::upper_bound_index (const Value x, Iterator begin, const index_type n)
 
template<typename input_iterator1 , typename input_iterator2 , typename output_iterator >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::merge (input_iterator1 first1, input_iterator1 end1, input_iterator2 first2, input_iterator2 end2, output_iterator output)
 
template<typename key_iterator1 , typename key_iterator2 , typename value_iterator1 , typename value_iterator2 , typename key_iterator , typename value_iterator >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::merge_by_key (key_iterator1 first1, key_iterator1 end1, key_iterator2 first2, key_iterator2 end2, value_iterator1 values1, value_iterator2 values2, key_iterator output_keys, value_iterator output_values)
 

Function Documentation

◆ find_pivot()

template<typename Iterator , typename Predicate >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator cugar::find_pivot ( Iterator  begin,
const uint32  n,
const Predicate  predicate 
)

find the first element in a sequence for which a given predicate evaluates to true

Parameters
beginsequence start iterator
nsequence size
predicateunary predicate

◆ lower_bound()

template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator cugar::lower_bound ( const Value  x,
Iterator  begin,
const index_type  n 
)

find the lower bound in a sequence

Parameters
xelement to find
beginsequence start iterator
nsequence size

◆ lower_bound_index()

template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE index_type cugar::lower_bound_index ( const Value  x,
Iterator  begin,
const index_type  n 
)

find the lower bound in a sequence

Parameters
xelement to find
beginsequence start iterator
nsequence size

◆ merge()

template<typename input_iterator1 , typename input_iterator2 , typename output_iterator >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::merge ( input_iterator1  first1,
input_iterator1  end1,
input_iterator2  first2,
input_iterator2  end2,
output_iterator  output 
)

merge two ranges

Parameters
first1beginning of the first range
end1end of the first range
first2beginning of the second range
end2end of the second range
outputbeginning of the output range

◆ merge_by_key()

template<typename key_iterator1 , typename key_iterator2 , typename value_iterator1 , typename value_iterator2 , typename key_iterator , typename value_iterator >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE void cugar::merge_by_key ( key_iterator1  first1,
key_iterator1  end1,
key_iterator2  first2,
key_iterator2  end2,
value_iterator1  values1,
value_iterator2  values2,
key_iterator  output_keys,
value_iterator  output_values 
)

merge two ranges

Parameters
first1beginning of the first range
end1end of the first range
first2beginning of the second range
end2end of the second range
outputbeginning of the output range

◆ upper_bound()

template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE Iterator cugar::upper_bound ( const Value  x,
Iterator  begin,
const index_type  n 
)

find the upper bound in a sequence

Parameters
xelement to find
beginsequence start iterator
nsequence size

◆ upper_bound_index()

template<typename Iterator , typename Value , typename index_type >
CUGAR_FORCEINLINE CUGAR_HOST_DEVICE index_type cugar::upper_bound_index ( const Value  x,
Iterator  begin,
const index_type  n 
)

find the upper bound in a sequence

Parameters
xelement to find
beginsequence start iterator
nsequence size