160 #if !defined(SESI_ALLOW_DRAND48)
166 #define srand48(X) static_assert(0, "Use SYSsrand48() instead")
167 #define drand48(X) 0; { static_assert(0, "Use SYSdrand48() instead"); }
174 template<
typename F >
178 return int(F(0) <
a) -
int(
a < F(0));
182 template<
typename F >
183 constexpr
inline bool
239 #if defined(__cplusplus)
245 #define h_min(a, b) (((a) > (b)) ? (b) : (a))
246 #define h_argmin(a, b) (((a) > (b)) ? 1 : 0)
247 #define h_max(a, b) (((a) < (b)) ? (b) : (a))
248 #define h_argmax(a, b) (((a) < (b)) ? 1 : 0)
250 #define h_abs(a) (((a) > 0) ? (a) : -(a))
251 #define h_sgn(a) (((a) > 0) ? 1 : (((a) < 0) ? -1 : 0))
257 static constexpr
inline int16 SYSsgn(
int16 a) {
return h_sgn(a); }
258 static constexpr
inline int SYSargmin(
int16 a,
int16 b) {
return h_argmin(a,b);}
259 static constexpr
inline int SYSargmax(
int16 a,
int16 b) {
return h_argmax(a,b);}
263 static constexpr
inline int32 SYSsgn(
int32 a) {
return h_sgn(a); }
264 static constexpr
inline int SYSargmin(
int32 a,
int32 b) {
return h_argmin(a,b);}
265 static constexpr
inline int SYSargmax(
int32 a,
int32 b) {
return h_argmax(a,b);}
273 static constexpr
inline int64 SYSsgn(
int64 a) {
return h_sgn(a); }
274 static constexpr
inline int SYSargmin(
int64 a,
int64 b) {
return h_argmin(a,b);}
275 static constexpr
inline int SYSargmax(
int64 a,
int64 b) {
return h_argmax(a,b);}
278 static constexpr
inline int SYSargmin(
uint16 a,
uint16 b) {
return h_argmin(a,b);}
279 static constexpr
inline int SYSargmax(
uint16 a,
uint16 b) {
return h_argmax(a,b);}
282 static constexpr
inline int SYSargmin(
uint32 a,
uint32 b) {
return h_argmin(a,b);}
283 static constexpr
inline int SYSargmax(
uint32 a,
uint32 b) {
return h_argmax(a,b);}
286 static constexpr
inline int SYSargmin(
uint64 a,
uint64 b) {
return h_argmin(a,b);}
287 static constexpr
inline int SYSargmax(
uint64 a,
uint64 b) {
return h_argmax(a,b);}
306 static constexpr
inline size_t SYSmin(
size_t a,
size_t b) {
return h_min(a,b); }
307 static constexpr
inline size_t SYSmax(
size_t a,
size_t b) {
return h_max(a,b); }
308 static constexpr
inline int SYSargmin(
size_t a,
size_t b) {
return h_argmin(a,b);}
309 static constexpr
inline int SYSargmax(
size_t a,
size_t b) {
return h_argmax(a,b);}
310 static constexpr
inline size_t SYSmin(
long a,
long b) {
return h_min(a,b); }
311 static constexpr
inline size_t SYSmax(
long a,
long b) {
return h_max(a,b); }
312 static constexpr
inline int SYSargmin(
long a,
long b) {
return h_argmin(a,b);}
313 static constexpr
inline int SYSargmax(
long a,
long b) {
return h_argmax(a,b);}
321 #define h_clamp(val, min, max, tol) \
322 ((val <= min+tol) ? min : ((val >= max-tol) ? max : val))
324 static constexpr
inline int
326 {
return h_clamp(v, min, max, 0); }
328 static constexpr
inline uint
330 {
return h_clamp(v, min, max, 0); }
332 static constexpr
inline int64
336 static constexpr
inline uint64
342 {
return h_clamp(v, min, max, tol); }
346 {
return h_clamp(v, min, max, tol); }
351 static constexpr
inline float SYSclamp01(
float v)
353 static constexpr
inline double SYSclamp01(
double v)
357 static constexpr
inline float SYSclamp01_excl1(
float v)
358 {
return SYSclamp(v, 0.
f, 1.
f - FLT_EPSILON/FLT_RADIX); }
359 static constexpr
inline double SYSclamp01_excl1(
double v)
360 {
return SYSclamp(v, 0.0, 1.0 - DBL_EPSILON/FLT_RADIX); }
364 template<
typename OUTTYPE,
typename INTYPE>
365 constexpr OUTTYPE SYSclampInt(INTYPE
value)
369 return OUTTYPE(value);
374 # define SYS_MF(X) SYS_FastMath::X
376 # define SYS_MF(X) ::X
379 #define SYS_UNARY(func) \
380 static inline fpreal64 SYS##func(fpreal64 arg) \
381 { return SYS_MF(func)(arg); } \
382 static inline fpreal32 SYS##func(fpreal32 arg) \
383 { return SYS_MF(func##f)(arg); } \
384 static inline fpreal64 SYS##func(int64 arg) \
385 { return SYS_MF(func)((fpreal64)arg); } \
386 static inline fpreal64 SYS##func(int32 arg) \
387 { return SYS_MF(func)((fpreal64)arg); } \
389 #define SYS_BINARY(func) \
390 static inline fpreal64 SYS##func(fpreal64 a, fpreal64 b) \
391 { return SYS_MF(func)(a,b); } \
392 static inline fpreal32 SYS##func(fpreal32 a, fpreal32 b) \
393 { return SYS_MF(func##f)(a, b); } \
397 #define hypotf(x,y) hypot((x),(y))
416 #define SYS_UNARY_PI(func) \
417 static inline fpreal64 SYS##func##pi(fpreal64 arg) \
418 { return SYS##func( SYSfmod(arg, 2.0) * M_PI ); } \
419 static inline fpreal32 SYS##func##pi(fpreal32 arg) \
420 { return SYS##func( SYSfmod(arg, 2.0f) * M_PI ); } \
421 static inline fpreal64 SYS##func##pi(int64 arg) \
422 { return SYS##func( (arg % 2) * M_PI ); } \
423 static inline fpreal32 SYS##func##pi(int32 arg) \
424 { return SYS##func( (arg % 2) * M_PI ); } \
436 {
return x > 0 ? SYSsqrt(x) : 0; }
438 {
return x > 0 ? SYSsqrt(x) : 0; }
440 {
return y != 0 ? SYSfmod(x, y) : 0; }
442 {
return y != 0 ? SYSfmod(x, y) : 0; }
458 { __sincosf(x,s,c); }
464 __sincosf(x,&s32,&c32);
470 { *s = SYSsin(x); *c = SYScos(x); }
472 { *s = SYSsin(x); *c = SYScos(x); }
478 #include <xmmintrin.h>
482 #if defined(WIN32) || defined(LINUX) || defined(MBSD)
488 vec = _mm_rsqrt_ss(vec);
491 return 1.0f/SYSsqrt(x);
498 #if defined(WIN32) || defined(LINUX) || defined(MBSD)
499 fpreal32 approximate = SYSrsqrt11(x);
533 uint32 r = (x > 0xFFFFu) << 4; x >>=
r;
534 uint32 shift = (x > 0xFFu ) << 3; x >>= shift; r |= shift;
535 shift = (x > 0xFu ) << 2; x >>= shift; r |= shift;
536 shift = (x > 0x3u ) << 1;
537 return r | shift | (x >> (shift+1));
556 {
return SYS_MF(
atanf)(
a); }
564 {
return SYS_MF(
atan) (
a); }
566 {
return SYS_MF(
atan2)(
y,
x); }
569 {
return x > 0 ? SYSpow(x, y) : x < 0 ? SYSpow(x,
SYSrint(y)) : y == 0 ? 1 : 0; }
571 {
return x > 0 ? SYSpow(x, y) : x < 0 ? SYSpow(x,
SYSrint(y)) : y == 0 ? 1 : 0; }
578 {
return SYSsafediv( (
fpreal32)1, a ); }
580 {
return SYSsafediv( (
fpreal64)1, a ); }
600 static constexpr
inline fpreal32 SYSpow4(
fpreal32 a) {
return SYSpow2(SYSpow2(a)); }
601 static constexpr
inline fpreal64 SYSpow4(
fpreal64 a) {
return SYSpow2(SYSpow2(a)); }
605 #define h_compare(func, code) \
606 static inline bool func(fpreal32 a, fpreal32 b, \
607 fpreal32 tol=SYS_FTOLERANCE) \
609 static inline bool func(fpreal64 a, fpreal64 b, \
610 fpreal64 tol=SYS_FTOLERANCE_D) \
612 #define h_compare_ce(func, code) \
613 static constexpr inline bool func(fpreal32 a, fpreal32 b, \
614 fpreal32 tol=SYS_FTOLERANCE) \
616 static constexpr inline bool func(fpreal64 a, fpreal64 b, \
617 fpreal64 tol=SYS_FTOLERANCE_D) \
620 static constexpr
inline bool
622 {
return a >= -tol && a <= tol; }
624 static constexpr
inline bool
626 {
return a >= -tol && a <= tol; }
628 static constexpr
inline bool
630 {
return a >= -tol && a <= tol; }
632 static constexpr
inline bool
634 {
return a >= -tol && a <= tol; }
637 h_compare_ce(SYSisGreater, (a-
b) > tol)
638 h_compare_ce(SYSisGreaterOrEqual, (a-
b) >= -tol)
639 h_compare_ce(SYSisLess, (a-
b) < -tol)
640 h_compare_ce(SYSisLessOrEqual, (a-
b) <= tol)
646 constexpr
inline bool SYSisGreater(
int32 a,
int32 b) {
return a >
b; }
647 constexpr
inline bool SYSisGreater(
int64 a,
int64 b) {
return a >
b; }
648 constexpr
inline bool SYSisGreaterOrEqual(
int32 a,
int32 b) {
return a >=
b; }
649 constexpr
inline bool SYSisGreaterOrEqual(
int64 a,
int64 b) {
return a >=
b; }
650 constexpr
inline bool SYSisLess(
int32 a,
int32 b) {
return a <
b; }
651 constexpr
inline bool SYSisLess(
int64 a,
int64 b) {
return a <
b; }
652 constexpr
inline bool SYSisLessOrEqual(
int32 a,
int32 b) {
return a <=
b; }
653 constexpr
inline bool SYSisLessOrEqual(
int64 a,
int64 b) {
return a <=
b; }
659 if (SYSfabs(a - b) <= tol)
672 if ((a < 0) != (b < 0))
693 if (SYSfabs(a - b) <= tol)
706 if ((a < 0) != (b < 0))
724 return SYSalmostEqual(a, b, (
int64)ulps, tol);
732 #define h_max3(type) \
733 static constexpr inline type \
734 SYSmax(type v0, type v1, type v2) { \
735 return SYSmax(v2, SYSmax(v0, v1)); \
737 #define h_max4(type) \
738 static constexpr inline type \
739 SYSmax(type v0, type v1, type v2, type v3) { \
740 return SYSmax(SYSmax(v0, v1), SYSmax(v2, v3)); \
742 #define h_argmax3(type) \
743 static constexpr inline int \
744 SYSargmax(type v0, type v1, type v2) { \
745 return v2 > SYSmax(v0, v1) ? 2 : SYSargmax(v0, v1); \
747 #define h_argmax4(type) \
748 static constexpr inline int \
749 SYSargmax(type v0, type v1, type v2, type v3) { \
750 return SYSmax(v0, v1) < SYSmax(v2, v3) ? \
751 (SYSargmax(v2, v3) + 2) : SYSargmax(v0, v1); \
753 #define h_min3(type) \
754 static constexpr inline type \
755 SYSmin(type v0, type v1, type v2) { \
756 return SYSmin(v2, SYSmin(v0, v1)); \
758 #define h_min4(type) \
759 static constexpr inline type \
760 SYSmin(type v0, type v1, type v2, type v3) { \
761 return SYSmin(SYSmin(v0, v1), SYSmin(v2, v3)); \
763 #define h_argmin3(type) \
764 static constexpr inline int \
765 SYSargmin(type v0, type v1, type v2) { \
766 return v2 < SYSmin(v0, v1) ? 2 : SYSargmin(v0, v1); \
768 #define h_argmin4(type) \
769 static constexpr inline int \
770 SYSargmin(type v0, type v1, type v2, type v3) { \
771 return SYSmin(v0, v1) > SYSmin(v2, v3) ? \
772 (SYSargmin(v2, v3) + 2) : SYSargmin(v0, v1); \
776 #define h_max(type) h_min3(type) h_min4(type) h_max3(type) h_max4(type) \
777 h_argmin3(type) h_argmin4(type) \
778 h_argmax3(type) h_argmax4(type)
780 #define h_avg3(type) \
781 static constexpr inline type \
782 SYSavg(type v0, type v1, type v2) { \
783 return (v0+v1+v2) * ((type)(1.0/3.0)); \
785 #define h_avg4(type) \
786 static constexpr inline type \
787 SYSavg(type v0, type v1, type v2, type v3) { \
788 return (v0+v1+v2+v3) * ((type)0.25); \
791 #define h_avg(type) h_avg3(type) h_avg4(type)
804 static constexpr inline
int32
806 {
return (a + b + c + 1) / 3; }
807 static constexpr
inline int32
809 {
return (a + b + c + d + 2) / 4; }
811 static constexpr
inline int64
813 {
return (a + b + c + 1) / 3; }
814 static constexpr
inline int64
816 {
return (a + b + c + d + 2) / 4; }
841 return v1 + (v2 -
v1)*t;
847 return v1 + (v2 -
v1)*t;
888 return v0*(1-u-
v) + v1*u + v2*v;
894 return v0*(1-u-
v) + v1*u + v2*v;
907 return ((a < 0) ^ (b < 0) && r != 0.0
f) ? r+b :
r;
914 return ((a < 0) ^ (b < 0) && r != 0.0) ? r+b :
r;
917 static constexpr
inline int32
923 return ((a < 0) ^ (b < 0) && r) ? r+b :
r;
926 static constexpr
inline int64
932 return ((a < 0) ^ (b < 0) && r) ? r+b :
r;
938 if (val <= min)
return 0;
939 if (val >= max)
return 1;
949 if (val <= min)
return 0;
950 if (val >= max)
return 1;
964 (
fpreal32)1/roll) : SYSpow(f, roll);
974 fpreal64 f = SYSsmooth(min, max, value);
976 (
fpreal64)1/roll) : SYSpow(f, roll);
985 fpreal32 tmp = (d == 0) ? 0.5f * (nmin+nmax) :
SYSlerp(nmin, nmax, (val-omin)/d);
994 fpreal64 tmp = (d == 0) ? 0.5 * (nmin+nmax) :
SYSlerp(nmin, nmax, (val-omin)/d);
1004 return (d == 0) ? 0.5f * (nmin+nmax) :
SYSlerp(nmin, nmax, (v-omin)/d);
1011 return (d == 0) ? 0.5 * (nmin+nmax) :
SYSlerp(nmin, nmax, (v-omin)/d);
1017 if (val < 0)
return nmin;
1018 if (val > 1)
return nmax;
1019 return SYSlerp(nmin, nmax, val);
1025 if (val < 0)
return nmin;
1026 if (val > 1)
return nmax;
1027 return SYSlerp(nmin, nmax, val);
1035 return SYSefit(v, omin, omax, 0.0f, 1.0f);
1041 return SYSefit(v, omin, omax, 0.0, 1.0);
1049 return (ax > dx ? 0 : 1 - ax / dx);
1056 return (ax > dx ? 0 : 1 - ax / dx);
1074 template<
typename T>
1076 SYSroundDownToMultipleOf(T val, T multiple)
1082 int rem = val % multiple;
1087 return val - multiple - rem;
1098 fpreal32 modulus = SYSfmod(val, multiple);
1113 fpreal64 modulus = SYSfmod(val, multiple);
1122 template<
typename T>
1124 SYSroundUpToMultipleOf(T val, T multiple)
1130 int rem = val % multiple;
1137 return val + multiple - rem;
1147 modulus = SYSfmod(val, multiple);
1152 return val - modulus;
1162 modulus = SYSfmod(val, multiple);
1167 return val - modulus;
1171 SYSroundUpPow2(
uint32 val)
1187 static constexpr
inline uint32
1188 SYSwang_inthash(
uint32 key)
1191 key += ~(key << 16);
1201 static constexpr
inline uint32
1202 SYSmultiplicative_inthash(
uint32 key)
1207 return key * 2654435761u;
1210 static constexpr
inline uint64
1211 SYSmultiplicative_inthash64(
uint64 key)
1214 return key * 11400714819323198485llu;
1217 static constexpr
inline uint64
1218 SYSwang_inthash64(
uint64 key)
1221 key += ~(key << 32ULL);
1223 key += ~(key << 13);
1227 key += ~(key << 27);
1232 static constexpr
inline uint32
1233 SYSsharpe_inthash(
uint32 key)
1242 key ^= ~(key >> 15);
1248 static constexpr
inline uint32
1249 SYSwang2_inthash(
uint32 key)
1253 constexpr
uint c2=0x27d4eb2d;
1254 key = (key ^ 61) ^ (key >> 16);
1255 key = key + (key << 3);
1256 key = key ^ (key >> 4);
1258 key = key ^ (key >> 15);
1262 static constexpr
inline uint64
1263 SYSwang2_inthash(
uint64 key)
1267 key = (~key) + (key << 21);
1268 key = key ^ (key >> 24);
1269 key = (key + (key << 3)) + (key << 8);
1270 key = key ^ (key >> 14);
1271 key = (key + (key << 2)) + (key << 4);
1272 key = key ^ (key >> 28);
1273 key = key + (key << 31);
1278 SYSreal_hash(
fpreal16 a,
int lowmask=0x3)
1280 return SYSwang_inthash(a.
bits() & (~lowmask));
1284 SYSreal_hashseed(
fpreal16 a,
uint seed,
int lowmask=0x3)
1286 return SYSwang_inthash(seed + (a.
bits() & (~lowmask)));
1290 SYSreal_hash(
fpreal32 a,
int lowmask=0xf)
1294 return SYSwang_inthash(ai.
uval & (~lowmask));
1298 SYSreal_hashseed(
fpreal32 a,
uint seed,
int lowmask=0xf)
1302 return SYSwang_inthash(seed + (ai.
uval & (~lowmask)));
1306 SYSreal_hash(
fpreal64 a,
int lowmask=0xf)
1310 return SYSwang_inthash64(ai.
uval & (~lowmask));
1318 return SYSwang_inthash64(seed + (ai.
uval & (~lowmask)));
1321 static constexpr
inline uint
1322 SYSvector_hash(
const int32 *vector,
int size)
1325 for (
int i = 0; i <
size; ++i)
1326 hash = SYSwang_inthash(hash + vector[i]);
1330 static constexpr
inline uint
1331 SYSvector_hash(
const int64 *vector,
int size)
1334 for (
int i = 0; i <
size; ++i)
1335 hash = (
uint)SYSwang_inthash64(hash + vector[i]);
1340 SYSvector_hash(
const fpreal16 *vector,
int size)
1343 for (
int i = 0; i <
size; ++i)
1344 hash = SYSreal_hashseed(vector[i], hash);
1349 SYSvector_hash(
const fpreal32 *vector,
int size)
1352 for (
int i = 0; i <
size; ++i)
1353 hash = SYSreal_hashseed(vector[i], hash);
1358 SYSvector_hash(
const fpreal64 *vector,
int size)
1361 for (
int i = 0; i <
size; ++i)
1362 hash = SYSreal_hashseed(vector[i], hash);
1371 static inline size_t
1372 SYSvector3_hash(
const P &vector)
1374 static constexpr
size_t p1 = 73856093;
1375 static constexpr
size_t p2 = 19349663;
1376 static constexpr
size_t p3 = 83492791;
1378 return size_t(vector.x()*p1) ^
size_t(vector.y()*p2) ^
size_t(vector.z()*p3);
1381 static inline size_t
1382 SYSpointerHash(
const void *
ptr)
1388 return v ^ (v >> 29);
1393 SYShashToFloat01(
uint hash)
1396 tmp.
uval = 0x3f800000 | (0x007fffff & hash);
1397 return tmp.
fval-1.0F;
1402 SYSfastRandom(
uint &seed)
1404 seed = seed*1664525 + 1013904223;
1405 return SYShashToFloat01(seed);
1409 SYSrandom(
uint &seed)
1411 seed = seed*1664525 + 1013904223;
1412 return SYShashToFloat01(SYSwang_inthash(seed));
1415 static constexpr
uint
1416 SYSfastRandomInt(
uint &seed)
1418 seed = seed*1664525 + 1013904223;
1419 return SYSwang_inthash(seed);
1423 SYSfastRandomZero(
uint &seed)
1425 return SYSfastRandom(seed) - 0.5F;
1429 SYSrandomZero(
uint &seed)
1431 return SYSrandom(seed) - 0.5F;
1434 template <
typename T>
1435 static constexpr
inline void
1436 SYSminmax(T
v0, T
v1, T
v2, T
v3, T &min, T &max)
1438 min =
SYSmin(v0, v1, v2, v3);
1439 max =
SYSmax(v0, v1, v2, v3);
1442 template <
typename T>
1443 static constexpr
inline void
1444 SYSminmax(T
v0, T
v1, T
v2, T &min, T &max)
1446 min =
SYSmin(v0, v1, v2);
1447 max =
SYSmax(v0, v1, v2);
1450 template <
typename T>
1451 static constexpr
inline void
1452 SYSminmax(T
v0, T
v1, T &min, T &max)
1465 sintheta = slope / SYSsqrt(slope*slope + (
fpreal32)1);
1469 costheta = one_over_m / SYSsqrt(one_over_m*one_over_m + 1);
1472 costheta = SYSsqrt((
fpreal32)1 - sintheta*sintheta);
1479 sintheta = slope / SYSsqrt(slope*slope + (
fpreal64)1);
1483 costheta = one_over_m / SYSsqrt(one_over_m*one_over_m + 1);
1486 costheta = SYSsqrt((
fpreal64)1 - sintheta*sintheta);
1489 inline constexpr
static bool
1495 inline constexpr
static bool
1501 inline constexpr
static bool
1504 return (v0 ^ v1) >= 0;
1507 inline constexpr
static bool
1510 return (v0 ^ v1) >= 0;
1514 SYSnextPrime(
uint num)
1519 static constexpr
inline int
1520 SYShexCharToInt(
char c)
1524 if (c >=
'0' && c <=
'9')
1526 if (c >=
'a' && c <=
'f')
1527 return c -
'a' + 10;
1528 if (c >=
'A' && c <=
'F')
1529 return c -
'A' + 10;
1533 static constexpr
inline char
1534 SYSintToHexChar(
int value)
1537 return value < 10 ?
'0' + value :
'a' + value - 10;
1540 SYS_API void SYSsort(
int &a,
int &b);
1541 SYS_API void SYSsort(
int &a,
int &b,
int &c);
1544 SYS_API void SYSsort(
float &a,
float &b);
1545 SYS_API void SYSsort(
float &a,
float &b,
float &c);
1546 SYS_API void SYSsort(
double &a,
double &b);
1547 SYS_API void SYSsort(
double &a,
double &b,
double &c);
1551 static constexpr
inline void
1552 SYSdivMod(
int numerator,
int denominator,
int "ient,
int &remainder)
1554 quotient = numerator / denominator;
1555 remainder = numerator % denominator;
1558 static constexpr
inline void
1561 quotient = numerator / denominator;
1562 remainder = numerator % denominator;
1570 #define SYSmax(a,b) ((a) > (b) ? (a) : (b))
1571 #define SYSmin(a,b) ((a) < (b) ? (a) : (b))
1572 #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.