No Description
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.

uint4x2.gen.cs 47KB

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