FleCSI User API Version: 2.3.0
 
Loading...
Searching...
No Matches
Ranges

Range and iterator tools, mostly backported from the standard library. More...

Classes

struct  mdcolex< T, D >
 A variation of mdspan with reversed indices (distinguished by ()). More...
 
struct  mdspan< T, D >
 A small, approximate subset of mdspan as proposed for C++23. More...
 
struct  span< T >
 A workalike for std::span from C++20 (only dynamic-extent, without ranges support). More...
 
struct  substring_view< R >
 A view of part of a range. More...
 

Functions

template<class R , class T = std::remove_reference_t<decltype(*std::begin(std::declval<R>()))>>
constexpr auto binary_index (R &&r, const T &t)
 Find the index of a value in a sorted range.
 
template<class R , class F >
constexpr auto partition_point (R &&r, F &&f)
 A subset of std::ranges::partition_point from C++20.
 
template<class B , class R >
constexpr auto permutation_view (B b, R r)
 A view of a (partial) permutation of a range.
 
template<class T >
auto to_vector (span< T > s)
 Copy a span into a std::vector.
 
template<class S , class D , class F >
constexpr void transform (S &&s, D d, F &&f)
 A simple subset of std::ranges::transform from C++20.
 

Detailed Description

Range and iterator tools, mostly backported from the standard library.

Function Documentation

◆ to_vector()

template<class T >
auto to_vector ( span< T >  s)

Copy a span into a std::vector.

◆ transform()

template<class S , class D , class F >
constexpr void transform ( S &&  s,
d,
F &&  f 
)
constexpr

A simple subset of std::ranges::transform from C++20.

This function supports GPU execution.

Parameters
ssource range
ddestination iterator

◆ partition_point()

template<class R , class F >
constexpr auto partition_point ( R &&  r,
F &&  f 
)
constexpr

A subset of std::ranges::partition_point from C++20.

This function supports GPU execution.

Parameters
rrandom-access range
Returns
an iterator to the first element for which f returns false

◆ binary_index()

template<class R , class T = std::remove_reference_t<decltype(*std::begin(std::declval<R>()))>>
constexpr auto binary_index ( R &&  r,
const T &  t 
)
constexpr

Find the index of a value in a sorted range.

This function supports GPU execution.

Parameters
rrandom-access range

◆ permutation_view()

template<class B , class R >
constexpr auto permutation_view ( b,
r 
)
constexpr

A view of a (partial) permutation of a range.

Elements need not be sorted (though see also binary_index) and may be repeated (with caution for the resulting aliasing).

This function supports GPU execution.

Parameters
brandom-access starting iterator
rrange of offsets from b
Returns
view of selected elements, random access iff R is