説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

double2x4.gen.cs 43KB

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