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>
81 #ifndef IMATH_HAVE_LARGE_STACK
82 ~halfFunction () {
delete[] _lut; }
83 halfFunction (
const halfFunction&) =
delete;
84 halfFunction&
operator= (
const halfFunction&) =
delete;
85 halfFunction (halfFunction&&) =
delete;
86 halfFunction&
operator= (halfFunction&&) =
delete;
93 T operator() (
half x)
const;
96 #ifdef IMATH_HAVE_LARGE_STACK
108 template <
class Function>
109 halfFunction<T>::halfFunction (
118 #ifndef IMATH_HAVE_LARGE_STACK
119 _lut =
new T[1 << 16];
122 for (
int i = 0; i < (1 << 16); i++)
129 else if (x.isInfinity ())
130 _lut[i] = x.isNegative () ? negInfValue : posInfValue;
132 _lut[i] = defaultValue;
140 halfFunction<T>::operator() (
half x)
const
142 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