Keine Beschreibung
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

double4x2.gen.cs 41KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  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 doubles.</summary>
  16. [System.Serializable]
  17. [Il2CppEagerStaticClassConstruction]
  18. public partial struct double4x2 : System.IEquatable<double4x2>, IFormattable
  19. {
  20. /// <summary>Column 0 of the matrix.</summary>
  21. public double4 c0;
  22. /// <summary>Column 1 of the matrix.</summary>
  23. public double4 c1;
  24. /// <summary>double4x2 zero value.</summary>
  25. public static readonly double4x2 zero;
  26. /// <summary>Constructs a double4x2 matrix from two double4 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 double4x2(double4 c0, double4 c1)
  31. {
  32. this.c0 = c0;
  33. this.c1 = c1;
  34. }
  35. /// <summary>Constructs a double4x2 matrix from 8 double 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 double4x2(double m00, double m01,
  46. double m10, double m11,
  47. double m20, double m21,
  48. double m30, double m31)
  49. {
  50. this.c0 = new double4(m00, m10, m20, m30);
  51. this.c1 = new double4(m01, m11, m21, m31);
  52. }
  53. /// <summary>Constructs a double4x2 matrix from a single double value by assigning it to every component.</summary>
  54. /// <param name="v">double to convert to double4x2</param>
  55. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  56. public double4x2(double v)
  57. {
  58. this.c0 = v;
  59. this.c1 = v;
  60. }
  61. /// <summary>Constructs a double4x2 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
  62. /// <param name="v">bool to convert to double4x2</param>
  63. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  64. public double4x2(bool v)
  65. {
  66. this.c0 = math.select(new double4(0.0), new double4(1.0), v);
  67. this.c1 = math.select(new double4(0.0), new double4(1.0), v);
  68. }
  69. /// <summary>Constructs a double4x2 matrix from a bool4x2 matrix by componentwise conversion.</summary>
  70. /// <param name="v">bool4x2 to convert to double4x2</param>
  71. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  72. public double4x2(bool4x2 v)
  73. {
  74. this.c0 = math.select(new double4(0.0), new double4(1.0), v.c0);
  75. this.c1 = math.select(new double4(0.0), new double4(1.0), v.c1);
  76. }
  77. /// <summary>Constructs a double4x2 matrix from a single int value by converting it to double and assigning it to every component.</summary>
  78. /// <param name="v">int to convert to double4x2</param>
  79. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  80. public double4x2(int v)
  81. {
  82. this.c0 = v;
  83. this.c1 = v;
  84. }
  85. /// <summary>Constructs a double4x2 matrix from a int4x2 matrix by componentwise conversion.</summary>
  86. /// <param name="v">int4x2 to convert to double4x2</param>
  87. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  88. public double4x2(int4x2 v)
  89. {
  90. this.c0 = v.c0;
  91. this.c1 = v.c1;
  92. }
  93. /// <summary>Constructs a double4x2 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
  94. /// <param name="v">uint to convert to double4x2</param>
  95. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  96. public double4x2(uint v)
  97. {
  98. this.c0 = v;
  99. this.c1 = v;
  100. }
  101. /// <summary>Constructs a double4x2 matrix from a uint4x2 matrix by componentwise conversion.</summary>
  102. /// <param name="v">uint4x2 to convert to double4x2</param>
  103. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  104. public double4x2(uint4x2 v)
  105. {
  106. this.c0 = v.c0;
  107. this.c1 = v.c1;
  108. }
  109. /// <summary>Constructs a double4x2 matrix from a single float value by converting it to double and assigning it to every component.</summary>
  110. /// <param name="v">float to convert to double4x2</param>
  111. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  112. public double4x2(float v)
  113. {
  114. this.c0 = v;
  115. this.c1 = v;
  116. }
  117. /// <summary>Constructs a double4x2 matrix from a float4x2 matrix by componentwise conversion.</summary>
  118. /// <param name="v">float4x2 to convert to double4x2</param>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public double4x2(float4x2 v)
  121. {
  122. this.c0 = v.c0;
  123. this.c1 = v.c1;
  124. }
  125. /// <summary>Implicitly converts a single double value to a double4x2 matrix by assigning it to every component.</summary>
  126. /// <param name="v">double to convert to double4x2</param>
  127. /// <returns>Converted value.</returns>
  128. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  129. public static implicit operator double4x2(double v) { return new double4x2(v); }
  130. /// <summary>Explicitly converts a single bool value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
  131. /// <param name="v">bool to convert to double4x2</param>
  132. /// <returns>Converted value.</returns>
  133. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  134. public static explicit operator double4x2(bool v) { return new double4x2(v); }
  135. /// <summary>Explicitly converts a bool4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
  136. /// <param name="v">bool4x2 to convert to double4x2</param>
  137. /// <returns>Converted value.</returns>
  138. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  139. public static explicit operator double4x2(bool4x2 v) { return new double4x2(v); }
  140. /// <summary>Implicitly converts a single int value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
  141. /// <param name="v">int to convert to double4x2</param>
  142. /// <returns>Converted value.</returns>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static implicit operator double4x2(int v) { return new double4x2(v); }
  145. /// <summary>Implicitly converts a int4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
  146. /// <param name="v">int4x2 to convert to double4x2</param>
  147. /// <returns>Converted value.</returns>
  148. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  149. public static implicit operator double4x2(int4x2 v) { return new double4x2(v); }
  150. /// <summary>Implicitly converts a single uint value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
  151. /// <param name="v">uint to convert to double4x2</param>
  152. /// <returns>Converted value.</returns>
  153. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  154. public static implicit operator double4x2(uint v) { return new double4x2(v); }
  155. /// <summary>Implicitly converts a uint4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
  156. /// <param name="v">uint4x2 to convert to double4x2</param>
  157. /// <returns>Converted value.</returns>
  158. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  159. public static implicit operator double4x2(uint4x2 v) { return new double4x2(v); }
  160. /// <summary>Implicitly converts a single float value to a double4x2 matrix by converting it to double and assigning it to every component.</summary>
  161. /// <param name="v">float to convert to double4x2</param>
  162. /// <returns>Converted value.</returns>
  163. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  164. public static implicit operator double4x2(float v) { return new double4x2(v); }
  165. /// <summary>Implicitly converts a float4x2 matrix to a double4x2 matrix by componentwise conversion.</summary>
  166. /// <param name="v">float4x2 to convert to double4x2</param>
  167. /// <returns>Converted value.</returns>
  168. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  169. public static implicit operator double4x2(float4x2 v) { return new double4x2(v); }
  170. /// <summary>Returns the result of a componentwise multiplication operation on two double4x2 matrices.</summary>
  171. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise multiplication.</param>
  172. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise multiplication.</param>
  173. /// <returns>double4x2 result of the componentwise multiplication.</returns>
  174. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  175. public static double4x2 operator * (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
  176. /// <summary>Returns the result of a componentwise multiplication operation on a double4x2 matrix and a double value.</summary>
  177. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise multiplication.</param>
  178. /// <param name="rhs">Right hand side double to use to compute componentwise multiplication.</param>
  179. /// <returns>double4x2 result of the componentwise multiplication.</returns>
  180. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  181. public static double4x2 operator * (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
  182. /// <summary>Returns the result of a componentwise multiplication operation on a double value and a double4x2 matrix.</summary>
  183. /// <param name="lhs">Left hand side double to use to compute componentwise multiplication.</param>
  184. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise multiplication.</param>
  185. /// <returns>double4x2 result of the componentwise multiplication.</returns>
  186. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  187. public static double4x2 operator * (double lhs, double4x2 rhs) { return new double4x2 (lhs * rhs.c0, lhs * rhs.c1); }
  188. /// <summary>Returns the result of a componentwise addition operation on two double4x2 matrices.</summary>
  189. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise addition.</param>
  190. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise addition.</param>
  191. /// <returns>double4x2 result of the componentwise addition.</returns>
  192. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  193. public static double4x2 operator + (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
  194. /// <summary>Returns the result of a componentwise addition operation on a double4x2 matrix and a double value.</summary>
  195. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise addition.</param>
  196. /// <param name="rhs">Right hand side double to use to compute componentwise addition.</param>
  197. /// <returns>double4x2 result of the componentwise addition.</returns>
  198. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  199. public static double4x2 operator + (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
  200. /// <summary>Returns the result of a componentwise addition operation on a double value and a double4x2 matrix.</summary>
  201. /// <param name="lhs">Left hand side double to use to compute componentwise addition.</param>
  202. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise addition.</param>
  203. /// <returns>double4x2 result of the componentwise addition.</returns>
  204. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  205. public static double4x2 operator + (double lhs, double4x2 rhs) { return new double4x2 (lhs + rhs.c0, lhs + rhs.c1); }
  206. /// <summary>Returns the result of a componentwise subtraction operation on two double4x2 matrices.</summary>
  207. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise subtraction.</param>
  208. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise subtraction.</param>
  209. /// <returns>double4x2 result of the componentwise subtraction.</returns>
  210. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  211. public static double4x2 operator - (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
  212. /// <summary>Returns the result of a componentwise subtraction operation on a double4x2 matrix and a double value.</summary>
  213. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise subtraction.</param>
  214. /// <param name="rhs">Right hand side double to use to compute componentwise subtraction.</param>
  215. /// <returns>double4x2 result of the componentwise subtraction.</returns>
  216. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  217. public static double4x2 operator - (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
  218. /// <summary>Returns the result of a componentwise subtraction operation on a double value and a double4x2 matrix.</summary>
  219. /// <param name="lhs">Left hand side double to use to compute componentwise subtraction.</param>
  220. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise subtraction.</param>
  221. /// <returns>double4x2 result of the componentwise subtraction.</returns>
  222. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  223. public static double4x2 operator - (double lhs, double4x2 rhs) { return new double4x2 (lhs - rhs.c0, lhs - rhs.c1); }
  224. /// <summary>Returns the result of a componentwise division operation on two double4x2 matrices.</summary>
  225. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise division.</param>
  226. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise division.</param>
  227. /// <returns>double4x2 result of the componentwise division.</returns>
  228. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  229. public static double4x2 operator / (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
  230. /// <summary>Returns the result of a componentwise division operation on a double4x2 matrix and a double value.</summary>
  231. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise division.</param>
  232. /// <param name="rhs">Right hand side double to use to compute componentwise division.</param>
  233. /// <returns>double4x2 result of the componentwise division.</returns>
  234. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  235. public static double4x2 operator / (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
  236. /// <summary>Returns the result of a componentwise division operation on a double value and a double4x2 matrix.</summary>
  237. /// <param name="lhs">Left hand side double to use to compute componentwise division.</param>
  238. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise division.</param>
  239. /// <returns>double4x2 result of the componentwise division.</returns>
  240. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  241. public static double4x2 operator / (double lhs, double4x2 rhs) { return new double4x2 (lhs / rhs.c0, lhs / rhs.c1); }
  242. /// <summary>Returns the result of a componentwise modulus operation on two double4x2 matrices.</summary>
  243. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise modulus.</param>
  244. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise modulus.</param>
  245. /// <returns>double4x2 result of the componentwise modulus.</returns>
  246. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  247. public static double4x2 operator % (double4x2 lhs, double4x2 rhs) { return new double4x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
  248. /// <summary>Returns the result of a componentwise modulus operation on a double4x2 matrix and a double value.</summary>
  249. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise modulus.</param>
  250. /// <param name="rhs">Right hand side double to use to compute componentwise modulus.</param>
  251. /// <returns>double4x2 result of the componentwise modulus.</returns>
  252. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  253. public static double4x2 operator % (double4x2 lhs, double rhs) { return new double4x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
  254. /// <summary>Returns the result of a componentwise modulus operation on a double value and a double4x2 matrix.</summary>
  255. /// <param name="lhs">Left hand side double to use to compute componentwise modulus.</param>
  256. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise modulus.</param>
  257. /// <returns>double4x2 result of the componentwise modulus.</returns>
  258. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  259. public static double4x2 operator % (double lhs, double4x2 rhs) { return new double4x2 (lhs % rhs.c0, lhs % rhs.c1); }
  260. /// <summary>Returns the result of a componentwise increment operation on a double4x2 matrix.</summary>
  261. /// <param name="val">Value to use when computing the componentwise increment.</param>
  262. /// <returns>double4x2 result of the componentwise increment.</returns>
  263. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  264. public static double4x2 operator ++ (double4x2 val) { return new double4x2 (++val.c0, ++val.c1); }
  265. /// <summary>Returns the result of a componentwise decrement operation on a double4x2 matrix.</summary>
  266. /// <param name="val">Value to use when computing the componentwise decrement.</param>
  267. /// <returns>double4x2 result of the componentwise decrement.</returns>
  268. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  269. public static double4x2 operator -- (double4x2 val) { return new double4x2 (--val.c0, --val.c1); }
  270. /// <summary>Returns the result of a componentwise less than operation on two double4x2 matrices.</summary>
  271. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise less than.</param>
  272. /// <param name="rhs">Right hand side double4x2 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 < (double4x2 lhs, double4x2 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 double4x2 matrix and a double value.</summary>
  277. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise less than.</param>
  278. /// <param name="rhs">Right hand side double 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 < (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
  282. /// <summary>Returns the result of a componentwise less than operation on a double value and a double4x2 matrix.</summary>
  283. /// <param name="lhs">Left hand side double to use to compute componentwise less than.</param>
  284. /// <param name="rhs">Right hand side double4x2 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 < (double lhs, double4x2 rhs) { return new bool4x2 (lhs < rhs.c0, lhs < rhs.c1); }
  288. /// <summary>Returns the result of a componentwise less or equal operation on two double4x2 matrices.</summary>
  289. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise less or equal.</param>
  290. /// <param name="rhs">Right hand side double4x2 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 <= (double4x2 lhs, double4x2 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 double4x2 matrix and a double value.</summary>
  295. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise less or equal.</param>
  296. /// <param name="rhs">Right hand side double 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 <= (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
  300. /// <summary>Returns the result of a componentwise less or equal operation on a double value and a double4x2 matrix.</summary>
  301. /// <param name="lhs">Left hand side double to use to compute componentwise less or equal.</param>
  302. /// <param name="rhs">Right hand side double4x2 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 <= (double lhs, double4x2 rhs) { return new bool4x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
  306. /// <summary>Returns the result of a componentwise greater than operation on two double4x2 matrices.</summary>
  307. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater than.</param>
  308. /// <param name="rhs">Right hand side double4x2 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 > (double4x2 lhs, double4x2 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 double4x2 matrix and a double value.</summary>
  313. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater than.</param>
  314. /// <param name="rhs">Right hand side double 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 > (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
  318. /// <summary>Returns the result of a componentwise greater than operation on a double value and a double4x2 matrix.</summary>
  319. /// <param name="lhs">Left hand side double to use to compute componentwise greater than.</param>
  320. /// <param name="rhs">Right hand side double4x2 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 > (double lhs, double4x2 rhs) { return new bool4x2 (lhs > rhs.c0, lhs > rhs.c1); }
  324. /// <summary>Returns the result of a componentwise greater or equal operation on two double4x2 matrices.</summary>
  325. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater or equal.</param>
  326. /// <param name="rhs">Right hand side double4x2 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 >= (double4x2 lhs, double4x2 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 double4x2 matrix and a double value.</summary>
  331. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise greater or equal.</param>
  332. /// <param name="rhs">Right hand side double 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 >= (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
  336. /// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double4x2 matrix.</summary>
  337. /// <param name="lhs">Left hand side double to use to compute componentwise greater or equal.</param>
  338. /// <param name="rhs">Right hand side double4x2 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 >= (double lhs, double4x2 rhs) { return new bool4x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
  342. /// <summary>Returns the result of a componentwise unary minus operation on a double4x2 matrix.</summary>
  343. /// <param name="val">Value to use when computing the componentwise unary minus.</param>
  344. /// <returns>double4x2 result of the componentwise unary minus.</returns>
  345. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  346. public static double4x2 operator - (double4x2 val) { return new double4x2 (-val.c0, -val.c1); }
  347. /// <summary>Returns the result of a componentwise unary plus operation on a double4x2 matrix.</summary>
  348. /// <param name="val">Value to use when computing the componentwise unary plus.</param>
  349. /// <returns>double4x2 result of the componentwise unary plus.</returns>
  350. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  351. public static double4x2 operator + (double4x2 val) { return new double4x2 (+val.c0, +val.c1); }
  352. /// <summary>Returns the result of a componentwise equality operation on two double4x2 matrices.</summary>
  353. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise equality.</param>
  354. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise equality.</param>
  355. /// <returns>bool4x2 result of the componentwise equality.</returns>
  356. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  357. public static bool4x2 operator == (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
  358. /// <summary>Returns the result of a componentwise equality operation on a double4x2 matrix and a double value.</summary>
  359. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise equality.</param>
  360. /// <param name="rhs">Right hand side double to use to compute componentwise equality.</param>
  361. /// <returns>bool4x2 result of the componentwise equality.</returns>
  362. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  363. public static bool4x2 operator == (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
  364. /// <summary>Returns the result of a componentwise equality operation on a double value and a double4x2 matrix.</summary>
  365. /// <param name="lhs">Left hand side double to use to compute componentwise equality.</param>
  366. /// <param name="rhs">Right hand side double4x2 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 == (double lhs, double4x2 rhs) { return new bool4x2 (lhs == rhs.c0, lhs == rhs.c1); }
  370. /// <summary>Returns the result of a componentwise not equal operation on two double4x2 matrices.</summary>
  371. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise not equal.</param>
  372. /// <param name="rhs">Right hand side double4x2 to use to compute componentwise not equal.</param>
  373. /// <returns>bool4x2 result of the componentwise not equal.</returns>
  374. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  375. public static bool4x2 operator != (double4x2 lhs, double4x2 rhs) { return new bool4x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
  376. /// <summary>Returns the result of a componentwise not equal operation on a double4x2 matrix and a double value.</summary>
  377. /// <param name="lhs">Left hand side double4x2 to use to compute componentwise not equal.</param>
  378. /// <param name="rhs">Right hand side double to use to compute componentwise not equal.</param>
  379. /// <returns>bool4x2 result of the componentwise not equal.</returns>
  380. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  381. public static bool4x2 operator != (double4x2 lhs, double rhs) { return new bool4x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
  382. /// <summary>Returns the result of a componentwise not equal operation on a double value and a double4x2 matrix.</summary>
  383. /// <param name="lhs">Left hand side double to use to compute componentwise not equal.</param>
  384. /// <param name="rhs">Right hand side double4x2 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 != (double lhs, double4x2 rhs) { return new bool4x2 (lhs != rhs.c0, lhs != rhs.c1); }
  388. /// <summary>Returns the double4 element at a specified index.</summary>
  389. unsafe public ref double4 this[int index]
  390. {
  391. get
  392. {
  393. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  394. if ((uint)index >= 2)
  395. throw new System.ArgumentException("index must be between[0...1]");
  396. #endif
  397. fixed (double4x2* array = &this) { return ref ((double4*)array)[index]; }
  398. }
  399. }
  400. /// <summary>Returns true if the double4x2 is equal to a given double4x2, false otherwise.</summary>
  401. /// <param name="rhs">Right hand side argument to compare equality with.</param>
  402. /// <returns>The result of the equality comparison.</returns>
  403. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  404. public bool Equals(double4x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
  405. /// <summary>Returns true if the double4x2 is equal to a given double4x2, false otherwise.</summary>
  406. /// <param name="o">Right hand side argument to compare equality with.</param>
  407. /// <returns>The result of the equality comparison.</returns>
  408. public override bool Equals(object o) { return o is double4x2 converted && Equals(converted); }
  409. /// <summary>Returns a hash code for the double4x2.</summary>
  410. /// <returns>The computed hash code.</returns>
  411. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  412. public override int GetHashCode() { return (int)math.hash(this); }
  413. /// <summary>Returns a string representation of the double4x2.</summary>
  414. /// <returns>String representation of the value.</returns>
  415. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  416. public override string ToString()
  417. {
  418. return string.Format("double4x2({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z, c0.w, c1.w);
  419. }
  420. /// <summary>Returns a string representation of the double4x2 using a specified format and culture-specific format information.</summary>
  421. /// <param name="format">Format string to use during string formatting.</param>
  422. /// <param name="formatProvider">Format provider to use during string formatting.</param>
  423. /// <returns>String representation of the value.</returns>
  424. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  425. public string ToString(string format, IFormatProvider formatProvider)
  426. {
  427. return string.Format("double4x2({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));
  428. }
  429. }
  430. public static partial class math
  431. {
  432. /// <summary>Returns a double4x2 matrix constructed from two double4 vectors.</summary>
  433. /// <param name="c0">The matrix column c0 will be set to this value.</param>
  434. /// <param name="c1">The matrix column c1 will be set to this value.</param>
  435. /// <returns>double4x2 constructed from arguments.</returns>
  436. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  437. public static double4x2 double4x2(double4 c0, double4 c1) { return new double4x2(c0, c1); }
  438. /// <summary>Returns a double4x2 matrix constructed from from 8 double values given in row-major order.</summary>
  439. /// <param name="m00">The matrix at row 0, column 0 will be set to this value.</param>
  440. /// <param name="m01">The matrix at row 0, column 1 will be set to this value.</param>
  441. /// <param name="m10">The matrix at row 1, column 0 will be set to this value.</param>
  442. /// <param name="m11">The matrix at row 1, column 1 will be set to this value.</param>
  443. /// <param name="m20">The matrix at row 2, column 0 will be set to this value.</param>
  444. /// <param name="m21">The matrix at row 2, column 1 will be set to this value.</param>
  445. /// <param name="m30">The matrix at row 3, column 0 will be set to this value.</param>
  446. /// <param name="m31">The matrix at row 3, column 1 will be set to this value.</param>
  447. /// <returns>double4x2 constructed from arguments.</returns>
  448. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  449. public static double4x2 double4x2(double m00, double m01,
  450. double m10, double m11,
  451. double m20, double m21,
  452. double m30, double m31)
  453. {
  454. return new double4x2(m00, m01,
  455. m10, m11,
  456. m20, m21,
  457. m30, m31);
  458. }
  459. /// <summary>Returns a double4x2 matrix constructed from a single double value by assigning it to every component.</summary>
  460. /// <param name="v">double to convert to double4x2</param>
  461. /// <returns>Converted value.</returns>
  462. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  463. public static double4x2 double4x2(double v) { return new double4x2(v); }
  464. /// <summary>Returns a double4x2 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
  465. /// <param name="v">bool to convert to double4x2</param>
  466. /// <returns>Converted value.</returns>
  467. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  468. public static double4x2 double4x2(bool v) { return new double4x2(v); }
  469. /// <summary>Return a double4x2 matrix constructed from a bool4x2 matrix by componentwise conversion.</summary>
  470. /// <param name="v">bool4x2 to convert to double4x2</param>
  471. /// <returns>Converted value.</returns>
  472. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  473. public static double4x2 double4x2(bool4x2 v) { return new double4x2(v); }
  474. /// <summary>Returns a double4x2 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
  475. /// <param name="v">int to convert to double4x2</param>
  476. /// <returns>Converted value.</returns>
  477. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  478. public static double4x2 double4x2(int v) { return new double4x2(v); }
  479. /// <summary>Return a double4x2 matrix constructed from a int4x2 matrix by componentwise conversion.</summary>
  480. /// <param name="v">int4x2 to convert to double4x2</param>
  481. /// <returns>Converted value.</returns>
  482. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  483. public static double4x2 double4x2(int4x2 v) { return new double4x2(v); }
  484. /// <summary>Returns a double4x2 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
  485. /// <param name="v">uint to convert to double4x2</param>
  486. /// <returns>Converted value.</returns>
  487. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  488. public static double4x2 double4x2(uint v) { return new double4x2(v); }
  489. /// <summary>Return a double4x2 matrix constructed from a uint4x2 matrix by componentwise conversion.</summary>
  490. /// <param name="v">uint4x2 to convert to double4x2</param>
  491. /// <returns>Converted value.</returns>
  492. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  493. public static double4x2 double4x2(uint4x2 v) { return new double4x2(v); }
  494. /// <summary>Returns a double4x2 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
  495. /// <param name="v">float to convert to double4x2</param>
  496. /// <returns>Converted value.</returns>
  497. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  498. public static double4x2 double4x2(float v) { return new double4x2(v); }
  499. /// <summary>Return a double4x2 matrix constructed from a float4x2 matrix by componentwise conversion.</summary>
  500. /// <param name="v">float4x2 to convert to double4x2</param>
  501. /// <returns>Converted value.</returns>
  502. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  503. public static double4x2 double4x2(float4x2 v) { return new double4x2(v); }
  504. /// <summary>Return the double2x4 transpose of a double4x2 matrix.</summary>
  505. /// <param name="v">Value to transpose.</param>
  506. /// <returns>Transposed value.</returns>
  507. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  508. public static double2x4 transpose(double4x2 v)
  509. {
  510. return double2x4(
  511. v.c0.x, v.c0.y, v.c0.z, v.c0.w,
  512. v.c1.x, v.c1.y, v.c1.z, v.c1.w);
  513. }
  514. /// <summary>Returns a uint hash code of a double4x2 matrix.</summary>
  515. /// <param name="v">Matrix value to hash.</param>
  516. /// <returns>uint hash of the argument.</returns>
  517. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  518. public static uint hash(double4x2 v)
  519. {
  520. return csum(fold_to_uint(v.c0) * uint4(0x5AB3E8CDu, 0x676E8407u, 0xB36DE767u, 0x6FCA387Du) +
  521. fold_to_uint(v.c1) * uint4(0xAF0F3103u, 0xE4A056C7u, 0x841D8225u, 0xC9393C7Du)) + 0xD42EAFA3u;
  522. }
  523. /// <summary>
  524. /// Returns a uint4 vector hash code of a double4x2 matrix.
  525. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  526. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  527. /// </summary>
  528. /// <param name="v">Matrix value to hash.</param>
  529. /// <returns>uint4 hash of the argument.</returns>
  530. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  531. public static uint4 hashwide(double4x2 v)
  532. {
  533. return (fold_to_uint(v.c0) * uint4(0xD9AFD06Du, 0x97A65421u, 0x7809205Fu, 0x9C9F0823u) +
  534. fold_to_uint(v.c1) * uint4(0x5A9CA13Bu, 0xAFCDD5EFu, 0xA88D187Du, 0xCF6EBA1Du)) + 0x9D88E5A1u;
  535. }
  536. }
  537. }