49 #ifndef _HALF_FUNCTION_H_
50 #define _HALF_FUNCTION_H_
57 #ifndef IMATH_HAVE_LARGE_STACK
64 template <
class T>
class halfFunction
71 template <
class Function>
72 halfFunction (Function
f,
80 #ifndef IMATH_HAVE_LARGE_STACK
81 ~halfFunction() {
delete[] _lut; }
82 halfFunction (
const halfFunction&) =
delete;
83 halfFunction&
operator= (
const halfFunction&) =
delete;
84 halfFunction (halfFunction&&) =
delete;
85 halfFunction&
operator= (halfFunction&&) =
delete;
92 T operator() (
half x)
const;
95 #ifdef IMATH_HAVE_LARGE_STACK
107 template <
class Function>
108 halfFunction<T>::halfFunction (Function
f,
116 #ifndef IMATH_HAVE_LARGE_STACK
117 _lut =
new T[1 << 16];
120 for (
int i = 0; i < (1 << 16); i++)
127 else if (x.isInfinity())
128 _lut[i] = x.isNegative() ? negInfValue : posInfValue;
130 _lut[i] = defaultValue;
138 halfFunction<T>::operator() (
half x)
const
140 return _lut[x.bits()];
imath_half_bits_t half
if we're in a C-only context, alias the half bits type to half
#define HALF_MAX
Largest positive half.
LeafData & operator=(const LeafData &)=delete