13template <
typename T,
size_t N>
18 template <
typename... Args>
22 template <
typename Compare>
25 static_for<1, N>([&] (
size_t i) {
42 static_for<0, N>([&] (
size_t i) {
v[i] =
f(i); });
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)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
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 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 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)