double3x2.gen.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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.
  7. // </auto-generated>
  8. //------------------------------------------------------------------------------
  9. using System;
  10. using System.Runtime.CompilerServices;
  11. #pragma warning disable 0660, 0661
  12. namespace Unity.Mathematics
  13. {
  14. [System.Serializable]
  15. public partial struct double3x2 : System.IEquatable<double3x2>, IFormattable
  16. {
  17. public double3 c0;
  18. public double3 c1;
  19. /// <summary>double3x2 zero value.</summary>
  20. public static readonly double3x2 zero;
  21. /// <summary>Constructs a double3x2 matrix from two double3 vectors.</summary>
  22. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  23. public double3x2(double3 c0, double3 c1)
  24. {
  25. this.c0 = c0;
  26. this.c1 = c1;
  27. }
  28. /// <summary>Constructs a double3x2 matrix from 6 double values given in row-major order.</summary>
  29. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  30. public double3x2(double m00, double m01,
  31. double m10, double m11,
  32. double m20, double m21)
  33. {
  34. this.c0 = new double3(m00, m10, m20);
  35. this.c1 = new double3(m01, m11, m21);
  36. }
  37. /// <summary>Constructs a double3x2 matrix from a single double value by assigning it to every component.</summary>
  38. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  39. public double3x2(double v)
  40. {
  41. this.c0 = v;
  42. this.c1 = v;
  43. }
  44. /// <summary>Constructs a double3x2 matrix from a single bool value by converting it to double and assigning it to every component.</summary>
  45. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  46. public double3x2(bool v)
  47. {
  48. this.c0 = math.select(new double3(0.0), new double3(1.0), v);
  49. this.c1 = math.select(new double3(0.0), new double3(1.0), v);
  50. }
  51. /// <summary>Constructs a double3x2 matrix from a bool3x2 matrix by componentwise conversion.</summary>
  52. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  53. public double3x2(bool3x2 v)
  54. {
  55. this.c0 = math.select(new double3(0.0), new double3(1.0), v.c0);
  56. this.c1 = math.select(new double3(0.0), new double3(1.0), v.c1);
  57. }
  58. /// <summary>Constructs a double3x2 matrix from a single int value by converting it to double and assigning it to every component.</summary>
  59. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  60. public double3x2(int v)
  61. {
  62. this.c0 = v;
  63. this.c1 = v;
  64. }
  65. /// <summary>Constructs a double3x2 matrix from a int3x2 matrix by componentwise conversion.</summary>
  66. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  67. public double3x2(int3x2 v)
  68. {
  69. this.c0 = v.c0;
  70. this.c1 = v.c1;
  71. }
  72. /// <summary>Constructs a double3x2 matrix from a single uint value by converting it to double and assigning it to every component.</summary>
  73. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  74. public double3x2(uint v)
  75. {
  76. this.c0 = v;
  77. this.c1 = v;
  78. }
  79. /// <summary>Constructs a double3x2 matrix from a uint3x2 matrix by componentwise conversion.</summary>
  80. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  81. public double3x2(uint3x2 v)
  82. {
  83. this.c0 = v.c0;
  84. this.c1 = v.c1;
  85. }
  86. /// <summary>Constructs a double3x2 matrix from a single float value by converting it to double and assigning it to every component.</summary>
  87. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  88. public double3x2(float v)
  89. {
  90. this.c0 = v;
  91. this.c1 = v;
  92. }
  93. /// <summary>Constructs a double3x2 matrix from a float3x2 matrix by componentwise conversion.</summary>
  94. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  95. public double3x2(float3x2 v)
  96. {
  97. this.c0 = v.c0;
  98. this.c1 = v.c1;
  99. }
  100. /// <summary>Implicitly converts a single double value to a double3x2 matrix by assigning it to every component.</summary>
  101. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  102. public static implicit operator double3x2(double v) { return new double3x2(v); }
  103. /// <summary>Explicitly converts a single bool value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  104. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  105. public static explicit operator double3x2(bool v) { return new double3x2(v); }
  106. /// <summary>Explicitly converts a bool3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  107. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  108. public static explicit operator double3x2(bool3x2 v) { return new double3x2(v); }
  109. /// <summary>Implicitly converts a single int value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  110. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  111. public static implicit operator double3x2(int v) { return new double3x2(v); }
  112. /// <summary>Implicitly converts a int3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  113. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  114. public static implicit operator double3x2(int3x2 v) { return new double3x2(v); }
  115. /// <summary>Implicitly converts a single uint value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  116. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  117. public static implicit operator double3x2(uint v) { return new double3x2(v); }
  118. /// <summary>Implicitly converts a uint3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  119. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  120. public static implicit operator double3x2(uint3x2 v) { return new double3x2(v); }
  121. /// <summary>Implicitly converts a single float value to a double3x2 matrix by converting it to double and assigning it to every component.</summary>
  122. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  123. public static implicit operator double3x2(float v) { return new double3x2(v); }
  124. /// <summary>Implicitly converts a float3x2 matrix to a double3x2 matrix by componentwise conversion.</summary>
  125. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  126. public static implicit operator double3x2(float3x2 v) { return new double3x2(v); }
  127. /// <summary>Returns the result of a componentwise multiplication operation on two double3x2 matrices.</summary>
  128. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  129. public static double3x2 operator * (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 * rhs.c0, lhs.c1 * rhs.c1); }
  130. /// <summary>Returns the result of a componentwise multiplication operation on a double3x2 matrix and a double value.</summary>
  131. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  132. public static double3x2 operator * (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 * rhs, lhs.c1 * rhs); }
  133. /// <summary>Returns the result of a componentwise multiplication operation on a double value and a double3x2 matrix.</summary>
  134. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  135. public static double3x2 operator * (double lhs, double3x2 rhs) { return new double3x2 (lhs * rhs.c0, lhs * rhs.c1); }
  136. /// <summary>Returns the result of a componentwise addition operation on two double3x2 matrices.</summary>
  137. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  138. public static double3x2 operator + (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 + rhs.c0, lhs.c1 + rhs.c1); }
  139. /// <summary>Returns the result of a componentwise addition operation on a double3x2 matrix and a double value.</summary>
  140. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  141. public static double3x2 operator + (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 + rhs, lhs.c1 + rhs); }
  142. /// <summary>Returns the result of a componentwise addition operation on a double value and a double3x2 matrix.</summary>
  143. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  144. public static double3x2 operator + (double lhs, double3x2 rhs) { return new double3x2 (lhs + rhs.c0, lhs + rhs.c1); }
  145. /// <summary>Returns the result of a componentwise subtraction operation on two double3x2 matrices.</summary>
  146. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  147. public static double3x2 operator - (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 - rhs.c0, lhs.c1 - rhs.c1); }
  148. /// <summary>Returns the result of a componentwise subtraction operation on a double3x2 matrix and a double value.</summary>
  149. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  150. public static double3x2 operator - (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 - rhs, lhs.c1 - rhs); }
  151. /// <summary>Returns the result of a componentwise subtraction operation on a double value and a double3x2 matrix.</summary>
  152. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  153. public static double3x2 operator - (double lhs, double3x2 rhs) { return new double3x2 (lhs - rhs.c0, lhs - rhs.c1); }
  154. /// <summary>Returns the result of a componentwise division operation on two double3x2 matrices.</summary>
  155. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  156. public static double3x2 operator / (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 / rhs.c0, lhs.c1 / rhs.c1); }
  157. /// <summary>Returns the result of a componentwise division operation on a double3x2 matrix and a double value.</summary>
  158. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  159. public static double3x2 operator / (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 / rhs, lhs.c1 / rhs); }
  160. /// <summary>Returns the result of a componentwise division operation on a double value and a double3x2 matrix.</summary>
  161. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  162. public static double3x2 operator / (double lhs, double3x2 rhs) { return new double3x2 (lhs / rhs.c0, lhs / rhs.c1); }
  163. /// <summary>Returns the result of a componentwise modulus operation on two double3x2 matrices.</summary>
  164. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  165. public static double3x2 operator % (double3x2 lhs, double3x2 rhs) { return new double3x2 (lhs.c0 % rhs.c0, lhs.c1 % rhs.c1); }
  166. /// <summary>Returns the result of a componentwise modulus operation on a double3x2 matrix and a double value.</summary>
  167. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  168. public static double3x2 operator % (double3x2 lhs, double rhs) { return new double3x2 (lhs.c0 % rhs, lhs.c1 % rhs); }
  169. /// <summary>Returns the result of a componentwise modulus operation on a double value and a double3x2 matrix.</summary>
  170. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  171. public static double3x2 operator % (double lhs, double3x2 rhs) { return new double3x2 (lhs % rhs.c0, lhs % rhs.c1); }
  172. /// <summary>Returns the result of a componentwise increment operation on a double3x2 matrix.</summary>
  173. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  174. public static double3x2 operator ++ (double3x2 val) { return new double3x2 (++val.c0, ++val.c1); }
  175. /// <summary>Returns the result of a componentwise decrement operation on a double3x2 matrix.</summary>
  176. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  177. public static double3x2 operator -- (double3x2 val) { return new double3x2 (--val.c0, --val.c1); }
  178. /// <summary>Returns the result of a componentwise less than operation on two double3x2 matrices.</summary>
  179. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  180. public static bool3x2 operator < (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 < rhs.c0, lhs.c1 < rhs.c1); }
  181. /// <summary>Returns the result of a componentwise less than operation on a double3x2 matrix and a double value.</summary>
  182. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  183. public static bool3x2 operator < (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 < rhs, lhs.c1 < rhs); }
  184. /// <summary>Returns the result of a componentwise less than operation on a double value and a double3x2 matrix.</summary>
  185. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  186. public static bool3x2 operator < (double lhs, double3x2 rhs) { return new bool3x2 (lhs < rhs.c0, lhs < rhs.c1); }
  187. /// <summary>Returns the result of a componentwise less or equal operation on two double3x2 matrices.</summary>
  188. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  189. public static bool3x2 operator <= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 <= rhs.c0, lhs.c1 <= rhs.c1); }
  190. /// <summary>Returns the result of a componentwise less or equal operation on a double3x2 matrix and a double value.</summary>
  191. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  192. public static bool3x2 operator <= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 <= rhs, lhs.c1 <= rhs); }
  193. /// <summary>Returns the result of a componentwise less or equal operation on a double value and a double3x2 matrix.</summary>
  194. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  195. public static bool3x2 operator <= (double lhs, double3x2 rhs) { return new bool3x2 (lhs <= rhs.c0, lhs <= rhs.c1); }
  196. /// <summary>Returns the result of a componentwise greater than operation on two double3x2 matrices.</summary>
  197. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  198. public static bool3x2 operator > (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 > rhs.c0, lhs.c1 > rhs.c1); }
  199. /// <summary>Returns the result of a componentwise greater than operation on a double3x2 matrix and a double value.</summary>
  200. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  201. public static bool3x2 operator > (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 > rhs, lhs.c1 > rhs); }
  202. /// <summary>Returns the result of a componentwise greater than operation on a double value and a double3x2 matrix.</summary>
  203. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  204. public static bool3x2 operator > (double lhs, double3x2 rhs) { return new bool3x2 (lhs > rhs.c0, lhs > rhs.c1); }
  205. /// <summary>Returns the result of a componentwise greater or equal operation on two double3x2 matrices.</summary>
  206. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  207. public static bool3x2 operator >= (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 >= rhs.c0, lhs.c1 >= rhs.c1); }
  208. /// <summary>Returns the result of a componentwise greater or equal operation on a double3x2 matrix and a double value.</summary>
  209. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  210. public static bool3x2 operator >= (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 >= rhs, lhs.c1 >= rhs); }
  211. /// <summary>Returns the result of a componentwise greater or equal operation on a double value and a double3x2 matrix.</summary>
  212. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  213. public static bool3x2 operator >= (double lhs, double3x2 rhs) { return new bool3x2 (lhs >= rhs.c0, lhs >= rhs.c1); }
  214. /// <summary>Returns the result of a componentwise unary minus operation on a double3x2 matrix.</summary>
  215. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  216. public static double3x2 operator - (double3x2 val) { return new double3x2 (-val.c0, -val.c1); }
  217. /// <summary>Returns the result of a componentwise unary plus operation on a double3x2 matrix.</summary>
  218. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  219. public static double3x2 operator + (double3x2 val) { return new double3x2 (+val.c0, +val.c1); }
  220. /// <summary>Returns the result of a componentwise equality operation on two double3x2 matrices.</summary>
  221. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  222. public static bool3x2 operator == (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 == rhs.c0, lhs.c1 == rhs.c1); }
  223. /// <summary>Returns the result of a componentwise equality operation on a double3x2 matrix and a double value.</summary>
  224. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  225. public static bool3x2 operator == (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 == rhs, lhs.c1 == rhs); }
  226. /// <summary>Returns the result of a componentwise equality operation on a double value and a double3x2 matrix.</summary>
  227. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  228. public static bool3x2 operator == (double lhs, double3x2 rhs) { return new bool3x2 (lhs == rhs.c0, lhs == rhs.c1); }
  229. /// <summary>Returns the result of a componentwise not equal operation on two double3x2 matrices.</summary>
  230. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  231. public static bool3x2 operator != (double3x2 lhs, double3x2 rhs) { return new bool3x2 (lhs.c0 != rhs.c0, lhs.c1 != rhs.c1); }
  232. /// <summary>Returns the result of a componentwise not equal operation on a double3x2 matrix and a double value.</summary>
  233. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  234. public static bool3x2 operator != (double3x2 lhs, double rhs) { return new bool3x2 (lhs.c0 != rhs, lhs.c1 != rhs); }
  235. /// <summary>Returns the result of a componentwise not equal operation on a double value and a double3x2 matrix.</summary>
  236. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  237. public static bool3x2 operator != (double lhs, double3x2 rhs) { return new bool3x2 (lhs != rhs.c0, lhs != rhs.c1); }
  238. /// <summary>Returns the double3 element at a specified index.</summary>
  239. unsafe public ref double3 this[int index]
  240. {
  241. get
  242. {
  243. #if ENABLE_UNITY_COLLECTIONS_CHECKS
  244. if ((uint)index >= 2)
  245. throw new System.ArgumentException("index must be between[0...1]");
  246. #endif
  247. fixed (double3x2* array = &this) { return ref ((double3*)array)[index]; }
  248. }
  249. }
  250. /// <summary>Returns true if the double3x2 is equal to a given double3x2, false otherwise.</summary>
  251. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  252. public bool Equals(double3x2 rhs) { return c0.Equals(rhs.c0) && c1.Equals(rhs.c1); }
  253. /// <summary>Returns true if the double3x2 is equal to a given double3x2, false otherwise.</summary>
  254. public override bool Equals(object o) { return Equals((double3x2)o); }
  255. /// <summary>Returns a hash code for the double3x2.</summary>
  256. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  257. public override int GetHashCode() { return (int)math.hash(this); }
  258. /// <summary>Returns a string representation of the double3x2.</summary>
  259. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  260. public override string ToString()
  261. {
  262. return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", c0.x, c1.x, c0.y, c1.y, c0.z, c1.z);
  263. }
  264. /// <summary>Returns a string representation of the double3x2 using a specified format and culture-specific format information.</summary>
  265. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  266. public string ToString(string format, IFormatProvider formatProvider)
  267. {
  268. return string.Format("double3x2({0}, {1}, {2}, {3}, {4}, {5})", 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));
  269. }
  270. }
  271. public static partial class math
  272. {
  273. /// <summary>Returns a double3x2 matrix constructed from two double3 vectors.</summary>
  274. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  275. public static double3x2 double3x2(double3 c0, double3 c1) { return new double3x2(c0, c1); }
  276. /// <summary>Returns a double3x2 matrix constructed from from 6 double values given in row-major order.</summary>
  277. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  278. public static double3x2 double3x2(double m00, double m01,
  279. double m10, double m11,
  280. double m20, double m21)
  281. {
  282. return new double3x2(m00, m01,
  283. m10, m11,
  284. m20, m21);
  285. }
  286. /// <summary>Returns a double3x2 matrix constructed from a single double value by assigning it to every component.</summary>
  287. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  288. public static double3x2 double3x2(double v) { return new double3x2(v); }
  289. /// <summary>Returns a double3x2 matrix constructed from a single bool value by converting it to double and assigning it to every component.</summary>
  290. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  291. public static double3x2 double3x2(bool v) { return new double3x2(v); }
  292. /// <summary>Return a double3x2 matrix constructed from a bool3x2 matrix by componentwise conversion.</summary>
  293. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  294. public static double3x2 double3x2(bool3x2 v) { return new double3x2(v); }
  295. /// <summary>Returns a double3x2 matrix constructed from a single int value by converting it to double and assigning it to every component.</summary>
  296. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  297. public static double3x2 double3x2(int v) { return new double3x2(v); }
  298. /// <summary>Return a double3x2 matrix constructed from a int3x2 matrix by componentwise conversion.</summary>
  299. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  300. public static double3x2 double3x2(int3x2 v) { return new double3x2(v); }
  301. /// <summary>Returns a double3x2 matrix constructed from a single uint value by converting it to double and assigning it to every component.</summary>
  302. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  303. public static double3x2 double3x2(uint v) { return new double3x2(v); }
  304. /// <summary>Return a double3x2 matrix constructed from a uint3x2 matrix by componentwise conversion.</summary>
  305. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  306. public static double3x2 double3x2(uint3x2 v) { return new double3x2(v); }
  307. /// <summary>Returns a double3x2 matrix constructed from a single float value by converting it to double and assigning it to every component.</summary>
  308. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  309. public static double3x2 double3x2(float v) { return new double3x2(v); }
  310. /// <summary>Return a double3x2 matrix constructed from a float3x2 matrix by componentwise conversion.</summary>
  311. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  312. public static double3x2 double3x2(float3x2 v) { return new double3x2(v); }
  313. /// <summary>Return the double2x3 transpose of a double3x2 matrix.</summary>
  314. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  315. public static double2x3 transpose(double3x2 v)
  316. {
  317. return double2x3(
  318. v.c0.x, v.c0.y, v.c0.z,
  319. v.c1.x, v.c1.y, v.c1.z);
  320. }
  321. /// <summary>Returns a uint hash code of a double3x2 vector.</summary>
  322. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  323. public static uint hash(double3x2 v)
  324. {
  325. return csum(fold_to_uint(v.c0) * uint3(0xEE390C97u, 0x9C8A2F05u, 0x4DDC6509u) +
  326. fold_to_uint(v.c1) * uint3(0x7CF083CBu, 0x5C4D6CEDu, 0xF9137117u)) + 0xE857DCE1u;
  327. }
  328. /// <summary>
  329. /// Returns a uint3 vector hash code of a double3x2 vector.
  330. /// When multiple elements are to be hashes together, it can more efficient to calculate and combine wide hash
  331. /// that are only reduced to a narrow uint hash at the very end instead of at every step.
  332. /// </summary>
  333. [MethodImpl(MethodImplOptions.AggressiveInlining)]
  334. public static uint3 hashwide(double3x2 v)
  335. {
  336. return (fold_to_uint(v.c0) * uint3(0xF62213C5u, 0x9CDAA959u, 0xAA269ABFu) +
  337. fold_to_uint(v.c1) * uint3(0xD54BA36Fu, 0xFD0847B9u, 0x8189A683u)) + 0xB139D651u;
  338. }
  339. }
  340. }