uint2x4.gen.cs 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. // This code was generated by a tool.
  4. //
  5. // Changes to this file may cause incorrect behavior and will be lost if
  6. // the code is regenerated.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. using System;
  10. using System.Runtime.CompilerServices;
  11. #pragma warning disable 0660, 0661
  12. namespace Unity.Mathematics
  13. {
  14. [System.Serializable]
  15. public partial struct uint2x4 : System.IEquatable<uint2x4>, IFormattable
  16. {
  17. public uint2 c0;
  18. public uint2 c1;
  19. public uint2 c2;
  20. public uint2 c3;
  21. /// <summary>uint2x4 zero value.</summary>
  22. public static readonly uint2x4 zero;
  23. /// <summary>Constructs a uint2x4 matrix from four uint2 vectors.</summary>
  24. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  25. public uint2x4(uint2 c0, uint2 c1, uint2 c2, uint2 c3)
  26. {
  27. this.c0 = c0;
  28. this.c1 = c1;
  29. this.c2 = c2;
  30. this.c3 = c3;
  31. }
  32. /// <summary>Constructs a uint2x4 matrix from 8 uint values given in row-major order.</summary>
  33. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  34. public uint2x4(uint m00, uint m01, uint m02, uint m03,
  35. uint m10, uint m11, uint m12, uint m13)
  36. {
  37. this.c0 = new uint2(m00, m10);
  38. this.c1 = new uint2(m01, m11);
  39. this.c2 = new uint2(m02, m12);
  40. this.c3 = new uint2(m03, m13);
  41. }
  42. /// <summary>Constructs a uint2x4 matrix from a single uint value by assigning it to every component.</summary>
  43. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  44. public uint2x4(uint v)
  45. {
  46. this.c0 = v;
  47. this.c1 = v;
  48. this.c2 = v;
  49. this.c3 = v;
  50. }
  51. /// <summary>Constructs a uint2x4 matrix from a single bool value by converting it to uint and assigning it to every component.</summary>
  52. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  53. public uint2x4(bool v)
  54. {
  55. this.c0 = math.select(new uint2(0u), new uint2(1u), v);
  56. this.c1 = math.select(new uint2(0u), new uint2(1u), v);
  57. this.c2 = math.select(new uint2(0u), new uint2(1u), v);
  58. this.c3 = math.select(new uint2(0u), new uint2(1u), v);
  59. }
  60. /// <summary>Constructs a uint2x4 matrix from a bool2x4 matrix by componentwise conversion.</summary>
  61. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  62. public uint2x4(bool2x4 v)
  63. {
  64. this.c0 = math.select(new uint2(0u), new uint2(1u), v.c0);
  65. this.c1 = math.select(new uint2(0u), new uint2(1u), v.c1);
  66. this.c2 = math.select(new uint2(0u), new uint2(1u), v.c2);
  67. this.c3 = math.select(new uint2(0u), new uint2(1u), v.c3);
  68. }
  69. /// <summary>Constructs a uint2x4 matrix from a single int value by converting it to uint and assigning it to every component.</summary>
  70. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  71. public uint2x4(int v)
  72. {
  73. this.c0 = (uint2)v;
  74. this.c1 = (uint2)v;
  75. this.c2 = (uint2)v;
  76. this.c3 = (uint2)v;
  77. }
  78. /// <summary>Constructs a uint2x4 matrix from a int2x4 matrix by componentwise conversion.</summary>
  79. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  80. public uint2x4(int2x4 v)
  81. {
  82. this.c0 = (uint2)v.c0;
  83. this.c1 = (uint2)v.c1;
  84. this.c2 = (uint2)v.c2;
  85. this.c3 = (uint2)v.c3;
  86. }
  87. /// <summary>Constructs a uint2x4 matrix from a single float value by converting it to uint and assigning it to every component.</summary>
  88. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  89. public uint2x4(float v)
  90. {
  91. this.c0 = (uint2)v;
  92. this.c1 = (uint2)v;
  93. this.c2 = (uint2)v;
  94. this.c3 = (uint2)v;
  95. }
  96. /// <summary>Constructs a uint2x4 matrix from a float2x4 matrix by componentwise conversion.</summary>
  97. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  98. public uint2x4(float2x4 v)
  99. {
  100. this.c0 = (uint2)v.c0;
  101. this.c1 = (uint2)v.c1;
  102. this.c2 = (uint2)v.c2;
  103. this.c3 = (uint2)v.c3;
  104. }
  105. /// <summary>Constructs a uint2x4 matrix from a single double value by converting it to uint and assigning it to every component.</summary>
  106. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  107. public uint2x4(double v)
  108. {
  109. this.c0 = (uint2)v;
  110. this.c1 = (uint2)v;
  111. this.c2 = (uint2)v;
  112. this.c3 = (uint2)v;
  113. }
  114. /// <summary>Constructs a uint2x4 matrix from a double2x4 matrix by componentwise conversion.</summary>
  115. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  116. public uint2x4(double2x4 v)
  117. {
  118. this.c0 = (uint2)v.c0;
  119. this.c1 = (uint2)v.c1;
  120. this.c2 = (uint2)v.c2;
  121. this.c3 = (uint2)v.c3;
  122. }
  123. /// <summary>Implicitly converts a single uint value to a uint2x4 matrix by assigning it to every component.</summary>
  124. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  125. public static implicit operator uint2x4(uint v) { return new uint2x4(v); }
  126. /// <summary>Explicitly converts a single bool value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  127. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  128. public static explicit operator uint2x4(bool v) { return new uint2x4(v); }
  129. /// <summary>Explicitly converts a bool2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  130. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  131. public static explicit operator uint2x4(bool2x4 v) { return new uint2x4(v); }
  132. /// <summary>Explicitly converts a single int value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  133. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  134. public static explicit operator uint2x4(int v) { return new uint2x4(v); }
  135. /// <summary>Explicitly converts a int2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  136. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  137. public static explicit operator uint2x4(int2x4 v) { return new uint2x4(v); }
  138. /// <summary>Explicitly converts a single float value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  139. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  140. public static explicit operator uint2x4(float v) { return new uint2x4(v); }
  141. /// <summary>Explicitly converts a float2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  142. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  143. public static explicit operator uint2x4(float2x4 v) { return new uint2x4(v); }
  144. /// <summary>Explicitly converts a single double value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  145. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  146. public static explicit operator uint2x4(double v) { return new uint2x4(v); }
  147. /// <summary>Explicitly converts a double2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  148. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  149. public static explicit operator uint2x4(double2x4 v) { return new uint2x4(v); }
  150. /// <summary>Returns the result of a componentwise multiplication operation on two uint2x4 matrices.</summary>
  151. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  152. public static uint2x4 operator * (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1, lhs.c2 * rhs.c2, lhs.c3 * rhs.c3); }
  153. /// <summary>Returns the result of a componentwise multiplication operation on a uint2x4 matrix and a uint value.</summary>
  154. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  155. public static uint2x4 operator * (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
  156. /// <summary>Returns the result of a componentwise multiplication operation on a uint value and a uint2x4 matrix.</summary>
  157. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  158. public static uint2x4 operator * (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
  159. /// <summary>Returns the result of a componentwise addition operation on two uint2x4 matrices.</summary>
  160. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  161. public static uint2x4 operator + (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1, lhs.c2 + rhs.c2, lhs.c3 + rhs.c3); }
  162. /// <summary>Returns the result of a componentwise addition operation on a uint2x4 matrix and a uint value.</summary>
  163. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  164. public static uint2x4 operator + (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
  165. /// <summary>Returns the result of a componentwise addition operation on a uint value and a uint2x4 matrix.</summary>
  166. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  167. public static uint2x4 operator + (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
  168. /// <summary>Returns the result of a componentwise subtraction operation on two uint2x4 matrices.</summary>
  169. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  170. public static uint2x4 operator - (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1, lhs.c2 - rhs.c2, lhs.c3 - rhs.c3); }
  171. /// <summary>Returns the result of a componentwise subtraction operation on a uint2x4 matrix and a uint value.</summary>
  172. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  173. public static uint2x4 operator - (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
  174. /// <summary>Returns the result of a componentwise subtraction operation on a uint value and a uint2x4 matrix.</summary>
  175. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  176. public static uint2x4 operator - (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
  177. /// <summary>Returns the result of a componentwise division operation on two uint2x4 matrices.</summary>
  178. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  179. public static uint2x4 operator / (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1, lhs.c2 / rhs.c2, lhs.c3 / rhs.c3); }
  180. /// <summary>Returns the result of a componentwise division operation on a uint2x4 matrix and a uint value.</summary>
  181. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  182. public static uint2x4 operator / (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
  183. /// <summary>Returns the result of a componentwise division operation on a uint value and a uint2x4 matrix.</summary>
  184. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  185. public static uint2x4 operator / (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
  186. /// <summary>Returns the result of a componentwise modulus operation on two uint2x4 matrices.</summary>
  187. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  188. public static uint2x4 operator % (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1, lhs.c2 % rhs.c2, lhs.c3 % rhs.c3); }
  189. /// <summary>Returns the result of a componentwise modulus operation on a uint2x4 matrix and a uint value.</summary>
  190. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  191. public static uint2x4 operator % (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
  192. /// <summary>Returns the result of a componentwise modulus operation on a uint value and a uint2x4 matrix.</summary>
  193. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  194. public static uint2x4 operator % (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
  195. /// <summary>Returns the result of a componentwise increment operation on a uint2x4 matrix.</summary>
  196. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  197. public static uint2x4 operator ++ (uint2x4 val) { return new uint2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
  198. /// <summary>Returns the result of a componentwise decrement operation on a uint2x4 matrix.</summary>
  199. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  200. public static uint2x4 operator -- (uint2x4 val) { return new uint2x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
  201. /// <summary>Returns the result of a componentwise less than operation on two uint2x4 matrices.</summary>
  202. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  203. public static bool2x4 operator < (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1, lhs.c2 < rhs.c2, lhs.c3 < rhs.c3); }
  204. /// <summary>Returns the result of a componentwise less than operation on a uint2x4 matrix and a uint value.</summary>
  205. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  206. public static bool2x4 operator < (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
  207. /// <summary>Returns the result of a componentwise less than operation on a uint value and a uint2x4 matrix.</summary>
  208. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  209. public static bool2x4 operator < (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
  210. /// <summary>Returns the result of a componentwise less or equal operation on two uint2x4 matrices.</summary>
  211. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  212. public static bool2x4 operator <= (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1, lhs.c2 <= rhs.c2, lhs.c3 <= rhs.c3); }
  213. /// <summary>Returns the result of a componentwise less or equal operation on a uint2x4 matrix and a uint value.</summary>
  214. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  215. public static bool2x4 operator <= (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
  216. /// <summary>Returns the result of a componentwise less or equal operation on a uint value and a uint2x4 matrix.</summary>
  217. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  218. public static bool2x4 operator <= (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
  219. /// <summary>Returns the result of a componentwise greater than operation on two uint2x4 matrices.</summary>
  220. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  221. public static bool2x4 operator > (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1, lhs.c2 > rhs.c2, lhs.c3 > rhs.c3); }
  222. /// <summary>Returns the result of a componentwise greater than operation on a uint2x4 matrix and a uint value.</summary>
  223. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  224. public static bool2x4 operator > (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
  225. /// <summary>Returns the result of a componentwise greater than operation on a uint value and a uint2x4 matrix.</summary>
  226. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  227. public static bool2x4 operator > (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
  228. /// <summary>Returns the result of a componentwise greater or equal operation on two uint2x4 matrices.</summary>
  229. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  230. public static bool2x4 operator >= (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1, lhs.c2 >= rhs.c2, lhs.c3 >= rhs.c3); }
  231. /// <summary>Returns the result of a componentwise greater or equal operation on a uint2x4 matrix and a uint value.</summary>
  232. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  233. public static bool2x4 operator >= (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
  234. /// <summary>Returns the result of a componentwise greater or equal operation on a uint value and a uint2x4 matrix.</summary>
  235. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  236. public static bool2x4 operator >= (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
  237. /// <summary>Returns the result of a componentwise unary minus operation on a uint2x4 matrix.</summary>
  238. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  239. public static uint2x4 operator - (uint2x4 val) { return new uint2x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
  240. /// <summary>Returns the result of a componentwise unary plus operation on a uint2x4 matrix.</summary>
  241. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  242. public static uint2x4 operator + (uint2x4 val) { return new uint2x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
  243. /// <summary>Returns the result of a componentwise left shift operation on a uint2x4 matrix by a number of bits specified by a single int.</summary>
  244. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  245. public static uint2x4 operator << (uint2x4 x, int n) { return new uint2x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); }
  246. /// <summary>Returns the result of a componentwise right shift operation on a uint2x4 matrix by a number of bits specified by a single int.</summary>
  247. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  248. public static uint2x4 operator >> (uint2x4 x, int n) { return new uint2x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); }
  249. /// <summary>Returns the result of a componentwise equality operation on two uint2x4 matrices.</summary>
  250. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  251. public static bool2x4 operator == (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1, lhs.c2 == rhs.c2, lhs.c3 == rhs.c3); }
  252. /// <summary>Returns the result of a componentwise equality operation on a uint2x4 matrix and a uint value.</summary>
  253. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  254. public static bool2x4 operator == (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
  255. /// <summary>Returns the result of a componentwise equality operation on a uint value and a uint2x4 matrix.</summary>
  256. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  257. public static bool2x4 operator == (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
  258. /// <summary>Returns the result of a componentwise not equal operation on two uint2x4 matrices.</summary>
  259. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  260. public static bool2x4 operator != (uint2x4 lhs, uint2x4 rhs) { return new bool2x4 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1, lhs.c2 != rhs.c2, lhs.c3 != rhs.c3); }
  261. /// <summary>Returns the result of a componentwise not equal operation on a uint2x4 matrix and a uint value.</summary>
  262. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  263. public static bool2x4 operator != (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
  264. /// <summary>Returns the result of a componentwise not equal operation on a uint value and a uint2x4 matrix.</summary>
  265. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  266. public static bool2x4 operator != (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
  267. /// <summary>Returns the result of a componentwise bitwise not operation on a uint2x4 matrix.</summary>
  268. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  269. public static uint2x4 operator ~ (uint2x4 val) { return new uint2x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); }
  270. /// <summary>Returns the result of a componentwise bitwise and operation on two uint2x4 matrices.</summary>
  271. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  272. public static uint2x4 operator & (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 & rhs.c0, lhs.c1 & rhs.c1, lhs.c2 & rhs.c2, lhs.c3 & rhs.c3); }
  273. /// <summary>Returns the result of a componentwise bitwise and operation on a uint2x4 matrix and a uint value.</summary>
  274. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  275. public static uint2x4 operator & (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
  276. /// <summary>Returns the result of a componentwise bitwise and operation on a uint value and a uint2x4 matrix.</summary>
  277. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  278. public static uint2x4 operator & (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
  279. /// <summary>Returns the result of a componentwise bitwise or operation on two uint2x4 matrices.</summary>
  280. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  281. public static uint2x4 operator | (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 | rhs.c0, lhs.c1 | rhs.c1, lhs.c2 | rhs.c2, lhs.c3 | rhs.c3); }
  282. /// <summary>Returns the result of a componentwise bitwise or operation on a uint2x4 matrix and a uint value.</summary>
  283. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  284. public static uint2x4 operator | (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
  285. /// <summary>Returns the result of a componentwise bitwise or operation on a uint value and a uint2x4 matrix.</summary>
  286. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  287. public static uint2x4 operator | (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
  288. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two uint2x4 matrices.</summary>
  289. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  290. public static uint2x4 operator ^ (uint2x4 lhs, uint2x4 rhs) { return new uint2x4 (lhs.c0 ^ rhs.c0, lhs.c1 ^ rhs.c1, lhs.c2 ^ rhs.c2, lhs.c3 ^ rhs.c3); }
  291. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint2x4 matrix and a uint value.</summary>
  292. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  293. public static uint2x4 operator ^ (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
  294. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2x4 matrix.</summary>
  295. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  296. public static uint2x4 operator ^ (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
  297. /// <summary>Returns the uint2 element at a specified index.</summary>
  298. unsafe public ref uint2 this[int index]
  299. {
  300. get
  301. {
  302. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  303. if ((uint)index >= 4)
  304. throw new System.ArgumentException("index must be between[0...3]");
  305. #endif
  306. fixed (uint2x4* array = &this) { return ref ((uint2*)array)[index]; }
  307. }
  308. }
  309. /// <summary>Returns true if the uint2x4 is equal to a given uint2x4, false otherwise.</summary>
  310. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  311. public bool Equals(uint2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
  312. /// <summary>Returns true if the uint2x4 is equal to a given uint2x4, false otherwise.</summary>
  313. public override bool Equals(object o) { return Equals((uint2x4)o); }
  314. /// <summary>Returns a hash code for the uint2x4.</summary>
  315. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  316. public override int GetHashCode() { return (int)math.hash(this); }
  317. /// <summary>Returns a string representation of the uint2x4.</summary>
  318. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  319. public override string ToString()
  320. {
  321. return string.Format("uint2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c2.x, c3.x, c0.y, c1.y, c2.y, c3.y);
  322. }
  323. /// <summary>Returns a string representation of the uint2x4 using a specified format and culture-specific format information.</summary>
  324. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  325. public string ToString(string format, IFormatProvider formatProvider)
  326. {
  327. return string.Format("uint2x4({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x.ToString(format, formatProvider), c1.x.ToString(format, formatProvider), c2.x.ToString(format, formatProvider), c3.x.ToString(format, formatProvider), c0.y.ToString(format, formatProvider), c1.y.ToString(format, formatProvider), c2.y.ToString(format, formatProvider), c3.y.ToString(format, formatProvider));
  328. }
  329. }
  330. public static partial class math
  331. {
  332. /// <summary>Returns a uint2x4 matrix constructed from four uint2 vectors.</summary>
  333. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  334. public static uint2x4 uint2x4(uint2 c0, uint2 c1, uint2 c2, uint2 c3) { return new uint2x4(c0, c1, c2, c3); }
  335. /// <summary>Returns a uint2x4 matrix constructed from from 8 uint values given in row-major order.</summary>
  336. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  337. public static uint2x4 uint2x4(uint m00, uint m01, uint m02, uint m03,
  338. uint m10, uint m11, uint m12, uint m13)
  339. {
  340. return new uint2x4(m00, m01, m02, m03,
  341. m10, m11, m12, m13);
  342. }
  343. /// <summary>Returns a uint2x4 matrix constructed from a single uint value by assigning it to every component.</summary>
  344. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  345. public static uint2x4 uint2x4(uint v) { return new uint2x4(v); }
  346. /// <summary>Returns a uint2x4 matrix constructed from a single bool value by converting it to uint and assigning it to every component.</summary>
  347. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  348. public static uint2x4 uint2x4(bool v) { return new uint2x4(v); }
  349. /// <summary>Return a uint2x4 matrix constructed from a bool2x4 matrix by componentwise conversion.</summary>
  350. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  351. public static uint2x4 uint2x4(bool2x4 v) { return new uint2x4(v); }
  352. /// <summary>Returns a uint2x4 matrix constructed from a single int value by converting it to uint and assigning it to every component.</summary>
  353. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  354. public static uint2x4 uint2x4(int v) { return new uint2x4(v); }
  355. /// <summary>Return a uint2x4 matrix constructed from a int2x4 matrix by componentwise conversion.</summary>
  356. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  357. public static uint2x4 uint2x4(int2x4 v) { return new uint2x4(v); }
  358. /// <summary>Returns a uint2x4 matrix constructed from a single float value by converting it to uint and assigning it to every component.</summary>
  359. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  360. public static uint2x4 uint2x4(float v) { return new uint2x4(v); }
  361. /// <summary>Return a uint2x4 matrix constructed from a float2x4 matrix by componentwise conversion.</summary>
  362. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  363. public static uint2x4 uint2x4(float2x4 v) { return new uint2x4(v); }
  364. /// <summary>Returns a uint2x4 matrix constructed from a single double value by converting it to uint and assigning it to every component.</summary>
  365. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  366. public static uint2x4 uint2x4(double v) { return new uint2x4(v); }
  367. /// <summary>Return a uint2x4 matrix constructed from a double2x4 matrix by componentwise conversion.</summary>
  368. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  369. public static uint2x4 uint2x4(double2x4 v) { return new uint2x4(v); }
  370. /// <summary>Return the uint4x2 transpose of a uint2x4 matrix.</summary>
  371. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  372. public static uint4x2 transpose(uint2x4 v)
  373. {
  374. return uint4x2(
  375. v.c0.x, v.c0.y,
  376. v.c1.x, v.c1.y,
  377. v.c2.x, v.c2.y,
  378. v.c3.x, v.c3.y);
  379. }
  380. /// <summary>Returns a uint hash code of a uint2x4 vector.</summary>
  381. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  382. public static uint hash(uint2x4 v)
  383. {
  384. return csum(v.c0 * uint2(0x9DF50593u, 0xF18EEB85u) +
  385. v.c1 * uint2(0x9E19BFC3u, 0x8196B06Fu) +
  386. v.c2 * uint2(0xD24EFA19u, 0x7D8048BBu) +
  387. v.c3 * uint2(0x713BD06Fu, 0x753AD6ADu)) + 0xD19764C7u;
  388. }
  389. /// <summary>
  390. /// Returns a uint2 vector hash code of a uint2x4 vector.
  391. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  392. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  393. /// </summary>
  394. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  395. public static uint2 hashwide(uint2x4 v)
  396. {
  397. return (v.c0 * uint2(0xB5D0BF63u, 0xF9102C5Fu) +
  398. v.c1 * uint2(0x9881FB9Fu, 0x56A1530Du) +
  399. v.c2 * uint2(0x804B722Du, 0x738E50E5u) +
  400. v.c3 * uint2(0x4FC93C25u, 0xCD0445A5u)) + 0xD2B90D9Bu;
  401. }
  402. }
  403. }