16 #ifndef __UT_FixedArrayMath__
17 #define __UT_FixedArrayMath__
27 namespace UT {
namespace FA {
47 template<
typename T, ex
int SIZE >
50 template<
typename TS >
64 template<
typename T, ex
int SIZE,
typename A >
67 template<
typename TS,
typename AS >
82 template<
typename T, ex
int SIZE >
85 template<
typename TS >
99 template<
typename T, ex
int SIZE >
102 template<
typename TS >
116 template<
typename T, ex
int SIZE,
typename S = T >
119 template<
typename TS >
133 template<
typename T, ex
int SIZE,
typename S = T >
136 template<
typename TS >
148 template<
typename T,
typename S,
typename =
void >
151 template<
typename T,
typename S >
154 template<
typename T,
typename S >
164 template<
typename T, ex
int SIZE,
typename S = T >
167 template<
typename TS >
172 if constexpr( HasAddScaledFunction_v< T, S > )
176 addScaled( ts[ i ],
a, bs[ i ] );
183 ts[ i ] +=
a * bs[ i ];
191 template<
typename T, ex
int SIZE,
typename S = T >
194 template<
typename TS >
203 template<
typename T, ex
int SIZE >
206 template<
typename TS >
220 template<
typename T, ex
int SIZE >
223 template<
typename TS >
237 template<
typename T, ex
int SIZE >
240 template<
typename TS >
254 template<
typename T, ex
int SIZE >
257 template<
typename TS >
271 template<
typename T, ex
int SIZE >
274 template<
typename TS >
288 template<
typename T, ex
int SIZE >
291 template<
typename TS >
303 template<
typename T,
typename =
void >
306 template<
typename T >
309 template<
typename T >
323 template<
typename T, ex
int SIZE >
326 template<
typename TS >
331 if constexpr( HasDotFunction_v< T > )
333 auto r{
dot( as[ 0 ], bs[ 0 ] ) };
337 r +=
dot( as[ i ], bs[ i ] );
344 const auto a_0{ as[ 0 ] };
345 const auto b_0{ bs[ 0 ] };
350 const auto a_i{ as[ i ] };
351 const auto b_i{ bs[ i ] };
360 template<
typename T, ex
int SIZE >
363 template<
typename TS >
372 template<
typename T, ex
int SIZE >
375 template<
typename TS >
392 template<
typename T, ex
int SIZE,
typename MF = T,
typename U = T >
395 template<
typename TS >
412 const MF l{ SYSsqrt( MF( l2 ) ) };
419 const MF il{ MF{ 1 } / l };
432 template<
typename T, ex
int SIZE >
435 template<
typename TS,
typename UNARY_PREDICATE >
453 template<
typename T, ex
int SIZE >
456 template<
typename TS,
typename UNARY_PREDICATE >
475 template<
typename T, ex
int SIZE >
478 template<
typename TS >
485 if( ! ( as[ i ] ==
T{ 0 } ) )
497 template<
typename T, ex
int SIZE >
500 template<
typename TS >
507 if( ! ( as[ i ] == bs[ i ] ) )
521 template<
typename T, ex
int SIZE >
524 template<
typename TS >
531 if ( ( as[ i ] < -e ) || ( e < as[ i ] ) )
545 template<
typename T, ex
int SIZE >
548 template<
typename TS >
555 if ( ( as[ i ] < bs[ i ] - e ) || ( bs[ i ] + e < as[ i ] ) )
567 template<
typename T, ex
int SIZE >
570 template<
typename TS >
577 t = (
t < as[ i ] ) ? as[ i ] :
t;
586 template<
typename T, ex
int SIZE >
589 template<
typename TS >
596 t = ( as[ i ] <
t ) ? as[ i ] :
t;
605 template<
typename T, ex
int SIZE >
608 template<
typename TS >
627 template<
typename T, ex
int SIZE >
630 template<
typename TS >
637 if( as[ i ] < bs[ i ] )
642 if( bs[ i ] < as[ i ] )
SYS_FORCE_INLINE MF operator()(TS &ts, const MF l2_min) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const AS &as) const noexcept
#define SYS_STATIC_ASSERT(expr)
constexpr SYS_FORCE_INLINE auto operator()(const TS &as, const TS &bs) const noexcept
void SYS_Void_t
Alternative for C++17's std::void that can be used in C++14:
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const S &a) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const S &a) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const TS &as) const noexcept
GLboolean GLboolean GLboolean GLboolean a
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const TS &as) const noexcept
constexpr SYS_FORCE_INLINE bool operator()(const TS &as, const T e) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const TS &as) const noexcept
constexpr SYS_FORCE_INLINE bool operator()(const TS &as, const UNARY_PREDICATE p) const noexcept
constexpr SYS_FORCE_INLINE T operator()(const TS &as) const noexcept
fpreal64 dot(const CE_VectorT< T > &a, const CE_VectorT< T > &b)
constexpr SYS_FORCE_INLINE bool operator()(const TS &as, const TS &bs) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const S &a, const TS &bs) const noexcept
constexpr SYS_FORCE_INLINE T operator()(const TS &as) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts) const noexcept
constexpr SYS_FORCE_INLINE T operator()(const TS &as) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const TS &as) const noexcept
constexpr SYS_FORCE_INLINE auto operator()(const TS &as, const TS &bs) const noexcept
constexpr bool HasAddScaledFunction_v
constexpr bool HasDotFunction_v
constexpr SYS_FORCE_INLINE bool operator()(const TS &as, const UNARY_PREDICATE p) const noexcept
constexpr SYS_FORCE_INLINE bool operator()(const TS &as, const TS &bs, const T e) const noexcept
constexpr SYS_FORCE_INLINE int operator()(const TS &as, const TS &bs) const noexcept
constexpr SYS_FORCE_INLINE auto operator()(const TS &as) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const S &a, const TS &bs) const noexcept
constexpr SYS_FORCE_INLINE void operator()(TS &ts, const TS &as) const noexcept