157 #if !defined(SESI_ALLOW_DRAND48)
163 #define srand48(X) static_assert(0, "Use SYSsrand48() instead")
164 #define drand48(X) 0; { static_assert(0, "Use SYSdrand48() instead"); }
171 template<
typename F >
175 return int(F(0) <
a) -
int(
a < F(0));
179 template<
typename F >
180 constexpr
inline bool
236 #if defined(__cplusplus)
242 #define h_min(a, b) (((a) > (b)) ? (b) : (a))
243 #define h_argmin(a, b) (((a) > (b)) ? 1 : 0)
244 #define h_max(a, b) (((a) < (b)) ? (b) : (a))
245 #define h_argmax(a, b) (((a) < (b)) ? 1 : 0)
247 #define h_abs(a) (((a) > 0) ? (a) : -(a))
248 #define h_sgn(a) (((a) > 0) ? 1 : (((a) < 0) ? -1 : 0))
254 static constexpr
inline int16 SYSsgn(
int16 a) {
return h_sgn(a); }
255 static constexpr
inline int SYSargmin(
int16 a,
int16 b) {
return h_argmin(a,b);}
256 static constexpr
inline int SYSargmax(
int16 a,
int16 b) {
return h_argmax(a,b);}
260 static constexpr
inline int32 SYSsgn(
int32 a) {
return h_sgn(a); }
261 static constexpr
inline int SYSargmin(
int32 a,
int32 b) {
return h_argmin(a,b);}
262 static constexpr
inline int SYSargmax(
int32 a,
int32 b) {
return h_argmax(a,b);}
270 static constexpr
inline int64 SYSsgn(
int64 a) {
return h_sgn(a); }
271 static constexpr
inline int SYSargmin(
int64 a,
int64 b) {
return h_argmin(a,b);}
272 static constexpr
inline int SYSargmax(
int64 a,
int64 b) {
return h_argmax(a,b);}
275 static constexpr
inline int SYSargmin(
uint16 a,
uint16 b) {
return h_argmin(a,b);}
276 static constexpr
inline int SYSargmax(
uint16 a,
uint16 b) {
return h_argmax(a,b);}
279 static constexpr
inline int SYSargmin(
uint32 a,
uint32 b) {
return h_argmin(a,b);}
280 static constexpr
inline int SYSargmax(
uint32 a,
uint32 b) {
return h_argmax(a,b);}
283 static constexpr
inline int SYSargmin(
uint64 a,
uint64 b) {
return h_argmin(a,b);}
284 static constexpr
inline int SYSargmax(
uint64 a,
uint64 b) {
return h_argmax(a,b);}
303 static constexpr
inline size_t SYSmin(
size_t a,
size_t b) {
return h_min(a,b); }
304 static constexpr
inline size_t SYSmax(
size_t a,
size_t b) {
return h_max(a,b); }
305 static constexpr
inline int SYSargmin(
size_t a,
size_t b) {
return h_argmin(a,b);}
306 static constexpr
inline int SYSargmax(
size_t a,
size_t b) {
return h_argmax(a,b);}
307 static constexpr
inline size_t SYSmin(
long a,
long b) {
return h_min(a,b); }
308 static constexpr
inline size_t SYSmax(
long a,
long b) {
return h_max(a,b); }
309 static constexpr
inline int SYSargmin(
long a,
long b) {
return h_argmin(a,b);}
310 static constexpr
inline int SYSargmax(
long a,
long b) {
return h_argmax(a,b);}
318 #define h_clamp(val, min, max, tol) \
319 ((val <= min+tol) ? min : ((val >= max-tol) ? max : val))
321 static constexpr
inline int
323 {
return h_clamp(v, min, max, 0); }
325 static constexpr
inline uint
327 {
return h_clamp(v, min, max, 0); }
329 static constexpr
inline int64
333 static constexpr
inline uint64
339 {
return h_clamp(v, min, max, tol); }
343 {
return h_clamp(v, min, max, tol); }
348 static constexpr
inline float SYSclamp01(
float v)
350 static constexpr
inline double SYSclamp01(
double v)
354 static constexpr
inline float SYSclamp01_excl1(
float v)
355 {
return SYSclamp(v, 0.
f, 1.
f - FLT_EPSILON/FLT_RADIX); }
356 static constexpr
inline double SYSclamp01_excl1(
double v)
357 {
return SYSclamp(v, 0.0, 1.0 - DBL_EPSILON/FLT_RADIX); }
361 template<
typename OUTTYPE,
typename INTYPE>
362 constexpr OUTTYPE SYSclampInt(INTYPE
value)
366 return OUTTYPE(value);
371 # define SYS_MF(X) SYS_FastMath::X
373 # define SYS_MF(X) ::X
376 #define SYS_UNARY(func) \
377 static inline fpreal64 SYS##func(fpreal64 arg) \
378 { return SYS_MF(func)(arg); } \
379 static inline fpreal32 SYS##func(fpreal32 arg) \
380 { return SYS_MF(func##f)(arg); } \
381 static inline fpreal64 SYS##func(int64 arg) \
382 { return SYS_MF(func)((fpreal64)arg); } \
383 static inline fpreal64 SYS##func(int32 arg) \
384 { return SYS_MF(func)((fpreal64)arg); } \
386 #define SYS_BINARY(func) \
387 static inline fpreal64 SYS##func(fpreal64 a, fpreal64 b) \
388 { return SYS_MF(func)(a,b); } \
389 static inline fpreal32 SYS##func(fpreal32 a, fpreal32 b) \
390 { return SYS_MF(func##f)(a, b); } \
394 #define hypotf(x,y) hypot((x),(y))
417 {
return x > 0 ? SYSsqrt(x) : 0; }
419 {
return x > 0 ? SYSsqrt(x) : 0; }
421 {
return y != 0 ? SYSfmod(x, y) : 0; }
423 {
return y != 0 ? SYSfmod(x, y) : 0; }
439 { __sincosf(x,s,c); }
445 __sincosf(x,&s32,&c32);
451 { *s = SYSsin(x); *c = SYScos(x); }
453 { *s = SYSsin(x); *c = SYScos(x); }
459 #include <xmmintrin.h>
463 #if defined(WIN32) || defined(LINUX) || defined(MBSD)
469 vec = _mm_rsqrt_ss(vec);
472 return 1.0f/SYSsqrt(x);
479 #if defined(WIN32) || defined(LINUX) || defined(MBSD)
480 fpreal32 approximate = SYSrsqrt11(x);
524 {
return SYS_MF(
atanf)(
a); }
532 {
return SYS_MF(
atan) (
a); }
534 {
return SYS_MF(
atan2)(
y,
x); }
537 {
return SYSpow(x, x < 0 ?
SYSrint(y) : y); }
539 {
return SYSpow(x, x < 0 ?
SYSrint(y) : y); }
546 {
return SYSsafediv( (
fpreal32)1, a ); }
548 {
return SYSsafediv( (
fpreal64)1, a ); }
568 static constexpr
inline fpreal32 SYSpow4(
fpreal32 a) {
return SYSpow2(SYSpow2(a)); }
569 static constexpr
inline fpreal64 SYSpow4(
fpreal64 a) {
return SYSpow2(SYSpow2(a)); }
573 #define h_compare(func, code) \
574 static inline bool func(fpreal32 a, fpreal32 b, \
575 fpreal32 tol=SYS_FTOLERANCE) \
577 static inline bool func(fpreal64 a, fpreal64 b, \
578 fpreal64 tol=SYS_FTOLERANCE_D) \
580 #define h_compare_ce(func, code) \
581 static constexpr inline bool func(fpreal32 a, fpreal32 b, \
582 fpreal32 tol=SYS_FTOLERANCE) \
584 static constexpr inline bool func(fpreal64 a, fpreal64 b, \
585 fpreal64 tol=SYS_FTOLERANCE_D) \
588 static constexpr
inline bool
590 {
return a >= -tol && a <= tol; }
592 static constexpr
inline bool
594 {
return a >= -tol && a <= tol; }
596 static constexpr
inline bool
598 {
return a >= -tol && a <= tol; }
600 static constexpr
inline bool
602 {
return a >= -tol && a <= tol; }
605 h_compare_ce(SYSisGreater, (a-
b) > tol)
606 h_compare_ce(SYSisGreaterOrEqual, (a-
b) >= -tol)
607 h_compare_ce(SYSisLess, (a-
b) < -tol)
608 h_compare_ce(SYSisLessOrEqual, (a-
b) <= tol)
614 constexpr
inline bool SYSisGreater(
int32 a,
int32 b) {
return a >
b; }
615 constexpr
inline bool SYSisGreater(
int64 a,
int64 b) {
return a >
b; }
616 constexpr
inline bool SYSisGreaterOrEqual(
int32 a,
int32 b) {
return a >=
b; }
617 constexpr
inline bool SYSisGreaterOrEqual(
int64 a,
int64 b) {
return a >=
b; }
618 constexpr
inline bool SYSisLess(
int32 a,
int32 b) {
return a <
b; }
619 constexpr
inline bool SYSisLess(
int64 a,
int64 b) {
return a <
b; }
620 constexpr
inline bool SYSisLessOrEqual(
int32 a,
int32 b) {
return a <=
b; }
621 constexpr
inline bool SYSisLessOrEqual(
int64 a,
int64 b) {
return a <=
b; }
627 if (SYSfabs(a - b) <= tol)
640 if ((a < 0) != (b < 0))
661 if (SYSfabs(a - b) <= tol)
674 if ((a < 0) != (b < 0))
692 return SYSalmostEqual(a, b, (
int64)ulps, tol);
700 #define h_max3(type) \
701 static constexpr inline type \
702 SYSmax(type v0, type v1, type v2) { \
703 return SYSmax(v2, SYSmax(v0, v1)); \
705 #define h_max4(type) \
706 static constexpr inline type \
707 SYSmax(type v0, type v1, type v2, type v3) { \
708 return SYSmax(SYSmax(v0, v1), SYSmax(v2, v3)); \
710 #define h_argmax3(type) \
711 static constexpr inline int \
712 SYSargmax(type v0, type v1, type v2) { \
713 return v2 > SYSmax(v0, v1) ? 2 : SYSargmax(v0, v1); \
715 #define h_argmax4(type) \
716 static constexpr inline int \
717 SYSargmax(type v0, type v1, type v2, type v3) { \
718 return SYSmax(v0, v1) < SYSmax(v2, v3) ? \
719 (SYSargmax(v2, v3) + 2) : SYSargmax(v0, v1); \
721 #define h_min3(type) \
722 static constexpr inline type \
723 SYSmin(type v0, type v1, type v2) { \
724 return SYSmin(v2, SYSmin(v0, v1)); \
726 #define h_min4(type) \
727 static constexpr inline type \
728 SYSmin(type v0, type v1, type v2, type v3) { \
729 return SYSmin(SYSmin(v0, v1), SYSmin(v2, v3)); \
731 #define h_argmin3(type) \
732 static constexpr inline int \
733 SYSargmin(type v0, type v1, type v2) { \
734 return v2 < SYSmin(v0, v1) ? 2 : SYSargmin(v0, v1); \
736 #define h_argmin4(type) \
737 static constexpr inline int \
738 SYSargmin(type v0, type v1, type v2, type v3) { \
739 return SYSmin(v0, v1) > SYSmin(v2, v3) ? \
740 (SYSargmin(v2, v3) + 2) : SYSargmin(v0, v1); \
744 #define h_max(type) h_min3(type) h_min4(type) h_max3(type) h_max4(type) \
745 h_argmin3(type) h_argmin4(type) \
746 h_argmax3(type) h_argmax4(type)
748 #define h_avg3(type) \
749 static constexpr inline type \
750 SYSavg(type v0, type v1, type v2) { \
751 return (v0+v1+v2) * ((type)(1.0/3.0)); \
753 #define h_avg4(type) \
754 static constexpr inline type \
755 SYSavg(type v0, type v1, type v2, type v3) { \
756 return (v0+v1+v2+v3) * ((type)0.25); \
759 #define h_avg(type) h_avg3(type) h_avg4(type)
772 static constexpr inline
int32
774 {
return (a + b + c + 1) / 3; }
775 static constexpr
inline int32
777 {
return (a + b + c + d + 2) / 4; }
779 static constexpr
inline int64
781 {
return (a + b + c + 1) / 3; }
782 static constexpr
inline int64
784 {
return (a + b + c + d + 2) / 4; }
809 return v1 + (v2 -
v1)*t;
815 return v1 + (v2 -
v1)*t;
856 return v0*(1-u-
v) + v1*u + v2*v;
862 return v0*(1-u-
v) + v1*u + v2*v;
875 return ((a < 0) ^ (b < 0) && r != 0.0
f) ? r+b :
r;
882 return ((a < 0) ^ (b < 0) && r != 0.0) ? r+b :
r;
885 static constexpr
inline int32
891 return ((a < 0) ^ (b < 0) && r) ? r+b :
r;
894 static constexpr
inline int64
900 return ((a < 0) ^ (b < 0) && r) ? r+b :
r;
906 if (val <= min)
return 0;
907 if (val >= max)
return 1;
917 if (val <= min)
return 0;
918 if (val >= max)
return 1;
932 (
fpreal32)1/roll) : SYSpow(f, roll);
942 fpreal64 f = SYSsmooth(min, max, value);
944 (
fpreal64)1/roll) : SYSpow(f, roll);
953 fpreal32 tmp = (d == 0) ? 0.5f * (nmin+nmax) :
SYSlerp(nmin, nmax, (val-omin)/d);
962 fpreal64 tmp = (d == 0) ? 0.5 * (nmin+nmax) :
SYSlerp(nmin, nmax, (val-omin)/d);
972 return (d == 0) ? 0.5f * (nmin+nmax) :
SYSlerp(nmin, nmax, (v-omin)/d);
979 return (d == 0) ? 0.5 * (nmin+nmax) :
SYSlerp(nmin, nmax, (v-omin)/d);
985 if (val < 0)
return nmin;
986 if (val > 1)
return nmax;
987 return SYSlerp(nmin, nmax, val);
993 if (val < 0)
return nmin;
994 if (val > 1)
return nmax;
995 return SYSlerp(nmin, nmax, val);
1003 return SYSefit(v, omin, omax, 0.0f, 1.0f);
1009 return SYSefit(v, omin, omax, 0.0, 1.0);
1017 return (ax > dx ? 0 : 1 - ax / dx);
1024 return (ax > dx ? 0 : 1 - ax / dx);
1042 template<
typename T>
1044 SYSroundDownToMultipleOf(T val, T multiple)
1050 int rem = val % multiple;
1055 return val - multiple - rem;
1066 fpreal32 modulus = SYSfmod(val, multiple);
1081 fpreal64 modulus = SYSfmod(val, multiple);
1090 template<
typename T>
1092 SYSroundUpToMultipleOf(T val, T multiple)
1098 int rem = val % multiple;
1105 return val + multiple - rem;
1115 modulus = SYSfmod(val, multiple);
1120 return val - modulus;
1130 modulus = SYSfmod(val, multiple);
1135 return val - modulus;
1139 SYSroundUpPow2(
uint32 val)
1155 static constexpr
inline uint32
1156 SYSwang_inthash(
uint32 key)
1159 key += ~(key << 16);
1169 static constexpr
inline uint32
1170 SYSmultiplicative_inthash(
uint32 key)
1175 return key * 2654435761u;
1178 static constexpr
inline uint64
1179 SYSmultiplicative_inthash64(
uint64 key)
1182 return key * 11400714819323198485llu;
1185 static constexpr
inline uint64
1186 SYSwang_inthash64(
uint64 key)
1189 key += ~(key << 32ULL);
1191 key += ~(key << 13);
1195 key += ~(key << 27);
1200 static constexpr
inline uint32
1201 SYSsharpe_inthash(
uint32 key)
1210 key ^= ~(key >> 15);
1216 static constexpr
inline uint32
1217 SYSwang2_inthash(
uint32 key)
1221 constexpr
uint c2=0x27d4eb2d;
1222 key = (key ^ 61) ^ (key >> 16);
1223 key = key + (key << 3);
1224 key = key ^ (key >> 4);
1226 key = key ^ (key >> 15);
1230 static constexpr
inline uint64
1231 SYSwang2_inthash(
uint64 key)
1235 key = (~key) + (key << 21);
1236 key = key ^ (key >> 24);
1237 key = (key + (key << 3)) + (key << 8);
1238 key = key ^ (key >> 14);
1239 key = (key + (key << 2)) + (key << 4);
1240 key = key ^ (key >> 28);
1241 key = key + (key << 31);
1246 SYSreal_hash(
fpreal16 a,
int lowmask=0x3)
1248 return SYSwang_inthash(a.
bits() & (~lowmask));
1252 SYSreal_hashseed(
fpreal16 a,
uint seed,
int lowmask=0x3)
1254 return SYSwang_inthash(seed + (a.
bits() & (~lowmask)));
1258 SYSreal_hash(
fpreal32 a,
int lowmask=0xf)
1262 return SYSwang_inthash(ai.
uval & (~lowmask));
1266 SYSreal_hashseed(
fpreal32 a,
uint seed,
int lowmask=0xf)
1270 return SYSwang_inthash(seed + (ai.
uval & (~lowmask)));
1274 SYSreal_hash(
fpreal64 a,
int lowmask=0xf)
1278 return SYSwang_inthash64(ai.
uval & (~lowmask));
1286 return SYSwang_inthash64(seed + (ai.
uval & (~lowmask)));
1289 static constexpr
inline uint
1290 SYSvector_hash(
const int32 *vector,
int size)
1293 for (
int i = 0; i <
size; ++i)
1294 hash = SYSwang_inthash(hash + vector[i]);
1298 static constexpr
inline uint
1299 SYSvector_hash(
const int64 *vector,
int size)
1302 for (
int i = 0; i <
size; ++i)
1303 hash = (
uint)SYSwang_inthash64(hash + vector[i]);
1308 SYSvector_hash(
const fpreal16 *vector,
int size)
1311 for (
int i = 0; i <
size; ++i)
1312 hash = SYSreal_hashseed(vector[i], hash);
1317 SYSvector_hash(
const fpreal32 *vector,
int size)
1320 for (
int i = 0; i <
size; ++i)
1321 hash = SYSreal_hashseed(vector[i], hash);
1326 SYSvector_hash(
const fpreal64 *vector,
int size)
1329 for (
int i = 0; i <
size; ++i)
1330 hash = SYSreal_hashseed(vector[i], hash);
1339 static inline size_t
1340 SYSvector3_hash(
const P &vector)
1342 static constexpr
size_t p1 = 73856093;
1343 static constexpr
size_t p2 = 19349663;
1344 static constexpr
size_t p3 = 83492791;
1346 return size_t(vector.x()*p1) ^
size_t(vector.y()*p2) ^
size_t(vector.z()*p3);
1349 static inline size_t
1350 SYSpointerHash(
const void *
ptr)
1356 return v ^ (v >> 29);
1361 SYShashToFloat01(
uint hash)
1364 tmp.
uval = 0x3f800000 | (0x007fffff & hash);
1365 return tmp.
fval-1.0F;
1370 SYSfastRandom(
uint &seed)
1372 seed = seed*1664525 + 1013904223;
1373 return SYShashToFloat01(seed);
1377 SYSrandom(
uint &seed)
1379 seed = seed*1664525 + 1013904223;
1380 return SYShashToFloat01(SYSwang_inthash(seed));
1383 static constexpr
uint
1384 SYSfastRandomInt(
uint &seed)
1386 seed = seed*1664525 + 1013904223;
1387 return SYSwang_inthash(seed);
1391 SYSfastRandomZero(
uint &seed)
1393 return SYSfastRandom(seed) - 0.5F;
1397 SYSrandomZero(
uint &seed)
1399 return SYSrandom(seed) - 0.5F;
1402 template <
typename T>
1403 static constexpr
inline void
1404 SYSminmax(T
v0, T
v1, T
v2, T
v3, T &min, T &max)
1406 min =
SYSmin(v0, v1, v2, v3);
1407 max =
SYSmax(v0, v1, v2, v3);
1410 template <
typename T>
1411 static constexpr
inline void
1412 SYSminmax(T
v0, T
v1, T
v2, T &min, T &max)
1414 min =
SYSmin(v0, v1, v2);
1415 max =
SYSmax(v0, v1, v2);
1418 template <
typename T>
1419 static constexpr
inline void
1420 SYSminmax(T
v0, T
v1, T &min, T &max)
1433 sintheta = slope / SYSsqrt(slope*slope + (
fpreal32)1);
1437 costheta = one_over_m / SYSsqrt(one_over_m*one_over_m + 1);
1440 costheta = SYSsqrt((
fpreal32)1 - sintheta*sintheta);
1447 sintheta = slope / SYSsqrt(slope*slope + (
fpreal64)1);
1451 costheta = one_over_m / SYSsqrt(one_over_m*one_over_m + 1);
1454 costheta = SYSsqrt((
fpreal64)1 - sintheta*sintheta);
1457 inline constexpr
static bool
1463 inline constexpr
static bool
1469 inline constexpr
static bool
1472 return (v0 ^ v1) >= 0;
1475 inline constexpr
static bool
1478 return (v0 ^ v1) >= 0;
1482 SYSnextPrime(
uint num)
1487 static constexpr
inline int
1488 SYShexCharToInt(
char c)
1492 if (c >=
'0' && c <=
'9')
1494 if (c >=
'a' && c <=
'f')
1495 return c -
'a' + 10;
1496 if (c >=
'A' && c <=
'F')
1497 return c -
'A' + 10;
1501 static constexpr
inline char
1502 SYSintToHexChar(
int value)
1505 return value < 10 ?
'0' + value :
'a' + value - 10;
1508 SYS_API void SYSsort(
int &a,
int &b);
1509 SYS_API void SYSsort(
int &a,
int &b,
int &c);
1512 SYS_API void SYSsort(
float &a,
float &b);
1513 SYS_API void SYSsort(
float &a,
float &b,
float &c);
1514 SYS_API void SYSsort(
double &a,
double &b);
1515 SYS_API void SYSsort(
double &a,
double &b,
double &c);
1519 static constexpr
inline void
1520 SYSdivMod(
int numerator,
int denominator,
int "ient,
int &
remainder)
1522 quotient = numerator / denominator;
1523 remainder = numerator % denominator;
1526 static constexpr
inline void
1529 quotient = numerator / denominator;
1530 remainder = numerator % denominator;
1538 #define SYSmax(a,b) ((a) > (b) ? (a) : (b))
1539 #define SYSmin(a,b) ((a) < (b) ? (a) : (b))
1540 #define SYSabs(a) ((a) < 0 ? (a) : -(a))
bool SYSisNormal(fpreal64 f)
SYS_API float acosf(float x)
SYS_API double cos(double x)
typedef int(APIENTRYP RE_PFNGLXSWAPINTERVALSGIPROC)(int)
SYS_API double fmod(double x, double y)
SYS_API double atan2(double y, double x)
UT_Vector3T< T > SYSrecip(const UT_Vector3T< T > &v)
SYS_API double expm1(double x)
SYS_API void SYSsrand48(long seed)
bool SYSisFinite(fpreal64 f)
bool SYSisInf(fpreal64 f)
bool SYSisInteger(const UT_Vector2T< T > &v1)
Componentwise integer test.
vfloat4 sqrt(const vfloat4 &a)
OIIO_HOSTDEVICE void sincos(float x, float *sine, float *cosine)
constexpr bool SYSisNan(const F f)
GLboolean GLboolean GLboolean GLboolean a
SYS_API float atan2f(float y, float x)
ImageBuf OIIO_API min(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
UT_Matrix2T< T > SYSbilerp(const UT_Matrix2T< T > &u0v0, const UT_Matrix2T< T > &u1v0, const UT_Matrix2T< T > &u0v1, const UT_Matrix2T< T > &u1v1, S u, S v)
Bilinear interpolation.
**But if you need a result
GLfloat GLfloat GLfloat v2
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
unsigned long long uint64
GLfloat GLfloat GLfloat GLfloat v3
SYS_API double log10(double x)
UT_Matrix2T< T > SYSbarycentric(const UT_Matrix2T< T > &v0, const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S u, S v)
Barycentric interpolation.
SYS_API float log10f(float x)
ImageBuf OIIO_API pow(const ImageBuf &A, cspan< float > B, ROI roi={}, int nthreads=0)
SYS_API double asin(double x)
IMATH_HOSTDEVICE constexpr int trunc(T x) IMATH_NOEXCEPT
SYS_API double sinh(double x)
SYS_API double copysign(double x, double y)
SYS_API float atanf(float x)
SYS_API fpreal32 SYSroundAngle(fpreal32 base, fpreal32 source)
UT_Vector3T< T > SYSclamp(const UT_Vector3T< T > &v, const UT_Vector3T< T > &min, const UT_Vector3T< T > &max)
GLsizei GLsizei GLchar * source
SYS_API double cosh(double x)
SYS_API bool SYSisPrime(uint num)
SYS_API void sincosf(float x, float *s, float *c)
constexpr int SYSsignum(const F a) noexcept
SYS_API double SYSdrand48()
SYS_API fpreal32 SYSfloor(fpreal32 val)
UT_Vector2T< T > SYSinvlerp(const UT_Vector2T< T > &a, const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
Componentwise inverse linear interpolation.
SYS_API float logf(float x)
SYS_API double acos(double x)
SYS_API bool SYSisInt(const char *str)
SYS_API double hypot(double x, double y)
GLboolean GLboolean GLboolean b
fpreal32 SYSrint(fpreal32 val)
SYS_API double log1p(double x)
SYS_API double tanh(double x)
bool SYSequalZero(const UT_Vector3T< T > &v)
SYS_API uint SYSmakePrime(uint num)
SYS_API double tan(double x)
SYS_API double atan(double x)
ImageBuf OIIO_API max(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
SYS_API float asinf(float x)
unsigned short bits() const
OIIO_FORCEINLINE T log(const T &v)
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
SYS_API bool SYSisFloat(const char *str)
SYS_API double sin(double x)
SYS_API fpreal32 SYSceil(fpreal32 val)
bool isNormalized() const
OIIO_FORCEINLINE OIIO_HOSTDEVICE T degrees(T rad)
Convert radians to degrees.