Nav apraksta
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

double2x3.gen.cs 42KB

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