Nessuna descrizione
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

uint2x4.gen.cs 50KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  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. To update the generation of this file, modify and re-run Unity.Mathematics.CodeGen.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. using System;
  10. using System.Runtime.CompilerServices;
  11. using Unity.IL2CPP.CompilerServices;
  12. #pragma warning disable 0660, 0661
  13. namespace Unity.Mathematics
  14. {
  15. /// <summary>A 2x4 matrix of uints.</summary>
  16. [System.Serializable]
  17. [Il2CppEagerStaticClassConstruction]
  18. public partial struct uint2x4 : System.IEquatable<uint2x4>, IFormattable
  19. {
  20. /// <summary>Column 0 of the matrix.</summary>
  21. public uint2 c0;
  22. /// <summary>Column 1 of the matrix.</summary>
  23. public uint2 c1;
  24. /// <summary>Column 2 of the matrix.</summary>
  25. public uint2 c2;
  26. /// <summary>Column 3 of the matrix.</summary>
  27. public uint2 c3;
  28. /// <summary>uint2x4 zero value.</summary>
  29. public static readonly uint2x4 zero;
  30. /// <summary>Constructs a uint2x4 matrix from four uint2 vectors.</summary>
  31. /// <param name="c0">The matrix column c0 will be set to this value.</param>
  32. /// <param name="c1">The matrix column c1 will be set to this value.</param>
  33. /// <param name="c2">The matrix column c2 will be set to this value.</param>
  34. /// <param name="c3">The matrix column c3 will be set to this value.</param>
  35. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  36. public uint2x4(uint2 c0, uint2 c1, uint2 c2, uint2 c3)
  37. {
  38. this.c0 = c0;
  39. this.c1 = c1;
  40. this.c2 = c2;
  41. this.c3 = c3;
  42. }
  43. /// <summary>Constructs a uint2x4 matrix from 8 uint values given in row-major order.</summary>
  44. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  45. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  46. /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
  47. /// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
  48. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  49. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  50. /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
  51. /// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
  52. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  53. public uint2x4(uint m00, uint m01, uint m02, uint m03,
  54. uint m10, uint m11, uint m12, uint m13)
  55. {
  56. this.c0 = new uint2(m00, m10);
  57. this.c1 = new uint2(m01, m11);
  58. this.c2 = new uint2(m02, m12);
  59. this.c3 = new uint2(m03, m13);
  60. }
  61. /// <summary>Constructs a uint2x4 matrix from a single uint value by assigning it to every component.</summary>
  62. /// <param name="v">uint to convert to uint2x4</param>
  63. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  64. public uint2x4(uint v)
  65. {
  66. this.c0 = v;
  67. this.c1 = v;
  68. this.c2 = v;
  69. this.c3 = v;
  70. }
  71. /// <summary>Constructs a uint2x4 matrix from a single bool value by converting it to uint and assigning it to every component.</summary>
  72. /// <param name="v">bool to convert to uint2x4</param>
  73. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  74. public uint2x4(bool v)
  75. {
  76. this.c0 = math.select(new uint2(0u), new uint2(1u), v);
  77. this.c1 = math.select(new uint2(0u), new uint2(1u), v);
  78. this.c2 = math.select(new uint2(0u), new uint2(1u), v);
  79. this.c3 = math.select(new uint2(0u), new uint2(1u), v);
  80. }
  81. /// <summary>Constructs a uint2x4 matrix from a bool2x4 matrix by componentwise conversion.</summary>
  82. /// <param name="v">bool2x4 to convert to uint2x4</param>
  83. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  84. public uint2x4(bool2x4 v)
  85. {
  86. this.c0 = math.select(new uint2(0u), new uint2(1u), v.c0);
  87. this.c1 = math.select(new uint2(0u), new uint2(1u), v.c1);
  88. this.c2 = math.select(new uint2(0u), new uint2(1u), v.c2);
  89. this.c3 = math.select(new uint2(0u), new uint2(1u), v.c3);
  90. }
  91. /// <summary>Constructs a uint2x4 matrix from a single int value by converting it to uint and assigning it to every component.</summary>
  92. /// <param name="v">int to convert to uint2x4</param>
  93. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  94. public uint2x4(int v)
  95. {
  96. this.c0 = (uint2)v;
  97. this.c1 = (uint2)v;
  98. this.c2 = (uint2)v;
  99. this.c3 = (uint2)v;
  100. }
  101. /// <summary>Constructs a uint2x4 matrix from a int2x4 matrix by componentwise conversion.</summary>
  102. /// <param name="v">int2x4 to convert to uint2x4</param>
  103. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  104. public uint2x4(int2x4 v)
  105. {
  106. this.c0 = (uint2)v.c0;
  107. this.c1 = (uint2)v.c1;
  108. this.c2 = (uint2)v.c2;
  109. this.c3 = (uint2)v.c3;
  110. }
  111. /// <summary>Constructs a uint2x4 matrix from a single float value by converting it to uint and assigning it to every component.</summary>
  112. /// <param name="v">float to convert to uint2x4</param>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public uint2x4(float v)
  115. {
  116. this.c0 = (uint2)v;
  117. this.c1 = (uint2)v;
  118. this.c2 = (uint2)v;
  119. this.c3 = (uint2)v;
  120. }
  121. /// <summary>Constructs a uint2x4 matrix from a float2x4 matrix by componentwise conversion.</summary>
  122. /// <param name="v">float2x4 to convert to uint2x4</param>
  123. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  124. public uint2x4(float2x4 v)
  125. {
  126. this.c0 = (uint2)v.c0;
  127. this.c1 = (uint2)v.c1;
  128. this.c2 = (uint2)v.c2;
  129. this.c3 = (uint2)v.c3;
  130. }
  131. /// <summary>Constructs a uint2x4 matrix from a single double value by converting it to uint and assigning it to every component.</summary>
  132. /// <param name="v">double to convert to uint2x4</param>
  133. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  134. public uint2x4(double v)
  135. {
  136. this.c0 = (uint2)v;
  137. this.c1 = (uint2)v;
  138. this.c2 = (uint2)v;
  139. this.c3 = (uint2)v;
  140. }
  141. /// <summary>Constructs a uint2x4 matrix from a double2x4 matrix by componentwise conversion.</summary>
  142. /// <param name="v">double2x4 to convert to uint2x4</param>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public uint2x4(double2x4 v)
  145. {
  146. this.c0 = (uint2)v.c0;
  147. this.c1 = (uint2)v.c1;
  148. this.c2 = (uint2)v.c2;
  149. this.c3 = (uint2)v.c3;
  150. }
  151. /// <summary>Implicitly converts a single uint value to a uint2x4 matrix by assigning it to every component.</summary>
  152. /// <param name="v">uint to convert to uint2x4</param>
  153. /// <returns>Converted value.</returns>
  154. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  155. public static implicit operator uint2x4(uint v) { return new uint2x4(v); }
  156. /// <summary>Explicitly converts a single bool value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  157. /// <param name="v">bool to convert to uint2x4</param>
  158. /// <returns>Converted value.</returns>
  159. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  160. public static explicit operator uint2x4(bool v) { return new uint2x4(v); }
  161. /// <summary>Explicitly converts a bool2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  162. /// <param name="v">bool2x4 to convert to uint2x4</param>
  163. /// <returns>Converted value.</returns>
  164. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  165. public static explicit operator uint2x4(bool2x4 v) { return new uint2x4(v); }
  166. /// <summary>Explicitly converts a single int value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  167. /// <param name="v">int to convert to uint2x4</param>
  168. /// <returns>Converted value.</returns>
  169. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  170. public static explicit operator uint2x4(int v) { return new uint2x4(v); }
  171. /// <summary>Explicitly converts a int2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  172. /// <param name="v">int2x4 to convert to uint2x4</param>
  173. /// <returns>Converted value.</returns>
  174. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  175. public static explicit operator uint2x4(int2x4 v) { return new uint2x4(v); }
  176. /// <summary>Explicitly converts a single float value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  177. /// <param name="v">float to convert to uint2x4</param>
  178. /// <returns>Converted value.</returns>
  179. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  180. public static explicit operator uint2x4(float v) { return new uint2x4(v); }
  181. /// <summary>Explicitly converts a float2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  182. /// <param name="v">float2x4 to convert to uint2x4</param>
  183. /// <returns>Converted value.</returns>
  184. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  185. public static explicit operator uint2x4(float2x4 v) { return new uint2x4(v); }
  186. /// <summary>Explicitly converts a single double value to a uint2x4 matrix by converting it to uint and assigning it to every component.</summary>
  187. /// <param name="v">double to convert to uint2x4</param>
  188. /// <returns>Converted value.</returns>
  189. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  190. public static explicit operator uint2x4(double v) { return new uint2x4(v); }
  191. /// <summary>Explicitly converts a double2x4 matrix to a uint2x4 matrix by componentwise conversion.</summary>
  192. /// <param name="v">double2x4 to convert to uint2x4</param>
  193. /// <returns>Converted value.</returns>
  194. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  195. public static explicit operator uint2x4(double2x4 v) { return new uint2x4(v); }
  196. /// <summary>Returns the result of a componentwise multiplication operation on two uint2x4 matrices.</summary>
  197. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise multiplication.</param>
  198. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise multiplication.</param>
  199. /// <returns>uint2x4 result of the componentwise multiplication.</returns>
  200. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  201. 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); }
  202. /// <summary>Returns the result of a componentwise multiplication operation on a uint2x4 matrix and a uint value.</summary>
  203. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise multiplication.</param>
  204. /// <param name="rhs">Right hand side uint to use to compute componentwise multiplication.</param>
  205. /// <returns>uint2x4 result of the componentwise multiplication.</returns>
  206. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  207. public static uint2x4 operator * (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 * rhs, lhs.c1 * rhs, lhs.c2 * rhs, lhs.c3 * rhs); }
  208. /// <summary>Returns the result of a componentwise multiplication operation on a uint value and a uint2x4 matrix.</summary>
  209. /// <param name="lhs">Left hand side uint to use to compute componentwise multiplication.</param>
  210. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise multiplication.</param>
  211. /// <returns>uint2x4 result of the componentwise multiplication.</returns>
  212. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  213. public static uint2x4 operator * (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs * rhs.c0, lhs * rhs.c1, lhs * rhs.c2, lhs * rhs.c3); }
  214. /// <summary>Returns the result of a componentwise addition operation on two uint2x4 matrices.</summary>
  215. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise addition.</param>
  216. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise addition.</param>
  217. /// <returns>uint2x4 result of the componentwise addition.</returns>
  218. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  219. 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); }
  220. /// <summary>Returns the result of a componentwise addition operation on a uint2x4 matrix and a uint value.</summary>
  221. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise addition.</param>
  222. /// <param name="rhs">Right hand side uint to use to compute componentwise addition.</param>
  223. /// <returns>uint2x4 result of the componentwise addition.</returns>
  224. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  225. public static uint2x4 operator + (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 + rhs, lhs.c1 + rhs, lhs.c2 + rhs, lhs.c3 + rhs); }
  226. /// <summary>Returns the result of a componentwise addition operation on a uint value and a uint2x4 matrix.</summary>
  227. /// <param name="lhs">Left hand side uint to use to compute componentwise addition.</param>
  228. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise addition.</param>
  229. /// <returns>uint2x4 result of the componentwise addition.</returns>
  230. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  231. public static uint2x4 operator + (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs + rhs.c0, lhs + rhs.c1, lhs + rhs.c2, lhs + rhs.c3); }
  232. /// <summary>Returns the result of a componentwise subtraction operation on two uint2x4 matrices.</summary>
  233. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise subtraction.</param>
  234. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise subtraction.</param>
  235. /// <returns>uint2x4 result of the componentwise subtraction.</returns>
  236. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  237. 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); }
  238. /// <summary>Returns the result of a componentwise subtraction operation on a uint2x4 matrix and a uint value.</summary>
  239. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise subtraction.</param>
  240. /// <param name="rhs">Right hand side uint to use to compute componentwise subtraction.</param>
  241. /// <returns>uint2x4 result of the componentwise subtraction.</returns>
  242. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  243. public static uint2x4 operator - (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 - rhs, lhs.c1 - rhs, lhs.c2 - rhs, lhs.c3 - rhs); }
  244. /// <summary>Returns the result of a componentwise subtraction operation on a uint value and a uint2x4 matrix.</summary>
  245. /// <param name="lhs">Left hand side uint to use to compute componentwise subtraction.</param>
  246. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise subtraction.</param>
  247. /// <returns>uint2x4 result of the componentwise subtraction.</returns>
  248. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  249. public static uint2x4 operator - (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs - rhs.c0, lhs - rhs.c1, lhs - rhs.c2, lhs - rhs.c3); }
  250. /// <summary>Returns the result of a componentwise division operation on two uint2x4 matrices.</summary>
  251. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise division.</param>
  252. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise division.</param>
  253. /// <returns>uint2x4 result of the componentwise division.</returns>
  254. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  255. 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); }
  256. /// <summary>Returns the result of a componentwise division operation on a uint2x4 matrix and a uint value.</summary>
  257. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise division.</param>
  258. /// <param name="rhs">Right hand side uint to use to compute componentwise division.</param>
  259. /// <returns>uint2x4 result of the componentwise division.</returns>
  260. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  261. public static uint2x4 operator / (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 / rhs, lhs.c1 / rhs, lhs.c2 / rhs, lhs.c3 / rhs); }
  262. /// <summary>Returns the result of a componentwise division operation on a uint value and a uint2x4 matrix.</summary>
  263. /// <param name="lhs">Left hand side uint to use to compute componentwise division.</param>
  264. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise division.</param>
  265. /// <returns>uint2x4 result of the componentwise division.</returns>
  266. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  267. public static uint2x4 operator / (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs / rhs.c0, lhs / rhs.c1, lhs / rhs.c2, lhs / rhs.c3); }
  268. /// <summary>Returns the result of a componentwise modulus operation on two uint2x4 matrices.</summary>
  269. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise modulus.</param>
  270. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise modulus.</param>
  271. /// <returns>uint2x4 result of the componentwise modulus.</returns>
  272. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  273. 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); }
  274. /// <summary>Returns the result of a componentwise modulus operation on a uint2x4 matrix and a uint value.</summary>
  275. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise modulus.</param>
  276. /// <param name="rhs">Right hand side uint to use to compute componentwise modulus.</param>
  277. /// <returns>uint2x4 result of the componentwise modulus.</returns>
  278. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  279. public static uint2x4 operator % (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 % rhs, lhs.c1 % rhs, lhs.c2 % rhs, lhs.c3 % rhs); }
  280. /// <summary>Returns the result of a componentwise modulus operation on a uint value and a uint2x4 matrix.</summary>
  281. /// <param name="lhs">Left hand side uint to use to compute componentwise modulus.</param>
  282. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise modulus.</param>
  283. /// <returns>uint2x4 result of the componentwise modulus.</returns>
  284. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  285. public static uint2x4 operator % (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs % rhs.c0, lhs % rhs.c1, lhs % rhs.c2, lhs % rhs.c3); }
  286. /// <summary>Returns the result of a componentwise increment operation on a uint2x4 matrix.</summary>
  287. /// <param name="val">Value to use when computing the componentwise increment.</param>
  288. /// <returns>uint2x4 result of the componentwise increment.</returns>
  289. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  290. public static uint2x4 operator ++ (uint2x4 val) { return new uint2x4 (++val.c0, ++val.c1, ++val.c2, ++val.c3); }
  291. /// <summary>Returns the result of a componentwise decrement operation on a uint2x4 matrix.</summary>
  292. /// <param name="val">Value to use when computing the componentwise decrement.</param>
  293. /// <returns>uint2x4 result of the componentwise decrement.</returns>
  294. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  295. public static uint2x4 operator -- (uint2x4 val) { return new uint2x4 (--val.c0, --val.c1, --val.c2, --val.c3); }
  296. /// <summary>Returns the result of a componentwise less than operation on two uint2x4 matrices.</summary>
  297. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise less than.</param>
  298. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise less than.</param>
  299. /// <returns>bool2x4 result of the componentwise less than.</returns>
  300. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  301. 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); }
  302. /// <summary>Returns the result of a componentwise less than operation on a uint2x4 matrix and a uint value.</summary>
  303. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise less than.</param>
  304. /// <param name="rhs">Right hand side uint to use to compute componentwise less than.</param>
  305. /// <returns>bool2x4 result of the componentwise less than.</returns>
  306. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  307. public static bool2x4 operator < (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 < rhs, lhs.c1 < rhs, lhs.c2 < rhs, lhs.c3 < rhs); }
  308. /// <summary>Returns the result of a componentwise less than operation on a uint value and a uint2x4 matrix.</summary>
  309. /// <param name="lhs">Left hand side uint to use to compute componentwise less than.</param>
  310. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise less than.</param>
  311. /// <returns>bool2x4 result of the componentwise less than.</returns>
  312. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  313. public static bool2x4 operator < (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs < rhs.c0, lhs < rhs.c1, lhs < rhs.c2, lhs < rhs.c3); }
  314. /// <summary>Returns the result of a componentwise less or equal operation on two uint2x4 matrices.</summary>
  315. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise less or equal.</param>
  316. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise less or equal.</param>
  317. /// <returns>bool2x4 result of the componentwise less or equal.</returns>
  318. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  319. 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); }
  320. /// <summary>Returns the result of a componentwise less or equal operation on a uint2x4 matrix and a uint value.</summary>
  321. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise less or equal.</param>
  322. /// <param name="rhs">Right hand side uint to use to compute componentwise less or equal.</param>
  323. /// <returns>bool2x4 result of the componentwise less or equal.</returns>
  324. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  325. public static bool2x4 operator <= (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 <= rhs, lhs.c1 <= rhs, lhs.c2 <= rhs, lhs.c3 <= rhs); }
  326. /// <summary>Returns the result of a componentwise less or equal operation on a uint value and a uint2x4 matrix.</summary>
  327. /// <param name="lhs">Left hand side uint to use to compute componentwise less or equal.</param>
  328. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise less or equal.</param>
  329. /// <returns>bool2x4 result of the componentwise less or equal.</returns>
  330. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  331. public static bool2x4 operator <= (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs <= rhs.c0, lhs <= rhs.c1, lhs <= rhs.c2, lhs <= rhs.c3); }
  332. /// <summary>Returns the result of a componentwise greater than operation on two uint2x4 matrices.</summary>
  333. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise greater than.</param>
  334. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise greater than.</param>
  335. /// <returns>bool2x4 result of the componentwise greater than.</returns>
  336. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  337. 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); }
  338. /// <summary>Returns the result of a componentwise greater than operation on a uint2x4 matrix and a uint value.</summary>
  339. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise greater than.</param>
  340. /// <param name="rhs">Right hand side uint to use to compute componentwise greater than.</param>
  341. /// <returns>bool2x4 result of the componentwise greater than.</returns>
  342. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  343. public static bool2x4 operator > (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 > rhs, lhs.c1 > rhs, lhs.c2 > rhs, lhs.c3 > rhs); }
  344. /// <summary>Returns the result of a componentwise greater than operation on a uint value and a uint2x4 matrix.</summary>
  345. /// <param name="lhs">Left hand side uint to use to compute componentwise greater than.</param>
  346. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise greater than.</param>
  347. /// <returns>bool2x4 result of the componentwise greater than.</returns>
  348. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  349. public static bool2x4 operator > (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs > rhs.c0, lhs > rhs.c1, lhs > rhs.c2, lhs > rhs.c3); }
  350. /// <summary>Returns the result of a componentwise greater or equal operation on two uint2x4 matrices.</summary>
  351. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise greater or equal.</param>
  352. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise greater or equal.</param>
  353. /// <returns>bool2x4 result of the componentwise greater or equal.</returns>
  354. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  355. 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); }
  356. /// <summary>Returns the result of a componentwise greater or equal operation on a uint2x4 matrix and a uint value.</summary>
  357. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise greater or equal.</param>
  358. /// <param name="rhs">Right hand side uint to use to compute componentwise greater or equal.</param>
  359. /// <returns>bool2x4 result of the componentwise greater or equal.</returns>
  360. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  361. public static bool2x4 operator >= (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 >= rhs, lhs.c1 >= rhs, lhs.c2 >= rhs, lhs.c3 >= rhs); }
  362. /// <summary>Returns the result of a componentwise greater or equal operation on a uint value and a uint2x4 matrix.</summary>
  363. /// <param name="lhs">Left hand side uint to use to compute componentwise greater or equal.</param>
  364. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise greater or equal.</param>
  365. /// <returns>bool2x4 result of the componentwise greater or equal.</returns>
  366. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  367. public static bool2x4 operator >= (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs >= rhs.c0, lhs >= rhs.c1, lhs >= rhs.c2, lhs >= rhs.c3); }
  368. /// <summary>Returns the result of a componentwise unary minus operation on a uint2x4 matrix.</summary>
  369. /// <param name="val">Value to use when computing the componentwise unary minus.</param>
  370. /// <returns>uint2x4 result of the componentwise unary minus.</returns>
  371. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  372. public static uint2x4 operator - (uint2x4 val) { return new uint2x4 (-val.c0, -val.c1, -val.c2, -val.c3); }
  373. /// <summary>Returns the result of a componentwise unary plus operation on a uint2x4 matrix.</summary>
  374. /// <param name="val">Value to use when computing the componentwise unary plus.</param>
  375. /// <returns>uint2x4 result of the componentwise unary plus.</returns>
  376. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  377. public static uint2x4 operator + (uint2x4 val) { return new uint2x4 (+val.c0, +val.c1, +val.c2, +val.c3); }
  378. /// <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>
  379. /// <param name="x">The matrix to left shift.</param>
  380. /// <param name="n">The number of bits to left shift.</param>
  381. /// <returns>The result of the componentwise left shift.</returns>
  382. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  383. public static uint2x4 operator << (uint2x4 x, int n) { return new uint2x4 (x.c0 << n, x.c1 << n, x.c2 << n, x.c3 << n); }
  384. /// <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>
  385. /// <param name="x">The matrix to right shift.</param>
  386. /// <param name="n">The number of bits to right shift.</param>
  387. /// <returns>The result of the componentwise right shift.</returns>
  388. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  389. public static uint2x4 operator >> (uint2x4 x, int n) { return new uint2x4 (x.c0 >> n, x.c1 >> n, x.c2 >> n, x.c3 >> n); }
  390. /// <summary>Returns the result of a componentwise equality operation on two uint2x4 matrices.</summary>
  391. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise equality.</param>
  392. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise equality.</param>
  393. /// <returns>bool2x4 result of the componentwise equality.</returns>
  394. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  395. 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); }
  396. /// <summary>Returns the result of a componentwise equality operation on a uint2x4 matrix and a uint value.</summary>
  397. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise equality.</param>
  398. /// <param name="rhs">Right hand side uint to use to compute componentwise equality.</param>
  399. /// <returns>bool2x4 result of the componentwise equality.</returns>
  400. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  401. public static bool2x4 operator == (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 == rhs, lhs.c1 == rhs, lhs.c2 == rhs, lhs.c3 == rhs); }
  402. /// <summary>Returns the result of a componentwise equality operation on a uint value and a uint2x4 matrix.</summary>
  403. /// <param name="lhs">Left hand side uint to use to compute componentwise equality.</param>
  404. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise equality.</param>
  405. /// <returns>bool2x4 result of the componentwise equality.</returns>
  406. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  407. public static bool2x4 operator == (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs == rhs.c0, lhs == rhs.c1, lhs == rhs.c2, lhs == rhs.c3); }
  408. /// <summary>Returns the result of a componentwise not equal operation on two uint2x4 matrices.</summary>
  409. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise not equal.</param>
  410. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise not equal.</param>
  411. /// <returns>bool2x4 result of the componentwise not equal.</returns>
  412. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  413. 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); }
  414. /// <summary>Returns the result of a componentwise not equal operation on a uint2x4 matrix and a uint value.</summary>
  415. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise not equal.</param>
  416. /// <param name="rhs">Right hand side uint to use to compute componentwise not equal.</param>
  417. /// <returns>bool2x4 result of the componentwise not equal.</returns>
  418. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  419. public static bool2x4 operator != (uint2x4 lhs, uint rhs) { return new bool2x4 (lhs.c0 != rhs, lhs.c1 != rhs, lhs.c2 != rhs, lhs.c3 != rhs); }
  420. /// <summary>Returns the result of a componentwise not equal operation on a uint value and a uint2x4 matrix.</summary>
  421. /// <param name="lhs">Left hand side uint to use to compute componentwise not equal.</param>
  422. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise not equal.</param>
  423. /// <returns>bool2x4 result of the componentwise not equal.</returns>
  424. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  425. public static bool2x4 operator != (uint lhs, uint2x4 rhs) { return new bool2x4 (lhs != rhs.c0, lhs != rhs.c1, lhs != rhs.c2, lhs != rhs.c3); }
  426. /// <summary>Returns the result of a componentwise bitwise not operation on a uint2x4 matrix.</summary>
  427. /// <param name="val">Value to use when computing the componentwise bitwise not.</param>
  428. /// <returns>uint2x4 result of the componentwise bitwise not.</returns>
  429. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  430. public static uint2x4 operator ~ (uint2x4 val) { return new uint2x4 (~val.c0, ~val.c1, ~val.c2, ~val.c3); }
  431. /// <summary>Returns the result of a componentwise bitwise and operation on two uint2x4 matrices.</summary>
  432. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise bitwise and.</param>
  433. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise bitwise and.</param>
  434. /// <returns>uint2x4 result of the componentwise bitwise and.</returns>
  435. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  436. 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); }
  437. /// <summary>Returns the result of a componentwise bitwise and operation on a uint2x4 matrix and a uint value.</summary>
  438. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise bitwise and.</param>
  439. /// <param name="rhs">Right hand side uint to use to compute componentwise bitwise and.</param>
  440. /// <returns>uint2x4 result of the componentwise bitwise and.</returns>
  441. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  442. public static uint2x4 operator & (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 & rhs, lhs.c1 & rhs, lhs.c2 & rhs, lhs.c3 & rhs); }
  443. /// <summary>Returns the result of a componentwise bitwise and operation on a uint value and a uint2x4 matrix.</summary>
  444. /// <param name="lhs">Left hand side uint to use to compute componentwise bitwise and.</param>
  445. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise bitwise and.</param>
  446. /// <returns>uint2x4 result of the componentwise bitwise and.</returns>
  447. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  448. public static uint2x4 operator & (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs & rhs.c0, lhs & rhs.c1, lhs & rhs.c2, lhs & rhs.c3); }
  449. /// <summary>Returns the result of a componentwise bitwise or operation on two uint2x4 matrices.</summary>
  450. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise bitwise or.</param>
  451. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise bitwise or.</param>
  452. /// <returns>uint2x4 result of the componentwise bitwise or.</returns>
  453. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  454. 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); }
  455. /// <summary>Returns the result of a componentwise bitwise or operation on a uint2x4 matrix and a uint value.</summary>
  456. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise bitwise or.</param>
  457. /// <param name="rhs">Right hand side uint to use to compute componentwise bitwise or.</param>
  458. /// <returns>uint2x4 result of the componentwise bitwise or.</returns>
  459. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  460. public static uint2x4 operator | (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 | rhs, lhs.c1 | rhs, lhs.c2 | rhs, lhs.c3 | rhs); }
  461. /// <summary>Returns the result of a componentwise bitwise or operation on a uint value and a uint2x4 matrix.</summary>
  462. /// <param name="lhs">Left hand side uint to use to compute componentwise bitwise or.</param>
  463. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise bitwise or.</param>
  464. /// <returns>uint2x4 result of the componentwise bitwise or.</returns>
  465. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  466. public static uint2x4 operator | (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs | rhs.c0, lhs | rhs.c1, lhs | rhs.c2, lhs | rhs.c3); }
  467. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on two uint2x4 matrices.</summary>
  468. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise bitwise exclusive or.</param>
  469. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise bitwise exclusive or.</param>
  470. /// <returns>uint2x4 result of the componentwise bitwise exclusive or.</returns>
  471. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  472. 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); }
  473. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint2x4 matrix and a uint value.</summary>
  474. /// <param name="lhs">Left hand side uint2x4 to use to compute componentwise bitwise exclusive or.</param>
  475. /// <param name="rhs">Right hand side uint to use to compute componentwise bitwise exclusive or.</param>
  476. /// <returns>uint2x4 result of the componentwise bitwise exclusive or.</returns>
  477. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  478. public static uint2x4 operator ^ (uint2x4 lhs, uint rhs) { return new uint2x4 (lhs.c0 ^ rhs, lhs.c1 ^ rhs, lhs.c2 ^ rhs, lhs.c3 ^ rhs); }
  479. /// <summary>Returns the result of a componentwise bitwise exclusive or operation on a uint value and a uint2x4 matrix.</summary>
  480. /// <param name="lhs">Left hand side uint to use to compute componentwise bitwise exclusive or.</param>
  481. /// <param name="rhs">Right hand side uint2x4 to use to compute componentwise bitwise exclusive or.</param>
  482. /// <returns>uint2x4 result of the componentwise bitwise exclusive or.</returns>
  483. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  484. public static uint2x4 operator ^ (uint lhs, uint2x4 rhs) { return new uint2x4 (lhs ^ rhs.c0, lhs ^ rhs.c1, lhs ^ rhs.c2, lhs ^ rhs.c3); }
  485. /// <summary>Returns the uint2 element at a specified index.</summary>
  486. unsafe public ref uint2 this[int index]
  487. {
  488. get
  489. {
  490. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  491. if ((uint)index >= 4)
  492. throw new System.ArgumentException("index must be between[0...3]");
  493. #endif
  494. fixed (uint2x4* array = &this) { return ref ((uint2*)array)[index]; }
  495. }
  496. }
  497. /// <summary>Returns true if the uint2x4 is equal to a given uint2x4, false otherwise.</summary>
  498. /// <param name="rhs">Right hand side argument to compare equality with.</param>
  499. /// <returns>The result of the equality comparison.</returns>
  500. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  501. public bool Equals(uint2x4 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1) && c2.Equals(rhs.c2) && c3.Equals(rhs.c3); }
  502. /// <summary>Returns true if the uint2x4 is equal to a given uint2x4, false otherwise.</summary>
  503. /// <param name="o">Right hand side argument to compare equality with.</param>
  504. /// <returns>The result of the equality comparison.</returns>
  505. public override bool Equals(object o) { return o is uint2x4 converted && Equals(converted); }
  506. /// <summary>Returns a hash code for the uint2x4.</summary>
  507. /// <returns>The computed hash code.</returns>
  508. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  509. public override int GetHashCode() { return (int)math.hash(this); }
  510. /// <summary>Returns a string representation of the uint2x4.</summary>
  511. /// <returns>String representation of the value.</returns>
  512. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  513. public override string ToString()
  514. {
  515. 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);
  516. }
  517. /// <summary>Returns a string representation of the uint2x4 using a specified format and culture-specific format information.</summary>
  518. /// <param name="format">Format string to use during string formatting.</param>
  519. /// <param name="formatProvider">Format provider to use during string formatting.</param>
  520. /// <returns>String representation of the value.</returns>
  521. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  522. public string ToString(string format, IFormatProvider formatProvider)
  523. {
  524. 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));
  525. }
  526. }
  527. public static partial class math
  528. {
  529. /// <summary>Returns a uint2x4 matrix constructed from four uint2 vectors.</summary>
  530. /// <param name="c0">The matrix column c0 will be set to this value.</param>
  531. /// <param name="c1">The matrix column c1 will be set to this value.</param>
  532. /// <param name="c2">The matrix column c2 will be set to this value.</param>
  533. /// <param name="c3">The matrix column c3 will be set to this value.</param>
  534. /// <returns>uint2x4 constructed from arguments.</returns>
  535. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  536. public static uint2x4 uint2x4(uint2 c0, uint2 c1, uint2 c2, uint2 c3) { return new uint2x4(c0, c1, c2, c3); }
  537. /// <summary>Returns a uint2x4 matrix constructed from from 8 uint values given in row-major order.</summary>
  538. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  539. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  540. /// <param name="m02">The matrix at row 0, column 2 will be set to this value.</param>
  541. /// <param name="m03">The matrix at row 0, column 3 will be set to this value.</param>
  542. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  543. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  544. /// <param name="m12">The matrix at row 1, column 2 will be set to this value.</param>
  545. /// <param name="m13">The matrix at row 1, column 3 will be set to this value.</param>
  546. /// <returns>uint2x4 constructed from arguments.</returns>
  547. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  548. public static uint2x4 uint2x4(uint m00, uint m01, uint m02, uint m03,
  549. uint m10, uint m11, uint m12, uint m13)
  550. {
  551. return new uint2x4(m00, m01, m02, m03,
  552. m10, m11, m12, m13);
  553. }
  554. /// <summary>Returns a uint2x4 matrix constructed from a single uint value by assigning it to every component.</summary>
  555. /// <param name="v">uint to convert to uint2x4</param>
  556. /// <returns>Converted value.</returns>
  557. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  558. public static uint2x4 uint2x4(uint v) { return new uint2x4(v); }
  559. /// <summary>Returns a uint2x4 matrix constructed from a single bool value by converting it to uint and assigning it to every component.</summary>
  560. /// <param name="v">bool to convert to uint2x4</param>
  561. /// <returns>Converted value.</returns>
  562. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  563. public static uint2x4 uint2x4(bool v) { return new uint2x4(v); }
  564. /// <summary>Return a uint2x4 matrix constructed from a bool2x4 matrix by componentwise conversion.</summary>
  565. /// <param name="v">bool2x4 to convert to uint2x4</param>
  566. /// <returns>Converted value.</returns>
  567. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  568. public static uint2x4 uint2x4(bool2x4 v) { return new uint2x4(v); }
  569. /// <summary>Returns a uint2x4 matrix constructed from a single int value by converting it to uint and assigning it to every component.</summary>
  570. /// <param name="v">int to convert to uint2x4</param>
  571. /// <returns>Converted value.</returns>
  572. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  573. public static uint2x4 uint2x4(int v) { return new uint2x4(v); }
  574. /// <summary>Return a uint2x4 matrix constructed from a int2x4 matrix by componentwise conversion.</summary>
  575. /// <param name="v">int2x4 to convert to uint2x4</param>
  576. /// <returns>Converted value.</returns>
  577. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  578. public static uint2x4 uint2x4(int2x4 v) { return new uint2x4(v); }
  579. /// <summary>Returns a uint2x4 matrix constructed from a single float value by converting it to uint and assigning it to every component.</summary>
  580. /// <param name="v">float to convert to uint2x4</param>
  581. /// <returns>Converted value.</returns>
  582. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  583. public static uint2x4 uint2x4(float v) { return new uint2x4(v); }
  584. /// <summary>Return a uint2x4 matrix constructed from a float2x4 matrix by componentwise conversion.</summary>
  585. /// <param name="v">float2x4 to convert to uint2x4</param>
  586. /// <returns>Converted value.</returns>
  587. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  588. public static uint2x4 uint2x4(float2x4 v) { return new uint2x4(v); }
  589. /// <summary>Returns a uint2x4 matrix constructed from a single double value by converting it to uint and assigning it to every component.</summary>
  590. /// <param name="v">double to convert to uint2x4</param>
  591. /// <returns>Converted value.</returns>
  592. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  593. public static uint2x4 uint2x4(double v) { return new uint2x4(v); }
  594. /// <summary>Return a uint2x4 matrix constructed from a double2x4 matrix by componentwise conversion.</summary>
  595. /// <param name="v">double2x4 to convert to uint2x4</param>
  596. /// <returns>Converted value.</returns>
  597. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  598. public static uint2x4 uint2x4(double2x4 v) { return new uint2x4(v); }
  599. /// <summary>Return the uint4x2 transpose of a uint2x4 matrix.</summary>
  600. /// <param name="v">Value to transpose.</param>
  601. /// <returns>Transposed value.</returns>
  602. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  603. public static uint4x2 transpose(uint2x4 v)
  604. {
  605. return uint4x2(
  606. v.c0.x, v.c0.y,
  607. v.c1.x, v.c1.y,
  608. v.c2.x, v.c2.y,
  609. v.c3.x, v.c3.y);
  610. }
  611. /// <summary>Returns a uint hash code of a uint2x4 matrix.</summary>
  612. /// <param name="v">Matrix value to hash.</param>
  613. /// <returns>uint hash of the argument.</returns>
  614. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  615. public static uint hash(uint2x4 v)
  616. {
  617. return csum(v.c0 * uint2(0x9DF50593u, 0xF18EEB85u) +
  618. v.c1 * uint2(0x9E19BFC3u, 0x8196B06Fu) +
  619. v.c2 * uint2(0xD24EFA19u, 0x7D8048BBu) +
  620. v.c3 * uint2(0x713BD06Fu, 0x753AD6ADu)) + 0xD19764C7u;
  621. }
  622. /// <summary>
  623. /// Returns a uint2 vector hash code of a uint2x4 matrix.
  624. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  625. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  626. /// </summary>
  627. /// <param name="v">Matrix value to hash.</param>
  628. /// <returns>uint2 hash of the argument.</returns>
  629. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  630. public static uint2 hashwide(uint2x4 v)
  631. {
  632. return (v.c0 * uint2(0xB5D0BF63u, 0xF9102C5Fu) +
  633. v.c1 * uint2(0x9881FB9Fu, 0x56A1530Du) +
  634. v.c2 * uint2(0x804B722Du, 0x738E50E5u) +
  635. v.c3 * uint2(0x4FC93C25u, 0xCD0445A5u)) + 0xD2B90D9Bu;
  636. }
  637. }
  638. }