13template <
typename T,
size_t N>
18 template <
typename... Args>
22 template <
typename Compare>
47template <
typename T,
size_t N>
52template <
typename T,
size_t N>
57template <
typename T,
size_t N>
62template <
typename T,
size_t N>
67template <
typename T,
size_t N>
72template <
typename T,
size_t N>
77template <
typename T,
size_t N>
82template <
typename T,
size_t N>
87template <
typename T,
size_t N>
92template <
typename T,
size_t N>
97template <
typename T,
size_t N>
100 return std::inner_product(
a.values,
a.values +
N,
b.values, T(0));
106 a[1] *
b[2] -
a[2] *
b[1],
107 a[2] *
b[0] -
a[0] *
b[2],
108 a[0] *
b[1] -
a[1] *
b[0]);
111template <
typename T,
size_t N>
116template <
typename T,
size_t N>
121template <
typename T,
size_t N>
123 return std::sqrt(
dot(
v,
v));
126template <
typename T,
size_t N>
128 return v * (
static_cast<T
>(1.) /
length(
v));
Int_t Compare(const void *item1, const void *item2)
BVH_ALWAYS_INLINE Vec< T, N > operator-(const Vec< T, N > &a, const Vec< T, N > &b)
BVH_ALWAYS_INLINE Vec< T, N > operator*(const Vec< T, N > &a, const Vec< T, N > &b)
BVH_ALWAYS_INLINE T safe_inverse(T x)
Computes the inverse of the given value, always returning a finite value.
BVH_ALWAYS_INLINE Vec< T, N > normalize(const Vec< T, N > &v)
BVH_ALWAYS_INLINE Vec< T, N > operator/(const Vec< T, N > &a, const Vec< T, N > &b)
BVH_ALWAYS_INLINE Vec< T, 3 > cross(const Vec< T, 3 > &a, const Vec< T, 3 > &b)
BVH_ALWAYS_INLINE T robust_max(T a, T b)
BVH_ALWAYS_INLINE T fast_mul_add(T a, T b, T c)
Fast multiply-add operation.
BVH_ALWAYS_INLINE void static_for(F &&f)
Executes the given function once for every integer in the range [Begin, End).
BVH_ALWAYS_INLINE T robust_min(T a, T b)
BVH_ALWAYS_INLINE T dot(const Vec< T, N > &a, const Vec< T, N > &b)
BVH_ALWAYS_INLINE T length(const Vec< T, N > &v)
BVH_ALWAYS_INLINE Vec< T, N > operator+(const Vec< T, N > &a, const Vec< T, N > &b)
BVH_ALWAYS_INLINE Vec(T x, T y, Args &&... args)
BVH_ALWAYS_INLINE Vec(T x)
BVH_ALWAYS_INLINE size_t get_smallest_axis() const
BVH_ALWAYS_INLINE size_t get_largest_axis() const
static BVH_ALWAYS_INLINE Vec< T, N > generate(F &&f)
BVH_ALWAYS_INLINE size_t get_best_axis(Compare &&compare) const
BVH_ALWAYS_INLINE T & operator[](size_t i)