Blender  V3.3
BLI_math_vec_types.hh
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2022 Blender Foundation. */
3 
4 #pragma once
5 
10 #include <array>
11 #include <cmath>
12 #include <iostream>
13 #include <type_traits>
14 
15 #include "BLI_utildefines.h"
16 
17 namespace blender {
18 
19 /* clang-format off */
20 template<typename T>
21 using as_uint_type = std::conditional_t<sizeof(T) == sizeof(uint8_t), uint8_t,
22  std::conditional_t<sizeof(T) == sizeof(uint16_t), uint16_t,
23  std::conditional_t<sizeof(T) == sizeof(uint32_t), uint32_t,
24  std::conditional_t<sizeof(T) == sizeof(uint64_t), uint64_t, void>>>>;
25 /* clang-format on */
26 
27 template<typename T, int Size> struct vec_struct_base {
28  std::array<T, Size> values;
29 };
30 
31 template<typename T> struct vec_struct_base<T, 2> {
32  T x, y;
33 };
34 
35 template<typename T> struct vec_struct_base<T, 3> {
36  T x, y, z;
37 };
38 
39 template<typename T> struct vec_struct_base<T, 4> {
40  T x, y, z, w;
41 };
42 
43 namespace math {
44 
45 template<typename T> uint64_t vector_hash(const T &vec)
46 {
47  BLI_STATIC_ASSERT(T::type_length <= 4, "Longer types need to implement vector_hash themself.");
48  const typename T::uint_type &uvec = *reinterpret_cast<const typename T::uint_type *>(&vec);
50  result = uvec[0] * uint64_t(435109);
51  if constexpr (T::type_length > 1) {
52  result ^= uvec[1] * uint64_t(380867);
53  }
54  if constexpr (T::type_length > 2) {
55  result ^= uvec[2] * uint64_t(1059217);
56  }
57  if constexpr (T::type_length > 3) {
58  result ^= uvec[3] * uint64_t(2002613);
59  }
60  return result;
61 }
62 
63 } // namespace math
64 
65 template<typename T, int Size> struct vec_base : public vec_struct_base<T, Size> {
66 
67  static constexpr int type_length = Size;
68 
69  using base_type = T;
71 
72  vec_base() = default;
73 
74  explicit vec_base(uint value)
75  {
76  for (int i = 0; i < Size; i++) {
77  (*this)[i] = static_cast<T>(value);
78  }
79  }
80 
81  explicit vec_base(int value)
82  {
83  for (int i = 0; i < Size; i++) {
84  (*this)[i] = static_cast<T>(value);
85  }
86  }
87 
88  explicit vec_base(float value)
89  {
90  for (int i = 0; i < Size; i++) {
91  (*this)[i] = static_cast<T>(value);
92  }
93  }
94 
95  explicit vec_base(double value)
96  {
97  for (int i = 0; i < Size; i++) {
98  (*this)[i] = static_cast<T>(value);
99  }
100  }
101 
102 /* Workaround issue with template BLI_ENABLE_IF((Size == 2)) not working. */
103 #define BLI_ENABLE_IF_VEC(_size, _test) int S = _size, BLI_ENABLE_IF((S _test))
104 
105  template<BLI_ENABLE_IF_VEC(Size, == 2)> vec_base(T _x, T _y)
106  {
107  (*this)[0] = _x;
108  (*this)[1] = _y;
109  }
110 
111  template<BLI_ENABLE_IF_VEC(Size, == 3)> vec_base(T _x, T _y, T _z)
112  {
113  (*this)[0] = _x;
114  (*this)[1] = _y;
115  (*this)[2] = _z;
116  }
117 
118  template<BLI_ENABLE_IF_VEC(Size, == 4)> vec_base(T _x, T _y, T _z, T _w)
119  {
120  (*this)[0] = _x;
121  (*this)[1] = _y;
122  (*this)[2] = _z;
123  (*this)[3] = _w;
124  }
125 
128  template<typename U, BLI_ENABLE_IF_VEC(Size, == 3)>
129  constexpr vec_base(const vec_base<U, 2> &xy, T z)
130  : vec_base(static_cast<T>(xy.x), static_cast<T>(xy.y), z)
131  {
132  }
133 
134  template<typename U, BLI_ENABLE_IF_VEC(Size, == 3)>
135  constexpr vec_base(T x, const vec_base<U, 2> &yz)
136  : vec_base(x, static_cast<T>(yz.x), static_cast<T>(yz.y))
137  {
138  }
139 
140  template<typename U, BLI_ENABLE_IF_VEC(Size, == 4)>
142  : vec_base(
143  static_cast<T>(xyz.x), static_cast<T>(xyz.y), static_cast<T>(xyz.z), static_cast<T>(w))
144  {
145  }
146 
147  template<typename U, BLI_ENABLE_IF_VEC(Size, == 4)>
149  : vec_base(
150  static_cast<T>(x), static_cast<T>(yzw.x), static_cast<T>(yzw.y), static_cast<T>(yzw.z))
151  {
152  }
153 
154  template<typename U, typename V, BLI_ENABLE_IF_VEC(Size, == 4)>
156  : vec_base(
157  static_cast<T>(xy.x), static_cast<T>(xy.y), static_cast<T>(zw.x), static_cast<T>(zw.y))
158  {
159  }
160 
161  template<typename U, BLI_ENABLE_IF_VEC(Size, == 4)>
163  : vec_base(static_cast<T>(xy.x), static_cast<T>(xy.y), static_cast<T>(z), static_cast<T>(w))
164  {
165  }
166 
167  template<typename U, BLI_ENABLE_IF_VEC(Size, == 4)>
169  : vec_base(static_cast<T>(x), static_cast<T>(yz.x), static_cast<T>(yz.y), static_cast<T>(w))
170  {
171  }
172 
173  template<typename U, BLI_ENABLE_IF_VEC(Size, == 4)>
175  : vec_base(static_cast<T>(x), static_cast<T>(y), static_cast<T>(zw.x), static_cast<T>(zw.y))
176  {
177  }
178 
181  template<typename U, int OtherSize, BLI_ENABLE_IF(OtherSize > Size)>
182  explicit vec_base(const vec_base<U, OtherSize> &other)
183  {
184  for (int i = 0; i < Size; i++) {
185  (*this)[i] = static_cast<T>(other[i]);
186  }
187  }
188 
189 #undef BLI_ENABLE_IF_VEC
190 
193  vec_base(const T *ptr)
194  {
195  for (int i = 0; i < Size; i++) {
196  (*this)[i] = ptr[i];
197  }
198  }
199 
200  template<typename U, BLI_ENABLE_IF((std::is_convertible_v<U, T>))>
201  explicit vec_base(const U *ptr)
202  {
203  for (int i = 0; i < Size; i++) {
204  (*this)[i] = ptr[i];
205  }
206  }
207 
208  vec_base(const T (*ptr)[Size]) : vec_base(static_cast<const T *>(ptr[0]))
209  {
210  }
211 
214  template<typename U> explicit vec_base(const vec_base<U, Size> &vec)
215  {
216  for (int i = 0; i < Size; i++) {
217  (*this)[i] = static_cast<T>(vec[i]);
218  }
219  }
220 
223  operator const T *() const
224  {
225  return reinterpret_cast<const T *>(this);
226  }
227 
228  operator T *()
229  {
230  return reinterpret_cast<T *>(this);
231  }
232 
235  const T &operator[](int index) const
236  {
237  BLI_assert(index >= 0);
238  BLI_assert(index < Size);
239  return reinterpret_cast<const T *>(this)[index];
240  }
241 
242  T &operator[](int index)
243  {
244  BLI_assert(index >= 0);
245  BLI_assert(index < Size);
246  return reinterpret_cast<T *>(this)[index];
247  }
248 
251 #define BLI_INT_OP(_T) template<typename U = _T, BLI_ENABLE_IF((std::is_integral_v<U>))>
252 
253 #define BLI_VEC_OP_IMPL(_result, _i, _op) \
254  vec_base _result; \
255  for (int _i = 0; _i < Size; _i++) { \
256  _op; \
257  } \
258  return _result;
259 
260 #define BLI_VEC_OP_IMPL_SELF(_i, _op) \
261  for (int _i = 0; _i < Size; _i++) { \
262  _op; \
263  } \
264  return *this;
265 
268  friend vec_base operator+(const vec_base &a, const vec_base &b)
269  {
270  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] + b[i]);
271  }
272 
273  friend vec_base operator+(const vec_base &a, const T &b)
274  {
275  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] + b);
276  }
277 
278  friend vec_base operator+(const T &a, const vec_base &b)
279  {
280  return b + a;
281  }
282 
284  {
285  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] += b[i]);
286  }
287 
289  {
290  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] += b);
291  }
292 
293  friend vec_base operator-(const vec_base &a)
294  {
295  BLI_VEC_OP_IMPL(ret, i, ret[i] = -a[i]);
296  }
297 
298  friend vec_base operator-(const vec_base &a, const vec_base &b)
299  {
300  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] - b[i]);
301  }
302 
303  friend vec_base operator-(const vec_base &a, const T &b)
304  {
305  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] - b);
306  }
307 
308  friend vec_base operator-(const T &a, const vec_base &b)
309  {
310  BLI_VEC_OP_IMPL(ret, i, ret[i] = a - b[i]);
311  }
312 
314  {
315  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] -= b[i]);
316  }
317 
319  {
320  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] -= b);
321  }
322 
323  friend vec_base operator*(const vec_base &a, const vec_base &b)
324  {
325  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] * b[i]);
326  }
327 
328  template<typename FactorT> friend vec_base operator*(const vec_base &a, FactorT b)
329  {
330  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] * b);
331  }
332 
333  friend vec_base operator*(T a, const vec_base &b)
334  {
335  return b * a;
336  }
337 
339  {
340  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] *= b);
341  }
342 
344  {
345  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] *= b[i]);
346  }
347 
348  friend vec_base operator/(const vec_base &a, const vec_base &b)
349  {
350  for (int i = 0; i < Size; i++) {
351  BLI_assert(b[i] != T(0));
352  }
353  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] / b[i]);
354  }
355 
356  friend vec_base operator/(const vec_base &a, T b)
357  {
358  BLI_assert(b != T(0));
359  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] / b);
360  }
361 
362  friend vec_base operator/(T a, const vec_base &b)
363  {
364  for (int i = 0; i < Size; i++) {
365  BLI_assert(b[i] != T(0));
366  }
367  BLI_VEC_OP_IMPL(ret, i, ret[i] = a / b[i]);
368  }
369 
371  {
372  BLI_assert(b != T(0));
373  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] /= b);
374  }
375 
377  {
378  BLI_assert(b != T(0));
379  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] /= b[i]);
380  }
381 
384  BLI_INT_OP(T) friend vec_base operator&(const vec_base &a, const vec_base &b)
385  {
386  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] & b[i]);
387  }
388 
390  {
391  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] & b);
392  }
393 
395  {
396  return b & a;
397  }
398 
400  {
401  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] &= b);
402  }
403 
405  {
406  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] &= b[i]);
407  }
408 
409  BLI_INT_OP(T) friend vec_base operator|(const vec_base &a, const vec_base &b)
410  {
411  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] | b[i]);
412  }
413 
414  BLI_INT_OP(T) friend vec_base operator|(const vec_base &a, T b)
415  {
416  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] | b);
417  }
418 
419  BLI_INT_OP(T) friend vec_base operator|(T a, const vec_base &b)
420  {
421  return b | a;
422  }
423 
425  {
426  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] |= b);
427  }
428 
430  {
431  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] |= b[i]);
432  }
433 
434  BLI_INT_OP(T) friend vec_base operator^(const vec_base &a, const vec_base &b)
435  {
436  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] ^ b[i]);
437  }
438 
439  BLI_INT_OP(T) friend vec_base operator^(const vec_base &a, T b)
440  {
441  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] ^ b);
442  }
443 
444  BLI_INT_OP(T) friend vec_base operator^(T a, const vec_base &b)
445  {
446  return b ^ a;
447  }
448 
450  {
451  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] ^= b);
452  }
453 
455  {
456  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] ^= b[i]);
457  }
458 
459  BLI_INT_OP(T) friend vec_base operator~(const vec_base &a)
460  {
461  BLI_VEC_OP_IMPL(ret, i, ret[i] = ~a[i]);
462  }
463 
466  BLI_INT_OP(T) friend vec_base operator<<(const vec_base &a, const vec_base &b)
467  {
468  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] << b[i]);
469  }
470 
471  BLI_INT_OP(T) friend vec_base operator<<(const vec_base &a, T b)
472  {
473  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] << b);
474  }
475 
477  {
478  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] <<= b);
479  }
480 
482  {
483  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] <<= b[i]);
484  }
485 
486  BLI_INT_OP(T) friend vec_base operator>>(const vec_base &a, const vec_base &b)
487  {
488  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] >> b[i]);
489  }
490 
491  BLI_INT_OP(T) friend vec_base operator>>(const vec_base &a, T b)
492  {
493  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] >> b);
494  }
495 
497  {
498  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] >>= b);
499  }
500 
502  {
503  BLI_VEC_OP_IMPL_SELF(i, (*this)[i] >>= b[i]);
504  }
505 
508  BLI_INT_OP(T) friend vec_base operator%(const vec_base &a, const vec_base &b)
509  {
510  for (int i = 0; i < Size; i++) {
511  BLI_assert(b[i] != T(0));
512  }
513  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] % b[i]);
514  }
515 
516  BLI_INT_OP(T) friend vec_base operator%(const vec_base &a, T b)
517  {
518  BLI_assert(b != 0);
519  BLI_VEC_OP_IMPL(ret, i, ret[i] = a[i] % b);
520  }
521 
522  BLI_INT_OP(T) friend vec_base operator%(T a, const vec_base &b)
523  {
524  BLI_assert(b != T(0));
525  BLI_VEC_OP_IMPL(ret, i, ret[i] = a % b[i]);
526  }
527 
528 #undef BLI_INT_OP
529 #undef BLI_VEC_OP_IMPL
530 #undef BLI_VEC_OP_IMPL_SELF
531 
534  friend bool operator==(const vec_base &a, const vec_base &b)
535  {
536  for (int i = 0; i < Size; i++) {
537  if (a[i] != b[i]) {
538  return false;
539  }
540  }
541  return true;
542  }
543 
544  friend bool operator!=(const vec_base &a, const vec_base &b)
545  {
546  return !(a == b);
547  }
548 
551  uint64_t hash() const
552  {
553  return math::vector_hash(*this);
554  }
555 
556  friend std::ostream &operator<<(std::ostream &stream, const vec_base &v)
557  {
558  stream << "(";
559  for (int i = 0; i < Size; i++) {
560  stream << v[i];
561  if (i != Size - 1) {
562  stream << ", ";
563  }
564  }
565  stream << ")";
566  return stream;
567  }
568 };
569 
573 
577 
579 
583 
587 
588 } // namespace blender
#define BLI_STATIC_ASSERT(a, msg)
Definition: BLI_assert.h:83
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define BLI_VEC_OP_IMPL_SELF(_i, _op)
#define BLI_VEC_OP_IMPL(_result, _i, _op)
unsigned int uint
Definition: BLI_sys_types.h:67
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble z
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
__forceinline const avxb operator|=(avxb &a, const avxb &b)
Definition: avxb.h:121
__forceinline const avxb operator&(const avxb &a, const avxb &b)
Binary Operators.
Definition: avxb.h:100
__forceinline const avxb operator^=(avxb &a, const avxb &b)
Definition: avxb.h:125
__forceinline const avxb operator&=(avxb &a, const avxb &b)
Assignment Operators.
Definition: avxb.h:117
__forceinline const avxb operator|(const avxb &a, const avxb &b)
Definition: avxb.h:104
__forceinline avxi & operator<<=(avxi &a, const int32_t b)
Definition: avxi.h:439
__forceinline const avxi operator>>(const avxi &a, const int32_t n)
Definition: avxi.h:326
__forceinline avxi & operator>>=(avxi &a, const int32_t b)
Definition: avxi.h:443
ATTR_WARN_UNUSED_RESULT const BMVert * v
unsigned int U
Definition: btGjkEpa3.h:78
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
#define T
static unsigned a[3]
Definition: RandGen.cpp:78
GPUState operator^(const GPUState &a, const GPUState &b)
GPUState operator~(const GPUState &a)
uint64_t vector_hash(const T &vec)
constexpr bool operator!=(StringRef a, StringRef b)
std::conditional_t< sizeof(T)==sizeof(uint8_t), uint8_t, std::conditional_t< sizeof(T)==sizeof(uint16_t), uint16_t, std::conditional_t< sizeof(T)==sizeof(uint32_t), uint32_t, std::conditional_t< sizeof(T)==sizeof(uint64_t), uint64_t, void > >> > as_uint_type
constexpr bool operator==(StringRef a, StringRef b)
std::ostream & operator<<(std::ostream &stream, const eAlpha &space)
Definition: BLI_color.cc:7
#define hash
Definition: noise.c:153
return ret
unsigned short uint16_t
Definition: stdint.h:79
unsigned int uint32_t
Definition: stdint.h:80
unsigned char uint8_t
Definition: stdint.h:78
unsigned __int64 uint64_t
Definition: stdint.h:90
vec_base(const vec_base< U, OtherSize > &other)
friend vec_base operator+(const vec_base &a, const T &b)
vec_base & operator*=(const vec_base &b)
friend vec_base operator-(const vec_base &a, const T &b)
vec_base(vec_base< U, 2 > xy, vec_base< V, 2 > zw)
vec_base & operator-=(const vec_base &b)
vec_base & operator+=(const T &b)
vec_base & operator-=(const T &b)
vec_base(T _x, T _y, T _z, T _w)
vec_base()=default
vec_base(vec_base< U, 3 > xyz, T w)
vec_base(const vec_base< U, Size > &vec)
friend vec_base operator*(const vec_base &a, const vec_base &b)
vec_base(double value)
const vec_base & b
vec_base & operator/=(T b)
BLI_INT_OP(T) friend vec_base operator&(const vec_base &a
friend vec_base operator/(T a, const vec_base &b)
vec_base(T _x, T _y, T _z)
vec_base(T x, T y, vec_base< U, 2 > zw)
friend vec_base operator-(const vec_base &a)
vec_base & operator/=(const vec_base &b)
BLI_INT_OP(T) friend vec_base operator&(T a
vec_base & operator+=(const vec_base &b)
vec_base(vec_base< U, 2 > xy, T z, T w)
const T & operator[](int index) const
vec_base & operator*=(T b)
friend vec_base operator/(const vec_base &a, T b)
friend vec_base operator*(const vec_base &a, FactorT b)
friend vec_base operator-(const vec_base &a, const vec_base &b)
vec_base(const T(*ptr)[Size])
friend vec_base operator+(const vec_base &a, const vec_base &b)
vec_base(T x, vec_base< U, 2 > yz, T w)
friend vec_base operator/(const vec_base &a, const vec_base &b)
constexpr vec_base(const vec_base< U, 2 > &xy, T z)
friend vec_base operator*(T a, const vec_base &b)
friend vec_base operator+(const T &a, const vec_base &b)
vec_base(T x, vec_base< U, 3 > yzw)
static constexpr int type_length
T & operator[](int index)
constexpr vec_base(T x, const vec_base< U, 2 > &yz)
friend vec_base operator-(const T &a, const vec_base &b)
std::array< T, Size > values
int xy[2]
Definition: wm_draw.c:135
PointerRNA * ptr
Definition: wm_files.c:3480