E.V.E
v2023.02.15
Loading...
Searching...
No Matches

Detailed Description

Names the range an algorithm should expect to be the shorter one.

Variables

template<int N>
constexpr auto eve::algo::expect_smaller_range = (expect_smaller_range_key = eve::index<N>)

Variable Documentation

◆ expect_smaller_range

template<int N>
auto eve::algo::expect_smaller_range = (expect_smaller_range_key = eve::index<N>)
inlineconstexpr
Header file #include <eve/module/algo.hpp>
namespace eve::algo
{
template<int N> inline constexpr auto expect_smaller_range = eve_implementation_defined;
}
constexpr auto expect_smaller_range
Definition traits.hpp:662
Template Parameters
NZero-based position of that range among the arguments.

Names the range, by its zero-based position among the arguments, that is expected to run out first. An algorithm that reads two ranges, as eve::algo::set_intersection does, is faster when it is told which of them is the shorter. Shorter is a rough guide rather than a rule, and the choice is to be benchmarked on the data at hand.

std::vector<int> a(1 << 16), b(64), out(64);
// b runs out first: the loop is shaped around it.
constexpr auto set_intersection
SIMD variation on std::set_intersection that HAS A SLIGHTLY DIFFERENT SEMANTICS.
Definition set_intersection.hpp:441
See also
eve::algo::set_intersection