Some useful math utilities.
More...
#include <algorithm>
#include <cfloat>
#include <cmath>
Go to the source code of this file.
|
template<class Iter , class T > |
Iter | binary_search (Iter begin, Iter end, const T &val) |
| perform binary search on the range [begin, end). More...
|
|
template<typename T > |
bool | CheckNAN (T value) |
| check for NaN (Not a Number) More...
|
|
Some useful math utilities.
Copyright (c) 2020 by Contributors
- Author
- Hyunsu Cho
Definition in file math.h.
◆ binary_search()
Iter treelite::math::binary_search |
( |
Iter |
begin, |
|
|
Iter |
end, |
|
|
const T & |
val |
|
) |
| |
perform binary search on the range [begin, end).
- Parameters
-
begin | beginning of the search range |
end | end of the search range |
val | value being searched |
- Returns
- iterator pointing to the value if found; end if value not found.
- Template Parameters
-
Iter | type of iterator |
T | type of elements |
Definition at line 27 of file math.h.
◆ CheckNAN()
bool treelite::math::CheckNAN |
( |
T |
value | ) |
|
|
inline |
check for NaN (Not a Number)
- Parameters
-
- Returns
- whether the given value is NaN or not
- Template Parameters
-
type | of value (should be a floating-point value) |
Definition at line 43 of file math.h.