|
std::string | QPot::version () |
| Return version string, e.g. More...
|
|
std::vector< std::string > | QPot::version_dependencies () |
| Return versions of this library and of all of its dependencies. More...
|
|
template<class It , class T , class R = size_t> |
R | QPot::iterator::lower_bound (const It first, const It last, const T &value, R guess=0, size_t proximity=10) |
| Return index of the first element in the range [first, last) such that element < value is false (i.e. More...
|
|
template<class T , class V , class R > |
void | QPot::inplace::lower_bound (const T &matrix, const V &value, R &index, size_t proximity=10) |
| Similar to lower_bound but on the last axis of an nd-array (e.g. More...
|
|
template<class V , class I > |
void | QPot::inplace::cumsum_chunk (V &cumsum, const V &delta, const I &shift) |
| Update the chunk of a cumsum computed and stored in chunks. More...
|
|
template<class T , class V , class R > |
R | QPot::lower_bound (const T &matrix, const V &value, const R &index, size_t proximity=10) |
| Iterating on the last axis of an nd-array (e.g. More...
|
|
template<class T , class V , class R > |
R | QPot::lower_bound (const T &matrix, const V &value) |
| Iterating on the last axis of an nd-array (e.g. More...
|
|
template<class V , class I > |
V | QPot::cumsum_chunk (const V &cumsum, const V &delta, const I &shift) |
| Update the chunk of a cumsum computed and stored in chunks. More...
|
|
- Copyright
- Copyright 2017. Tom de Geus. All rights reserved.
- License: This project is released under the MIT License.
Definition in file QPot.h.
template<class It , class T , class R = size_t>
R QPot::iterator::lower_bound |
( |
const It |
first, |
|
|
const It |
last, |
|
|
const T & |
value, |
|
|
R |
guess = 0 , |
|
|
size_t |
proximity = 10 |
|
) |
| |
|
inline |
Return index of the first element in the range [first, last) such that element < value
is false
(i.e.
greater or equal to), or last if no such element is found.
Compared to the default function, this function allows for a guess of the index and a proximity search around. This could be efficient for finding items in large arrays.
- Parameters
-
first | Iterator defining the beginning of the range to examine (e.g. a.begin() ). |
last | Iterator defining the end of the range to examine (e.g. a.end() ) |
value | Value to find. |
guess | Guess of the index where to find the value. |
proximity | Size of the proximity search around guess (use 0 to disable proximity search). |
- Returns
- The index of
value
(i.e. a[index] < value <= a[index + 1]
).
Definition at line 214 of file QPot.h.
template<class T , class V , class R >
void QPot::inplace::lower_bound |
( |
const T & |
matrix, |
|
|
const V & |
value, |
|
|
R & |
index, |
|
|
size_t |
proximity = 10 |
|
) |
| |
|
inline |
Similar to lower_bound
but on the last axis of an nd-array (e.g.
per row of a rank 2 matrix).
- Parameters
-
matrix | The matrix defining a range per row. |
value | The value to find (per row). |
index | Initial guess on index (updated). |
proximity | Size of the proximity search around guess (use 0 to disable proximity search). |
Definition at line 254 of file QPot.h.