Treelite
Functions
math.h File Reference

Some useful math utilities. More...

#include <algorithm>
#include <cfloat>
#include <cmath>
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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...
 

Detailed Description

Some useful math utilities.

Copyright (c) 2020 by Contributors

Author
Hyunsu Cho

Definition in file math.h.

Function Documentation

◆ binary_search()

Iter treelite::math::binary_search ( Iter  begin,
Iter  end,
const T &  val 
)

perform binary search on the range [begin, end).

Parameters
beginbeginning of the search range
endend of the search range
valvalue being searched
Returns
iterator pointing to the value if found; end if value not found.
Template Parameters
Itertype of iterator
Ttype of elements

Definition at line 27 of file math.h.

◆ CheckNAN()

bool treelite::math::CheckNAN ( value)
inline

check for NaN (Not a Number)

Parameters
valuevalue to check
Returns
whether the given value is NaN or not
Template Parameters
typeof value (should be a floating-point value)

Definition at line 43 of file math.h.