HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_Algorithm.h File Reference
#include "UT_Assert.h"
#include "UT_IteratorRange.h"
#include <SYS/SYS_Types.h>
#include <algorithm>
#include <iterator>
#include <limits>
#include <type_traits>
#include <stddef.h>
+ Include dependency graph for UT_Algorithm.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UT_CycleDetect< T >
 
class  UT_CycleDetect< T >::AutoScope
 
class  UT_CycleDetectEx< T >
 

Functions

template<typename ForwardIt >
void UTdeleteAll (ForwardIt begin, ForwardIt end)
 
template<typename ForwardIt >
void UTdeleteAll (UT_IteratorRange< ForwardIt > range)
 
template<typename T >
void UTdeleteAll (T &container)
 
template<typename InputIt >
void UTgetArrayMinMax (InputIt begin, InputIt end, typename std::iterator_traits< InputIt >::value_type &min, typename std::iterator_traits< InputIt >::value_type &max)
 Get the min/max values of an array. More...
 
template<typename InputIt , typename OutputIt >
void UTnormalizeArray (InputIt begin, InputIt end, OutputIt d_begin)
 Normalize an array. More...
 
template<typename T >
size_t UTfastSelectLow (T a, T b, size_t src1, size_t src2)
 Selects between arguments 'src1/src2' based on the lower of 'a/b'. More...
 
template<typename ForwardIt , typename T >
ForwardIt UTfastUpperBound (ForwardIt first, ForwardIt last, const T &value)
 

Function Documentation

template<typename ForwardIt >
void UTdeleteAll ( ForwardIt  begin,
ForwardIt  end 
)

Delete all items in the range using the delete operator. The item type must be a pointer type.

Definition at line 232 of file UT_Algorithm.h.

template<typename ForwardIt >
void UTdeleteAll ( UT_IteratorRange< ForwardIt >  range)

Definition at line 245 of file UT_Algorithm.h.

template<typename T >
void UTdeleteAll ( T &  container)

Deletes all items from a container. The container item type must be a pointer type.

Definition at line 254 of file UT_Algorithm.h.

template<typename T >
size_t UTfastSelectLow ( a,
b,
size_t  src1,
size_t  src2 
)
inline

Selects between arguments 'src1/src2' based on the lower of 'a/b'.

Definition at line 299 of file UT_Algorithm.h.

template<typename ForwardIt , typename T >
ForwardIt UTfastUpperBound ( ForwardIt  first,
ForwardIt  last,
const T &  value 
)
inline

Fast upper bound search. Adapted from "How We Beat C++ STL Binary Search" Reference: https://realm.io/news/how-we-beat-cpp-stl-binary-search/

Definition at line 324 of file UT_Algorithm.h.

template<typename InputIt >
void UTgetArrayMinMax ( InputIt  begin,
InputIt  end,
typename std::iterator_traits< InputIt >::value_type &  min,
typename std::iterator_traits< InputIt >::value_type &  max 
)
inline

Get the min/max values of an array.

Definition at line 264 of file UT_Algorithm.h.

template<typename InputIt , typename OutputIt >
void UTnormalizeArray ( InputIt  begin,
InputIt  end,
OutputIt  d_begin 
)
inline

Normalize an array.

Definition at line 282 of file UT_Algorithm.h.