Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Namespaces | Functions
binary_range_search.hpp File Reference

Binary range search algorithm. More...

#include "shambase/aliases_int.hpp"
#include "shambase/assert.hpp"
#include "shamalgs/primitives/lower_bound.hpp"
#include "shamalgs/primitives/upper_bound.hpp"
+ Include dependency graph for binary_range_search.hpp:

Go to the source code of this file.

Namespaces

namespace  shamalgs
 namespace to contain everything implemented by shamalgs
 
namespace  shamalgs::primitives
 namespace for primitive algorithm (e.g. sort, scan, reductions, ...)
 

Functions

template<class Tkey >
constexpr void shamalgs::primitives::binary_range_search (const Tkey *__restrict__ key, u32 first, u32 last, const Tkey &value_min, const Tkey &value_max, u32 &inf, u32 &sup)
 Find the range of indices for which key[inf] <= value_min <= value_max <= key[sup].
 

Detailed Description

Binary range search algorithm.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file binary_range_search.hpp.