13 #ifndef __SYS_MathPermute__
14 #define __SYS_MathPermute__
17 #error "SYS_MathPermute.h should only be included by SYS_Math.h"
20 #define _ARGS_2_IMPL(fname, CONSTEXPR) \
21 static CONSTEXPR inline fpreal64 fname(fpreal32 a, fpreal64 b) \
22 { return fname((fpreal64)a, b); } \
23 static CONSTEXPR inline fpreal64 fname(fpreal64 a, fpreal32 b) \
24 { return fname(a, (fpreal64)b); } \
26 #define ARGS_2(fname) _ARGS_2_IMPL(fname, )
27 #define ARGS_2_CE(fname) _ARGS_2_IMPL(fname, constexpr)
29 #define _ARGS_3_IMPL(fname, CONSTEXPR) \
30 static CONSTEXPR inline fpreal64 fname(fpreal32 a, fpreal64 b, fpreal64 c) \
31 { return fname((fpreal64)a, b, c); } \
32 static CONSTEXPR inline fpreal64 fname(fpreal64 a, fpreal32 b, fpreal64 c) \
33 { return fname(a, (fpreal64)b, c); } \
34 static CONSTEXPR inline fpreal64 fname(fpreal32 a, fpreal32 b, fpreal64 c) \
35 { return fname((fpreal64)a, (fpreal64)b, c); } \
36 static CONSTEXPR inline fpreal64 fname(fpreal64 a, fpreal64 b, fpreal32 c) \
37 { return fname(a, b, (fpreal64)c); } \
38 static CONSTEXPR inline fpreal64 fname(fpreal32 a, fpreal64 b, fpreal32 c) \
39 { return fname((fpreal64)a, b, (fpreal64)c); } \
40 static CONSTEXPR inline fpreal64 fname(fpreal64 a, fpreal32 b, fpreal32 c) \
41 { return fname(a, (fpreal64)b, (fpreal64)c); }
43 #define ARGS_3(fname) _ARGS_3_IMPL(fname, )
44 #define ARGS_3_CE(fname) _ARGS_3_IMPL(fname, constexpr)
46 #define _ARGS_4_IMPL(fname, CONSTEXPR) \
47 static CONSTEXPR inline fpreal64 fname(fpreal64 a,fpreal32 b,fpreal32 c,fpreal32 d) \
48 { return fname(a, (fpreal64)b, (fpreal64)c, (fpreal64)d); } \
49 static CONSTEXPR inline fpreal64 fname(fpreal32 a,fpreal64 b,fpreal32 c,fpreal32 d) \
50 { return fname((fpreal64)a, b, (fpreal64)c, (fpreal64)d); } \
51 static CONSTEXPR inline fpreal64 fname(fpreal64 a,fpreal64 b,fpreal32 c,fpreal32 d) \
52 { return fname(a, b, (fpreal64)c, (fpreal64)d); } \
53 static CONSTEXPR inline fpreal64 fname(fpreal32 a,fpreal32 b,fpreal64 c,fpreal32 d) \
54 { return fname((fpreal64)a, (fpreal64)b, c, (fpreal64)d); } \
55 static CONSTEXPR inline fpreal64 fname(fpreal64 a,fpreal32 b,fpreal64 c,fpreal32 d) \
56 { return fname(a, (fpreal64)b, c, (fpreal64)d); } \
57 static CONSTEXPR inline fpreal64 fname(fpreal32 a,fpreal64 b,fpreal64 c,fpreal32 d) \
58 { return fname((fpreal64)a, b, c, (fpreal64)d); } \
59 static CONSTEXPR inline fpreal64 fname(fpreal64 a,fpreal64 b,fpreal64 c,fpreal32 d) \
60 { return fname(a, b, c, (fpreal64)d); } \
61 static CONSTEXPR inline fpreal64 fname(fpreal32 a,fpreal32 b,fpreal32 c,fpreal64 d) \
62 { return fname((fpreal64)a, (fpreal64)b, (fpreal64)c, d); } \
63 static CONSTEXPR inline fpreal64 fname(fpreal64 a,fpreal32 b,fpreal32 c,fpreal64 d) \
64 { return fname(a, (fpreal64)b, (fpreal64)c, d); } \
65 static CONSTEXPR inline fpreal64 fname(fpreal32 a,fpreal64 b,fpreal32 c,fpreal64 d) \
66 { return fname((fpreal64)a, b, (fpreal64)c, d); } \
67 static CONSTEXPR inline fpreal64 fname(fpreal64 a,fpreal64 b,fpreal32 c,fpreal64 d) \
68 { return fname(a, b, (fpreal64)c, d); } \
69 static CONSTEXPR inline fpreal64 fname(fpreal32 a,fpreal32 b,fpreal64 c,fpreal64 d) \
70 { return fname((fpreal64)a, (fpreal64)b, c, d); } \
71 static CONSTEXPR inline fpreal64 fname(fpreal64 a,fpreal32 b,fpreal64 c,fpreal64 d) \
72 { return fname(a, (fpreal64)b, c, d); } \
73 static CONSTEXPR inline fpreal64 fname(fpreal32 a,fpreal64 b,fpreal64 c,fpreal64 d) \
74 { return fname((fpreal64)a, b, c, d); }
76 #define ARGS_4(fname) _ARGS_4_IMPL(fname, )
77 #define ARGS_4_CE(fname) _ARGS_4_IMPL(fname, constexpr)
102 static constexpr inline
bool
106 static constexpr
inline bool
110 #define _CMP_PERM_IMPL(fname, CONSTEXPR) \
111 static CONSTEXPR inline bool fname(fpreal32 a, fpreal32 b, fpreal64 tol) \
112 { return fname(a, b, (fpreal32)tol); } \
113 static CONSTEXPR inline bool fname(fpreal64 a, fpreal64 b, fpreal32 tol) \
114 { return fname(a, b, (fpreal64)tol); } \
115 static CONSTEXPR inline bool fname(fpreal32 a, fpreal64 b, fpreal32 tol) \
116 { return fname((fpreal64)a, b, (fpreal64)tol); } \
117 static CONSTEXPR inline bool fname(fpreal64 a, fpreal32 b, fpreal32 tol) \
118 { return fname(a, (fpreal64)b, (fpreal64)tol); } \
119 static CONSTEXPR inline bool fname(fpreal32 a, fpreal64 b, fpreal64 tol=SYS_FTOLERANCE_D) \
120 { return fname((fpreal64)a, b, tol); } \
121 static CONSTEXPR inline bool fname(fpreal64 a, fpreal32 b, fpreal64 tol=SYS_FTOLERANCE_D) \
122 { return fname(a, (fpreal64)b, tol); } \
123 static CONSTEXPR inline bool fname(fpreal32 a, int b, fpreal32 tol=SYS_FTOLERANCE) \
124 { return fname(a, (fpreal32)b, tol); } \
125 static CONSTEXPR inline bool fname(fpreal32 a, int b, fpreal64 tol) \
126 { return fname((fpreal64)a, (fpreal64)b, tol); } \
127 static CONSTEXPR inline bool fname(fpreal64 a, int b, fpreal64 tol=SYS_FTOLERANCE_D) \
128 { return fname(a, (fpreal64)b, tol); } \
129 static CONSTEXPR inline bool fname(int a, fpreal32 b, fpreal32 tol=SYS_FTOLERANCE) \
130 { return fname((fpreal32)a, b, tol); } \
131 static CONSTEXPR inline bool fname(int a, fpreal32 b, fpreal64 tol) \
132 { return fname((fpreal64)a, (fpreal64)b, tol); } \
133 static CONSTEXPR inline bool fname(int a, fpreal64 b, fpreal64 tol=SYS_FTOLERANCE_D) \
134 { return fname((fpreal64)a, b, tol); }
136 #define CMP_PERM(fname) _CMP_PERM_IMPL(fname, )
137 #define CMP_PERM_CE(fname) _CMP_PERM_IMPL(fname, constexpr)
147 #undef _CMP_PERM_IMPL
UT_Matrix2T< T > SYSlerp(const UT_Matrix2T< T > &v1, const UT_Matrix2T< T > &v2, S t)
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)
bool SYSequalZero(const UT_Vector3T< T > &v)
#define CMP_PERM_CE(fname)
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.