Go to the documentation of this file.
7 #ifndef INCLUDE_JET_MATH_UTILS_H_
8 #define INCLUDE_JET_MATH_UTILS_H_
28 inline bool similar(T x, T y, T eps = std::numeric_limits<T>::epsilon());
54 inline T
min3(T x, T y, T z);
68 inline T
max3(T x, T y, T z);
72 inline T
minn(
const T* x,
size_t n);
76 inline T
maxn(
const T* x,
size_t n);
101 template <
typename T>
105 template <
typename T>
109 template <
typename T>
112 template <
typename T>
115 template <
typename T>
118 template <
typename T>
121 template <
typename T>
133 template <
typename T>
145 template <
typename T>
159 template <
typename T>
160 inline T
clamp(T val, T low, T high);
171 template <
typename T>
183 template <
typename T>
212 template <
typename S,
typename T>
213 inline S
lerp(
const S& f0,
const S& f1, T t);
216 template <
typename S,
typename T>
217 inline S
bilerp(
const S& f00,
const S& f10,
const S& f01,
const S& f11, T tx,
221 template <
typename S,
typename T>
222 inline S
trilerp(
const S& f000,
const S& f100,
const S& f010,
const S& f110,
223 const S& f001,
const S& f101,
const S& f011,
const S& f111,
227 template <
typename S,
typename T>
228 inline S
catmullRom(
const S& f0,
const S& f1,
const S& f2,
const S& f3, T t);
231 template <
typename T>
237 #include "detail/math_utils-inl.h"
239 #endif // INCLUDE_JET_MATH_UTILS_H_
T absminn(const T *x, size_t n)
Returns absolute minimum among n-elements.
size_t argmax3(T x, T y, T z)
T radiansToDegrees(T angleInRadians)
Converts radians to degrees.
S trilerp(const S &f000, const S &f100, const S &f010, const S &f110, const S &f001, const S &f101, const S &f011, const S &f111, T tx, T ty, T tz)
Computes trilinear interpolation.
T min3(T x, T y, T z)
Returns the minimum value among three inputs.
T sign(T x)
Returns the sign of the value.
T square(T x)
Returns the square of x.
size_t argmin3(T x, T y, T z)
Definition: advection_solver2.h:18
T minn(const T *x, size_t n)
Returns minimum among n-elements.
void getBarycentric(T x, ssize_t iLow, ssize_t iHigh, ssize_t *i, T *t)
Gets the barycentric coordinate.
T absmaxn(const T *x, size_t n)
Returns absolute maximum among n-elements.
T cubic(T x)
Returns the cubic of x.
T clamp(T val, T low, T high)
Returns the clamped value.
T absmax(T x, T y)
Returns the absolute maximum value among the two inputs.
T monotonicCatmullRom(const T &f0, const T &f1, const T &f2, const T &f3, T t)
Computes monotonic Catmull-Rom interpolation.
T max3(T x, T y, T z)
Returns the maximum value among three inputs.
S lerp(const S &f0, const S &f1, T t)
Computes linear interpolation.
S catmullRom(const S &f0, const S &f1, const S &f2, const S &f3, T t)
Computes Catmull-Rom interpolation.
T maxn(const T *x, size_t n)
Returns maximum among n-elements.
T absmin(T x, T y)
Returns the absolute minimum value among the two inputs.
T degreesToRadians(T angleInDegrees)
Converts degrees to radians.
S bilerp(const S &f00, const S &f10, const S &f01, const S &f11, T tx, T ty)
Computes bilinear interpolation.
bool similar(T x, T y, T eps=std::numeric_limits< T >::epsilon())
Returns true if x and y are similar.