@lakutata/math 0.0.0-stage → 3.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1728) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +954 -2
  3. package/README.zh-CN.md +578 -0
  4. package/THIRD_PARTY_NOTICES.md +553 -0
  5. package/binding.gyp +89 -0
  6. package/dist/cjs/exceptions/MathArgumentException.d.ts +11 -0
  7. package/dist/cjs/exceptions/MathArgumentException.js +18 -0
  8. package/dist/cjs/exceptions/MathCancelledException.d.ts +10 -0
  9. package/dist/cjs/exceptions/MathCancelledException.js +17 -0
  10. package/dist/cjs/exceptions/MathDefinitionException.d.ts +11 -0
  11. package/dist/cjs/exceptions/MathDefinitionException.js +18 -0
  12. package/dist/cjs/exceptions/MathDivisionByZeroException.d.ts +10 -0
  13. package/dist/cjs/exceptions/MathDivisionByZeroException.js +17 -0
  14. package/dist/cjs/exceptions/MathDomainException.d.ts +11 -0
  15. package/dist/cjs/exceptions/MathDomainException.js +18 -0
  16. package/dist/cjs/exceptions/MathException.d.ts +19 -0
  17. package/dist/cjs/exceptions/MathException.js +22 -0
  18. package/dist/cjs/exceptions/MathNotSupportedException.d.ts +11 -0
  19. package/dist/cjs/exceptions/MathNotSupportedException.js +18 -0
  20. package/dist/cjs/exceptions/MathSyntaxException.d.ts +11 -0
  21. package/dist/cjs/exceptions/MathSyntaxException.js +18 -0
  22. package/dist/cjs/exceptions/MathTimeoutException.d.ts +10 -0
  23. package/dist/cjs/exceptions/MathTimeoutException.js +17 -0
  24. package/dist/cjs/exceptions/MathUnitException.d.ts +11 -0
  25. package/dist/cjs/exceptions/MathUnitException.js +18 -0
  26. package/dist/cjs/exceptions/MathUnknownFunctionException.d.ts +12 -0
  27. package/dist/cjs/exceptions/MathUnknownFunctionException.js +19 -0
  28. package/dist/cjs/exports/Math.d.ts +28 -0
  29. package/dist/cjs/exports/Math.js +84 -0
  30. package/dist/cjs/lib/Addon.d.ts +5 -0
  31. package/dist/cjs/lib/Addon.js +9 -0
  32. package/dist/cjs/lib/Context.d.ts +90 -0
  33. package/dist/cjs/lib/Context.js +134 -0
  34. package/dist/cjs/lib/Decimal.d.ts +276 -0
  35. package/dist/cjs/lib/Decimal.js +402 -0
  36. package/dist/cjs/lib/Defaults.d.ts +273 -0
  37. package/dist/cjs/lib/Defaults.js +308 -0
  38. package/dist/cjs/lib/Distribution.d.ts +177 -0
  39. package/dist/cjs/lib/Distribution.js +196 -0
  40. package/dist/cjs/lib/Expression.d.ts +791 -0
  41. package/dist/cjs/lib/Expression.js +991 -0
  42. package/dist/cjs/lib/ExpressionMatrix.d.ts +284 -0
  43. package/dist/cjs/lib/ExpressionMatrix.js +412 -0
  44. package/dist/cjs/lib/LinearAlgebra.d.ts +613 -0
  45. package/dist/cjs/lib/LinearAlgebra.js +712 -0
  46. package/dist/cjs/lib/MathScope.d.ts +268 -0
  47. package/dist/cjs/lib/MathScope.js +316 -0
  48. package/dist/cjs/lib/MathSet.d.ts +139 -0
  49. package/dist/cjs/lib/MathSet.js +376 -0
  50. package/dist/cjs/lib/Matrix.d.ts +212 -0
  51. package/dist/cjs/lib/Matrix.js +393 -0
  52. package/dist/cjs/lib/Native.d.ts +80 -0
  53. package/dist/cjs/lib/Native.js +61 -0
  54. package/dist/cjs/lib/NumberTheory.d.ts +356 -0
  55. package/dist/cjs/lib/NumberTheory.js +524 -0
  56. package/dist/cjs/lib/Numeric.d.ts +363 -0
  57. package/dist/cjs/lib/Numeric.js +243 -0
  58. package/dist/cjs/lib/Polynomials.d.ts +140 -0
  59. package/dist/cjs/lib/Polynomials.js +167 -0
  60. package/dist/cjs/lib/SparseMatrix.d.ts +125 -0
  61. package/dist/cjs/lib/SparseMatrix.js +341 -0
  62. package/dist/cjs/lib/Statistics.d.ts +366 -0
  63. package/dist/cjs/lib/Statistics.js +380 -0
  64. package/dist/cjs/lib/Unit.d.ts +342 -0
  65. package/dist/cjs/lib/Unit.js +1027 -0
  66. package/dist/cjs/lib/UnitTable.d.ts +39 -0
  67. package/dist/cjs/lib/UnitTable.js +634 -0
  68. package/dist/cjs/package.json +1 -0
  69. package/dist/esm/exceptions/MathArgumentException.js +14 -0
  70. package/dist/esm/exceptions/MathCancelledException.js +13 -0
  71. package/dist/esm/exceptions/MathDefinitionException.js +14 -0
  72. package/dist/esm/exceptions/MathDivisionByZeroException.js +13 -0
  73. package/dist/esm/exceptions/MathDomainException.js +14 -0
  74. package/dist/esm/exceptions/MathException.js +18 -0
  75. package/dist/esm/exceptions/MathNotSupportedException.js +14 -0
  76. package/dist/esm/exceptions/MathSyntaxException.js +14 -0
  77. package/dist/esm/exceptions/MathTimeoutException.js +13 -0
  78. package/dist/esm/exceptions/MathUnitException.js +14 -0
  79. package/dist/esm/exceptions/MathUnknownFunctionException.js +15 -0
  80. package/dist/esm/exports/Math.js +26 -0
  81. package/dist/esm/lib/Addon.js +10 -0
  82. package/dist/esm/lib/Context.js +128 -0
  83. package/dist/esm/lib/Decimal.js +397 -0
  84. package/dist/esm/lib/Defaults.js +290 -0
  85. package/dist/esm/lib/Distribution.js +191 -0
  86. package/dist/esm/lib/Expression.js +979 -0
  87. package/dist/esm/lib/ExpressionMatrix.js +407 -0
  88. package/dist/esm/lib/LinearAlgebra.js +708 -0
  89. package/dist/esm/lib/MathScope.js +311 -0
  90. package/dist/esm/lib/MathSet.js +370 -0
  91. package/dist/esm/lib/Matrix.js +382 -0
  92. package/dist/esm/lib/Native.js +56 -0
  93. package/dist/esm/lib/NumberTheory.js +520 -0
  94. package/dist/esm/lib/Numeric.js +239 -0
  95. package/dist/esm/lib/Polynomials.js +163 -0
  96. package/dist/esm/lib/SparseMatrix.js +332 -0
  97. package/dist/esm/lib/Statistics.js +376 -0
  98. package/dist/esm/lib/Unit.js +1018 -0
  99. package/dist/esm/lib/UnitTable.js +631 -0
  100. package/dist/types/exceptions/MathArgumentException.d.ts +11 -0
  101. package/dist/types/exceptions/MathCancelledException.d.ts +10 -0
  102. package/dist/types/exceptions/MathDefinitionException.d.ts +11 -0
  103. package/dist/types/exceptions/MathDivisionByZeroException.d.ts +10 -0
  104. package/dist/types/exceptions/MathDomainException.d.ts +11 -0
  105. package/dist/types/exceptions/MathException.d.ts +19 -0
  106. package/dist/types/exceptions/MathNotSupportedException.d.ts +11 -0
  107. package/dist/types/exceptions/MathSyntaxException.d.ts +11 -0
  108. package/dist/types/exceptions/MathTimeoutException.d.ts +10 -0
  109. package/dist/types/exceptions/MathUnitException.d.ts +11 -0
  110. package/dist/types/exceptions/MathUnknownFunctionException.d.ts +12 -0
  111. package/dist/types/exports/Math.d.ts +28 -0
  112. package/dist/types/lib/Addon.d.ts +5 -0
  113. package/dist/types/lib/Context.d.ts +90 -0
  114. package/dist/types/lib/Decimal.d.ts +276 -0
  115. package/dist/types/lib/Defaults.d.ts +273 -0
  116. package/dist/types/lib/Distribution.d.ts +177 -0
  117. package/dist/types/lib/Expression.d.ts +791 -0
  118. package/dist/types/lib/ExpressionMatrix.d.ts +284 -0
  119. package/dist/types/lib/LinearAlgebra.d.ts +613 -0
  120. package/dist/types/lib/MathScope.d.ts +268 -0
  121. package/dist/types/lib/MathSet.d.ts +139 -0
  122. package/dist/types/lib/Matrix.d.ts +212 -0
  123. package/dist/types/lib/Native.d.ts +80 -0
  124. package/dist/types/lib/NumberTheory.d.ts +356 -0
  125. package/dist/types/lib/Numeric.d.ts +363 -0
  126. package/dist/types/lib/Polynomials.d.ts +140 -0
  127. package/dist/types/lib/SparseMatrix.d.ts +125 -0
  128. package/dist/types/lib/Statistics.d.ts +366 -0
  129. package/dist/types/lib/Unit.d.ts +342 -0
  130. package/dist/types/lib/UnitTable.d.ts +39 -0
  131. package/native/addon.cpp +1374 -0
  132. package/native/async/Pool.cpp +133 -0
  133. package/native/async/Pool.h +59 -0
  134. package/native/config/boost_math_policy.h +26 -0
  135. package/native/config/mpdecimal/mpdecimal.h +809 -0
  136. package/native/config/symengine/symengine_config.h +44 -0
  137. package/native/config/symengine/symengine_export.h +19 -0
  138. package/native/core/Errors.cpp +77 -0
  139. package/native/core/Errors.h +72 -0
  140. package/native/core/Handle.cpp +109 -0
  141. package/native/core/Handle.h +72 -0
  142. package/native/core/Scope.cpp +122 -0
  143. package/native/core/Scope.h +36 -0
  144. package/native/functions/Functions.cpp +468 -0
  145. package/native/functions/Functions.h +115 -0
  146. package/native/functions/Gosper.cpp +429 -0
  147. package/native/functions/Gosper.h +20 -0
  148. package/native/functions/SpecialIntegrals.cpp +329 -0
  149. package/native/functions/SpecialIntegrals.h +53 -0
  150. package/native/functions/Summation.cpp +645 -0
  151. package/native/functions/Summation.h +42 -0
  152. package/native/integrals/Integrals.cpp +1428 -0
  153. package/native/integrals/Integrals.h +32 -0
  154. package/native/limits/Gruntz.cpp +1332 -0
  155. package/native/limits/Gruntz.h +24 -0
  156. package/native/linalg/Decompositions.cpp +159 -0
  157. package/native/linalg/Functions.cpp +199 -0
  158. package/native/linalg/Linalg.cpp +123 -0
  159. package/native/linalg/Linalg.h +67 -0
  160. package/native/linalg/LinalgSupport.h +69 -0
  161. package/native/linalg/Sparse.cpp +172 -0
  162. package/native/matrix/Matrices.cpp +766 -0
  163. package/native/matrix/Matrices.h +74 -0
  164. package/native/ntheory/NumberTheory.cpp +754 -0
  165. package/native/ntheory/NumberTheory.h +56 -0
  166. package/native/numeric/Compiled.cpp +93 -0
  167. package/native/numeric/Compiled.h +49 -0
  168. package/native/numeric/Integrate.cpp +718 -0
  169. package/native/numeric/Numeric.h +95 -0
  170. package/native/numeric/ODE.cpp +542 -0
  171. package/native/numeric/Roots.cpp +402 -0
  172. package/native/ops/Decimal.cpp +776 -0
  173. package/native/ops/Decimal.h +182 -0
  174. package/native/ops/DecimalComplex.cpp +738 -0
  175. package/native/ops/DecimalEvaluator.h +79 -0
  176. package/native/ops/DecimalFunctions.cpp +439 -0
  177. package/native/ops/DecimalOperations.cpp +236 -0
  178. package/native/ops/DecimalSpecial.cpp +1028 -0
  179. package/native/ops/DecimalSupport.h +109 -0
  180. package/native/ops/Operations.cpp +969 -0
  181. package/native/ops/Operations.h +120 -0
  182. package/native/ops/Piecewise.cpp +195 -0
  183. package/native/ops/Piecewise.h +40 -0
  184. package/native/parser/Parser.cpp +853 -0
  185. package/native/parser/Parser.h +56 -0
  186. package/native/poly/Convert.cpp +210 -0
  187. package/native/poly/Convert.h +40 -0
  188. package/native/poly/Dense.cpp +1008 -0
  189. package/native/poly/Dense.h +136 -0
  190. package/native/poly/Euclid.cpp +446 -0
  191. package/native/poly/Euclid.h +44 -0
  192. package/native/poly/Factor.cpp +919 -0
  193. package/native/poly/Factor.h +36 -0
  194. package/native/poly/Galois.cpp +439 -0
  195. package/native/poly/Galois.h +86 -0
  196. package/native/poly/Inequalities.cpp +227 -0
  197. package/native/poly/Inequalities.h +21 -0
  198. package/native/poly/Poly.cpp +338 -0
  199. package/native/poly/Poly.h +46 -0
  200. package/native/poly/Rational.cpp +403 -0
  201. package/native/poly/Rational.h +33 -0
  202. package/native/poly/RealRoots.cpp +136 -0
  203. package/native/poly/RealRoots.h +35 -0
  204. package/native/printer/Printer.cpp +973 -0
  205. package/native/printer/Printer.h +23 -0
  206. package/native/simplify/Simplify.cpp +921 -0
  207. package/native/simplify/Simplify.h +21 -0
  208. package/native/stats/Distributions.cpp +392 -0
  209. package/native/stats/Distributions.h +33 -0
  210. package/native/stats/Statistics.cpp +255 -0
  211. package/native/stats/Statistics.h +25 -0
  212. package/package.json +85 -4
  213. package/scripts/sources.mjs +35 -0
  214. package/vendor/PATCHES.md +169 -0
  215. package/vendor/boost/config/README.md +43 -0
  216. package/vendor/boost/config/include/boost/config/abi/borland_prefix.hpp +27 -0
  217. package/vendor/boost/config/include/boost/config/abi/borland_suffix.hpp +12 -0
  218. package/vendor/boost/config/include/boost/config/abi/msvc_prefix.hpp +22 -0
  219. package/vendor/boost/config/include/boost/config/abi/msvc_suffix.hpp +8 -0
  220. package/vendor/boost/config/include/boost/config/abi_prefix.hpp +25 -0
  221. package/vendor/boost/config/include/boost/config/abi_suffix.hpp +25 -0
  222. package/vendor/boost/config/include/boost/config/assert_cxx03.hpp +211 -0
  223. package/vendor/boost/config/include/boost/config/assert_cxx11.hpp +212 -0
  224. package/vendor/boost/config/include/boost/config/assert_cxx14.hpp +47 -0
  225. package/vendor/boost/config/include/boost/config/assert_cxx17.hpp +65 -0
  226. package/vendor/boost/config/include/boost/config/assert_cxx20.hpp +59 -0
  227. package/vendor/boost/config/include/boost/config/assert_cxx23.hpp +41 -0
  228. package/vendor/boost/config/include/boost/config/assert_cxx98.hpp +23 -0
  229. package/vendor/boost/config/include/boost/config/auto_link.hpp +530 -0
  230. package/vendor/boost/config/include/boost/config/compiler/borland.hpp +342 -0
  231. package/vendor/boost/config/include/boost/config/compiler/clang.hpp +370 -0
  232. package/vendor/boost/config/include/boost/config/compiler/clang_version.hpp +98 -0
  233. package/vendor/boost/config/include/boost/config/compiler/codegear.hpp +389 -0
  234. package/vendor/boost/config/include/boost/config/compiler/comeau.hpp +59 -0
  235. package/vendor/boost/config/include/boost/config/compiler/common_edg.hpp +185 -0
  236. package/vendor/boost/config/include/boost/config/compiler/compaq_cxx.hpp +19 -0
  237. package/vendor/boost/config/include/boost/config/compiler/cray.hpp +446 -0
  238. package/vendor/boost/config/include/boost/config/compiler/diab.hpp +26 -0
  239. package/vendor/boost/config/include/boost/config/compiler/digitalmars.hpp +146 -0
  240. package/vendor/boost/config/include/boost/config/compiler/gcc.hpp +386 -0
  241. package/vendor/boost/config/include/boost/config/compiler/gcc_xml.hpp +115 -0
  242. package/vendor/boost/config/include/boost/config/compiler/greenhills.hpp +28 -0
  243. package/vendor/boost/config/include/boost/config/compiler/hp_acc.hpp +153 -0
  244. package/vendor/boost/config/include/boost/config/compiler/intel.hpp +577 -0
  245. package/vendor/boost/config/include/boost/config/compiler/kai.hpp +33 -0
  246. package/vendor/boost/config/include/boost/config/compiler/metrowerks.hpp +201 -0
  247. package/vendor/boost/config/include/boost/config/compiler/mpw.hpp +143 -0
  248. package/vendor/boost/config/include/boost/config/compiler/nvcc.hpp +64 -0
  249. package/vendor/boost/config/include/boost/config/compiler/pathscale.hpp +141 -0
  250. package/vendor/boost/config/include/boost/config/compiler/pgi.hpp +23 -0
  251. package/vendor/boost/config/include/boost/config/compiler/sgi_mipspro.hpp +29 -0
  252. package/vendor/boost/config/include/boost/config/compiler/sunpro_cc.hpp +225 -0
  253. package/vendor/boost/config/include/boost/config/compiler/vacpp.hpp +189 -0
  254. package/vendor/boost/config/include/boost/config/compiler/visualc.hpp +400 -0
  255. package/vendor/boost/config/include/boost/config/compiler/xlcpp.hpp +303 -0
  256. package/vendor/boost/config/include/boost/config/compiler/xlcpp_zos.hpp +174 -0
  257. package/vendor/boost/config/include/boost/config/detail/cxx_composite.hpp +218 -0
  258. package/vendor/boost/config/include/boost/config/detail/posix_features.hpp +95 -0
  259. package/vendor/boost/config/include/boost/config/detail/select_compiler_config.hpp +157 -0
  260. package/vendor/boost/config/include/boost/config/detail/select_platform_config.hpp +147 -0
  261. package/vendor/boost/config/include/boost/config/detail/select_stdlib_config.hpp +121 -0
  262. package/vendor/boost/config/include/boost/config/detail/suffix.hpp +1334 -0
  263. package/vendor/boost/config/include/boost/config/header_deprecated.hpp +26 -0
  264. package/vendor/boost/config/include/boost/config/helper_macros.hpp +37 -0
  265. package/vendor/boost/config/include/boost/config/no_tr1/cmath.hpp +28 -0
  266. package/vendor/boost/config/include/boost/config/no_tr1/complex.hpp +28 -0
  267. package/vendor/boost/config/include/boost/config/no_tr1/functional.hpp +28 -0
  268. package/vendor/boost/config/include/boost/config/no_tr1/memory.hpp +28 -0
  269. package/vendor/boost/config/include/boost/config/no_tr1/utility.hpp +28 -0
  270. package/vendor/boost/config/include/boost/config/platform/aix.hpp +33 -0
  271. package/vendor/boost/config/include/boost/config/platform/amigaos.hpp +15 -0
  272. package/vendor/boost/config/include/boost/config/platform/beos.hpp +26 -0
  273. package/vendor/boost/config/include/boost/config/platform/bsd.hpp +83 -0
  274. package/vendor/boost/config/include/boost/config/platform/cloudabi.hpp +18 -0
  275. package/vendor/boost/config/include/boost/config/platform/cray.hpp +18 -0
  276. package/vendor/boost/config/include/boost/config/platform/cygwin.hpp +71 -0
  277. package/vendor/boost/config/include/boost/config/platform/haiku.hpp +31 -0
  278. package/vendor/boost/config/include/boost/config/platform/hpux.hpp +87 -0
  279. package/vendor/boost/config/include/boost/config/platform/irix.hpp +31 -0
  280. package/vendor/boost/config/include/boost/config/platform/linux.hpp +106 -0
  281. package/vendor/boost/config/include/boost/config/platform/macos.hpp +87 -0
  282. package/vendor/boost/config/include/boost/config/platform/qnxnto.hpp +31 -0
  283. package/vendor/boost/config/include/boost/config/platform/solaris.hpp +31 -0
  284. package/vendor/boost/config/include/boost/config/platform/symbian.hpp +97 -0
  285. package/vendor/boost/config/include/boost/config/platform/vms.hpp +25 -0
  286. package/vendor/boost/config/include/boost/config/platform/vxworks.hpp +422 -0
  287. package/vendor/boost/config/include/boost/config/platform/wasm.hpp +23 -0
  288. package/vendor/boost/config/include/boost/config/platform/win32.hpp +90 -0
  289. package/vendor/boost/config/include/boost/config/platform/zos.hpp +32 -0
  290. package/vendor/boost/config/include/boost/config/pragma_message.hpp +31 -0
  291. package/vendor/boost/config/include/boost/config/requires_threads.hpp +92 -0
  292. package/vendor/boost/config/include/boost/config/stdlib/dinkumware.hpp +324 -0
  293. package/vendor/boost/config/include/boost/config/stdlib/libcomo.hpp +93 -0
  294. package/vendor/boost/config/include/boost/config/stdlib/libcpp.hpp +185 -0
  295. package/vendor/boost/config/include/boost/config/stdlib/libstdcpp3.hpp +482 -0
  296. package/vendor/boost/config/include/boost/config/stdlib/modena.hpp +79 -0
  297. package/vendor/boost/config/include/boost/config/stdlib/msl.hpp +98 -0
  298. package/vendor/boost/config/include/boost/config/stdlib/roguewave.hpp +208 -0
  299. package/vendor/boost/config/include/boost/config/stdlib/sgi.hpp +168 -0
  300. package/vendor/boost/config/include/boost/config/stdlib/stlport.hpp +258 -0
  301. package/vendor/boost/config/include/boost/config/stdlib/vacpp.hpp +74 -0
  302. package/vendor/boost/config/include/boost/config/stdlib/xlcpp_zos.hpp +61 -0
  303. package/vendor/boost/config/include/boost/config/user.hpp +133 -0
  304. package/vendor/boost/config/include/boost/config/warning_disable.hpp +47 -0
  305. package/vendor/boost/config/include/boost/config/workaround.hpp +310 -0
  306. package/vendor/boost/config/include/boost/config.hpp +67 -0
  307. package/vendor/boost/config/include/boost/cstdint.hpp +556 -0
  308. package/vendor/boost/config/include/boost/cxx11_char_types.hpp +70 -0
  309. package/vendor/boost/config/include/boost/detail/workaround.hpp +10 -0
  310. package/vendor/boost/config/include/boost/limits.hpp +146 -0
  311. package/vendor/boost/config/include/boost/static_assert.hpp +179 -0
  312. package/vendor/boost/config/include/boost/version.hpp +32 -0
  313. package/vendor/boost/math/LICENSE +23 -0
  314. package/vendor/boost/math/README.md +184 -0
  315. package/vendor/boost/math/include/boost/cstdfloat.hpp +58 -0
  316. package/vendor/boost/math/include/boost/math/bindings/detail/big_digamma.hpp +297 -0
  317. package/vendor/boost/math/include/boost/math/bindings/detail/big_lanczos.hpp +777 -0
  318. package/vendor/boost/math/include/boost/math/bindings/mpfr.hpp +974 -0
  319. package/vendor/boost/math/include/boost/math/bindings/mpreal.hpp +921 -0
  320. package/vendor/boost/math/include/boost/math/bindings/rr.hpp +876 -0
  321. package/vendor/boost/math/include/boost/math/ccmath/abs.hpp +89 -0
  322. package/vendor/boost/math/include/boost/math/ccmath/ccmath.hpp +45 -0
  323. package/vendor/boost/math/include/boost/math/ccmath/ceil.hpp +78 -0
  324. package/vendor/boost/math/include/boost/math/ccmath/copysign.hpp +81 -0
  325. package/vendor/boost/math/include/boost/math/ccmath/detail/config.hpp +52 -0
  326. package/vendor/boost/math/include/boost/math/ccmath/detail/swap.hpp +21 -0
  327. package/vendor/boost/math/include/boost/math/ccmath/div.hpp +86 -0
  328. package/vendor/boost/math/include/boost/math/ccmath/fabs.hpp +41 -0
  329. package/vendor/boost/math/include/boost/math/ccmath/fdim.hpp +93 -0
  330. package/vendor/boost/math/include/boost/math/ccmath/floor.hpp +131 -0
  331. package/vendor/boost/math/include/boost/math/ccmath/fma.hpp +130 -0
  332. package/vendor/boost/math/include/boost/math/ccmath/fmax.hpp +89 -0
  333. package/vendor/boost/math/include/boost/math/ccmath/fmin.hpp +89 -0
  334. package/vendor/boost/math/include/boost/math/ccmath/fmod.hpp +114 -0
  335. package/vendor/boost/math/include/boost/math/ccmath/fpclassify.hpp +48 -0
  336. package/vendor/boost/math/include/boost/math/ccmath/frexp.hpp +101 -0
  337. package/vendor/boost/math/include/boost/math/ccmath/hypot.hpp +116 -0
  338. package/vendor/boost/math/include/boost/math/ccmath/ilogb.hpp +60 -0
  339. package/vendor/boost/math/include/boost/math/ccmath/isfinite.hpp +53 -0
  340. package/vendor/boost/math/include/boost/math/ccmath/isgreater.hpp +42 -0
  341. package/vendor/boost/math/include/boost/math/ccmath/isgreaterequal.hpp +42 -0
  342. package/vendor/boost/math/include/boost/math/ccmath/isinf.hpp +61 -0
  343. package/vendor/boost/math/include/boost/math/ccmath/isless.hpp +42 -0
  344. package/vendor/boost/math/include/boost/math/ccmath/islessequal.hpp +42 -0
  345. package/vendor/boost/math/include/boost/math/ccmath/isnan.hpp +42 -0
  346. package/vendor/boost/math/include/boost/math/ccmath/isnormal.hpp +47 -0
  347. package/vendor/boost/math/include/boost/math/ccmath/isunordered.hpp +35 -0
  348. package/vendor/boost/math/include/boost/math/ccmath/ldexp.hpp +81 -0
  349. package/vendor/boost/math/include/boost/math/ccmath/logb.hpp +86 -0
  350. package/vendor/boost/math/include/boost/math/ccmath/modf.hpp +79 -0
  351. package/vendor/boost/math/include/boost/math/ccmath/next.hpp +458 -0
  352. package/vendor/boost/math/include/boost/math/ccmath/remainder.hpp +106 -0
  353. package/vendor/boost/math/include/boost/math/ccmath/round.hpp +179 -0
  354. package/vendor/boost/math/include/boost/math/ccmath/scalbln.hpp +60 -0
  355. package/vendor/boost/math/include/boost/math/ccmath/scalbn.hpp +81 -0
  356. package/vendor/boost/math/include/boost/math/ccmath/signbit.hpp +218 -0
  357. package/vendor/boost/math/include/boost/math/ccmath/sqrt.hpp +80 -0
  358. package/vendor/boost/math/include/boost/math/ccmath/trunc.hpp +70 -0
  359. package/vendor/boost/math/include/boost/math/common_factor.hpp +23 -0
  360. package/vendor/boost/math/include/boost/math/common_factor_ct.hpp +34 -0
  361. package/vendor/boost/math/include/boost/math/common_factor_rt.hpp +30 -0
  362. package/vendor/boost/math/include/boost/math/complex/acos.hpp +245 -0
  363. package/vendor/boost/math/include/boost/math/complex/acosh.hpp +34 -0
  364. package/vendor/boost/math/include/boost/math/complex/asin.hpp +252 -0
  365. package/vendor/boost/math/include/boost/math/complex/asinh.hpp +32 -0
  366. package/vendor/boost/math/include/boost/math/complex/atan.hpp +36 -0
  367. package/vendor/boost/math/include/boost/math/complex/atanh.hpp +214 -0
  368. package/vendor/boost/math/include/boost/math/complex/details.hpp +68 -0
  369. package/vendor/boost/math/include/boost/math/complex/fabs.hpp +23 -0
  370. package/vendor/boost/math/include/boost/math/complex.hpp +32 -0
  371. package/vendor/boost/math/include/boost/math/concepts/distributions.hpp +497 -0
  372. package/vendor/boost/math/include/boost/math/concepts/real_concept.hpp +400 -0
  373. package/vendor/boost/math/include/boost/math/concepts/real_type_concept.hpp +119 -0
  374. package/vendor/boost/math/include/boost/math/concepts/std_real_concept.hpp +427 -0
  375. package/vendor/boost/math/include/boost/math/constants/calculate_constants.hpp +1117 -0
  376. package/vendor/boost/math/include/boost/math/constants/constants.hpp +360 -0
  377. package/vendor/boost/math/include/boost/math/constants/info.hpp +169 -0
  378. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_cmath.hpp +1012 -0
  379. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_complex.hpp +38 -0
  380. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp +813 -0
  381. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_iostream.hpp +822 -0
  382. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_limits.hpp +87 -0
  383. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_types.hpp +441 -0
  384. package/vendor/boost/math/include/boost/math/differentiation/autodiff.hpp +2061 -0
  385. package/vendor/boost/math/include/boost/math/differentiation/autodiff_cpp11.hpp +387 -0
  386. package/vendor/boost/math/include/boost/math/differentiation/autodiff_reverse.hpp +811 -0
  387. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_basic_operator_expressions.hpp +276 -0
  388. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_basic_ops_et.hpp +160 -0
  389. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_basic_ops_no_et.hpp +154 -0
  390. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_comparison_operator_overloads.hpp +167 -0
  391. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_erf_overloads.hpp +234 -0
  392. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_expression_template_base.hpp +258 -0
  393. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_helper_functions.hpp +18 -0
  394. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_memory_management.hpp +462 -0
  395. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_stl_et.hpp +275 -0
  396. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_stl_expressions.hpp +852 -0
  397. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_stl_no_et.hpp +266 -0
  398. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_utilities.hpp +51 -0
  399. package/vendor/boost/math/include/boost/math/differentiation/finite_difference.hpp +266 -0
  400. package/vendor/boost/math/include/boost/math/differentiation/lanczos_smoothing.hpp +591 -0
  401. package/vendor/boost/math/include/boost/math/distributions/arcsine.hpp +593 -0
  402. package/vendor/boost/math/include/boost/math/distributions/bernoulli.hpp +349 -0
  403. package/vendor/boost/math/include/boost/math/distributions/beta.hpp +584 -0
  404. package/vendor/boost/math/include/boost/math/distributions/binomial.hpp +729 -0
  405. package/vendor/boost/math/include/boost/math/distributions/cauchy.hpp +379 -0
  406. package/vendor/boost/math/include/boost/math/distributions/chi_squared.hpp +345 -0
  407. package/vendor/boost/math/include/boost/math/distributions/complement.hpp +198 -0
  408. package/vendor/boost/math/include/boost/math/distributions/detail/common_error_handling.hpp +228 -0
  409. package/vendor/boost/math/include/boost/math/distributions/detail/derived_accessors.hpp +190 -0
  410. package/vendor/boost/math/include/boost/math/distributions/detail/generic_mode.hpp +145 -0
  411. package/vendor/boost/math/include/boost/math/distributions/detail/generic_quantile.hpp +100 -0
  412. package/vendor/boost/math/include/boost/math/distributions/detail/hypergeometric_cdf.hpp +101 -0
  413. package/vendor/boost/math/include/boost/math/distributions/detail/hypergeometric_pdf.hpp +490 -0
  414. package/vendor/boost/math/include/boost/math/distributions/detail/hypergeometric_quantile.hpp +245 -0
  415. package/vendor/boost/math/include/boost/math/distributions/detail/inv_discrete_quantile.hpp +583 -0
  416. package/vendor/boost/math/include/boost/math/distributions/empirical_cumulative_distribution_function.hpp +73 -0
  417. package/vendor/boost/math/include/boost/math/distributions/exponential.hpp +352 -0
  418. package/vendor/boost/math/include/boost/math/distributions/extreme_value.hpp +388 -0
  419. package/vendor/boost/math/include/boost/math/distributions/find_location.hpp +141 -0
  420. package/vendor/boost/math/include/boost/math/distributions/find_scale.hpp +200 -0
  421. package/vendor/boost/math/include/boost/math/distributions/fisher_f.hpp +393 -0
  422. package/vendor/boost/math/include/boost/math/distributions/fwd.hpp +171 -0
  423. package/vendor/boost/math/include/boost/math/distributions/gamma.hpp +396 -0
  424. package/vendor/boost/math/include/boost/math/distributions/geometric.hpp +571 -0
  425. package/vendor/boost/math/include/boost/math/distributions/holtsmark.hpp +2518 -0
  426. package/vendor/boost/math/include/boost/math/distributions/hyperexponential.hpp +641 -0
  427. package/vendor/boost/math/include/boost/math/distributions/hypergeometric.hpp +313 -0
  428. package/vendor/boost/math/include/boost/math/distributions/inverse_chi_squared.hpp +398 -0
  429. package/vendor/boost/math/include/boost/math/distributions/inverse_gamma.hpp +504 -0
  430. package/vendor/boost/math/include/boost/math/distributions/inverse_gaussian.hpp +566 -0
  431. package/vendor/boost/math/include/boost/math/distributions/kolmogorov_smirnov.hpp +511 -0
  432. package/vendor/boost/math/include/boost/math/distributions/landau.hpp +4642 -0
  433. package/vendor/boost/math/include/boost/math/distributions/laplace.hpp +494 -0
  434. package/vendor/boost/math/include/boost/math/distributions/logistic.hpp +377 -0
  435. package/vendor/boost/math/include/boost/math/distributions/lognormal.hpp +361 -0
  436. package/vendor/boost/math/include/boost/math/distributions/mapairy.hpp +4220 -0
  437. package/vendor/boost/math/include/boost/math/distributions/negative_binomial.hpp +609 -0
  438. package/vendor/boost/math/include/boost/math/distributions/non_central_beta.hpp +981 -0
  439. package/vendor/boost/math/include/boost/math/distributions/non_central_chi_squared.hpp +998 -0
  440. package/vendor/boost/math/include/boost/math/distributions/non_central_f.hpp +712 -0
  441. package/vendor/boost/math/include/boost/math/distributions/non_central_t.hpp +1324 -0
  442. package/vendor/boost/math/include/boost/math/distributions/normal.hpp +368 -0
  443. package/vendor/boost/math/include/boost/math/distributions/pareto.hpp +508 -0
  444. package/vendor/boost/math/include/boost/math/distributions/poisson.hpp +563 -0
  445. package/vendor/boost/math/include/boost/math/distributions/rayleigh.hpp +381 -0
  446. package/vendor/boost/math/include/boost/math/distributions/saspoint5.hpp +2796 -0
  447. package/vendor/boost/math/include/boost/math/distributions/skew_normal.hpp +760 -0
  448. package/vendor/boost/math/include/boost/math/distributions/students_t.hpp +721 -0
  449. package/vendor/boost/math/include/boost/math/distributions/triangular.hpp +548 -0
  450. package/vendor/boost/math/include/boost/math/distributions/uniform.hpp +398 -0
  451. package/vendor/boost/math/include/boost/math/distributions/weibull.hpp +487 -0
  452. package/vendor/boost/math/include/boost/math/distributions.hpp +58 -0
  453. package/vendor/boost/math/include/boost/math/filters/daubechies.hpp +99 -0
  454. package/vendor/boost/math/include/boost/math/interpolators/barycentric_rational.hpp +99 -0
  455. package/vendor/boost/math/include/boost/math/interpolators/bezier_polynomial.hpp +60 -0
  456. package/vendor/boost/math/include/boost/math/interpolators/bilinear_uniform.hpp +54 -0
  457. package/vendor/boost/math/include/boost/math/interpolators/cardinal_cubic_b_spline.hpp +87 -0
  458. package/vendor/boost/math/include/boost/math/interpolators/cardinal_quadratic_b_spline.hpp +57 -0
  459. package/vendor/boost/math/include/boost/math/interpolators/cardinal_quintic_b_spline.hpp +62 -0
  460. package/vendor/boost/math/include/boost/math/interpolators/cardinal_trigonometric.hpp +58 -0
  461. package/vendor/boost/math/include/boost/math/interpolators/catmull_rom.hpp +310 -0
  462. package/vendor/boost/math/include/boost/math/interpolators/cubic_b_spline.hpp +90 -0
  463. package/vendor/boost/math/include/boost/math/interpolators/cubic_hermite.hpp +142 -0
  464. package/vendor/boost/math/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp +215 -0
  465. package/vendor/boost/math/include/boost/math/interpolators/detail/bezier_polynomial_detail.hpp +167 -0
  466. package/vendor/boost/math/include/boost/math/interpolators/detail/bilinear_uniform_detail.hpp +137 -0
  467. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_cubic_b_spline_detail.hpp +331 -0
  468. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_quadratic_b_spline_detail.hpp +208 -0
  469. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_quintic_b_spline_detail.hpp +241 -0
  470. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_trigonometric_detail.hpp +684 -0
  471. package/vendor/boost/math/include/boost/math/interpolators/detail/cubic_b_spline_detail.hpp +330 -0
  472. package/vendor/boost/math/include/boost/math/interpolators/detail/cubic_hermite_detail.hpp +439 -0
  473. package/vendor/boost/math/include/boost/math/interpolators/detail/quintic_hermite_detail.hpp +586 -0
  474. package/vendor/boost/math/include/boost/math/interpolators/detail/septic_hermite_detail.hpp +653 -0
  475. package/vendor/boost/math/include/boost/math/interpolators/detail/vector_barycentric_rational_detail.hpp +196 -0
  476. package/vendor/boost/math/include/boost/math/interpolators/detail/whittaker_shannon_detail.hpp +128 -0
  477. package/vendor/boost/math/include/boost/math/interpolators/makima.hpp +178 -0
  478. package/vendor/boost/math/include/boost/math/interpolators/pchip.hpp +136 -0
  479. package/vendor/boost/math/include/boost/math/interpolators/quintic_hermite.hpp +143 -0
  480. package/vendor/boost/math/include/boost/math/interpolators/septic_hermite.hpp +147 -0
  481. package/vendor/boost/math/include/boost/math/interpolators/vector_barycentric_rational.hpp +82 -0
  482. package/vendor/boost/math/include/boost/math/interpolators/whittaker_shannon.hpp +47 -0
  483. package/vendor/boost/math/include/boost/math/octonion.hpp +4254 -0
  484. package/vendor/boost/math/include/boost/math/optimization/cma_es.hpp +392 -0
  485. package/vendor/boost/math/include/boost/math/optimization/detail/common.hpp +200 -0
  486. package/vendor/boost/math/include/boost/math/optimization/detail/differentiable_opt_utilties.hpp +157 -0
  487. package/vendor/boost/math/include/boost/math/optimization/detail/gradient_opt_base.hpp +92 -0
  488. package/vendor/boost/math/include/boost/math/optimization/detail/line_search_policies.hpp +206 -0
  489. package/vendor/boost/math/include/boost/math/optimization/detail/rdiff_optimization_policies.hpp +134 -0
  490. package/vendor/boost/math/include/boost/math/optimization/differential_evolution.hpp +236 -0
  491. package/vendor/boost/math/include/boost/math/optimization/gradient_descent.hpp +202 -0
  492. package/vendor/boost/math/include/boost/math/optimization/gradient_optimizers.hpp +18 -0
  493. package/vendor/boost/math/include/boost/math/optimization/jso.hpp +465 -0
  494. package/vendor/boost/math/include/boost/math/optimization/lbfgs.hpp +382 -0
  495. package/vendor/boost/math/include/boost/math/optimization/minimizer.hpp +336 -0
  496. package/vendor/boost/math/include/boost/math/optimization/nesterov.hpp +208 -0
  497. package/vendor/boost/math/include/boost/math/optimization/random_search.hpp +145 -0
  498. package/vendor/boost/math/include/boost/math/policies/error_handling.hpp +1062 -0
  499. package/vendor/boost/math/include/boost/math/policies/policy.hpp +1034 -0
  500. package/vendor/boost/math/include/boost/math/quadrature/detail/exp_sinh_detail.hpp +2002 -0
  501. package/vendor/boost/math/include/boost/math/quadrature/detail/ooura_fourier_integrals_detail.hpp +692 -0
  502. package/vendor/boost/math/include/boost/math/quadrature/detail/sinh_sinh_detail.hpp +1353 -0
  503. package/vendor/boost/math/include/boost/math/quadrature/detail/tanh_sinh_detail.hpp +879 -0
  504. package/vendor/boost/math/include/boost/math/quadrature/exp_sinh.hpp +180 -0
  505. package/vendor/boost/math/include/boost/math/quadrature/gauss.hpp +904 -0
  506. package/vendor/boost/math/include/boost/math/quadrature/gauss_kronrod.hpp +1317 -0
  507. package/vendor/boost/math/include/boost/math/quadrature/naive_monte_carlo.hpp +469 -0
  508. package/vendor/boost/math/include/boost/math/quadrature/ooura_fourier_integrals.hpp +68 -0
  509. package/vendor/boost/math/include/boost/math/quadrature/sinh_sinh.hpp +72 -0
  510. package/vendor/boost/math/include/boost/math/quadrature/tanh_sinh.hpp +289 -0
  511. package/vendor/boost/math/include/boost/math/quadrature/trapezoidal.hpp +125 -0
  512. package/vendor/boost/math/include/boost/math/quadrature/wavelet_transforms.hpp +47 -0
  513. package/vendor/boost/math/include/boost/math/quaternion.hpp +1190 -0
  514. package/vendor/boost/math/include/boost/math/special_functions/acosh.hpp +102 -0
  515. package/vendor/boost/math/include/boost/math/special_functions/airy.hpp +475 -0
  516. package/vendor/boost/math/include/boost/math/special_functions/asinh.hpp +110 -0
  517. package/vendor/boost/math/include/boost/math/special_functions/atanh.hpp +116 -0
  518. package/vendor/boost/math/include/boost/math/special_functions/bernoulli.hpp +149 -0
  519. package/vendor/boost/math/include/boost/math/special_functions/bessel.hpp +795 -0
  520. package/vendor/boost/math/include/boost/math/special_functions/bessel_iterators.hpp +187 -0
  521. package/vendor/boost/math/include/boost/math/special_functions/bessel_prime.hpp +343 -0
  522. package/vendor/boost/math/include/boost/math/special_functions/beta.hpp +1870 -0
  523. package/vendor/boost/math/include/boost/math/special_functions/binomial.hpp +87 -0
  524. package/vendor/boost/math/include/boost/math/special_functions/cardinal_b_spline.hpp +218 -0
  525. package/vendor/boost/math/include/boost/math/special_functions/cbrt.hpp +215 -0
  526. package/vendor/boost/math/include/boost/math/special_functions/chebyshev.hpp +314 -0
  527. package/vendor/boost/math/include/boost/math/special_functions/chebyshev_transform.hpp +237 -0
  528. package/vendor/boost/math/include/boost/math/special_functions/cos_pi.hpp +128 -0
  529. package/vendor/boost/math/include/boost/math/special_functions/daubechies_scaling.hpp +491 -0
  530. package/vendor/boost/math/include/boost/math/special_functions/daubechies_wavelet.hpp +266 -0
  531. package/vendor/boost/math/include/boost/math/special_functions/detail/airy_ai_bi_zero.hpp +222 -0
  532. package/vendor/boost/math/include/boost/math/special_functions/detail/bernoulli_details.hpp +629 -0
  533. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp +107 -0
  534. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_i0.hpp +550 -0
  535. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_i1.hpp +556 -0
  536. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_ik.hpp +447 -0
  537. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_j0.hpp +192 -0
  538. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_j1.hpp +179 -0
  539. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jn.hpp +127 -0
  540. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy.hpp +603 -0
  541. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_asym.hpp +230 -0
  542. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_derivatives_asym.hpp +141 -0
  543. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_derivatives_series.hpp +219 -0
  544. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_series.hpp +267 -0
  545. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_zero.hpp +643 -0
  546. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_k0.hpp +485 -0
  547. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_k1.hpp +526 -0
  548. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_kn.hpp +91 -0
  549. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_y0.hpp +205 -0
  550. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_y1.hpp +183 -0
  551. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_yn.hpp +113 -0
  552. package/vendor/boost/math/include/boost/math/special_functions/detail/daubechies_scaling_integer_grid.hpp +244 -0
  553. package/vendor/boost/math/include/boost/math/special_functions/detail/erf_inv.hpp +559 -0
  554. package/vendor/boost/math/include/boost/math/special_functions/detail/fp_traits.hpp +562 -0
  555. package/vendor/boost/math/include/boost/math/special_functions/detail/gamma_inva.hpp +241 -0
  556. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_0F1_bessel.hpp +46 -0
  557. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_addition_theorems_on_z.hpp +293 -0
  558. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_bessel.hpp +768 -0
  559. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_by_ratios.hpp +678 -0
  560. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_cf.hpp +50 -0
  561. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_large_a.hpp +35 -0
  562. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp +492 -0
  563. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_negative_b_regions.hpp +521 -0
  564. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_recurrence.hpp +522 -0
  565. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_scaled_series.hpp +60 -0
  566. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_small_a_negative_b_by_ratio.hpp +70 -0
  567. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_asym.hpp +179 -0
  568. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_cf.hpp +228 -0
  569. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp +687 -0
  570. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_pade.hpp +131 -0
  571. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_rational.hpp +167 -0
  572. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_separated_series.hpp +50 -0
  573. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_series.hpp +434 -0
  574. package/vendor/boost/math/include/boost/math/special_functions/detail/ibeta_inv_ab.hpp +331 -0
  575. package/vendor/boost/math/include/boost/math/special_functions/detail/ibeta_inverse.hpp +1122 -0
  576. package/vendor/boost/math/include/boost/math/special_functions/detail/iconv.hpp +43 -0
  577. package/vendor/boost/math/include/boost/math/special_functions/detail/igamma_inverse.hpp +587 -0
  578. package/vendor/boost/math/include/boost/math/special_functions/detail/igamma_large.hpp +823 -0
  579. package/vendor/boost/math/include/boost/math/special_functions/detail/lambert_w_lookup_table.ipp +162 -0
  580. package/vendor/boost/math/include/boost/math/special_functions/detail/lanczos_sse2.hpp +238 -0
  581. package/vendor/boost/math/include/boost/math/special_functions/detail/lgamma_small.hpp +569 -0
  582. package/vendor/boost/math/include/boost/math/special_functions/detail/polygamma.hpp +538 -0
  583. package/vendor/boost/math/include/boost/math/special_functions/detail/round_fwd.hpp +87 -0
  584. package/vendor/boost/math/include/boost/math/special_functions/detail/t_distribution_inv.hpp +567 -0
  585. package/vendor/boost/math/include/boost/math/special_functions/detail/unchecked_bernoulli.hpp +1305 -0
  586. package/vendor/boost/math/include/boost/math/special_functions/detail/unchecked_factorial.hpp +1727 -0
  587. package/vendor/boost/math/include/boost/math/special_functions/digamma.hpp +631 -0
  588. package/vendor/boost/math/include/boost/math/special_functions/ellint_1.hpp +815 -0
  589. package/vendor/boost/math/include/boost/math/special_functions/ellint_2.hpp +756 -0
  590. package/vendor/boost/math/include/boost/math/special_functions/ellint_3.hpp +374 -0
  591. package/vendor/boost/math/include/boost/math/special_functions/ellint_d.hpp +183 -0
  592. package/vendor/boost/math/include/boost/math/special_functions/ellint_rc.hpp +112 -0
  593. package/vendor/boost/math/include/boost/math/special_functions/ellint_rd.hpp +207 -0
  594. package/vendor/boost/math/include/boost/math/special_functions/ellint_rf.hpp +169 -0
  595. package/vendor/boost/math/include/boost/math/special_functions/ellint_rg.hpp +130 -0
  596. package/vendor/boost/math/include/boost/math/special_functions/ellint_rj.hpp +299 -0
  597. package/vendor/boost/math/include/boost/math/special_functions/erf.hpp +1334 -0
  598. package/vendor/boost/math/include/boost/math/special_functions/expint.hpp +1614 -0
  599. package/vendor/boost/math/include/boost/math/special_functions/expm1.hpp +416 -0
  600. package/vendor/boost/math/include/boost/math/special_functions/factorials.hpp +276 -0
  601. package/vendor/boost/math/include/boost/math/special_functions/fibonacci.hpp +92 -0
  602. package/vendor/boost/math/include/boost/math/special_functions/fourier_transform_daubechies.hpp +248 -0
  603. package/vendor/boost/math/include/boost/math/special_functions/fpclassify.hpp +797 -0
  604. package/vendor/boost/math/include/boost/math/special_functions/gamma.hpp +2628 -0
  605. package/vendor/boost/math/include/boost/math/special_functions/gegenbauer.hpp +84 -0
  606. package/vendor/boost/math/include/boost/math/special_functions/hankel.hpp +186 -0
  607. package/vendor/boost/math/include/boost/math/special_functions/hermite.hpp +79 -0
  608. package/vendor/boost/math/include/boost/math/special_functions/heuman_lambda.hpp +97 -0
  609. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_0F1.hpp +116 -0
  610. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_1F0.hpp +69 -0
  611. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_1F1.hpp +822 -0
  612. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_2F0.hpp +163 -0
  613. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_pFq.hpp +205 -0
  614. package/vendor/boost/math/include/boost/math/special_functions/hypot.hpp +148 -0
  615. package/vendor/boost/math/include/boost/math/special_functions/jacobi.hpp +69 -0
  616. package/vendor/boost/math/include/boost/math/special_functions/jacobi_elliptic.hpp +319 -0
  617. package/vendor/boost/math/include/boost/math/special_functions/jacobi_theta.hpp +802 -0
  618. package/vendor/boost/math/include/boost/math/special_functions/jacobi_zeta.hpp +83 -0
  619. package/vendor/boost/math/include/boost/math/special_functions/laguerre.hpp +139 -0
  620. package/vendor/boost/math/include/boost/math/special_functions/lambert_w.hpp +2171 -0
  621. package/vendor/boost/math/include/boost/math/special_functions/lanczos.hpp +2760 -0
  622. package/vendor/boost/math/include/boost/math/special_functions/legendre.hpp +380 -0
  623. package/vendor/boost/math/include/boost/math/special_functions/legendre_stieltjes.hpp +234 -0
  624. package/vendor/boost/math/include/boost/math/special_functions/log1p.hpp +417 -0
  625. package/vendor/boost/math/include/boost/math/special_functions/logaddexp.hpp +41 -0
  626. package/vendor/boost/math/include/boost/math/special_functions/logistic_sigmoid.hpp +46 -0
  627. package/vendor/boost/math/include/boost/math/special_functions/logit.hpp +56 -0
  628. package/vendor/boost/math/include/boost/math/special_functions/logsumexp.hpp +60 -0
  629. package/vendor/boost/math/include/boost/math/special_functions/math_fwd.hpp +1927 -0
  630. package/vendor/boost/math/include/boost/math/special_functions/modf.hpp +74 -0
  631. package/vendor/boost/math/include/boost/math/special_functions/next.hpp +886 -0
  632. package/vendor/boost/math/include/boost/math/special_functions/nonfinite_num_facets.hpp +588 -0
  633. package/vendor/boost/math/include/boost/math/special_functions/owens_t.hpp +1067 -0
  634. package/vendor/boost/math/include/boost/math/special_functions/polygamma.hpp +83 -0
  635. package/vendor/boost/math/include/boost/math/special_functions/pow.hpp +144 -0
  636. package/vendor/boost/math/include/boost/math/special_functions/powm1.hpp +101 -0
  637. package/vendor/boost/math/include/boost/math/special_functions/prime.hpp +2433 -0
  638. package/vendor/boost/math/include/boost/math/special_functions/relative_difference.hpp +134 -0
  639. package/vendor/boost/math/include/boost/math/special_functions/round.hpp +353 -0
  640. package/vendor/boost/math/include/boost/math/special_functions/rsqrt.hpp +52 -0
  641. package/vendor/boost/math/include/boost/math/special_functions/sign.hpp +241 -0
  642. package/vendor/boost/math/include/boost/math/special_functions/sin_pi.hpp +135 -0
  643. package/vendor/boost/math/include/boost/math/special_functions/sinc.hpp +123 -0
  644. package/vendor/boost/math/include/boost/math/special_functions/sinhc.hpp +142 -0
  645. package/vendor/boost/math/include/boost/math/special_functions/spherical_harmonic.hpp +205 -0
  646. package/vendor/boost/math/include/boost/math/special_functions/sqrt1pm1.hpp +49 -0
  647. package/vendor/boost/math/include/boost/math/special_functions/trigamma.hpp +448 -0
  648. package/vendor/boost/math/include/boost/math/special_functions/trunc.hpp +385 -0
  649. package/vendor/boost/math/include/boost/math/special_functions/ulp.hpp +102 -0
  650. package/vendor/boost/math/include/boost/math/special_functions/zeta.hpp +1081 -0
  651. package/vendor/boost/math/include/boost/math/special_functions.hpp +86 -0
  652. package/vendor/boost/math/include/boost/math/statistics/anderson_darling.hpp +112 -0
  653. package/vendor/boost/math/include/boost/math/statistics/bivariate_statistics.hpp +470 -0
  654. package/vendor/boost/math/include/boost/math/statistics/chatterjee_correlation.hpp +159 -0
  655. package/vendor/boost/math/include/boost/math/statistics/detail/rank.hpp +140 -0
  656. package/vendor/boost/math/include/boost/math/statistics/detail/single_pass.hpp +401 -0
  657. package/vendor/boost/math/include/boost/math/statistics/linear_regression.hpp +133 -0
  658. package/vendor/boost/math/include/boost/math/statistics/ljung_box.hpp +70 -0
  659. package/vendor/boost/math/include/boost/math/statistics/runs_test.hpp +121 -0
  660. package/vendor/boost/math/include/boost/math/statistics/signal_statistics.hpp +350 -0
  661. package/vendor/boost/math/include/boost/math/statistics/t_test.hpp +275 -0
  662. package/vendor/boost/math/include/boost/math/statistics/univariate_statistics.hpp +1184 -0
  663. package/vendor/boost/math/include/boost/math/statistics/z_test.hpp +161 -0
  664. package/vendor/boost/math/include/boost/math/tools/agm.hpp +47 -0
  665. package/vendor/boost/math/include/boost/math/tools/array.hpp +41 -0
  666. package/vendor/boost/math/include/boost/math/tools/assert.hpp +49 -0
  667. package/vendor/boost/math/include/boost/math/tools/atomic.hpp +50 -0
  668. package/vendor/boost/math/include/boost/math/tools/big_constant.hpp +110 -0
  669. package/vendor/boost/math/include/boost/math/tools/bivariate_statistics.hpp +96 -0
  670. package/vendor/boost/math/include/boost/math/tools/centered_continued_fraction.hpp +173 -0
  671. package/vendor/boost/math/include/boost/math/tools/cohen_acceleration.hpp +51 -0
  672. package/vendor/boost/math/include/boost/math/tools/color_maps.hpp +1943 -0
  673. package/vendor/boost/math/include/boost/math/tools/complex.hpp +115 -0
  674. package/vendor/boost/math/include/boost/math/tools/concepts.hpp +24 -0
  675. package/vendor/boost/math/include/boost/math/tools/condition_numbers.hpp +144 -0
  676. package/vendor/boost/math/include/boost/math/tools/config.hpp +856 -0
  677. package/vendor/boost/math/include/boost/math/tools/convert_from_string.hpp +85 -0
  678. package/vendor/boost/math/include/boost/math/tools/cstdint.hpp +107 -0
  679. package/vendor/boost/math/include/boost/math/tools/cubic_roots.hpp +198 -0
  680. package/vendor/boost/math/include/boost/math/tools/cxx03_warn.hpp +95 -0
  681. package/vendor/boost/math/include/boost/math/tools/detail/is_const_iterable.hpp +38 -0
  682. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_10.hpp +84 -0
  683. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_11.hpp +90 -0
  684. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_12.hpp +96 -0
  685. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_13.hpp +102 -0
  686. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_14.hpp +108 -0
  687. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_15.hpp +114 -0
  688. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_16.hpp +120 -0
  689. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_17.hpp +126 -0
  690. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_18.hpp +132 -0
  691. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_19.hpp +138 -0
  692. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_2.hpp +36 -0
  693. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_20.hpp +144 -0
  694. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_3.hpp +42 -0
  695. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_4.hpp +48 -0
  696. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_5.hpp +54 -0
  697. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_6.hpp +60 -0
  698. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_7.hpp +66 -0
  699. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_8.hpp +72 -0
  700. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_9.hpp +78 -0
  701. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_10.hpp +90 -0
  702. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_11.hpp +97 -0
  703. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_12.hpp +104 -0
  704. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_13.hpp +111 -0
  705. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_14.hpp +118 -0
  706. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_15.hpp +125 -0
  707. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_16.hpp +132 -0
  708. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_17.hpp +139 -0
  709. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_18.hpp +146 -0
  710. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_19.hpp +153 -0
  711. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_2.hpp +48 -0
  712. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_20.hpp +160 -0
  713. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_3.hpp +48 -0
  714. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_4.hpp +48 -0
  715. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_5.hpp +55 -0
  716. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_6.hpp +62 -0
  717. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_7.hpp +69 -0
  718. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_8.hpp +76 -0
  719. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_9.hpp +83 -0
  720. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_10.hpp +156 -0
  721. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_11.hpp +181 -0
  722. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_12.hpp +208 -0
  723. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_13.hpp +237 -0
  724. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_14.hpp +268 -0
  725. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_15.hpp +301 -0
  726. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_16.hpp +336 -0
  727. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_17.hpp +373 -0
  728. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_18.hpp +412 -0
  729. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_19.hpp +453 -0
  730. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_2.hpp +48 -0
  731. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_20.hpp +496 -0
  732. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_3.hpp +48 -0
  733. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_4.hpp +48 -0
  734. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_5.hpp +61 -0
  735. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_6.hpp +76 -0
  736. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_7.hpp +93 -0
  737. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_8.hpp +112 -0
  738. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_9.hpp +133 -0
  739. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_10.hpp +138 -0
  740. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_11.hpp +150 -0
  741. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_12.hpp +162 -0
  742. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_13.hpp +174 -0
  743. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_14.hpp +186 -0
  744. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_15.hpp +198 -0
  745. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_16.hpp +210 -0
  746. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_17.hpp +222 -0
  747. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_18.hpp +234 -0
  748. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_19.hpp +246 -0
  749. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_2.hpp +42 -0
  750. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_20.hpp +258 -0
  751. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_3.hpp +54 -0
  752. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_4.hpp +66 -0
  753. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_5.hpp +78 -0
  754. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_6.hpp +90 -0
  755. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_7.hpp +102 -0
  756. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_8.hpp +114 -0
  757. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_9.hpp +126 -0
  758. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_10.hpp +144 -0
  759. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_11.hpp +160 -0
  760. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_12.hpp +176 -0
  761. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_13.hpp +192 -0
  762. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_14.hpp +208 -0
  763. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_15.hpp +224 -0
  764. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_16.hpp +240 -0
  765. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_17.hpp +256 -0
  766. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_18.hpp +272 -0
  767. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_19.hpp +288 -0
  768. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_2.hpp +48 -0
  769. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_20.hpp +304 -0
  770. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_3.hpp +48 -0
  771. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_4.hpp +48 -0
  772. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_5.hpp +64 -0
  773. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_6.hpp +80 -0
  774. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_7.hpp +96 -0
  775. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_8.hpp +112 -0
  776. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_9.hpp +128 -0
  777. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_10.hpp +396 -0
  778. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_11.hpp +482 -0
  779. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_12.hpp +576 -0
  780. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_13.hpp +678 -0
  781. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_14.hpp +788 -0
  782. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_15.hpp +906 -0
  783. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_16.hpp +1032 -0
  784. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_17.hpp +1166 -0
  785. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_18.hpp +1308 -0
  786. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_19.hpp +1458 -0
  787. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_2.hpp +48 -0
  788. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_20.hpp +1616 -0
  789. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_3.hpp +48 -0
  790. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_4.hpp +48 -0
  791. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_5.hpp +86 -0
  792. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_6.hpp +132 -0
  793. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_7.hpp +186 -0
  794. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_8.hpp +248 -0
  795. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_9.hpp +318 -0
  796. package/vendor/boost/math/include/boost/math/tools/engel_expansion.hpp +124 -0
  797. package/vendor/boost/math/include/boost/math/tools/estrin.hpp +72 -0
  798. package/vendor/boost/math/include/boost/math/tools/fraction.hpp +354 -0
  799. package/vendor/boost/math/include/boost/math/tools/header_deprecated.hpp +27 -0
  800. package/vendor/boost/math/include/boost/math/tools/is_constant_evaluated.hpp +51 -0
  801. package/vendor/boost/math/include/boost/math/tools/is_detected.hpp +56 -0
  802. package/vendor/boost/math/include/boost/math/tools/is_standalone.hpp +18 -0
  803. package/vendor/boost/math/include/boost/math/tools/luroth_expansion.hpp +147 -0
  804. package/vendor/boost/math/include/boost/math/tools/minima.hpp +164 -0
  805. package/vendor/boost/math/include/boost/math/tools/mp.hpp +423 -0
  806. package/vendor/boost/math/include/boost/math/tools/norms.hpp +638 -0
  807. package/vendor/boost/math/include/boost/math/tools/nothrow.hpp +27 -0
  808. package/vendor/boost/math/include/boost/math/tools/numeric_limits.hpp +888 -0
  809. package/vendor/boost/math/include/boost/math/tools/numerical_differentiation.hpp +12 -0
  810. package/vendor/boost/math/include/boost/math/tools/polynomial.hpp +862 -0
  811. package/vendor/boost/math/include/boost/math/tools/polynomial_gcd.hpp +268 -0
  812. package/vendor/boost/math/include/boost/math/tools/precision.hpp +418 -0
  813. package/vendor/boost/math/include/boost/math/tools/promotion.hpp +135 -0
  814. package/vendor/boost/math/include/boost/math/tools/quartic_roots.hpp +157 -0
  815. package/vendor/boost/math/include/boost/math/tools/random_vector.hpp +101 -0
  816. package/vendor/boost/math/include/boost/math/tools/rational.hpp +346 -0
  817. package/vendor/boost/math/include/boost/math/tools/real_cast.hpp +31 -0
  818. package/vendor/boost/math/include/boost/math/tools/recurrence.hpp +330 -0
  819. package/vendor/boost/math/include/boost/math/tools/roots.hpp +1072 -0
  820. package/vendor/boost/math/include/boost/math/tools/series.hpp +221 -0
  821. package/vendor/boost/math/include/boost/math/tools/signal_statistics.hpp +353 -0
  822. package/vendor/boost/math/include/boost/math/tools/simple_continued_fraction.hpp +177 -0
  823. package/vendor/boost/math/include/boost/math/tools/stats.hpp +87 -0
  824. package/vendor/boost/math/include/boost/math/tools/test_value.hpp +143 -0
  825. package/vendor/boost/math/include/boost/math/tools/throw_exception.hpp +43 -0
  826. package/vendor/boost/math/include/boost/math/tools/toms748_solve.hpp +636 -0
  827. package/vendor/boost/math/include/boost/math/tools/traits.hpp +140 -0
  828. package/vendor/boost/math/include/boost/math/tools/tuple.hpp +88 -0
  829. package/vendor/boost/math/include/boost/math/tools/type_traits.hpp +489 -0
  830. package/vendor/boost/math/include/boost/math/tools/ulps_plot.hpp +598 -0
  831. package/vendor/boost/math/include/boost/math/tools/univariate_statistics.hpp +437 -0
  832. package/vendor/boost/math/include/boost/math/tools/user.hpp +105 -0
  833. package/vendor/boost/math/include/boost/math/tools/utility.hpp +69 -0
  834. package/vendor/boost/math/include/boost/math/tools/workaround.hpp +42 -0
  835. package/vendor/boost/math/include/boost/math/tr1.hpp +1121 -0
  836. package/vendor/boost/math/include/boost/math/tr1_c_macros.ipp +810 -0
  837. package/vendor/boost/math/include/boost/math_fwd.hpp +42 -0
  838. package/vendor/boost/multiprecision/LICENSE +23 -0
  839. package/vendor/boost/multiprecision/README.md +168 -0
  840. package/vendor/boost/multiprecision/include/boost/config/abi/borland_prefix.hpp +27 -0
  841. package/vendor/boost/multiprecision/include/boost/config/abi/borland_suffix.hpp +12 -0
  842. package/vendor/boost/multiprecision/include/boost/config/abi/msvc_prefix.hpp +22 -0
  843. package/vendor/boost/multiprecision/include/boost/config/abi/msvc_suffix.hpp +8 -0
  844. package/vendor/boost/multiprecision/include/boost/config/abi_prefix.hpp +25 -0
  845. package/vendor/boost/multiprecision/include/boost/config/abi_suffix.hpp +25 -0
  846. package/vendor/boost/multiprecision/include/boost/config/assert_cxx03.hpp +211 -0
  847. package/vendor/boost/multiprecision/include/boost/config/assert_cxx11.hpp +212 -0
  848. package/vendor/boost/multiprecision/include/boost/config/assert_cxx14.hpp +47 -0
  849. package/vendor/boost/multiprecision/include/boost/config/assert_cxx17.hpp +65 -0
  850. package/vendor/boost/multiprecision/include/boost/config/assert_cxx20.hpp +59 -0
  851. package/vendor/boost/multiprecision/include/boost/config/assert_cxx23.hpp +41 -0
  852. package/vendor/boost/multiprecision/include/boost/config/assert_cxx98.hpp +23 -0
  853. package/vendor/boost/multiprecision/include/boost/config/auto_link.hpp +530 -0
  854. package/vendor/boost/multiprecision/include/boost/config/compiler/borland.hpp +342 -0
  855. package/vendor/boost/multiprecision/include/boost/config/compiler/clang.hpp +370 -0
  856. package/vendor/boost/multiprecision/include/boost/config/compiler/clang_version.hpp +98 -0
  857. package/vendor/boost/multiprecision/include/boost/config/compiler/codegear.hpp +389 -0
  858. package/vendor/boost/multiprecision/include/boost/config/compiler/comeau.hpp +59 -0
  859. package/vendor/boost/multiprecision/include/boost/config/compiler/common_edg.hpp +185 -0
  860. package/vendor/boost/multiprecision/include/boost/config/compiler/compaq_cxx.hpp +19 -0
  861. package/vendor/boost/multiprecision/include/boost/config/compiler/cray.hpp +446 -0
  862. package/vendor/boost/multiprecision/include/boost/config/compiler/diab.hpp +26 -0
  863. package/vendor/boost/multiprecision/include/boost/config/compiler/digitalmars.hpp +146 -0
  864. package/vendor/boost/multiprecision/include/boost/config/compiler/gcc.hpp +386 -0
  865. package/vendor/boost/multiprecision/include/boost/config/compiler/gcc_xml.hpp +115 -0
  866. package/vendor/boost/multiprecision/include/boost/config/compiler/greenhills.hpp +28 -0
  867. package/vendor/boost/multiprecision/include/boost/config/compiler/hp_acc.hpp +153 -0
  868. package/vendor/boost/multiprecision/include/boost/config/compiler/intel.hpp +577 -0
  869. package/vendor/boost/multiprecision/include/boost/config/compiler/kai.hpp +33 -0
  870. package/vendor/boost/multiprecision/include/boost/config/compiler/metrowerks.hpp +201 -0
  871. package/vendor/boost/multiprecision/include/boost/config/compiler/mpw.hpp +143 -0
  872. package/vendor/boost/multiprecision/include/boost/config/compiler/nvcc.hpp +64 -0
  873. package/vendor/boost/multiprecision/include/boost/config/compiler/pathscale.hpp +141 -0
  874. package/vendor/boost/multiprecision/include/boost/config/compiler/pgi.hpp +23 -0
  875. package/vendor/boost/multiprecision/include/boost/config/compiler/sgi_mipspro.hpp +29 -0
  876. package/vendor/boost/multiprecision/include/boost/config/compiler/sunpro_cc.hpp +225 -0
  877. package/vendor/boost/multiprecision/include/boost/config/compiler/vacpp.hpp +189 -0
  878. package/vendor/boost/multiprecision/include/boost/config/compiler/visualc.hpp +400 -0
  879. package/vendor/boost/multiprecision/include/boost/config/compiler/xlcpp.hpp +303 -0
  880. package/vendor/boost/multiprecision/include/boost/config/compiler/xlcpp_zos.hpp +174 -0
  881. package/vendor/boost/multiprecision/include/boost/config/detail/cxx_composite.hpp +218 -0
  882. package/vendor/boost/multiprecision/include/boost/config/detail/posix_features.hpp +95 -0
  883. package/vendor/boost/multiprecision/include/boost/config/detail/select_compiler_config.hpp +157 -0
  884. package/vendor/boost/multiprecision/include/boost/config/detail/select_platform_config.hpp +147 -0
  885. package/vendor/boost/multiprecision/include/boost/config/detail/select_stdlib_config.hpp +121 -0
  886. package/vendor/boost/multiprecision/include/boost/config/detail/suffix.hpp +1334 -0
  887. package/vendor/boost/multiprecision/include/boost/config/header_deprecated.hpp +26 -0
  888. package/vendor/boost/multiprecision/include/boost/config/helper_macros.hpp +37 -0
  889. package/vendor/boost/multiprecision/include/boost/config/no_tr1/cmath.hpp +28 -0
  890. package/vendor/boost/multiprecision/include/boost/config/no_tr1/complex.hpp +28 -0
  891. package/vendor/boost/multiprecision/include/boost/config/no_tr1/functional.hpp +28 -0
  892. package/vendor/boost/multiprecision/include/boost/config/no_tr1/memory.hpp +28 -0
  893. package/vendor/boost/multiprecision/include/boost/config/no_tr1/utility.hpp +28 -0
  894. package/vendor/boost/multiprecision/include/boost/config/platform/aix.hpp +33 -0
  895. package/vendor/boost/multiprecision/include/boost/config/platform/amigaos.hpp +15 -0
  896. package/vendor/boost/multiprecision/include/boost/config/platform/beos.hpp +26 -0
  897. package/vendor/boost/multiprecision/include/boost/config/platform/bsd.hpp +83 -0
  898. package/vendor/boost/multiprecision/include/boost/config/platform/cloudabi.hpp +18 -0
  899. package/vendor/boost/multiprecision/include/boost/config/platform/cray.hpp +18 -0
  900. package/vendor/boost/multiprecision/include/boost/config/platform/cygwin.hpp +71 -0
  901. package/vendor/boost/multiprecision/include/boost/config/platform/haiku.hpp +31 -0
  902. package/vendor/boost/multiprecision/include/boost/config/platform/hpux.hpp +87 -0
  903. package/vendor/boost/multiprecision/include/boost/config/platform/irix.hpp +31 -0
  904. package/vendor/boost/multiprecision/include/boost/config/platform/linux.hpp +106 -0
  905. package/vendor/boost/multiprecision/include/boost/config/platform/macos.hpp +87 -0
  906. package/vendor/boost/multiprecision/include/boost/config/platform/qnxnto.hpp +31 -0
  907. package/vendor/boost/multiprecision/include/boost/config/platform/solaris.hpp +31 -0
  908. package/vendor/boost/multiprecision/include/boost/config/platform/symbian.hpp +97 -0
  909. package/vendor/boost/multiprecision/include/boost/config/platform/vms.hpp +25 -0
  910. package/vendor/boost/multiprecision/include/boost/config/platform/vxworks.hpp +422 -0
  911. package/vendor/boost/multiprecision/include/boost/config/platform/wasm.hpp +23 -0
  912. package/vendor/boost/multiprecision/include/boost/config/platform/win32.hpp +90 -0
  913. package/vendor/boost/multiprecision/include/boost/config/platform/zos.hpp +32 -0
  914. package/vendor/boost/multiprecision/include/boost/config/pragma_message.hpp +31 -0
  915. package/vendor/boost/multiprecision/include/boost/config/requires_threads.hpp +92 -0
  916. package/vendor/boost/multiprecision/include/boost/config/stdlib/dinkumware.hpp +324 -0
  917. package/vendor/boost/multiprecision/include/boost/config/stdlib/libcomo.hpp +93 -0
  918. package/vendor/boost/multiprecision/include/boost/config/stdlib/libcpp.hpp +185 -0
  919. package/vendor/boost/multiprecision/include/boost/config/stdlib/libstdcpp3.hpp +482 -0
  920. package/vendor/boost/multiprecision/include/boost/config/stdlib/modena.hpp +79 -0
  921. package/vendor/boost/multiprecision/include/boost/config/stdlib/msl.hpp +98 -0
  922. package/vendor/boost/multiprecision/include/boost/config/stdlib/roguewave.hpp +208 -0
  923. package/vendor/boost/multiprecision/include/boost/config/stdlib/sgi.hpp +168 -0
  924. package/vendor/boost/multiprecision/include/boost/config/stdlib/stlport.hpp +258 -0
  925. package/vendor/boost/multiprecision/include/boost/config/stdlib/vacpp.hpp +74 -0
  926. package/vendor/boost/multiprecision/include/boost/config/stdlib/xlcpp_zos.hpp +61 -0
  927. package/vendor/boost/multiprecision/include/boost/config/user.hpp +133 -0
  928. package/vendor/boost/multiprecision/include/boost/config/warning_disable.hpp +47 -0
  929. package/vendor/boost/multiprecision/include/boost/config/workaround.hpp +310 -0
  930. package/vendor/boost/multiprecision/include/boost/config.hpp +67 -0
  931. package/vendor/boost/multiprecision/include/boost/cstdint.hpp +556 -0
  932. package/vendor/boost/multiprecision/include/boost/cxx11_char_types.hpp +70 -0
  933. package/vendor/boost/multiprecision/include/boost/detail/workaround.hpp +10 -0
  934. package/vendor/boost/multiprecision/include/boost/limits.hpp +146 -0
  935. package/vendor/boost/multiprecision/include/boost/multiprecision/complex128.hpp +24 -0
  936. package/vendor/boost/multiprecision/include/boost/multiprecision/complex_adaptor.hpp +1049 -0
  937. package/vendor/boost/multiprecision/include/boost/multiprecision/concepts/mp_number_archetypes.hpp +257 -0
  938. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_bin_float/io.hpp +700 -0
  939. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_bin_float/transcendental.hpp +157 -0
  940. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_bin_float.hpp +2374 -0
  941. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_complex.hpp +12 -0
  942. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_dec_float.hpp +3807 -0
  943. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail.hpp +177 -0
  944. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath.hpp +25 -0
  945. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_fabs.hpp +27 -0
  946. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_floor.hpp +116 -0
  947. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_fma.hpp +65 -0
  948. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_fpclassify.hpp +52 -0
  949. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_frexp.hpp +93 -0
  950. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_isinf.hpp +24 -0
  951. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_isnan.hpp +21 -0
  952. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_ldexp.hpp +71 -0
  953. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_limits.hpp +218 -0
  954. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_log.hpp +172 -0
  955. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_sqrt.hpp +57 -0
  956. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_constants.hpp +80 -0
  957. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_double_fp.hpp +2690 -0
  958. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/add.hpp +368 -0
  959. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/add_unsigned.hpp +387 -0
  960. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/bitwise.hpp +896 -0
  961. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/checked.hpp +178 -0
  962. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/comparison.hpp +374 -0
  963. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/cpp_int_config.hpp +161 -0
  964. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/divide.hpp +703 -0
  965. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/import_export.hpp +248 -0
  966. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp +138 -0
  967. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/limits.hpp +292 -0
  968. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/literals.hpp +296 -0
  969. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/misc.hpp +1462 -0
  970. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/multiply.hpp +848 -0
  971. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/serialize.hpp +209 -0
  972. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/value_pack.hpp +42 -0
  973. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int.hpp +2360 -0
  974. package/vendor/boost/multiprecision/include/boost/multiprecision/debug_adaptor.hpp +760 -0
  975. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/assert.hpp +29 -0
  976. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/atomic.hpp +62 -0
  977. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/bitscan.hpp +317 -0
  978. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/check_cpp11_config.hpp +64 -0
  979. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/constexpr.hpp +88 -0
  980. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/default_ops.hpp +4077 -0
  981. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/digits.hpp +49 -0
  982. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/dynamic_array.hpp +44 -0
  983. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/empty_value.hpp +87 -0
  984. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/endian.hpp +35 -0
  985. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/et_ops.hpp +1831 -0
  986. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/float128_functions.hpp +95 -0
  987. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/float_string_cvt.hpp +333 -0
  988. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/fpclassify.hpp +101 -0
  989. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/constants.hpp +289 -0
  990. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/pow.hpp +941 -0
  991. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/trig.hpp +1064 -0
  992. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/trunc.hpp +82 -0
  993. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/generic_interconvert.hpp +687 -0
  994. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/hash.hpp +56 -0
  995. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/integer_ops.hpp +474 -0
  996. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/itos.hpp +39 -0
  997. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/min_max.hpp +106 -0
  998. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/no_et_ops.hpp +661 -0
  999. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/no_exceptions_support.hpp +55 -0
  1000. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/number_base.hpp +1656 -0
  1001. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/number_compare.hpp +848 -0
  1002. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/precision.hpp +313 -0
  1003. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/rebind.hpp +19 -0
  1004. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/standalone_config.hpp +165 -0
  1005. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/static_array.hpp +42 -0
  1006. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/string_helpers.hpp +48 -0
  1007. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/tables.hpp +80 -0
  1008. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/ublas_interop.hpp +75 -0
  1009. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/uniform_int_distribution.hpp +212 -0
  1010. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/utype_helper.hpp +374 -0
  1011. package/vendor/boost/multiprecision/include/boost/multiprecision/eigen.hpp +248 -0
  1012. package/vendor/boost/multiprecision/include/boost/multiprecision/float128.hpp +960 -0
  1013. package/vendor/boost/multiprecision/include/boost/multiprecision/fwd.hpp +268 -0
  1014. package/vendor/boost/multiprecision/include/boost/multiprecision/gmp.hpp +4100 -0
  1015. package/vendor/boost/multiprecision/include/boost/multiprecision/integer.hpp +363 -0
  1016. package/vendor/boost/multiprecision/include/boost/multiprecision/logged_adaptor.hpp +834 -0
  1017. package/vendor/boost/multiprecision/include/boost/multiprecision/miller_rabin.hpp +221 -0
  1018. package/vendor/boost/multiprecision/include/boost/multiprecision/mpc.hpp +1721 -0
  1019. package/vendor/boost/multiprecision/include/boost/multiprecision/mpfi.hpp +2579 -0
  1020. package/vendor/boost/multiprecision/include/boost/multiprecision/mpfr.hpp +3668 -0
  1021. package/vendor/boost/multiprecision/include/boost/multiprecision/number.hpp +2491 -0
  1022. package/vendor/boost/multiprecision/include/boost/multiprecision/random.hpp +23 -0
  1023. package/vendor/boost/multiprecision/include/boost/multiprecision/rational_adaptor.hpp +1289 -0
  1024. package/vendor/boost/multiprecision/include/boost/multiprecision/tommath.hpp +1044 -0
  1025. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/explicit_conversion.hpp +67 -0
  1026. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/extract_exponent_type.hpp +28 -0
  1027. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_backend.hpp +91 -0
  1028. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_byte_container.hpp +51 -0
  1029. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_complex.hpp +22 -0
  1030. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_convertible_arithmetic.hpp +51 -0
  1031. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_restricted_conversion.hpp +47 -0
  1032. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_variable_precision.hpp +25 -0
  1033. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/max_digits10.hpp +79 -0
  1034. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/std_integer_traits.hpp +95 -0
  1035. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/transcendental_reduction_type.hpp +21 -0
  1036. package/vendor/boost/multiprecision/include/boost/static_assert.hpp +179 -0
  1037. package/vendor/boost/multiprecision/include/boost/version.hpp +32 -0
  1038. package/vendor/eigen/COPYING.APACHE +203 -0
  1039. package/vendor/eigen/COPYING.BSD +26 -0
  1040. package/vendor/eigen/COPYING.MPL2 +373 -0
  1041. package/vendor/eigen/COPYING.README +6 -0
  1042. package/vendor/eigen/Eigen/AccelerateSupport +52 -0
  1043. package/vendor/eigen/Eigen/Cholesky +43 -0
  1044. package/vendor/eigen/Eigen/CholmodSupport +48 -0
  1045. package/vendor/eigen/Eigen/Core +451 -0
  1046. package/vendor/eigen/Eigen/Dense +7 -0
  1047. package/vendor/eigen/Eigen/Eigen +2 -0
  1048. package/vendor/eigen/Eigen/Eigenvalues +63 -0
  1049. package/vendor/eigen/Eigen/Geometry +59 -0
  1050. package/vendor/eigen/Eigen/Householder +31 -0
  1051. package/vendor/eigen/Eigen/IterativeLinearSolvers +52 -0
  1052. package/vendor/eigen/Eigen/Jacobi +33 -0
  1053. package/vendor/eigen/Eigen/KLUSupport +43 -0
  1054. package/vendor/eigen/Eigen/LU +46 -0
  1055. package/vendor/eigen/Eigen/MetisSupport +35 -0
  1056. package/vendor/eigen/Eigen/OrderingMethods +73 -0
  1057. package/vendor/eigen/Eigen/PaStiXSupport +51 -0
  1058. package/vendor/eigen/Eigen/PardisoSupport +38 -0
  1059. package/vendor/eigen/Eigen/QR +48 -0
  1060. package/vendor/eigen/Eigen/QtAlignedMalloc +32 -0
  1061. package/vendor/eigen/Eigen/SPQRSupport +41 -0
  1062. package/vendor/eigen/Eigen/SVD +56 -0
  1063. package/vendor/eigen/Eigen/Sparse +33 -0
  1064. package/vendor/eigen/Eigen/SparseCholesky +40 -0
  1065. package/vendor/eigen/Eigen/SparseCore +70 -0
  1066. package/vendor/eigen/Eigen/SparseLU +50 -0
  1067. package/vendor/eigen/Eigen/SparseQR +38 -0
  1068. package/vendor/eigen/Eigen/StdDeque +30 -0
  1069. package/vendor/eigen/Eigen/StdList +29 -0
  1070. package/vendor/eigen/Eigen/StdVector +30 -0
  1071. package/vendor/eigen/Eigen/SuperLUSupport +70 -0
  1072. package/vendor/eigen/Eigen/ThreadPool +80 -0
  1073. package/vendor/eigen/Eigen/UmfPackSupport +42 -0
  1074. package/vendor/eigen/Eigen/Version +14 -0
  1075. package/vendor/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
  1076. package/vendor/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
  1077. package/vendor/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
  1078. package/vendor/eigen/Eigen/src/Cholesky/LDLT.h +649 -0
  1079. package/vendor/eigen/Eigen/src/Cholesky/LLT.h +514 -0
  1080. package/vendor/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +124 -0
  1081. package/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +738 -0
  1082. package/vendor/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  1083. package/vendor/eigen/Eigen/src/Core/ArithmeticSequence.h +239 -0
  1084. package/vendor/eigen/Eigen/src/Core/Array.h +376 -0
  1085. package/vendor/eigen/Eigen/src/Core/ArrayBase.h +213 -0
  1086. package/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +165 -0
  1087. package/vendor/eigen/Eigen/src/Core/Assign.h +80 -0
  1088. package/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +1057 -0
  1089. package/vendor/eigen/Eigen/src/Core/Assign_MKL.h +183 -0
  1090. package/vendor/eigen/Eigen/src/Core/BandMatrix.h +338 -0
  1091. package/vendor/eigen/Eigen/src/Core/Block.h +429 -0
  1092. package/vendor/eigen/Eigen/src/Core/CommaInitializer.h +149 -0
  1093. package/vendor/eigen/Eigen/src/Core/ConditionEstimator.h +173 -0
  1094. package/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +2018 -0
  1095. package/vendor/eigen/Eigen/src/Core/CoreIterators.h +141 -0
  1096. package/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +166 -0
  1097. package/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +975 -0
  1098. package/vendor/eigen/Eigen/src/Core/CwiseTernaryOp.h +171 -0
  1099. package/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +91 -0
  1100. package/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +167 -0
  1101. package/vendor/eigen/Eigen/src/Core/DenseBase.h +673 -0
  1102. package/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +568 -0
  1103. package/vendor/eigen/Eigen/src/Core/DenseStorage.h +573 -0
  1104. package/vendor/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  1105. package/vendor/eigen/Eigen/src/Core/Diagonal.h +219 -0
  1106. package/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +420 -0
  1107. package/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +30 -0
  1108. package/vendor/eigen/Eigen/src/Core/Dot.h +268 -0
  1109. package/vendor/eigen/Eigen/src/Core/EigenBase.h +149 -0
  1110. package/vendor/eigen/Eigen/src/Core/Fill.h +138 -0
  1111. package/vendor/eigen/Eigen/src/Core/FindCoeff.h +464 -0
  1112. package/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +127 -0
  1113. package/vendor/eigen/Eigen/src/Core/Fuzzy.h +132 -0
  1114. package/vendor/eigen/Eigen/src/Core/GeneralProduct.h +519 -0
  1115. package/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +1702 -0
  1116. package/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +230 -0
  1117. package/vendor/eigen/Eigen/src/Core/IO.h +233 -0
  1118. package/vendor/eigen/Eigen/src/Core/IndexedView.h +321 -0
  1119. package/vendor/eigen/Eigen/src/Core/InnerProduct.h +260 -0
  1120. package/vendor/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
  1121. package/vendor/eigen/Eigen/src/Core/Inverse.h +108 -0
  1122. package/vendor/eigen/Eigen/src/Core/Map.h +153 -0
  1123. package/vendor/eigen/Eigen/src/Core/MapBase.h +283 -0
  1124. package/vendor/eigen/Eigen/src/Core/MathFunctions.h +2103 -0
  1125. package/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +263 -0
  1126. package/vendor/eigen/Eigen/src/Core/Matrix.h +534 -0
  1127. package/vendor/eigen/Eigen/src/Core/MatrixBase.h +545 -0
  1128. package/vendor/eigen/Eigen/src/Core/NestByValue.h +91 -0
  1129. package/vendor/eigen/Eigen/src/Core/NoAlias.h +102 -0
  1130. package/vendor/eigen/Eigen/src/Core/NumTraits.h +335 -0
  1131. package/vendor/eigen/Eigen/src/Core/PartialReduxEvaluator.h +253 -0
  1132. package/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +555 -0
  1133. package/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +1014 -0
  1134. package/vendor/eigen/Eigen/src/Core/Product.h +307 -0
  1135. package/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +1287 -0
  1136. package/vendor/eigen/Eigen/src/Core/Random.h +207 -0
  1137. package/vendor/eigen/Eigen/src/Core/RandomImpl.h +262 -0
  1138. package/vendor/eigen/Eigen/src/Core/RealView.h +250 -0
  1139. package/vendor/eigen/Eigen/src/Core/Redux.h +535 -0
  1140. package/vendor/eigen/Eigen/src/Core/Ref.h +383 -0
  1141. package/vendor/eigen/Eigen/src/Core/Replicate.h +130 -0
  1142. package/vendor/eigen/Eigen/src/Core/Reshaped.h +398 -0
  1143. package/vendor/eigen/Eigen/src/Core/ReturnByValue.h +111 -0
  1144. package/vendor/eigen/Eigen/src/Core/Reverse.h +202 -0
  1145. package/vendor/eigen/Eigen/src/Core/Select.h +92 -0
  1146. package/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +329 -0
  1147. package/vendor/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +50 -0
  1148. package/vendor/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
  1149. package/vendor/eigen/Eigen/src/Core/Solve.h +174 -0
  1150. package/vendor/eigen/Eigen/src/Core/SolveTriangular.h +237 -0
  1151. package/vendor/eigen/Eigen/src/Core/SolverBase.h +167 -0
  1152. package/vendor/eigen/Eigen/src/Core/StableNorm.h +217 -0
  1153. package/vendor/eigen/Eigen/src/Core/StlIterators.h +619 -0
  1154. package/vendor/eigen/Eigen/src/Core/Stride.h +114 -0
  1155. package/vendor/eigen/Eigen/src/Core/Swap.h +99 -0
  1156. package/vendor/eigen/Eigen/src/Core/Transpose.h +427 -0
  1157. package/vendor/eigen/Eigen/src/Core/Transpositions.h +323 -0
  1158. package/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +900 -0
  1159. package/vendor/eigen/Eigen/src/Core/VectorBlock.h +83 -0
  1160. package/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +733 -0
  1161. package/vendor/eigen/Eigen/src/Core/Visitor.h +537 -0
  1162. package/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +565 -0
  1163. package/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +130 -0
  1164. package/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +3081 -0
  1165. package/vendor/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  1166. package/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +308 -0
  1167. package/vendor/eigen/Eigen/src/Core/arch/AVX512/Complex.h +472 -0
  1168. package/vendor/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  1169. package/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +141 -0
  1170. package/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  1171. package/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +3146 -0
  1172. package/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
  1173. package/vendor/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
  1174. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
  1175. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
  1176. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +277 -0
  1177. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  1178. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +653 -0
  1179. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +81 -0
  1180. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +3686 -0
  1181. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +205 -0
  1182. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +901 -0
  1183. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
  1184. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
  1185. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +3729 -0
  1186. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  1187. package/vendor/eigen/Eigen/src/Core/arch/Default/BFloat16.h +866 -0
  1188. package/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +128 -0
  1189. package/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +2634 -0
  1190. package/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +227 -0
  1191. package/vendor/eigen/Eigen/src/Core/arch/Default/Half.h +1091 -0
  1192. package/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +47 -0
  1193. package/vendor/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  1194. package/vendor/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +104 -0
  1195. package/vendor/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1712 -0
  1196. package/vendor/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  1197. package/vendor/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +77 -0
  1198. package/vendor/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  1199. package/vendor/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
  1200. package/vendor/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
  1201. package/vendor/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
  1202. package/vendor/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
  1203. package/vendor/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
  1204. package/vendor/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
  1205. package/vendor/eigen/Eigen/src/Core/arch/MSA/Complex.h +620 -0
  1206. package/vendor/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +379 -0
  1207. package/vendor/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1237 -0
  1208. package/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +732 -0
  1209. package/vendor/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +243 -0
  1210. package/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +68 -0
  1211. package/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +6096 -0
  1212. package/vendor/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1642 -0
  1213. package/vendor/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  1214. package/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +503 -0
  1215. package/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +88 -0
  1216. package/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +2384 -0
  1217. package/vendor/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  1218. package/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +230 -0
  1219. package/vendor/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +48 -0
  1220. package/vendor/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +674 -0
  1221. package/vendor/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +52 -0
  1222. package/vendor/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +227 -0
  1223. package/vendor/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +303 -0
  1224. package/vendor/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +576 -0
  1225. package/vendor/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +83 -0
  1226. package/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +570 -0
  1227. package/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +244 -0
  1228. package/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +1413 -0
  1229. package/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +174 -0
  1230. package/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +747 -0
  1231. package/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +274 -0
  1232. package/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +149 -0
  1233. package/vendor/eigen/Eigen/src/Core/functors/TernaryFunctors.h +52 -0
  1234. package/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1420 -0
  1235. package/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +3153 -0
  1236. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +459 -0
  1237. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +330 -0
  1238. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +148 -0
  1239. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +205 -0
  1240. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +473 -0
  1241. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +139 -0
  1242. package/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +282 -0
  1243. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +483 -0
  1244. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +277 -0
  1245. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +253 -0
  1246. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +115 -0
  1247. package/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  1248. package/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +95 -0
  1249. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +397 -0
  1250. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +325 -0
  1251. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +347 -0
  1252. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +275 -0
  1253. package/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +388 -0
  1254. package/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +166 -0
  1255. package/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +122 -0
  1256. package/vendor/eigen/Eigen/src/Core/util/Assert.h +158 -0
  1257. package/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +622 -0
  1258. package/vendor/eigen/Eigen/src/Core/util/ConfigureVectorization.h +543 -0
  1259. package/vendor/eigen/Eigen/src/Core/util/Constants.h +598 -0
  1260. package/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +146 -0
  1261. package/vendor/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  1262. package/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +524 -0
  1263. package/vendor/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
  1264. package/vendor/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
  1265. package/vendor/eigen/Eigen/src/Core/util/IndexedViewHelper.h +487 -0
  1266. package/vendor/eigen/Eigen/src/Core/util/IntegralConstant.h +279 -0
  1267. package/vendor/eigen/Eigen/src/Core/util/MKL_support.h +139 -0
  1268. package/vendor/eigen/Eigen/src/Core/util/Macros.h +1346 -0
  1269. package/vendor/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  1270. package/vendor/eigen/Eigen/src/Core/util/Memory.h +1385 -0
  1271. package/vendor/eigen/Eigen/src/Core/util/Meta.h +760 -0
  1272. package/vendor/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
  1273. package/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +44 -0
  1274. package/vendor/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  1275. package/vendor/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  1276. package/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +105 -0
  1277. package/vendor/eigen/Eigen/src/Core/util/SymbolicIndex.h +445 -0
  1278. package/vendor/eigen/Eigen/src/Core/util/XprHelper.h +1093 -0
  1279. package/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +315 -0
  1280. package/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +442 -0
  1281. package/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +95 -0
  1282. package/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +579 -0
  1283. package/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +402 -0
  1284. package/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +212 -0
  1285. package/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +356 -0
  1286. package/vendor/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
  1287. package/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +142 -0
  1288. package/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +587 -0
  1289. package/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +519 -0
  1290. package/vendor/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +83 -0
  1291. package/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +850 -0
  1292. package/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +90 -0
  1293. package/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +529 -0
  1294. package/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +485 -0
  1295. package/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +245 -0
  1296. package/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +203 -0
  1297. package/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +453 -0
  1298. package/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +273 -0
  1299. package/vendor/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  1300. package/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +257 -0
  1301. package/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +232 -0
  1302. package/vendor/eigen/Eigen/src/Geometry/Quaternion.h +930 -0
  1303. package/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +201 -0
  1304. package/vendor/eigen/Eigen/src/Geometry/RotationBase.h +209 -0
  1305. package/vendor/eigen/Eigen/src/Geometry/Scaling.h +195 -0
  1306. package/vendor/eigen/Eigen/src/Geometry/Transform.h +1485 -0
  1307. package/vendor/eigen/Eigen/src/Geometry/Translation.h +204 -0
  1308. package/vendor/eigen/Eigen/src/Geometry/Umeyama.h +161 -0
  1309. package/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +154 -0
  1310. package/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +115 -0
  1311. package/vendor/eigen/Eigen/src/Householder/Householder.h +154 -0
  1312. package/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +504 -0
  1313. package/vendor/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  1314. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +213 -0
  1315. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +220 -0
  1316. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +217 -0
  1317. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +402 -0
  1318. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +449 -0
  1319. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  1320. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +395 -0
  1321. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +193 -0
  1322. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +111 -0
  1323. package/vendor/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  1324. package/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +427 -0
  1325. package/vendor/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  1326. package/vendor/eigen/Eigen/src/KLUSupport/KLUSupport.h +339 -0
  1327. package/vendor/eigen/Eigen/src/LU/Determinant.h +98 -0
  1328. package/vendor/eigen/Eigen/src/LU/FullPivLU.h +826 -0
  1329. package/vendor/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  1330. package/vendor/eigen/Eigen/src/LU/InverseImpl.h +353 -0
  1331. package/vendor/eigen/Eigen/src/LU/PartialPivLU.h +586 -0
  1332. package/vendor/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +97 -0
  1333. package/vendor/eigen/Eigen/src/LU/arch/InverseSize4.h +353 -0
  1334. package/vendor/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
  1335. package/vendor/eigen/Eigen/src/MetisSupport/MetisSupport.h +125 -0
  1336. package/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +413 -0
  1337. package/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +1690 -0
  1338. package/vendor/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  1339. package/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +146 -0
  1340. package/vendor/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
  1341. package/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +632 -0
  1342. package/vendor/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
  1343. package/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +500 -0
  1344. package/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
  1345. package/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +161 -0
  1346. package/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +648 -0
  1347. package/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +733 -0
  1348. package/vendor/eigen/Eigen/src/QR/HouseholderQR.h +543 -0
  1349. package/vendor/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +77 -0
  1350. package/vendor/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
  1351. package/vendor/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
  1352. package/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +315 -0
  1353. package/vendor/eigen/Eigen/src/SVD/BDCSVD.h +1470 -0
  1354. package/vendor/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
  1355. package/vendor/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
  1356. package/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +846 -0
  1357. package/vendor/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +127 -0
  1358. package/vendor/eigen/Eigen/src/SVD/SVDBase.h +436 -0
  1359. package/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +379 -0
  1360. package/vendor/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  1361. package/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +868 -0
  1362. package/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +388 -0
  1363. package/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +329 -0
  1364. package/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +206 -0
  1365. package/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +308 -0
  1366. package/vendor/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  1367. package/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +279 -0
  1368. package/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +534 -0
  1369. package/vendor/eigen/Eigen/src/SparseCore/SparseColEtree.h +194 -0
  1370. package/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +592 -0
  1371. package/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +938 -0
  1372. package/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +142 -0
  1373. package/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +314 -0
  1374. package/vendor/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  1375. package/vendor/eigen/Eigen/src/SparseCore/SparseDot.h +100 -0
  1376. package/vendor/eigen/Eigen/src/SparseCore/SparseFuzzy.h +31 -0
  1377. package/vendor/eigen/Eigen/src/SparseCore/SparseMap.h +295 -0
  1378. package/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +1876 -0
  1379. package/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +451 -0
  1380. package/vendor/eigen/Eigen/src/SparseCore/SparsePermutation.h +249 -0
  1381. package/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +178 -0
  1382. package/vendor/eigen/Eigen/src/SparseCore/SparseRedux.h +47 -0
  1383. package/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +370 -0
  1384. package/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +613 -0
  1385. package/vendor/eigen/Eigen/src/SparseCore/SparseSolverBase.h +115 -0
  1386. package/vendor/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +184 -0
  1387. package/vendor/eigen/Eigen/src/SparseCore/SparseTranspose.h +83 -0
  1388. package/vendor/eigen/Eigen/src/SparseCore/SparseTriangularView.h +177 -0
  1389. package/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +209 -0
  1390. package/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +532 -0
  1391. package/vendor/eigen/Eigen/src/SparseCore/SparseView.h +225 -0
  1392. package/vendor/eigen/Eigen/src/SparseCore/TriangularSolver.h +274 -0
  1393. package/vendor/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
  1394. package/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +969 -0
  1395. package/vendor/eigen/Eigen/src/SparseLU/SparseLUImpl.h +79 -0
  1396. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +210 -0
  1397. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +113 -0
  1398. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +319 -0
  1399. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +75 -0
  1400. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +177 -0
  1401. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +168 -0
  1402. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +106 -0
  1403. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +114 -0
  1404. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +133 -0
  1405. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +215 -0
  1406. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +235 -0
  1407. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +136 -0
  1408. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +130 -0
  1409. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +81 -0
  1410. package/vendor/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
  1411. package/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +706 -0
  1412. package/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +51 -0
  1413. package/vendor/eigen/Eigen/src/StlSupport/StdList.h +50 -0
  1414. package/vendor/eigen/Eigen/src/StlSupport/StdVector.h +51 -0
  1415. package/vendor/eigen/Eigen/src/StlSupport/details.h +82 -0
  1416. package/vendor/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
  1417. package/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +929 -0
  1418. package/vendor/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
  1419. package/vendor/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
  1420. package/vendor/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
  1421. package/vendor/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
  1422. package/vendor/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
  1423. package/vendor/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
  1424. package/vendor/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
  1425. package/vendor/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
  1426. package/vendor/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
  1427. package/vendor/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
  1428. package/vendor/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
  1429. package/vendor/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
  1430. package/vendor/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
  1431. package/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +606 -0
  1432. package/vendor/eigen/Eigen/src/misc/Image.h +80 -0
  1433. package/vendor/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
  1434. package/vendor/eigen/Eigen/src/misc/Kernel.h +77 -0
  1435. package/vendor/eigen/Eigen/src/misc/RealSvd2x2.h +53 -0
  1436. package/vendor/eigen/Eigen/src/misc/blas.h +97 -0
  1437. package/vendor/eigen/Eigen/src/misc/lapacke.h +10085 -0
  1438. package/vendor/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
  1439. package/vendor/eigen/Eigen/src/misc/lapacke_mangling.h +16 -0
  1440. package/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
  1441. package/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
  1442. package/vendor/eigen/Eigen/src/plugins/BlockMethods.inc +1370 -0
  1443. package/vendor/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  1444. package/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.inc +167 -0
  1445. package/vendor/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
  1446. package/vendor/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
  1447. package/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
  1448. package/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
  1449. package/vendor/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
  1450. package/vendor/eigen/README.md +5 -0
  1451. package/vendor/mpdecimal/COPYRIGHT.txt +23 -0
  1452. package/vendor/mpdecimal/README.txt +53 -0
  1453. package/vendor/mpdecimal/libmpdec/.objs/README.txt +8 -0
  1454. package/vendor/mpdecimal/libmpdec/.objs/symbols32.exp +343 -0
  1455. package/vendor/mpdecimal/libmpdec/.objs/symbols64.exp +347 -0
  1456. package/vendor/mpdecimal/libmpdec/.pc/libmpdec.pc.in +11 -0
  1457. package/vendor/mpdecimal/libmpdec/.profile/train.sh +35 -0
  1458. package/vendor/mpdecimal/libmpdec/README.txt +84 -0
  1459. package/vendor/mpdecimal/libmpdec/basearith.c +649 -0
  1460. package/vendor/mpdecimal/libmpdec/basearith.h +217 -0
  1461. package/vendor/mpdecimal/libmpdec/bits.h +188 -0
  1462. package/vendor/mpdecimal/libmpdec/constants.c +129 -0
  1463. package/vendor/mpdecimal/libmpdec/constants.h +88 -0
  1464. package/vendor/mpdecimal/libmpdec/context.c +285 -0
  1465. package/vendor/mpdecimal/libmpdec/convolute.c +172 -0
  1466. package/vendor/mpdecimal/libmpdec/convolute.h +48 -0
  1467. package/vendor/mpdecimal/libmpdec/crt.c +178 -0
  1468. package/vendor/mpdecimal/libmpdec/crt.h +45 -0
  1469. package/vendor/mpdecimal/libmpdec/difradix2.c +171 -0
  1470. package/vendor/mpdecimal/libmpdec/difradix2.h +46 -0
  1471. package/vendor/mpdecimal/libmpdec/fnt.c +77 -0
  1472. package/vendor/mpdecimal/libmpdec/fnt.h +46 -0
  1473. package/vendor/mpdecimal/libmpdec/fourstep.c +242 -0
  1474. package/vendor/mpdecimal/libmpdec/fourstep.h +46 -0
  1475. package/vendor/mpdecimal/libmpdec/io.c +1610 -0
  1476. package/vendor/mpdecimal/libmpdec/io.h +61 -0
  1477. package/vendor/mpdecimal/libmpdec/mpalloc.c +347 -0
  1478. package/vendor/mpdecimal/libmpdec/mpalloc.h +53 -0
  1479. package/vendor/mpdecimal/libmpdec/mpdecimal.c +9155 -0
  1480. package/vendor/mpdecimal/libmpdec/mpdecimal.h.in +804 -0
  1481. package/vendor/mpdecimal/libmpdec/mpsignal.c +966 -0
  1482. package/vendor/mpdecimal/libmpdec/numbertheory.c +129 -0
  1483. package/vendor/mpdecimal/libmpdec/numbertheory.h +75 -0
  1484. package/vendor/mpdecimal/libmpdec/sixstep.c +212 -0
  1485. package/vendor/mpdecimal/libmpdec/sixstep.h +46 -0
  1486. package/vendor/mpdecimal/libmpdec/transpose.c +275 -0
  1487. package/vendor/mpdecimal/libmpdec/transpose.h +60 -0
  1488. package/vendor/mpdecimal/libmpdec/typearith.h +661 -0
  1489. package/vendor/mpdecimal/libmpdec/umodarith.h +645 -0
  1490. package/vendor/symengine/AUTHORS +101 -0
  1491. package/vendor/symengine/LICENSE +254 -0
  1492. package/vendor/symengine/README.md +199 -0
  1493. package/vendor/symengine/symengine/add.cpp +508 -0
  1494. package/vendor/symengine/symengine/add.h +187 -0
  1495. package/vendor/symengine/symengine/as_real_imag.cpp +289 -0
  1496. package/vendor/symengine/symengine/assumptions.cpp +202 -0
  1497. package/vendor/symengine/symengine/assumptions.h +47 -0
  1498. package/vendor/symengine/symengine/basic-inl.h +152 -0
  1499. package/vendor/symengine/symengine/basic-methods.inc +9 -0
  1500. package/vendor/symengine/symengine/basic.cpp +110 -0
  1501. package/vendor/symengine/symengine/basic.h +356 -0
  1502. package/vendor/symengine/symengine/complex.cpp +198 -0
  1503. package/vendor/symengine/symengine/complex.h +396 -0
  1504. package/vendor/symengine/symengine/complex_double.cpp +72 -0
  1505. package/vendor/symengine/symengine/complex_double.h +570 -0
  1506. package/vendor/symengine/symengine/complex_mpc.h +406 -0
  1507. package/vendor/symengine/symengine/constants.cpp +130 -0
  1508. package/vendor/symengine/symengine/constants.h +81 -0
  1509. package/vendor/symengine/symengine/cse.cpp +556 -0
  1510. package/vendor/symengine/symengine/cwrapper.h +949 -0
  1511. package/vendor/symengine/symengine/dense_matrix.cpp +2100 -0
  1512. package/vendor/symengine/symengine/derivative.cpp +841 -0
  1513. package/vendor/symengine/symengine/derivative.h +137 -0
  1514. package/vendor/symengine/symengine/dict.cpp +125 -0
  1515. package/vendor/symengine/symengine/dict.h +333 -0
  1516. package/vendor/symengine/symengine/diophantine.cpp +139 -0
  1517. package/vendor/symengine/symengine/diophantine.h +20 -0
  1518. package/vendor/symengine/symengine/eval.cpp +109 -0
  1519. package/vendor/symengine/symengine/eval.h +40 -0
  1520. package/vendor/symengine/symengine/eval_arb.h +31 -0
  1521. package/vendor/symengine/symengine/eval_double.cpp +959 -0
  1522. package/vendor/symengine/symengine/eval_double.h +28 -0
  1523. package/vendor/symengine/symengine/eval_mpc.h +29 -0
  1524. package/vendor/symengine/symengine/eval_mpfr.h +26 -0
  1525. package/vendor/symengine/symengine/expand.cpp +379 -0
  1526. package/vendor/symengine/symengine/expression.cpp +24 -0
  1527. package/vendor/symengine/symengine/expression.h +375 -0
  1528. package/vendor/symengine/symengine/fields.cpp +861 -0
  1529. package/vendor/symengine/symengine/fields.h +647 -0
  1530. package/vendor/symengine/symengine/finitediff.cpp +70 -0
  1531. package/vendor/symengine/symengine/finitediff.h +21 -0
  1532. package/vendor/symengine/symengine/flint_wrapper.h +1010 -0
  1533. package/vendor/symengine/symengine/functions.cpp +3913 -0
  1534. package/vendor/symengine/symengine/functions.h +1321 -0
  1535. package/vendor/symengine/symengine/infinity.cpp +537 -0
  1536. package/vendor/symengine/symengine/infinity.h +118 -0
  1537. package/vendor/symengine/symengine/integer.cpp +153 -0
  1538. package/vendor/symengine/symengine/integer.h +227 -0
  1539. package/vendor/symengine/symengine/interruption.cpp +9 -0
  1540. package/vendor/symengine/symengine/interruption.h +19 -0
  1541. package/vendor/symengine/symengine/lambda_double.h +918 -0
  1542. package/vendor/symengine/symengine/limits.h +35 -0
  1543. package/vendor/symengine/symengine/llvm_double.h +201 -0
  1544. package/vendor/symengine/symengine/logic.cpp +812 -0
  1545. package/vendor/symengine/symengine/logic.h +281 -0
  1546. package/vendor/symengine/symengine/matrices/conjugate_matrix.cpp +139 -0
  1547. package/vendor/symengine/symengine/matrices/conjugate_matrix.h +39 -0
  1548. package/vendor/symengine/symengine/matrices/diagonal_matrix.cpp +79 -0
  1549. package/vendor/symengine/symengine/matrices/diagonal_matrix.h +52 -0
  1550. package/vendor/symengine/symengine/matrices/hadamard_product.cpp +151 -0
  1551. package/vendor/symengine/symengine/matrices/hadamard_product.h +42 -0
  1552. package/vendor/symengine/symengine/matrices/identity_matrix.cpp +63 -0
  1553. package/vendor/symengine/symengine/matrices/identity_matrix.h +40 -0
  1554. package/vendor/symengine/symengine/matrices/immutable_dense_matrix.cpp +143 -0
  1555. package/vendor/symengine/symengine/matrices/immutable_dense_matrix.h +65 -0
  1556. package/vendor/symengine/symengine/matrices/is_diagonal.cpp +115 -0
  1557. package/vendor/symengine/symengine/matrices/is_lower.cpp +110 -0
  1558. package/vendor/symengine/symengine/matrices/is_real.cpp +78 -0
  1559. package/vendor/symengine/symengine/matrices/is_square.cpp +85 -0
  1560. package/vendor/symengine/symengine/matrices/is_symmetric.cpp +112 -0
  1561. package/vendor/symengine/symengine/matrices/is_toeplitz.cpp +104 -0
  1562. package/vendor/symengine/symengine/matrices/is_upper.cpp +108 -0
  1563. package/vendor/symengine/symengine/matrices/is_zero.cpp +81 -0
  1564. package/vendor/symengine/symengine/matrices/matrix_add.cpp +176 -0
  1565. package/vendor/symengine/symengine/matrices/matrix_add.h +42 -0
  1566. package/vendor/symengine/symengine/matrices/matrix_expr.h +19 -0
  1567. package/vendor/symengine/symengine/matrices/matrix_mul.cpp +258 -0
  1568. package/vendor/symengine/symengine/matrices/matrix_mul.h +55 -0
  1569. package/vendor/symengine/symengine/matrices/matrix_symbol.cpp +34 -0
  1570. package/vendor/symengine/symengine/matrices/matrix_symbol.h +41 -0
  1571. package/vendor/symengine/symengine/matrices/size.cpp +121 -0
  1572. package/vendor/symengine/symengine/matrices/size.h +15 -0
  1573. package/vendor/symengine/symengine/matrices/trace.cpp +112 -0
  1574. package/vendor/symengine/symengine/matrices/trace.h +31 -0
  1575. package/vendor/symengine/symengine/matrices/transpose.cpp +126 -0
  1576. package/vendor/symengine/symengine/matrices/transpose.h +39 -0
  1577. package/vendor/symengine/symengine/matrices/zero_matrix.cpp +94 -0
  1578. package/vendor/symengine/symengine/matrices/zero_matrix.h +47 -0
  1579. package/vendor/symengine/symengine/matrix.cpp +33 -0
  1580. package/vendor/symengine/symengine/matrix.h +675 -0
  1581. package/vendor/symengine/symengine/matrix_expressions.h +51 -0
  1582. package/vendor/symengine/symengine/monomials.cpp +33 -0
  1583. package/vendor/symengine/symengine/monomials.h +20 -0
  1584. package/vendor/symengine/symengine/mp_boost.cpp +635 -0
  1585. package/vendor/symengine/symengine/mp_class.h +1286 -0
  1586. package/vendor/symengine/symengine/mp_wrapper.h +510 -0
  1587. package/vendor/symengine/symengine/mul.cpp +629 -0
  1588. package/vendor/symengine/symengine/mul.h +146 -0
  1589. package/vendor/symengine/symengine/nan.cpp +234 -0
  1590. package/vendor/symengine/symengine/nan.h +82 -0
  1591. package/vendor/symengine/symengine/ntheory.cpp +1700 -0
  1592. package/vendor/symengine/symengine/ntheory.h +213 -0
  1593. package/vendor/symengine/symengine/ntheory_funcs.cpp +189 -0
  1594. package/vendor/symengine/symengine/ntheory_funcs.h +78 -0
  1595. package/vendor/symengine/symengine/number.cpp +36 -0
  1596. package/vendor/symengine/symengine/number.h +256 -0
  1597. package/vendor/symengine/symengine/numer_denom.cpp +149 -0
  1598. package/vendor/symengine/symengine/parser/parser.cpp +367 -0
  1599. package/vendor/symengine/symengine/parser/parser.h +56 -0
  1600. package/vendor/symengine/symengine/parser/parser.tab.cc +1495 -0
  1601. package/vendor/symengine/symengine/parser/parser.tab.hh +1410 -0
  1602. package/vendor/symengine/symengine/parser/parser_old.cpp +688 -0
  1603. package/vendor/symengine/symengine/parser/tokenizer.cpp +435 -0
  1604. package/vendor/symengine/symengine/parser/tokenizer.h +35 -0
  1605. package/vendor/symengine/symengine/parser.h +25 -0
  1606. package/vendor/symengine/symengine/polys/basic_conversions.cpp +178 -0
  1607. package/vendor/symengine/symengine/polys/basic_conversions.h +575 -0
  1608. package/vendor/symengine/symengine/polys/cancel.h +39 -0
  1609. package/vendor/symengine/symengine/polys/msymenginepoly.cpp +130 -0
  1610. package/vendor/symengine/symengine/polys/msymenginepoly.h +536 -0
  1611. package/vendor/symengine/symengine/polys/uexprpoly.cpp +90 -0
  1612. package/vendor/symengine/symengine/polys/uexprpoly.h +205 -0
  1613. package/vendor/symengine/symengine/polys/uintpoly.cpp +62 -0
  1614. package/vendor/symengine/symengine/polys/uintpoly.h +134 -0
  1615. package/vendor/symengine/symengine/polys/uintpoly_flint.h +228 -0
  1616. package/vendor/symengine/symengine/polys/uintpoly_piranha.h +373 -0
  1617. package/vendor/symengine/symengine/polys/upolybase.h +769 -0
  1618. package/vendor/symengine/symengine/polys/uratpoly.cpp +59 -0
  1619. package/vendor/symengine/symengine/polys/uratpoly.h +58 -0
  1620. package/vendor/symengine/symengine/polys/usymenginepoly.h +139 -0
  1621. package/vendor/symengine/symengine/pow.cpp +303 -0
  1622. package/vendor/symengine/symengine/pow.h +76 -0
  1623. package/vendor/symengine/symengine/prime_sieve.cpp +143 -0
  1624. package/vendor/symengine/symengine/prime_sieve.h +64 -0
  1625. package/vendor/symengine/symengine/printers/codegen.cpp +716 -0
  1626. package/vendor/symengine/symengine/printers/codegen.h +168 -0
  1627. package/vendor/symengine/symengine/printers/latex.cpp +630 -0
  1628. package/vendor/symengine/symengine/printers/latex.h +76 -0
  1629. package/vendor/symengine/symengine/printers/mathml.cpp +358 -0
  1630. package/vendor/symengine/symengine/printers/mathml.h +62 -0
  1631. package/vendor/symengine/symengine/printers/stringbox.cpp +276 -0
  1632. package/vendor/symengine/symengine/printers/stringbox.h +60 -0
  1633. package/vendor/symengine/symengine/printers/strprinter.cpp +1212 -0
  1634. package/vendor/symengine/symengine/printers/strprinter.h +217 -0
  1635. package/vendor/symengine/symengine/printers/unicode.cpp +730 -0
  1636. package/vendor/symengine/symengine/printers/unicode.h +84 -0
  1637. package/vendor/symengine/symengine/printers.h +46 -0
  1638. package/vendor/symengine/symengine/rational.cpp +365 -0
  1639. package/vendor/symengine/symengine/rational.h +341 -0
  1640. package/vendor/symengine/symengine/real_double.cpp +388 -0
  1641. package/vendor/symengine/symengine/real_double.h +492 -0
  1642. package/vendor/symengine/symengine/real_mpfr.h +379 -0
  1643. package/vendor/symengine/symengine/refine.cpp +213 -0
  1644. package/vendor/symengine/symengine/refine.h +43 -0
  1645. package/vendor/symengine/symengine/rewrite.cpp +235 -0
  1646. package/vendor/symengine/symengine/rings.cpp +107 -0
  1647. package/vendor/symengine/symengine/rings.h +24 -0
  1648. package/vendor/symengine/symengine/serialize-cereal.h +964 -0
  1649. package/vendor/symengine/symengine/series.cpp +85 -0
  1650. package/vendor/symengine/symengine/series.h +727 -0
  1651. package/vendor/symengine/symengine/series_flint.h +214 -0
  1652. package/vendor/symengine/symengine/series_generic.cpp +247 -0
  1653. package/vendor/symengine/symengine/series_generic.h +86 -0
  1654. package/vendor/symengine/symengine/series_piranha.h +95 -0
  1655. package/vendor/symengine/symengine/series_visitor.h +357 -0
  1656. package/vendor/symengine/symengine/set_funcs.cpp +296 -0
  1657. package/vendor/symengine/symengine/sets.cpp +1854 -0
  1658. package/vendor/symengine/symengine/sets.h +696 -0
  1659. package/vendor/symengine/symengine/simplify.cpp +62 -0
  1660. package/vendor/symengine/symengine/simplify.h +34 -0
  1661. package/vendor/symengine/symengine/solve.cpp +665 -0
  1662. package/vendor/symengine/symengine/solve.h +117 -0
  1663. package/vendor/symengine/symengine/sparse_matrix.cpp +776 -0
  1664. package/vendor/symengine/symengine/special_boost.cpp +85 -0
  1665. package/vendor/symengine/symengine/special_double.h +570 -0
  1666. package/vendor/symengine/symengine/subs.h +579 -0
  1667. package/vendor/symengine/symengine/symbol.cpp +88 -0
  1668. package/vendor/symengine/symengine/symbol.h +116 -0
  1669. package/vendor/symengine/symengine/symengine_assert.h +50 -0
  1670. package/vendor/symengine/symengine/symengine_casts.h +139 -0
  1671. package/vendor/symengine/symengine/symengine_exception.h +101 -0
  1672. package/vendor/symengine/symengine/symengine_rcp.cpp +21 -0
  1673. package/vendor/symengine/symengine/symengine_rcp.h +384 -0
  1674. package/vendor/symengine/symengine/test_visitors.cpp +1083 -0
  1675. package/vendor/symengine/symengine/test_visitors.h +466 -0
  1676. package/vendor/symengine/symengine/tribool.h +85 -0
  1677. package/vendor/symengine/symengine/tuple.cpp +47 -0
  1678. package/vendor/symengine/symengine/tuple.h +32 -0
  1679. package/vendor/symengine/symengine/type_codes.inc +139 -0
  1680. package/vendor/symengine/symengine/utilities/cereal/LICENSE +24 -0
  1681. package/vendor/symengine/symengine/utilities/cereal/include/cereal/access.hpp +351 -0
  1682. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/adapters.hpp +163 -0
  1683. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/binary.hpp +169 -0
  1684. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/json.hpp +1024 -0
  1685. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/portable_binary.hpp +334 -0
  1686. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/xml.hpp +956 -0
  1687. package/vendor/symengine/symengine/utilities/cereal/include/cereal/cereal.hpp +1120 -0
  1688. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/helpers.hpp +422 -0
  1689. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/polymorphic_impl.hpp +825 -0
  1690. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/polymorphic_impl_fwd.hpp +65 -0
  1691. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/static_object.hpp +128 -0
  1692. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/traits.hpp +1411 -0
  1693. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/util.hpp +84 -0
  1694. package/vendor/symengine/symengine/utilities/cereal/include/cereal/macros.hpp +156 -0
  1695. package/vendor/symengine/symengine/utilities/cereal/include/cereal/specialize.hpp +139 -0
  1696. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/array.hpp +79 -0
  1697. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/atomic.hpp +55 -0
  1698. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/base_class.hpp +203 -0
  1699. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/bitset.hpp +176 -0
  1700. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/boost_variant.hpp +164 -0
  1701. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/chrono.hpp +72 -0
  1702. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/common.hpp +129 -0
  1703. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/complex.hpp +56 -0
  1704. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/concepts/pair_associative_container.hpp +73 -0
  1705. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/deque.hpp +62 -0
  1706. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/forward_list.hpp +68 -0
  1707. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/functional.hpp +43 -0
  1708. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/list.hpp +62 -0
  1709. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/map.hpp +36 -0
  1710. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/memory.hpp +425 -0
  1711. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/optional.hpp +65 -0
  1712. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/polymorphic.hpp +483 -0
  1713. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/queue.hpp +132 -0
  1714. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/set.hpp +103 -0
  1715. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/stack.hpp +76 -0
  1716. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/string.hpp +61 -0
  1717. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/tuple.hpp +123 -0
  1718. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/unordered_map.hpp +36 -0
  1719. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/unordered_set.hpp +99 -0
  1720. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/utility.hpp +47 -0
  1721. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/valarray.hpp +89 -0
  1722. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/variant.hpp +108 -0
  1723. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/vector.hpp +112 -0
  1724. package/vendor/symengine/symengine/utilities/cereal/include/cereal/version.hpp +52 -0
  1725. package/vendor/symengine/symengine/utilities/fast_float/include/fast_float/fast_float.h +3720 -0
  1726. package/vendor/symengine/symengine/utilities/stream_fmt.h +25 -0
  1727. package/vendor/symengine/symengine/visitor.cpp +348 -0
  1728. package/vendor/symengine/symengine/visitor.h +425 -0
@@ -0,0 +1,2100 @@
1
+ #include <symengine/matrix.h>
2
+ #include <symengine/number.h>
3
+ #include <symengine/add.h>
4
+ #include <symengine/functions.h>
5
+ #include <symengine/pow.h>
6
+ #include <symengine/subs.h>
7
+ #include <symengine/symengine_exception.h>
8
+ #include <symengine/polys/uexprpoly.h>
9
+ #include <symengine/solve.h>
10
+ #include <symengine/test_visitors.h>
11
+ #if HAVE_SYMENGINE_RTTI
12
+ #include <symengine/serialize-cereal.h>
13
+ #endif
14
+
15
+ namespace SymEngine
16
+ {
17
+
18
+ // Constructors
19
+ DenseMatrix::DenseMatrix() {}
20
+
21
+ DenseMatrix::DenseMatrix(unsigned row, unsigned col) : row_(row), col_(col)
22
+ {
23
+ m_ = std::vector<RCP<const Basic>>(row * col);
24
+ }
25
+
26
+ DenseMatrix::DenseMatrix(unsigned row, unsigned col, const vec_basic &l)
27
+ : m_{l}, row_(row), col_(col){SYMENGINE_ASSERT(m_.size() == row * col)}
28
+
29
+ DenseMatrix::DenseMatrix(const vec_basic &column_elements)
30
+ : m_(column_elements), row_(static_cast<unsigned>(column_elements.size())),
31
+ col_(1)
32
+ {
33
+ }
34
+
35
+ // Resize the Matrix
36
+ void DenseMatrix::resize(unsigned row, unsigned col)
37
+ {
38
+ row_ = row;
39
+ col_ = col;
40
+ m_.resize(row * col);
41
+ }
42
+
43
+ // Get and set elements
44
+ RCP<const Basic> DenseMatrix::get(unsigned i, unsigned j) const
45
+ {
46
+ SYMENGINE_ASSERT(i < row_ and j < col_);
47
+ return m_[i * col_ + j];
48
+ }
49
+
50
+ void DenseMatrix::set(unsigned i, unsigned j, const RCP<const Basic> &e)
51
+ {
52
+ SYMENGINE_ASSERT(i < row_ and j < col_);
53
+ m_[i * col_ + j] = e;
54
+ }
55
+
56
+ // Flat (row major) view of Matrix
57
+ vec_basic DenseMatrix::as_vec_basic() const
58
+ {
59
+ return m_;
60
+ }
61
+
62
+ RCP<const Basic> DenseMatrix::trace() const
63
+ {
64
+ SYMENGINE_ASSERT(row_ == col_);
65
+ unsigned offset = 0;
66
+ vec_basic diag;
67
+ for (unsigned i = 0; i < row_; i++) {
68
+ diag.push_back(m_[offset]);
69
+ offset += row_ + 1;
70
+ }
71
+ auto sum = add(diag);
72
+ return sum;
73
+ }
74
+
75
+ unsigned DenseMatrix::rank() const
76
+ {
77
+ throw NotImplementedError("Not Implemented");
78
+ }
79
+
80
+ bool DenseMatrix::is_lower() const
81
+ {
82
+ auto A = *this;
83
+ unsigned n = A.nrows();
84
+ for (unsigned i = 1; i < n; ++i) {
85
+ for (unsigned j = 0; j < i; ++j) {
86
+ if (not is_number_and_zero(*A.get(i, j))) {
87
+ return false;
88
+ }
89
+ }
90
+ }
91
+ return true;
92
+ }
93
+
94
+ bool DenseMatrix::is_upper() const
95
+ {
96
+ auto A = *this;
97
+ unsigned n = A.nrows();
98
+ for (unsigned i = 0; i < n - 1; ++i) {
99
+ for (unsigned j = i + 1; j < n; ++j) {
100
+ if (not is_number_and_zero(*A.get(i, j))) {
101
+ return false;
102
+ }
103
+ }
104
+ }
105
+ return true;
106
+ }
107
+
108
+ tribool DenseMatrix::is_zero() const
109
+ {
110
+ auto A = *this;
111
+ tribool cur = tribool::tritrue;
112
+ for (auto &e : m_) {
113
+ cur = and_tribool(cur, SymEngine::is_zero(*e));
114
+ if (is_false(cur)) {
115
+ return cur;
116
+ }
117
+ }
118
+ return cur;
119
+ }
120
+
121
+ tribool DenseMatrix::is_diagonal() const
122
+ {
123
+ auto A = *this;
124
+ if (not A.is_square()) {
125
+ return tribool::trifalse;
126
+ }
127
+ unsigned ncols = A.ncols();
128
+ unsigned offset;
129
+ tribool cur = tribool::tritrue;
130
+ for (unsigned i = 0; i < ncols; i++) {
131
+ offset = i * ncols;
132
+ for (unsigned j = 0; j < ncols; j++) {
133
+ if (j != i) {
134
+ auto &e = m_[offset];
135
+ cur = and_tribool(cur, SymEngine::is_zero(*e));
136
+ if (is_false(cur)) {
137
+ return cur;
138
+ }
139
+ }
140
+ offset++;
141
+ }
142
+ }
143
+ return cur;
144
+ }
145
+
146
+ tribool DenseMatrix::is_real(const Assumptions *assumptions) const
147
+ {
148
+ RealVisitor visitor(assumptions);
149
+ tribool cur = tribool::tritrue;
150
+ for (auto &e : m_) {
151
+ cur = and_tribool(cur, visitor.apply(*e));
152
+ if (is_false(cur)) {
153
+ return cur;
154
+ }
155
+ }
156
+ return cur;
157
+ }
158
+
159
+ tribool DenseMatrix::is_symmetric() const
160
+ {
161
+ auto A = *this;
162
+ if (not A.is_square()) {
163
+ return tribool::trifalse;
164
+ }
165
+ unsigned ncols = A.ncols();
166
+ tribool cur = tribool::tritrue;
167
+ for (unsigned i = 0; i < ncols; i++) {
168
+ for (unsigned j = 0; j <= i; j++) {
169
+ if (j != i) {
170
+ auto &e = m_[i * ncols + j];
171
+ auto &e2 = m_[j * ncols + i];
172
+ cur = and_tribool(cur, SymEngine::is_zero(*sub(e, e2)));
173
+ }
174
+ if (is_false(cur)) {
175
+ return cur;
176
+ }
177
+ }
178
+ }
179
+ return cur;
180
+ }
181
+
182
+ tribool DenseMatrix::is_hermitian() const
183
+ {
184
+ auto A = *this;
185
+ if (not A.is_square()) {
186
+ return tribool::trifalse;
187
+ }
188
+ unsigned ncols = A.ncols();
189
+ tribool cur = tribool::tritrue;
190
+ for (unsigned i = 0; i < ncols; i++) {
191
+ for (unsigned j = 0; j <= i; j++) {
192
+ auto &e = m_[i * ncols + j];
193
+ if (j != i) {
194
+ auto &e2 = m_[j * ncols + i];
195
+ cur = and_tribool(
196
+ cur, SymEngine::is_zero(*sub(e, SymEngine::conjugate(e2))));
197
+ } else {
198
+ cur = and_tribool(cur, SymEngine::is_real(*e));
199
+ }
200
+ if (is_false(cur)) {
201
+ return cur;
202
+ }
203
+ }
204
+ }
205
+ return cur;
206
+ }
207
+
208
+ tribool DenseMatrix::is_weakly_diagonally_dominant() const
209
+ {
210
+ auto A = *this;
211
+ if (not A.is_square()) {
212
+ return tribool::trifalse;
213
+ }
214
+
215
+ unsigned ncols = A.ncols();
216
+ RCP<const Basic> diag;
217
+ RCP<const Basic> sum;
218
+ tribool diagdom = tribool::tritrue;
219
+ for (unsigned i = 0; i < ncols; i++) {
220
+ sum = zero;
221
+ for (unsigned j = 0; j < ncols; j++) {
222
+ auto &e = m_[i * ncols + j];
223
+ if (i == j) {
224
+ diag = abs(e);
225
+ } else {
226
+ sum = add(sum, abs(e));
227
+ }
228
+ }
229
+ diagdom = and_tribool(diagdom, is_nonnegative(*sub(diag, sum)));
230
+ if (is_false(diagdom)) {
231
+ return diagdom;
232
+ }
233
+ }
234
+ return diagdom;
235
+ }
236
+
237
+ tribool DenseMatrix::is_strictly_diagonally_dominant() const
238
+ {
239
+ auto A = *this;
240
+ if (not A.is_square()) {
241
+ return tribool::trifalse;
242
+ }
243
+
244
+ unsigned ncols = A.ncols();
245
+ RCP<const Basic> diag;
246
+ RCP<const Basic> sum;
247
+ tribool diagdom = tribool::tritrue;
248
+ for (unsigned i = 0; i < ncols; i++) {
249
+ sum = zero;
250
+ for (unsigned j = 0; j < ncols; j++) {
251
+ auto &e = m_[i * ncols + j];
252
+ if (i == j) {
253
+ diag = abs(e);
254
+ } else {
255
+ sum = add(sum, abs(e));
256
+ }
257
+ }
258
+ diagdom = and_tribool(diagdom, is_positive(*sub(diag, sum)));
259
+ if (is_false(diagdom)) {
260
+ return diagdom;
261
+ }
262
+ }
263
+ return diagdom;
264
+ }
265
+
266
+ tribool DenseMatrix::shortcut_to_posdef() const
267
+ {
268
+ tribool is_diagonal_positive = tribool::tritrue;
269
+ unsigned offset = 0;
270
+ for (unsigned i = 0; i < row_; i++) {
271
+ is_diagonal_positive
272
+ = and_tribool(is_diagonal_positive, is_positive(*m_[offset]));
273
+ if (is_false(is_diagonal_positive))
274
+ return is_diagonal_positive;
275
+ offset += row_ + 1;
276
+ }
277
+ if (is_true(and_tribool(is_diagonal_positive,
278
+ this->is_strictly_diagonally_dominant())))
279
+ return tribool::tritrue;
280
+ return tribool::indeterminate;
281
+ }
282
+
283
+ tribool DenseMatrix::is_positive_definite_GE()
284
+ {
285
+ auto size = row_;
286
+ for (unsigned i = 0; i < size; i++) {
287
+ auto ispos = is_positive(*m_[i * size + i]);
288
+ if (!is_true(ispos))
289
+ return ispos;
290
+ for (unsigned j = i + 1; j < size; j++) {
291
+ for (unsigned k = i + 1; k < size; k++) {
292
+ m_[j * size + k] = sub(mul(m_[i * size + i], m_[j * size + k]),
293
+ mul(m_[j * size + i], m_[i * size + k]));
294
+ }
295
+ }
296
+ }
297
+ return tribool::tritrue;
298
+ }
299
+
300
+ tribool DenseMatrix::is_positive_definite() const
301
+ {
302
+
303
+ auto A = *this;
304
+ std::unique_ptr<DenseMatrix> B;
305
+ const DenseMatrix *H;
306
+ if (!is_true(A.is_hermitian())) {
307
+ if (!A.is_square())
308
+ return tribool::trifalse;
309
+ DenseMatrix tmp1 = DenseMatrix(A.row_, A.col_);
310
+ B = std::unique_ptr<DenseMatrix>(new DenseMatrix(A.row_, A.col_));
311
+ A.conjugate_transpose(tmp1);
312
+ add_dense_dense(A, tmp1, *B.get());
313
+ H = B.get();
314
+ } else {
315
+ H = this;
316
+ }
317
+
318
+ tribool shortcut = H->shortcut_to_posdef();
319
+ if (!is_indeterminate(shortcut))
320
+ return shortcut;
321
+
322
+ if (!B) {
323
+ B = std::unique_ptr<DenseMatrix>(new DenseMatrix(A));
324
+ }
325
+ return B->is_positive_definite_GE();
326
+ }
327
+
328
+ tribool DenseMatrix::is_negative_definite() const
329
+ {
330
+ auto res = DenseMatrix(row_, col_);
331
+ mul_dense_scalar(*this, integer(-1), res);
332
+ return res.is_positive_definite();
333
+ }
334
+
335
+ RCP<const Basic> DenseMatrix::det() const
336
+ {
337
+ return det_bareis(*this);
338
+ }
339
+
340
+ void DenseMatrix::inv(MatrixBase &result) const
341
+ {
342
+ if (is_a<DenseMatrix>(result)) {
343
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
344
+ inverse_pivoted_LU(*this, r);
345
+ }
346
+ }
347
+
348
+ void DenseMatrix::add_matrix(const MatrixBase &other, MatrixBase &result) const
349
+ {
350
+ SYMENGINE_ASSERT(row_ == result.nrows() and col_ == result.ncols());
351
+
352
+ if (is_a<DenseMatrix>(other) and is_a<DenseMatrix>(result)) {
353
+ const DenseMatrix &o = down_cast<const DenseMatrix &>(other);
354
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
355
+ add_dense_dense(*this, o, r);
356
+ }
357
+ }
358
+
359
+ void DenseMatrix::mul_matrix(const MatrixBase &other, MatrixBase &result) const
360
+ {
361
+ SYMENGINE_ASSERT(row_ == result.nrows()
362
+ and other.ncols() == result.ncols());
363
+
364
+ if (is_a<DenseMatrix>(other) and is_a<DenseMatrix>(result)) {
365
+ const DenseMatrix &o = down_cast<const DenseMatrix &>(other);
366
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
367
+ mul_dense_dense(*this, o, r);
368
+ }
369
+ }
370
+
371
+ void DenseMatrix::elementwise_mul_matrix(const MatrixBase &other,
372
+ MatrixBase &result) const
373
+ {
374
+ SYMENGINE_ASSERT(row_ == result.nrows() and col_ == result.ncols()
375
+ and row_ == other.nrows() and col_ == other.ncols());
376
+
377
+ if (is_a<DenseMatrix>(other) and is_a<DenseMatrix>(result)) {
378
+ const DenseMatrix &o = down_cast<const DenseMatrix &>(other);
379
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
380
+ elementwise_mul_dense_dense(*this, o, r);
381
+ }
382
+ }
383
+
384
+ // Add a scalar
385
+ void DenseMatrix::add_scalar(const RCP<const Basic> &k,
386
+ MatrixBase &result) const
387
+ {
388
+ if (is_a<DenseMatrix>(result)) {
389
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
390
+ add_dense_scalar(*this, k, r);
391
+ }
392
+ }
393
+
394
+ // Multiply by a scalar
395
+ void DenseMatrix::mul_scalar(const RCP<const Basic> &k,
396
+ MatrixBase &result) const
397
+ {
398
+ if (is_a<DenseMatrix>(result)) {
399
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
400
+ mul_dense_scalar(*this, k, r);
401
+ }
402
+ }
403
+
404
+ // Matrix conjugate
405
+ void DenseMatrix::conjugate(MatrixBase &result) const
406
+ {
407
+ if (is_a<DenseMatrix>(result)) {
408
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
409
+ conjugate_dense(*this, r);
410
+ }
411
+ }
412
+
413
+ // Matrix transpose
414
+ void DenseMatrix::transpose(MatrixBase &result) const
415
+ {
416
+ if (is_a<DenseMatrix>(result)) {
417
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
418
+ transpose_dense(*this, r);
419
+ }
420
+ }
421
+
422
+ // Matrix conjugate transpose
423
+ void DenseMatrix::conjugate_transpose(MatrixBase &result) const
424
+ {
425
+ if (is_a<DenseMatrix>(result)) {
426
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
427
+ conjugate_transpose_dense(*this, r);
428
+ }
429
+ }
430
+
431
+ // Extract out a submatrix
432
+ void DenseMatrix::submatrix(MatrixBase &result, unsigned row_start,
433
+ unsigned col_start, unsigned row_end,
434
+ unsigned col_end, unsigned row_step,
435
+ unsigned col_step) const
436
+ {
437
+ if (is_a<DenseMatrix>(result)) {
438
+ DenseMatrix &r = down_cast<DenseMatrix &>(result);
439
+ submatrix_dense(*this, r, row_start, col_start, row_end, col_end,
440
+ row_step, col_step);
441
+ }
442
+ }
443
+
444
+ // LU factorization
445
+ void DenseMatrix::LU(MatrixBase &L, MatrixBase &U) const
446
+ {
447
+ if (is_a<DenseMatrix>(L) and is_a<DenseMatrix>(U)) {
448
+ DenseMatrix &L_ = down_cast<DenseMatrix &>(L);
449
+ DenseMatrix &U_ = down_cast<DenseMatrix &>(U);
450
+ SymEngine::LU(*this, L_, U_);
451
+ }
452
+ }
453
+
454
+ // LDL factorization
455
+ void DenseMatrix::LDL(MatrixBase &L, MatrixBase &D) const
456
+ {
457
+ if (is_a<DenseMatrix>(L) and is_a<DenseMatrix>(D)) {
458
+ DenseMatrix &L_ = down_cast<DenseMatrix &>(L);
459
+ DenseMatrix &D_ = down_cast<DenseMatrix &>(D);
460
+ SymEngine::LDL(*this, L_, D_);
461
+ }
462
+ }
463
+
464
+ // Solve Ax = b using LU factorization
465
+ void DenseMatrix::LU_solve(const MatrixBase &b, MatrixBase &x) const
466
+ {
467
+ if (is_a<DenseMatrix>(b) and is_a<DenseMatrix>(x)) {
468
+ const DenseMatrix &b_ = down_cast<const DenseMatrix &>(b);
469
+ DenseMatrix &x_ = down_cast<DenseMatrix &>(x);
470
+ SymEngine::LU_solve(*this, b_, x_);
471
+ }
472
+ }
473
+
474
+ // Fraction free LU factorization
475
+ void DenseMatrix::FFLU(MatrixBase &LU) const
476
+ {
477
+ if (is_a<DenseMatrix>(LU)) {
478
+ DenseMatrix &LU_ = down_cast<DenseMatrix &>(LU);
479
+ fraction_free_LU(*this, LU_);
480
+ }
481
+ }
482
+
483
+ // Fraction free LDU factorization
484
+ void DenseMatrix::FFLDU(MatrixBase &L, MatrixBase &D, MatrixBase &U) const
485
+ {
486
+ if (is_a<DenseMatrix>(L) and is_a<DenseMatrix>(D)
487
+ and is_a<DenseMatrix>(U)) {
488
+ DenseMatrix &L_ = down_cast<DenseMatrix &>(L);
489
+ DenseMatrix &D_ = down_cast<DenseMatrix &>(D);
490
+ DenseMatrix &U_ = down_cast<DenseMatrix &>(U);
491
+ fraction_free_LDU(*this, L_, D_, U_);
492
+ }
493
+ }
494
+
495
+ // QR factorization
496
+ void DenseMatrix::QR(MatrixBase &Q, MatrixBase &R) const
497
+ {
498
+ if (is_a<DenseMatrix>(Q) and is_a<DenseMatrix>(R)) {
499
+ DenseMatrix &Q_ = down_cast<DenseMatrix &>(Q);
500
+ DenseMatrix &R_ = down_cast<DenseMatrix &>(R);
501
+ SymEngine::QR(*this, Q_, R_);
502
+ }
503
+ }
504
+
505
+ // Cholesky decomposition
506
+ void DenseMatrix::cholesky(MatrixBase &L) const
507
+ {
508
+ if (is_a<DenseMatrix>(L)) {
509
+ DenseMatrix &L_ = down_cast<DenseMatrix &>(L);
510
+ SymEngine::cholesky(*this, L_);
511
+ }
512
+ }
513
+
514
+ // ---------------------------- Jacobian -------------------------------------//
515
+
516
+ void jacobian(const DenseMatrix &A, const DenseMatrix &x, DenseMatrix &result,
517
+ bool diff_cache)
518
+ {
519
+ SYMENGINE_ASSERT(A.col_ == 1);
520
+ SYMENGINE_ASSERT(x.col_ == 1);
521
+ SYMENGINE_ASSERT(A.row_ == result.nrows() and x.row_ == result.ncols());
522
+ bool error = false;
523
+ #pragma omp parallel for
524
+ for (unsigned i = 0; i < result.row_; i++) {
525
+ for (unsigned j = 0; j < result.col_; j++) {
526
+ if (is_a<Symbol>(*(x.m_[j]))) {
527
+ const RCP<const Symbol> x_
528
+ = rcp_static_cast<const Symbol>(x.m_[j]);
529
+ result.m_[i * result.col_ + j] = A.m_[i]->diff(x_, diff_cache);
530
+ } else {
531
+ error = true;
532
+ break;
533
+ }
534
+ }
535
+ }
536
+ if (error) {
537
+ throw SymEngineException(
538
+ "'x' must contain Symbols only. "
539
+ "Use sjacobian for SymPy style differentiation");
540
+ }
541
+ }
542
+
543
+ void sjacobian(const DenseMatrix &A, const DenseMatrix &x, DenseMatrix &result,
544
+ bool diff_cache)
545
+ {
546
+ SYMENGINE_ASSERT(A.col_ == 1);
547
+ SYMENGINE_ASSERT(x.col_ == 1);
548
+ SYMENGINE_ASSERT(A.row_ == result.nrows() and x.row_ == result.ncols());
549
+ #pragma omp parallel for
550
+ for (unsigned i = 0; i < result.row_; i++) {
551
+ for (unsigned j = 0; j < result.col_; j++) {
552
+ if (is_a<Symbol>(*(x.m_[j]))) {
553
+ const RCP<const Symbol> x_
554
+ = rcp_static_cast<const Symbol>(x.m_[j]);
555
+ result.m_[i * result.col_ + j] = A.m_[i]->diff(x_, diff_cache);
556
+ } else {
557
+ // TODO: Use a dummy symbol
558
+ const RCP<const Symbol> x_ = symbol("x_");
559
+ result.m_[i * result.col_ + j] = ssubs(
560
+ ssubs(A.m_[i], {{x.m_[j], x_}})->diff(x_, diff_cache),
561
+ {{x_, x.m_[j]}});
562
+ }
563
+ }
564
+ }
565
+ }
566
+
567
+ // ---------------------------- Diff -------------------------------------//
568
+
569
+ void diff(const DenseMatrix &A, const RCP<const Symbol> &x, DenseMatrix &result,
570
+ bool diff_cache)
571
+ {
572
+ SYMENGINE_ASSERT(A.row_ == result.nrows() and A.col_ == result.ncols());
573
+ #pragma omp parallel for
574
+ for (unsigned i = 0; i < result.row_; i++) {
575
+ for (unsigned j = 0; j < result.col_; j++) {
576
+ result.m_[i * result.col_ + j]
577
+ = A.m_[i * result.col_ + j]->diff(x, diff_cache);
578
+ }
579
+ }
580
+ }
581
+
582
+ void sdiff(const DenseMatrix &A, const RCP<const Basic> &x, DenseMatrix &result,
583
+ bool diff_cache)
584
+ {
585
+ SYMENGINE_ASSERT(A.row_ == result.nrows() and A.col_ == result.ncols());
586
+ #pragma omp parallel for
587
+ for (unsigned i = 0; i < result.row_; i++) {
588
+ for (unsigned j = 0; j < result.col_; j++) {
589
+ if (is_a<Symbol>(*x)) {
590
+ const RCP<const Symbol> x_ = rcp_static_cast<const Symbol>(x);
591
+ result.m_[i * result.col_ + j]
592
+ = A.m_[i * result.col_ + j]->diff(x_, diff_cache);
593
+ } else {
594
+ // TODO: Use a dummy symbol
595
+ const RCP<const Symbol> x_ = symbol("_x");
596
+ result.m_[i * result.col_ + j]
597
+ = ssubs(ssubs(A.m_[i * result.col_ + j], {{x, x_}})
598
+ ->diff(x_, diff_cache),
599
+ {{x_, x}});
600
+ }
601
+ }
602
+ }
603
+ }
604
+
605
+ // ----------------------------- Matrix Conjugate ----------------------------//
606
+ void conjugate_dense(const DenseMatrix &A, DenseMatrix &B)
607
+ {
608
+ SYMENGINE_ASSERT(B.col_ == A.col_ and B.row_ == A.row_);
609
+
610
+ for (unsigned i = 0; i < A.row_; i++)
611
+ for (unsigned j = 0; j < A.col_; j++)
612
+ B.m_[i * B.col_ + j] = conjugate(A.m_[i * A.col_ + j]);
613
+ }
614
+
615
+ // ----------------------------- Matrix Transpose ----------------------------//
616
+ void transpose_dense(const DenseMatrix &A, DenseMatrix &B)
617
+ {
618
+ SYMENGINE_ASSERT(B.row_ == A.col_ and B.col_ == A.row_);
619
+
620
+ for (unsigned i = 0; i < A.row_; i++)
621
+ for (unsigned j = 0; j < A.col_; j++)
622
+ B.m_[j * B.col_ + i] = A.m_[i * A.col_ + j];
623
+ }
624
+
625
+ // ----------------------------- Matrix Conjugate Transpose -----------------//
626
+ void conjugate_transpose_dense(const DenseMatrix &A, DenseMatrix &B)
627
+ {
628
+ SYMENGINE_ASSERT(B.row_ == A.col_ and B.col_ == A.row_);
629
+
630
+ for (unsigned i = 0; i < A.row_; i++)
631
+ for (unsigned j = 0; j < A.col_; j++)
632
+ B.m_[j * B.col_ + i] = conjugate(A.m_[i * A.col_ + j]);
633
+ }
634
+
635
+ // ------------------------------- Submatrix ---------------------------------//
636
+ void submatrix_dense(const DenseMatrix &A, DenseMatrix &B, unsigned row_start,
637
+ unsigned col_start, unsigned row_end, unsigned col_end,
638
+ unsigned row_step, unsigned col_step)
639
+ {
640
+ SYMENGINE_ASSERT(row_end >= row_start and col_end >= col_start);
641
+ SYMENGINE_ASSERT(row_end < A.row_);
642
+ SYMENGINE_ASSERT(col_end < A.col_);
643
+ SYMENGINE_ASSERT(B.row_ == row_end - row_start + 1
644
+ and B.col_ == col_end - col_start + 1);
645
+
646
+ unsigned row = B.row_, col = B.col_;
647
+
648
+ for (unsigned i = 0; i < row; i += row_step)
649
+ for (unsigned j = 0; j < col; j += col_step)
650
+ B.m_[i * col + j] = A.m_[(row_start + i) * A.col_ + col_start + j];
651
+ }
652
+
653
+ // ------------------------------- Matrix Addition ---------------------------//
654
+ void add_dense_dense(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &C)
655
+ {
656
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_ and A.row_ == C.row_
657
+ and A.col_ == C.col_);
658
+
659
+ unsigned row = A.row_, col = A.col_;
660
+
661
+ for (unsigned i = 0; i < row; i++) {
662
+ for (unsigned j = 0; j < col; j++) {
663
+ C.m_[i * col + j] = add(A.m_[i * col + j], B.m_[i * col + j]);
664
+ }
665
+ }
666
+ }
667
+
668
+ void add_dense_scalar(const DenseMatrix &A, const RCP<const Basic> &k,
669
+ DenseMatrix &B)
670
+ {
671
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_);
672
+
673
+ unsigned row = A.row_, col = A.col_;
674
+
675
+ for (unsigned i = 0; i < row; i++) {
676
+ for (unsigned j = 0; j < col; j++) {
677
+ B.m_[i * col + j] = add(A.m_[i * col + j], k);
678
+ }
679
+ }
680
+ }
681
+
682
+ // ------------------------------- Matrix Multiplication ---------------------//
683
+ void mul_dense_dense(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &C)
684
+ {
685
+ SYMENGINE_ASSERT(A.col_ == B.row_ and C.row_ == A.row_
686
+ and C.col_ == B.col_);
687
+
688
+ unsigned row = A.row_, col = B.col_;
689
+
690
+ if (&A != &C and &B != &C) {
691
+ for (unsigned r = 0; r < row; r++) {
692
+ for (unsigned c = 0; c < col; c++) {
693
+ C.m_[r * col + c] = zero; // Integer Zero
694
+ for (unsigned k = 0; k < A.col_; k++)
695
+ C.m_[r * col + c]
696
+ = add(C.m_[r * col + c],
697
+ mul(A.m_[r * A.col_ + k], B.m_[k * col + c]));
698
+ }
699
+ }
700
+ } else {
701
+ DenseMatrix tmp = DenseMatrix(A.row_, B.col_);
702
+ mul_dense_dense(A, B, tmp);
703
+ C = tmp;
704
+ }
705
+ }
706
+
707
+ void elementwise_mul_dense_dense(const DenseMatrix &A, const DenseMatrix &B,
708
+ DenseMatrix &C)
709
+ {
710
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_ and A.row_ == C.row_
711
+ and A.col_ == C.col_);
712
+
713
+ unsigned row = A.row_, col = A.col_;
714
+
715
+ for (unsigned i = 0; i < row; i++) {
716
+ for (unsigned j = 0; j < col; j++) {
717
+ C.m_[i * col + j] = mul(A.m_[i * col + j], B.m_[i * col + j]);
718
+ }
719
+ }
720
+ }
721
+
722
+ void mul_dense_scalar(const DenseMatrix &A, const RCP<const Basic> &k,
723
+ DenseMatrix &B)
724
+ {
725
+ SYMENGINE_ASSERT(A.col_ == B.col_ and A.row_ == B.row_);
726
+
727
+ unsigned row = A.row_, col = A.col_;
728
+
729
+ for (unsigned i = 0; i < row; i++) {
730
+ for (unsigned j = 0; j < col; j++) {
731
+ B.m_[i * col + j] = mul(A.m_[i * col + j], k);
732
+ }
733
+ }
734
+ }
735
+
736
+ // ---------------------------- Joining Operations ---------------------------//
737
+ void DenseMatrix::row_join(const DenseMatrix &B)
738
+ {
739
+ this->col_insert(B, col_);
740
+ }
741
+
742
+ void DenseMatrix::col_join(const DenseMatrix &B)
743
+ {
744
+ this->row_insert(B, row_);
745
+ }
746
+
747
+ void DenseMatrix::row_insert(const DenseMatrix &B, unsigned pos)
748
+ {
749
+ SYMENGINE_ASSERT(col_ == B.col_ and pos <= row_)
750
+
751
+ unsigned row = row_, col = col_;
752
+ this->resize(row_ + B.row_, col_);
753
+
754
+ for (unsigned i = row; i-- > pos;) {
755
+ for (unsigned j = col; j-- > 0;) {
756
+ this->m_[(i + B.row_) * col + j] = this->m_[i * col + j];
757
+ }
758
+ }
759
+
760
+ for (unsigned i = 0; i < B.row_; i++) {
761
+ for (unsigned j = 0; j < col; j++) {
762
+ this->m_[(i + pos) * col + j] = B.m_[i * col + j];
763
+ }
764
+ }
765
+ }
766
+
767
+ void DenseMatrix::col_insert(const DenseMatrix &B, unsigned pos)
768
+ {
769
+ SYMENGINE_ASSERT(row_ == B.row_ and pos <= col_)
770
+
771
+ unsigned row = row_, col = col_;
772
+ this->resize(row_, col_ + B.col_);
773
+
774
+ for (unsigned i = row; i-- > 0;) {
775
+ for (unsigned j = col; j-- > 0;) {
776
+ if (j >= pos) {
777
+ this->m_[i * (col + B.col_) + j + B.col_]
778
+ = this->m_[i * col + j];
779
+ } else {
780
+ this->m_[i * (col + B.col_) + j] = this->m_[i * col + j];
781
+ }
782
+ }
783
+ }
784
+
785
+ for (unsigned i = 0; i < row; i++) {
786
+ for (unsigned j = 0; j < B.col_; j++) {
787
+ this->m_[i * (col + B.col_) + j + pos] = B.m_[i * B.col_ + j];
788
+ }
789
+ }
790
+ }
791
+
792
+ void DenseMatrix::row_del(unsigned k)
793
+ {
794
+ SYMENGINE_ASSERT(k < row_)
795
+
796
+ if (row_ == 1)
797
+ this->resize(0, 0);
798
+ else {
799
+ for (unsigned i = k; i < row_ - 1; i++) {
800
+ row_exchange_dense(*this, i, i + 1);
801
+ }
802
+ this->resize(row_ - 1, col_);
803
+ }
804
+ }
805
+
806
+ void DenseMatrix::col_del(unsigned k)
807
+ {
808
+ SYMENGINE_ASSERT(k < col_)
809
+
810
+ if (col_ == 1)
811
+ this->resize(0, 0);
812
+ else {
813
+ unsigned row = row_, col = col_, m = 0;
814
+
815
+ for (unsigned i = 0; i < row; i++) {
816
+ for (unsigned j = 0; j < col; j++) {
817
+ if (j != k) {
818
+ this->m_[m] = this->m_[i * col + j];
819
+ m++;
820
+ }
821
+ }
822
+ }
823
+ this->resize(row_, col_ - 1);
824
+ }
825
+ }
826
+
827
+ // -------------------------------- Row Operations ---------------------------//
828
+ void row_exchange_dense(DenseMatrix &A, unsigned i, unsigned j)
829
+ {
830
+ SYMENGINE_ASSERT(i != j and i < A.row_ and j < A.row_);
831
+
832
+ unsigned col = A.col_;
833
+
834
+ for (unsigned k = 0; k < A.col_; k++)
835
+ std::swap(A.m_[i * col + k], A.m_[j * col + k]);
836
+ }
837
+
838
+ void row_mul_scalar_dense(DenseMatrix &A, unsigned i, RCP<const Basic> &c)
839
+ {
840
+ SYMENGINE_ASSERT(i < A.row_);
841
+
842
+ unsigned col = A.col_;
843
+
844
+ for (unsigned j = 0; j < A.col_; j++)
845
+ A.m_[i * col + j] = mul(c, A.m_[i * col + j]);
846
+ }
847
+
848
+ void row_add_row_dense(DenseMatrix &A, unsigned i, unsigned j,
849
+ RCP<const Basic> &c)
850
+ {
851
+ SYMENGINE_ASSERT(i != j and i < A.row_ and j < A.row_);
852
+
853
+ unsigned col = A.col_;
854
+
855
+ for (unsigned k = 0; k < A.col_; k++)
856
+ A.m_[i * col + k] = add(A.m_[i * col + k], mul(c, A.m_[j * col + k]));
857
+ }
858
+
859
+ void permuteFwd(DenseMatrix &A, permutelist &pl)
860
+ {
861
+ for (auto &p : pl) {
862
+ row_exchange_dense(A, p.first, p.second);
863
+ }
864
+ }
865
+
866
+ // ----------------------------- Column Operations ---------------------------//
867
+ void column_exchange_dense(DenseMatrix &A, unsigned i, unsigned j)
868
+ {
869
+ SYMENGINE_ASSERT(i != j and i < A.col_ and j < A.col_);
870
+
871
+ unsigned col = A.col_;
872
+
873
+ for (unsigned k = 0; k < A.row_; k++)
874
+ std::swap(A.m_[k * col + i], A.m_[k * col + j]);
875
+ }
876
+
877
+ // ------------------------------ Gaussian Elimination -----------------------//
878
+ void pivoted_gaussian_elimination(const DenseMatrix &A, DenseMatrix &B,
879
+ permutelist &pl)
880
+ {
881
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_);
882
+
883
+ unsigned row = A.row_, col = A.col_;
884
+ unsigned index = 0, i, j, k;
885
+ B.m_ = A.m_;
886
+
887
+ RCP<const Basic> scale;
888
+
889
+ for (i = 0; i < col - 1; i++) {
890
+ if (index == row)
891
+ break;
892
+
893
+ k = pivot(B, index, i);
894
+ if (k == row)
895
+ continue;
896
+ if (k != index) {
897
+ row_exchange_dense(B, k, index);
898
+ pl.push_back({k, index});
899
+ }
900
+
901
+ scale = div(one, B.m_[index * col + i]);
902
+ row_mul_scalar_dense(B, index, scale);
903
+
904
+ for (j = i + 1; j < row; j++) {
905
+ for (k = i + 1; k < col; k++)
906
+ B.m_[j * col + k]
907
+ = sub(B.m_[j * col + k],
908
+ mul(B.m_[j * col + i], B.m_[i * col + k]));
909
+ B.m_[j * col + i] = zero;
910
+ }
911
+
912
+ index++;
913
+ }
914
+ }
915
+
916
+ // Algorithm 1, page 12, Nakos, G. C., Turner, P. R., Williams, R. M. (1997).
917
+ // Fraction-free algorithms for linear and polynomial equations.
918
+ // ACM SIGSAM Bulletin, 31(3), 11–19. doi:10.1145/271130.271133.
919
+ void fraction_free_gaussian_elimination(const DenseMatrix &A, DenseMatrix &B)
920
+ {
921
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_);
922
+
923
+ unsigned col = A.col_;
924
+ B.m_ = A.m_;
925
+
926
+ for (unsigned i = 0; i < col - 1; i++)
927
+ for (unsigned j = i + 1; j < A.row_; j++) {
928
+ for (unsigned k = i + 1; k < col; k++) {
929
+ B.m_[j * col + k]
930
+ = sub(mul(B.m_[i * col + i], B.m_[j * col + k]),
931
+ mul(B.m_[j * col + i], B.m_[i * col + k]));
932
+ if (i > 0)
933
+ B.m_[j * col + k]
934
+ = div(B.m_[j * col + k], B.m_[i * col - col + i - 1]);
935
+ }
936
+ B.m_[j * col + i] = zero;
937
+ }
938
+ }
939
+
940
+ // Pivoted version of `fraction_free_gaussian_elimination`
941
+ void pivoted_fraction_free_gaussian_elimination(const DenseMatrix &A,
942
+ DenseMatrix &B, permutelist &pl)
943
+ {
944
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_);
945
+
946
+ unsigned col = A.col_, row = A.row_;
947
+ unsigned index = 0, i, k, j;
948
+ B.m_ = A.m_;
949
+
950
+ for (i = 0; i < col - 1; i++) {
951
+ if (index == row)
952
+ break;
953
+
954
+ k = pivot(B, index, i);
955
+ if (k == row)
956
+ continue;
957
+ if (k != index) {
958
+ row_exchange_dense(B, k, index);
959
+ pl.push_back({k, index});
960
+ }
961
+
962
+ for (j = i + 1; j < row; j++) {
963
+ for (k = i + 1; k < col; k++) {
964
+ B.m_[j * col + k]
965
+ = sub(mul(B.m_[i * col + i], B.m_[j * col + k]),
966
+ mul(B.m_[j * col + i], B.m_[i * col + k]));
967
+ if (i > 0)
968
+ B.m_[j * col + k]
969
+ = div(B.m_[j * col + k], B.m_[i * col - col + i - 1]);
970
+ }
971
+ B.m_[j * col + i] = zero;
972
+ }
973
+
974
+ index++;
975
+ }
976
+ }
977
+
978
+ void pivoted_gauss_jordan_elimination(const DenseMatrix &A, DenseMatrix &B,
979
+ permutelist &pl)
980
+ {
981
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_);
982
+
983
+ unsigned row = A.row_, col = A.col_;
984
+ unsigned index = 0, i, j, k;
985
+ RCP<const Basic> scale;
986
+ B.m_ = A.m_;
987
+
988
+ for (i = 0; i < col; i++) {
989
+ if (index == row)
990
+ break;
991
+
992
+ k = pivot(B, index, i);
993
+ if (k == row)
994
+ continue;
995
+ if (k != index) {
996
+ row_exchange_dense(B, k, index);
997
+ pl.push_back({k, index});
998
+ }
999
+
1000
+ scale = div(one, B.m_[index * col + i]);
1001
+ row_mul_scalar_dense(B, index, scale);
1002
+
1003
+ for (j = 0; j < row; j++) {
1004
+ if (j == index)
1005
+ continue;
1006
+
1007
+ scale = mul(minus_one, B.m_[j * col + i]);
1008
+ row_add_row_dense(B, j, index, scale);
1009
+ }
1010
+
1011
+ index++;
1012
+ }
1013
+ }
1014
+
1015
+ // Algorithm 2, page 13, Nakos, G. C., Turner, P. R., Williams, R. M. (1997).
1016
+ // Fraction-free algorithms for linear and polynomial equations.
1017
+ // ACM SIGSAM Bulletin, 31(3), 11–19. doi:10.1145/271130.271133.
1018
+ void fraction_free_gauss_jordan_elimination(const DenseMatrix &A,
1019
+ DenseMatrix &B)
1020
+ {
1021
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_);
1022
+
1023
+ unsigned row = A.row_, col = A.col_;
1024
+ unsigned i, j, k;
1025
+ RCP<const Basic> d;
1026
+
1027
+ B.m_ = A.m_;
1028
+
1029
+ for (i = 0; i < col; i++) {
1030
+ if (i > 0)
1031
+ d = B.m_[i * col - col + i - 1];
1032
+ for (j = 0; j < row; j++)
1033
+ if (j != i)
1034
+ for (k = 0; k < col; k++) {
1035
+ if (k != i) {
1036
+ B.m_[j * col + k]
1037
+ = sub(mul(B.m_[i * col + i], B.m_[j * col + k]),
1038
+ mul(B.m_[j * col + i], B.m_[i * col + k]));
1039
+ if (i > 0)
1040
+ B.m_[j * col + k] = div(B.m_[j * col + k], d);
1041
+ }
1042
+ }
1043
+ for (j = 0; j < row; j++)
1044
+ if (j != i)
1045
+ B.m_[j * col + i] = zero;
1046
+ }
1047
+ }
1048
+
1049
+ void pivoted_fraction_free_gauss_jordan_elimination(const DenseMatrix &A,
1050
+ DenseMatrix &B,
1051
+ permutelist &pl)
1052
+ {
1053
+ SYMENGINE_ASSERT(A.row_ == B.row_ and A.col_ == B.col_);
1054
+
1055
+ unsigned row = A.row_, col = A.col_;
1056
+ unsigned index = 0, i, k, j;
1057
+ RCP<const Basic> d;
1058
+
1059
+ B.m_ = A.m_;
1060
+
1061
+ for (i = 0; i < col; i++) {
1062
+ if (index == row)
1063
+ break;
1064
+
1065
+ k = pivot(B, index, i);
1066
+ if (k == row)
1067
+ continue;
1068
+ if (k != index) {
1069
+ row_exchange_dense(B, k, index);
1070
+ pl.push_back({k, index});
1071
+ }
1072
+
1073
+ for (j = 0; j < row; j++) {
1074
+ if (j == index)
1075
+ continue;
1076
+ for (k = 0; k < col; k++) {
1077
+ if (k == i)
1078
+ continue;
1079
+ B.m_[j * col + k]
1080
+ = sub(mul(B.m_[index * col + i], B.m_[j * col + k]),
1081
+ mul(B.m_[j * col + i], B.m_[index * col + k]));
1082
+ if (index == 0)
1083
+ continue;
1084
+ B.m_[j * col + k] = div(B.m_[j * col + k], d);
1085
+ }
1086
+ }
1087
+
1088
+ d = B.m_[index * col + i];
1089
+
1090
+ for (j = 0; j < row; j++) {
1091
+ if (j == index)
1092
+ continue;
1093
+ B.m_[j * col + i] = zero;
1094
+ }
1095
+ index++;
1096
+ }
1097
+ }
1098
+
1099
+ unsigned pivot(DenseMatrix &B, unsigned r, unsigned c)
1100
+ {
1101
+ for (unsigned k = r; k < B.row_; k++) {
1102
+ if (!is_true(is_zero(*(B.m_[k * B.col_ + c])))) {
1103
+ return k;
1104
+ }
1105
+ }
1106
+ return B.row_;
1107
+ }
1108
+
1109
+ void reduced_row_echelon_form(const DenseMatrix &A, DenseMatrix &b,
1110
+ vec_uint &pivot_cols, bool normalize_last)
1111
+ {
1112
+ permutelist pl;
1113
+ if (normalize_last) {
1114
+ pivoted_fraction_free_gauss_jordan_elimination(A, b, pl);
1115
+ } else {
1116
+ pivoted_gauss_jordan_elimination(A, b, pl);
1117
+ }
1118
+ unsigned row = 0;
1119
+ for (unsigned col = 0; col < b.col_ && row < b.row_; col++) {
1120
+ if (is_true(is_zero(*b.get(row, col))))
1121
+ continue;
1122
+ pivot_cols.push_back(col);
1123
+ if (row == 0 and normalize_last) {
1124
+ RCP<const Basic> m = div(one, b.get(row, col));
1125
+ b.mul_scalar(m, b);
1126
+ }
1127
+ row++;
1128
+ }
1129
+ }
1130
+
1131
+ // --------------------------- Solve Ax = b ---------------------------------//
1132
+ // Assuming A is a diagonal square matrix
1133
+ void diagonal_solve(const DenseMatrix &A, const DenseMatrix &b, DenseMatrix &x)
1134
+ {
1135
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1136
+ SYMENGINE_ASSERT(x.row_ == A.col_ and x.col_ == b.col_);
1137
+
1138
+ const unsigned sys = b.col_;
1139
+
1140
+ // No checks are done to see if the diagonal entries are zero
1141
+ for (unsigned k = 0; k < sys; k++) {
1142
+ for (unsigned i = 0; i < A.col_; i++) {
1143
+ x.m_[i * sys + k] = div(b.m_[i * sys + k], A.m_[i * A.col_ + i]);
1144
+ }
1145
+ }
1146
+ }
1147
+
1148
+ void back_substitution(const DenseMatrix &U, const DenseMatrix &b,
1149
+ DenseMatrix &x)
1150
+ {
1151
+ SYMENGINE_ASSERT(U.row_ == U.col_);
1152
+ SYMENGINE_ASSERT(b.row_ == U.row_);
1153
+ SYMENGINE_ASSERT(x.row_ == U.col_ and x.col_ == b.col_);
1154
+
1155
+ const unsigned col = U.col_;
1156
+ const unsigned sys = b.col_;
1157
+ x.m_ = b.m_;
1158
+
1159
+ for (unsigned k = 0; k < sys; k++) {
1160
+ for (int i = col - 1; i >= 0; i--) {
1161
+ for (unsigned j = i + 1; j < col; j++)
1162
+ x.m_[i * sys + k]
1163
+ = sub(x.m_[i * sys + k],
1164
+ mul(U.m_[i * col + j], x.m_[j * sys + k]));
1165
+ x.m_[i * sys + k] = div(x.m_[i * sys + k], U.m_[i * col + i]);
1166
+ }
1167
+ }
1168
+ }
1169
+
1170
+ void forward_substitution(const DenseMatrix &A, const DenseMatrix &b,
1171
+ DenseMatrix &x)
1172
+ {
1173
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1174
+ SYMENGINE_ASSERT(b.row_ == A.row_);
1175
+ SYMENGINE_ASSERT(x.row_ == A.col_ and x.col_ == b.col_);
1176
+
1177
+ unsigned col = A.col_;
1178
+ const unsigned sys = b.col_;
1179
+ x.m_ = b.m_;
1180
+
1181
+ for (unsigned k = 0; k < b.col_; k++) {
1182
+ for (unsigned i = 0; i < col - 1; i++) {
1183
+ for (unsigned j = i + 1; j < col; j++) {
1184
+ x.m_[j * sys + k]
1185
+ = sub(mul(A.m_[i * col + i], x.m_[j * sys + k]),
1186
+ mul(A.m_[j * col + i], x.m_[i * sys + k]));
1187
+ if (i > 0)
1188
+ x.m_[j * sys + k]
1189
+ = div(x.m_[j * sys + k], A.m_[(i - 1) * col + i - 1]);
1190
+ }
1191
+ }
1192
+ }
1193
+ }
1194
+
1195
+ void fraction_free_gaussian_elimination_solve(const DenseMatrix &A,
1196
+ const DenseMatrix &b,
1197
+ DenseMatrix &x)
1198
+ {
1199
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1200
+ SYMENGINE_ASSERT(b.row_ == A.row_ and x.row_ == A.row_);
1201
+ SYMENGINE_ASSERT(x.col_ == b.col_);
1202
+
1203
+ int i, j, k, col = A.col_, bcol = b.col_;
1204
+ DenseMatrix A_ = DenseMatrix(A.row_, A.col_, A.m_);
1205
+ DenseMatrix b_ = DenseMatrix(b.row_, b.col_, b.m_);
1206
+
1207
+ for (i = 0; i < col - 1; i++)
1208
+ for (j = i + 1; j < col; j++) {
1209
+ for (k = 0; k < bcol; k++) {
1210
+ b_.m_[j * bcol + k]
1211
+ = sub(mul(A_.m_[i * col + i], b_.m_[j * bcol + k]),
1212
+ mul(A_.m_[j * col + i], b_.m_[i * bcol + k]));
1213
+ if (i > 0)
1214
+ b_.m_[j * bcol + k] = div(b_.m_[j * bcol + k],
1215
+ A_.m_[i * col - col + i - 1]);
1216
+ }
1217
+
1218
+ for (k = i + 1; k < col; k++) {
1219
+ A_.m_[j * col + k]
1220
+ = sub(mul(A_.m_[i * col + i], A_.m_[j * col + k]),
1221
+ mul(A_.m_[j * col + i], A_.m_[i * col + k]));
1222
+ if (i > 0)
1223
+ A_.m_[j * col + k]
1224
+ = div(A_.m_[j * col + k], A_.m_[i * col - col + i - 1]);
1225
+ }
1226
+ A_.m_[j * col + i] = zero;
1227
+ }
1228
+
1229
+ for (i = 0; i < col * bcol; i++)
1230
+ x.m_[i] = zero; // Integer zero;
1231
+
1232
+ for (k = 0; k < bcol; k++) {
1233
+ for (i = col - 1; i >= 0; i--) {
1234
+ for (j = i + 1; j < col; j++)
1235
+ b_.m_[i * bcol + k]
1236
+ = sub(b_.m_[i * bcol + k],
1237
+ mul(A_.m_[i * col + j], x.m_[j * bcol + k]));
1238
+ x.m_[i * bcol + k] = div(b_.m_[i * bcol + k], A_.m_[i * col + i]);
1239
+ }
1240
+ }
1241
+ }
1242
+
1243
+ void fraction_free_gauss_jordan_solve(const DenseMatrix &A,
1244
+ const DenseMatrix &b, DenseMatrix &x,
1245
+ bool pivot)
1246
+ {
1247
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1248
+ SYMENGINE_ASSERT(b.row_ == A.row_ and x.row_ == A.row_);
1249
+ SYMENGINE_ASSERT(x.col_ == b.col_);
1250
+
1251
+ unsigned i, j, k, p, col = A.col_, bcol = b.col_;
1252
+ RCP<const Basic> d;
1253
+ DenseMatrix A_ = DenseMatrix(A.row_, A.col_, A.m_);
1254
+ DenseMatrix b_ = DenseMatrix(b.row_, b.col_, b.m_);
1255
+
1256
+ for (i = 0; i < col; i++) {
1257
+ if (i > 0)
1258
+ d = A_.m_[i * col - col + i - 1];
1259
+ if (pivot) {
1260
+ p = i;
1261
+ while (p < col and eq(*A_.m_[p * col + i], *zero)) {
1262
+ p++;
1263
+ }
1264
+ SYMENGINE_ASSERT(p != col);
1265
+ if (p != i) {
1266
+ // pivot A
1267
+ for (k = i; k < col; k++) {
1268
+ std::swap(A_.m_[p * col + k], A_.m_[i * col + k]);
1269
+ }
1270
+ for (k = 0; k < bcol; k++) {
1271
+ std::swap(b_.m_[p * bcol + k], b_.m_[i * bcol + k]);
1272
+ }
1273
+ }
1274
+ }
1275
+ for (j = 0; j < col; j++)
1276
+ if (j != i) {
1277
+ for (k = 0; k < bcol; k++) {
1278
+ b_.m_[j * bcol + k]
1279
+ = sub(mul(A_.m_[i * col + i], b_.m_[j * bcol + k]),
1280
+ mul(A_.m_[j * col + i], b_.m_[i * bcol + k]));
1281
+ if (i > 0)
1282
+ b_.m_[j * bcol + k] = div(b_.m_[j * bcol + k], d);
1283
+ }
1284
+
1285
+ for (k = 0; k < col; k++) {
1286
+ if (k != i) {
1287
+ A_.m_[j * col + k]
1288
+ = sub(mul(A_.m_[i * col + i], A_.m_[j * col + k]),
1289
+ mul(A_.m_[j * col + i], A_.m_[i * col + k]));
1290
+ if (i > 0)
1291
+ A_.m_[j * col + k] = div(A_.m_[j * col + k], d);
1292
+ }
1293
+ }
1294
+ }
1295
+
1296
+ for (j = 0; j < col; j++)
1297
+ if (j != i)
1298
+ A_.m_[j * col + i] = zero;
1299
+ }
1300
+
1301
+ // No checks are done to see if the diagonal entries are zero
1302
+ for (k = 0; k < bcol; k++)
1303
+ for (i = 0; i < col; i++)
1304
+ x.m_[i * bcol + k] = div(b_.m_[i * bcol + k], A_.m_[i * col + i]);
1305
+ }
1306
+
1307
+ void fraction_free_LU_solve(const DenseMatrix &A, const DenseMatrix &b,
1308
+ DenseMatrix &x)
1309
+ {
1310
+ DenseMatrix LU = DenseMatrix(A.nrows(), A.ncols());
1311
+ DenseMatrix x_ = DenseMatrix(b.nrows(), b.ncols());
1312
+
1313
+ fraction_free_LU(A, LU);
1314
+ forward_substitution(LU, b, x_);
1315
+ back_substitution(LU, x_, x);
1316
+ }
1317
+
1318
+ void LU_solve(const DenseMatrix &A, const DenseMatrix &b, DenseMatrix &x)
1319
+ {
1320
+ DenseMatrix L = DenseMatrix(A.nrows(), A.ncols());
1321
+ DenseMatrix U = DenseMatrix(A.nrows(), A.ncols());
1322
+ DenseMatrix x_ = DenseMatrix(b.nrows(), b.ncols());
1323
+
1324
+ LU(A, L, U);
1325
+ forward_substitution(L, b, x_);
1326
+ back_substitution(U, x_, x);
1327
+ }
1328
+
1329
+ void pivoted_LU_solve(const DenseMatrix &A, const DenseMatrix &b,
1330
+ DenseMatrix &x)
1331
+ {
1332
+ DenseMatrix L = DenseMatrix(A.nrows(), A.ncols());
1333
+ DenseMatrix U = DenseMatrix(A.nrows(), A.ncols());
1334
+ DenseMatrix x_ = DenseMatrix(b);
1335
+ permutelist pl;
1336
+
1337
+ pivoted_LU(A, L, U, pl);
1338
+ permuteFwd(x_, pl);
1339
+ forward_substitution(L, x_, x_);
1340
+ back_substitution(U, x_, x);
1341
+ }
1342
+
1343
+ void LDL_solve(const DenseMatrix &A, const DenseMatrix &b, DenseMatrix &x)
1344
+ {
1345
+ DenseMatrix L = DenseMatrix(A.nrows(), A.ncols());
1346
+ DenseMatrix D = DenseMatrix(A.nrows(), A.ncols());
1347
+ DenseMatrix x_ = DenseMatrix(b.nrows(), b.ncols());
1348
+
1349
+ if (not is_symmetric_dense(A))
1350
+ throw SymEngineException("Matrix must be symmetric");
1351
+
1352
+ LDL(A, L, D);
1353
+ forward_substitution(L, b, x);
1354
+ diagonal_solve(D, x, x_);
1355
+ transpose_dense(L, D);
1356
+ back_substitution(D, x_, x);
1357
+ }
1358
+
1359
+ // --------------------------- Matrix Decomposition --------------------------//
1360
+
1361
+ // Algorithm 3, page 14, Nakos, G. C., Turner, P. R., Williams, R. M. (1997).
1362
+ // Fraction-free algorithms for linear and polynomial equations.
1363
+ // ACM SIGSAM Bulletin, 31(3), 11–19. doi:10.1145/271130.271133.
1364
+ // This algorithms is not a true factorization of the matrix A(i.e. A != LU))
1365
+ // but can be used to solve linear systems by applying forward and backward
1366
+ // substitutions respectively.
1367
+ void fraction_free_LU(const DenseMatrix &A, DenseMatrix &LU)
1368
+ {
1369
+ SYMENGINE_ASSERT(A.row_ == A.col_ and LU.row_ == LU.col_
1370
+ and A.row_ == LU.row_);
1371
+
1372
+ unsigned n = A.row_;
1373
+ unsigned i, j, k;
1374
+
1375
+ LU.m_ = A.m_;
1376
+
1377
+ for (i = 0; i < n - 1; i++)
1378
+ for (j = i + 1; j < n; j++)
1379
+ for (k = i + 1; k < n; k++) {
1380
+ LU.m_[j * n + k] = sub(mul(LU.m_[i * n + i], LU.m_[j * n + k]),
1381
+ mul(LU.m_[j * n + i], LU.m_[i * n + k]));
1382
+ if (i)
1383
+ LU.m_[j * n + k]
1384
+ = div(LU.m_[j * n + k], LU.m_[i * n - n + i - 1]);
1385
+ }
1386
+ }
1387
+
1388
+ // SymPy LUDecomposition algorithm, in
1389
+ // sympy.matrices.matrices.Matrix.LUdecomposition
1390
+ // with no pivoting
1391
+ void LU(const DenseMatrix &A, DenseMatrix &L, DenseMatrix &U)
1392
+ {
1393
+ SYMENGINE_ASSERT(A.row_ == A.col_ and L.row_ == L.col_
1394
+ and U.row_ == U.col_);
1395
+ SYMENGINE_ASSERT(A.row_ == L.row_ and A.row_ == U.row_);
1396
+
1397
+ unsigned n = A.row_;
1398
+ unsigned i, j, k;
1399
+ RCP<const Basic> scale;
1400
+
1401
+ U.m_ = A.m_;
1402
+
1403
+ for (j = 0; j < n; j++) {
1404
+ for (i = 0; i < j; i++)
1405
+ for (k = 0; k < i; k++)
1406
+ U.m_[i * n + j] = sub(U.m_[i * n + j],
1407
+ mul(U.m_[i * n + k], U.m_[k * n + j]));
1408
+
1409
+ for (i = j; i < n; i++) {
1410
+ for (k = 0; k < j; k++)
1411
+ U.m_[i * n + j] = sub(U.m_[i * n + j],
1412
+ mul(U.m_[i * n + k], U.m_[k * n + j]));
1413
+ }
1414
+
1415
+ scale = div(one, U.m_[j * n + j]);
1416
+
1417
+ for (i = j + 1; i < n; i++)
1418
+ U.m_[i * n + j] = mul(U.m_[i * n + j], scale);
1419
+ }
1420
+
1421
+ for (i = 0; i < n; i++) {
1422
+ for (j = 0; j < i; j++) {
1423
+ L.m_[i * n + j] = U.m_[i * n + j];
1424
+ U.m_[i * n + j] = zero; // Integer zero
1425
+ }
1426
+ L.m_[i * n + i] = one; // Integer one
1427
+ for (j = i + 1; j < n; j++)
1428
+ L.m_[i * n + j] = zero; // Integer zero
1429
+ }
1430
+ }
1431
+
1432
+ // SymPy LUDecomposition_Simple algorithm, in
1433
+ // sympy.matrices.matrices.Matrix.LUdecomposition_Simple with pivoting.
1434
+ // P must be an initialized matrix and will be permuted.
1435
+ void pivoted_LU(const DenseMatrix &A, DenseMatrix &LU, permutelist &pl)
1436
+ {
1437
+ SYMENGINE_ASSERT(A.row_ == A.col_ and LU.row_ == LU.col_);
1438
+ SYMENGINE_ASSERT(A.row_ == LU.row_);
1439
+
1440
+ unsigned n = A.row_;
1441
+ unsigned i, j, k;
1442
+ RCP<const Basic> scale;
1443
+ int pivot;
1444
+
1445
+ LU.m_ = A.m_;
1446
+
1447
+ for (j = 0; j < n; j++) {
1448
+ for (i = 0; i < j; i++)
1449
+ for (k = 0; k < i; k++)
1450
+ LU.m_[i * n + j] = sub(LU.m_[i * n + j],
1451
+ mul(LU.m_[i * n + k], LU.m_[k * n + j]));
1452
+ pivot = -1;
1453
+ for (i = j; i < n; i++) {
1454
+ for (k = 0; k < j; k++) {
1455
+ LU.m_[i * n + j] = sub(LU.m_[i * n + j],
1456
+ mul(LU.m_[i * n + k], LU.m_[k * n + j]));
1457
+ }
1458
+ if (pivot == -1 and !is_true(is_zero(*LU.m_[i * n + j])))
1459
+ pivot = i;
1460
+ }
1461
+ if (pivot == -1)
1462
+ throw SymEngineException("Matrix is rank deficient");
1463
+ if (pivot - j != 0) { // row must be swapped
1464
+ row_exchange_dense(LU, pivot, j);
1465
+ pl.push_back({pivot, j});
1466
+ }
1467
+ scale = div(one, LU.m_[j * n + j]);
1468
+
1469
+ for (i = j + 1; i < n; i++)
1470
+ LU.m_[i * n + j] = mul(LU.m_[i * n + j], scale);
1471
+ }
1472
+ }
1473
+
1474
+ // SymPy LUDecomposition algorithm, in
1475
+ // sympy.matrices.matrices.Matrix.LUdecomposition_Simple with pivoting.
1476
+ // P must be an initialized matrix and will be permuted.
1477
+ void pivoted_LU(const DenseMatrix &A, DenseMatrix &L, DenseMatrix &U,
1478
+ permutelist &pl)
1479
+ {
1480
+ SYMENGINE_ASSERT(A.row_ == A.col_ and L.row_ == L.col_
1481
+ and U.row_ == U.col_);
1482
+ SYMENGINE_ASSERT(A.row_ == L.row_ and A.row_ == U.row_);
1483
+
1484
+ pivoted_LU(A, U, pl);
1485
+ unsigned n = A.col_;
1486
+ for (unsigned i = 0; i < n; i++) {
1487
+ for (unsigned j = 0; j < i; j++) {
1488
+ L.m_[i * n + j] = U.m_[i * n + j];
1489
+ U.m_[i * n + j] = zero; // Integer zero
1490
+ }
1491
+ L.m_[i * n + i] = one; // Integer one
1492
+ for (unsigned j = i + 1; j < n; j++)
1493
+ L.m_[i * n + j] = zero; // Integer zero
1494
+ }
1495
+ }
1496
+
1497
+ // SymPy's fraction free LU decomposition, without pivoting
1498
+ // sympy.matrices.matrices.MatrixBase.LUdecompositionFF
1499
+ // W. Zhou & D.J. Jeffrey, "Fraction-free matrix factors: new forms for LU and
1500
+ // QR factors".
1501
+ // Frontiers in Computer Science in China, Vol 2, no. 1, pp. 67-80, 2008.
1502
+ void fraction_free_LDU(const DenseMatrix &A, DenseMatrix &L, DenseMatrix &D,
1503
+ DenseMatrix &U)
1504
+ {
1505
+ SYMENGINE_ASSERT(A.row_ == L.row_ and A.row_ == U.row_);
1506
+ SYMENGINE_ASSERT(A.col_ == L.col_ and A.col_ == U.col_);
1507
+
1508
+ unsigned row = A.row_, col = A.col_;
1509
+ unsigned i, j, k;
1510
+ RCP<const Basic> old = integer(1);
1511
+
1512
+ U.m_ = A.m_;
1513
+
1514
+ // Initialize L
1515
+ for (i = 0; i < row; i++)
1516
+ for (j = 0; j < row; j++)
1517
+ if (i != j)
1518
+ L.m_[i * col + j] = zero;
1519
+ else
1520
+ L.m_[i * col + i] = one;
1521
+
1522
+ // Initialize D
1523
+ for (i = 0; i < row * row; i++)
1524
+ D.m_[i] = zero; // Integer zero
1525
+
1526
+ for (k = 0; k < row - 1; k++) {
1527
+ L.m_[k * col + k] = U.m_[k * col + k];
1528
+ D.m_[k * col + k] = mul(old, U.m_[k * col + k]);
1529
+
1530
+ for (i = k + 1; i < row; i++) {
1531
+ L.m_[i * col + k] = U.m_[i * col + k];
1532
+ for (j = k + 1; j < col; j++)
1533
+ U.m_[i * col + j]
1534
+ = div(sub(mul(U.m_[k * col + k], U.m_[i * col + j]),
1535
+ mul(U.m_[k * col + j], U.m_[i * col + k])),
1536
+ old);
1537
+ U.m_[i * col + k] = zero; // Integer zero
1538
+ }
1539
+
1540
+ old = U.m_[k * col + k];
1541
+ }
1542
+
1543
+ D.m_[row * col - col + row - 1] = old;
1544
+ }
1545
+
1546
+ // SymPy's QRecomposition in sympy.matrices.matrices.MatrixBase.QRdecomposition
1547
+ // Rank check is not performed
1548
+ void QR(const DenseMatrix &A, DenseMatrix &Q, DenseMatrix &R)
1549
+ {
1550
+ unsigned row = A.row_;
1551
+ unsigned col = A.col_;
1552
+
1553
+ SYMENGINE_ASSERT(Q.row_ == row and Q.col_ == col and R.row_ == col
1554
+ and R.col_ == col);
1555
+
1556
+ unsigned i, j, k;
1557
+ RCP<const Basic> t;
1558
+ std::vector<RCP<const Basic>> tmp(row);
1559
+
1560
+ // Initialize Q
1561
+ for (i = 0; i < row * col; i++)
1562
+ Q.m_[i] = zero;
1563
+
1564
+ // Initialize R
1565
+ for (i = 0; i < col * col; i++)
1566
+ R.m_[i] = zero;
1567
+
1568
+ for (j = 0; j < col; j++) {
1569
+ // Use submatrix for this
1570
+ for (k = 0; k < row; k++)
1571
+ tmp[k] = A.m_[k * col + j];
1572
+
1573
+ for (i = 0; i < j; i++) {
1574
+ t = zero;
1575
+ for (k = 0; k < row; k++)
1576
+ t = add(t, mul(A.m_[k * col + j], Q.m_[k * col + i]));
1577
+ for (k = 0; k < row; k++)
1578
+ tmp[k] = expand(sub(tmp[k], mul(Q.m_[k * col + i], t)));
1579
+ }
1580
+
1581
+ // calculate norm
1582
+ t = zero;
1583
+ for (k = 0; k < row; k++)
1584
+ t = add(t, pow(tmp[k], integer(2)));
1585
+
1586
+ t = pow(t, div(one, integer(2)));
1587
+
1588
+ R.m_[j * col + j] = t;
1589
+ for (k = 0; k < row; k++)
1590
+ Q.m_[k * col + j] = div(tmp[k], t);
1591
+
1592
+ for (i = 0; i < j; i++) {
1593
+ t = zero;
1594
+ for (k = 0; k < row; k++)
1595
+ t = add(t, mul(Q.m_[k * col + i], A.m_[k * col + j]));
1596
+ R.m_[i * col + j] = t;
1597
+ }
1598
+ }
1599
+ }
1600
+
1601
+ // SymPy's LDL decomposition, Assuming A is a symmetric, square, positive
1602
+ // definite non singular matrix
1603
+ void LDL(const DenseMatrix &A, DenseMatrix &L, DenseMatrix &D)
1604
+ {
1605
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1606
+ SYMENGINE_ASSERT(L.row_ == A.row_ and L.col_ == A.row_);
1607
+ SYMENGINE_ASSERT(D.row_ == A.row_ and D.col_ == A.row_);
1608
+
1609
+ unsigned col = A.col_;
1610
+ unsigned i, k, j;
1611
+ RCP<const Basic> sum;
1612
+ RCP<const Basic> i2 = integer(2);
1613
+
1614
+ // Initialize D
1615
+ for (i = 0; i < col; i++)
1616
+ for (j = 0; j < col; j++)
1617
+ D.m_[i * col + j] = zero; // Integer zero
1618
+
1619
+ // Initialize L
1620
+ for (i = 0; i < col; i++)
1621
+ for (j = 0; j < col; j++)
1622
+ L.m_[i * col + j] = (i != j) ? zero : one;
1623
+
1624
+ for (i = 0; i < col; i++) {
1625
+ for (j = 0; j < i; j++) {
1626
+ sum = zero;
1627
+ for (k = 0; k < j; k++)
1628
+ sum = add(sum, mul(mul(L.m_[i * col + k], L.m_[j * col + k]),
1629
+ D.m_[k * col + k]));
1630
+ L.m_[i * col + j]
1631
+ = mul(div(one, D.m_[j * col + j]), sub(A.m_[i * col + j], sum));
1632
+ }
1633
+ sum = zero;
1634
+ for (k = 0; k < i; k++)
1635
+ sum = add(sum, mul(pow(L.m_[i * col + k], i2), D.m_[k * col + k]));
1636
+ D.m_[i * col + i] = sub(A.m_[i * col + i], sum);
1637
+ }
1638
+ }
1639
+
1640
+ // SymPy's cholesky decomposition
1641
+ void cholesky(const DenseMatrix &A, DenseMatrix &L)
1642
+ {
1643
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1644
+ SYMENGINE_ASSERT(L.row_ == A.row_ and L.col_ == A.row_);
1645
+
1646
+ unsigned col = A.col_;
1647
+ unsigned i, j, k;
1648
+ RCP<const Basic> sum;
1649
+ RCP<const Basic> i2 = integer(2);
1650
+ RCP<const Basic> half = div(one, i2);
1651
+
1652
+ // Initialize L
1653
+ for (i = 0; i < col; i++)
1654
+ for (j = 0; j < col; j++)
1655
+ L.m_[i * col + j] = zero;
1656
+
1657
+ for (i = 0; i < col; i++) {
1658
+ for (j = 0; j < i; j++) {
1659
+ sum = zero;
1660
+ for (k = 0; k < j; k++)
1661
+ sum = add(sum, mul(L.m_[i * col + k], L.m_[j * col + k]));
1662
+
1663
+ L.m_[i * col + j]
1664
+ = mul(div(one, L.m_[j * col + j]), sub(A.m_[i * col + j], sum));
1665
+ }
1666
+ sum = zero;
1667
+ for (k = 0; k < i; k++)
1668
+ sum = add(sum, pow(L.m_[i * col + k], i2));
1669
+ L.m_[i * col + i] = pow(sub(A.m_[i * col + i], sum), half);
1670
+ }
1671
+ }
1672
+
1673
+ // Matrix Queries
1674
+ bool is_symmetric_dense(const DenseMatrix &A)
1675
+ {
1676
+ if (A.col_ != A.row_)
1677
+ return false;
1678
+
1679
+ unsigned col = A.col_;
1680
+ bool sym = true;
1681
+
1682
+ for (unsigned i = 0; i < col; i++)
1683
+ for (unsigned j = i + 1; j < col; j++)
1684
+ if (not eq(*(A.m_[j * col + i]), *(A.m_[i * col + j]))) {
1685
+ sym = false;
1686
+ break;
1687
+ }
1688
+
1689
+ return sym;
1690
+ }
1691
+
1692
+ // ----------------------------- Determinant ---------------------------------//
1693
+ RCP<const Basic> det_bareis(const DenseMatrix &A)
1694
+ {
1695
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1696
+
1697
+ unsigned n = A.row_;
1698
+
1699
+ if (n == 1) {
1700
+ return A.m_[0];
1701
+ } else if (n == 2) {
1702
+ // If A = [[a, b], [c, d]] then det(A) = ad - bc
1703
+ return sub(mul(A.m_[0], A.m_[3]), mul(A.m_[1], A.m_[2]));
1704
+ } else if (n == 3) {
1705
+ // if A = [[a, b, c], [d, e, f], [g, h, i]] then
1706
+ // det(A) = (aei + bfg + cdh) - (ceg + bdi + afh)
1707
+ return sub(add(add(mul(mul(A.m_[0], A.m_[4]), A.m_[8]),
1708
+ mul(mul(A.m_[1], A.m_[5]), A.m_[6])),
1709
+ mul(mul(A.m_[2], A.m_[3]), A.m_[7])),
1710
+ add(add(mul(mul(A.m_[2], A.m_[4]), A.m_[6]),
1711
+ mul(mul(A.m_[1], A.m_[3]), A.m_[8])),
1712
+ mul(mul(A.m_[0], A.m_[5]), A.m_[7])));
1713
+ } else {
1714
+
1715
+ if (A.is_lower() or A.is_upper()) {
1716
+ RCP<const Basic> det = A.m_[0];
1717
+ for (unsigned i = 1; i < n; ++i) {
1718
+ det = mul(det, A.m_[i * n + i]);
1719
+ }
1720
+ return det;
1721
+ }
1722
+
1723
+ DenseMatrix B = DenseMatrix(n, n, A.m_);
1724
+ unsigned i, sign = 1;
1725
+ RCP<const Basic> d;
1726
+
1727
+ for (unsigned k = 0; k < n - 1; k++) {
1728
+ if (is_true(is_zero(*B.m_[k * n + k]))) {
1729
+ for (i = k + 1; i < n; i++)
1730
+ if (!is_true(is_zero(*B.m_[i * n + k]))) {
1731
+ row_exchange_dense(B, i, k);
1732
+ sign *= -1;
1733
+ break;
1734
+ }
1735
+ if (i == n)
1736
+ return zero;
1737
+ }
1738
+
1739
+ for (i = k + 1; i < n; i++) {
1740
+ for (unsigned j = k + 1; j < n; j++) {
1741
+ d = sub(mul(B.m_[k * n + k], B.m_[i * n + j]),
1742
+ mul(B.m_[i * n + k], B.m_[k * n + j]));
1743
+ if (k > 0)
1744
+ d = div(d, B.m_[(k - 1) * n + k - 1]);
1745
+ B.m_[i * n + j] = d;
1746
+ }
1747
+ }
1748
+ }
1749
+
1750
+ return (sign == 1) ? B.m_[n * n - 1] : mul(minus_one, B.m_[n * n - 1]);
1751
+ }
1752
+ }
1753
+
1754
+ // Returns the coefficients of characterisitc polynomials of leading principal
1755
+ // minors of Matrix A as elements in `polys`. Principal leading minor of kth
1756
+ // order is the submatrix of A obtained by deleting last n-k rows and columns
1757
+ // from A. Here `n` is the dimension of the square matrix A.
1758
+ void berkowitz(const DenseMatrix &A, std::vector<DenseMatrix> &polys)
1759
+ {
1760
+ SYMENGINE_ASSERT(A.row_ == A.col_);
1761
+
1762
+ unsigned col = A.col_;
1763
+ unsigned i, k, l, m;
1764
+
1765
+ std::vector<DenseMatrix> items;
1766
+ std::vector<DenseMatrix> transforms;
1767
+ std::vector<RCP<const Basic>> items_;
1768
+
1769
+ for (unsigned n = col; n > 1; n--) {
1770
+ items.clear();
1771
+ k = n - 1;
1772
+ DenseMatrix T = DenseMatrix(n + 1, n);
1773
+ DenseMatrix C = DenseMatrix(k, 1);
1774
+
1775
+ // Initialize T and C
1776
+ for (i = 0; i < n * (n + 1); i++)
1777
+ T.m_[i] = zero;
1778
+ for (i = 0; i < k; i++)
1779
+ C.m_[i] = A.m_[i * col + k];
1780
+ items.push_back(C);
1781
+
1782
+ for (i = 0; i < n - 2; i++) {
1783
+ DenseMatrix B = DenseMatrix(k, 1);
1784
+ for (l = 0; l < k; l++) {
1785
+ B.m_[l] = zero;
1786
+ for (m = 0; m < k; m++)
1787
+ B.m_[l]
1788
+ = add(B.m_[l], mul(A.m_[l * col + m], items[i].m_[m]));
1789
+ }
1790
+ items.push_back(B);
1791
+ }
1792
+
1793
+ items_.clear();
1794
+ for (i = 0; i < n - 1; i++) {
1795
+ RCP<const Basic> element = zero;
1796
+ for (l = 0; l < k; l++)
1797
+ element = add(element, mul(A.m_[k * col + l], items[i].m_[l]));
1798
+ items_.push_back(mul(minus_one, element));
1799
+ }
1800
+ items_.insert(items_.begin(), mul(minus_one, A.m_[k * col + k]));
1801
+ items_.insert(items_.begin(), one);
1802
+
1803
+ for (i = 0; i < n; i++) {
1804
+ for (l = 0; l < n - i + 1; l++)
1805
+ T.m_[(i + l) * n + i] = items_[l];
1806
+ }
1807
+
1808
+ transforms.push_back(T);
1809
+ }
1810
+
1811
+ polys.push_back(DenseMatrix(2, 1, {one, mul(A.m_[0], minus_one)}));
1812
+
1813
+ for (i = 0; i < col - 1; i++) {
1814
+ unsigned t_row = transforms[col - 2 - i].nrows();
1815
+ unsigned t_col = transforms[col - 2 - i].ncols();
1816
+ DenseMatrix B = DenseMatrix(t_row, 1);
1817
+
1818
+ for (l = 0; l < t_row; l++) {
1819
+ B.m_[l] = zero;
1820
+ for (m = 0; m < t_col; m++) {
1821
+ B.m_[l] = add(B.m_[l],
1822
+ mul(transforms[col - 2 - i].m_[l * t_col + m],
1823
+ polys[i].m_[m]));
1824
+ B.m_[l] = expand(B.m_[l]);
1825
+ }
1826
+ }
1827
+ polys.push_back(B);
1828
+ }
1829
+ }
1830
+
1831
+ RCP<const Basic> det_berkowitz(const DenseMatrix &A)
1832
+ {
1833
+ std::vector<DenseMatrix> polys;
1834
+
1835
+ berkowitz(A, polys);
1836
+ DenseMatrix poly = polys[polys.size() - 1];
1837
+
1838
+ if (polys.size() % 2 == 1)
1839
+ return mul(minus_one, poly.get(poly.nrows() - 1, 0));
1840
+
1841
+ return poly.get(poly.nrows() - 1, 0);
1842
+ }
1843
+
1844
+ void char_poly(const DenseMatrix &A, DenseMatrix &B)
1845
+ {
1846
+ SYMENGINE_ASSERT(B.ncols() == 1 and B.nrows() == A.nrows() + 1);
1847
+ SYMENGINE_ASSERT(A.nrows() == A.ncols());
1848
+
1849
+ std::vector<DenseMatrix> polys;
1850
+
1851
+ berkowitz(A, polys);
1852
+ B = polys[polys.size() - 1];
1853
+ }
1854
+
1855
+ void inverse_fraction_free_LU(const DenseMatrix &A, DenseMatrix &B)
1856
+ {
1857
+ SYMENGINE_ASSERT(A.row_ == A.col_ and B.row_ == B.col_
1858
+ and B.row_ == A.row_);
1859
+
1860
+ unsigned n = A.row_, i;
1861
+ DenseMatrix LU = DenseMatrix(n, n);
1862
+ DenseMatrix e = DenseMatrix(n, 1);
1863
+ DenseMatrix x = DenseMatrix(n, 1);
1864
+ DenseMatrix x_ = DenseMatrix(n, 1);
1865
+
1866
+ // Initialize matrices
1867
+ for (i = 0; i < n * n; i++) {
1868
+ LU.m_[i] = zero;
1869
+ B.m_[i] = zero;
1870
+ }
1871
+ for (i = 0; i < n; i++) {
1872
+ e.m_[i] = zero;
1873
+ x.m_[i] = zero;
1874
+ x_.m_[i] = zero;
1875
+ }
1876
+
1877
+ fraction_free_LU(A, LU);
1878
+
1879
+ // We solve AX_{i} = e_{i} for i = 1, 2, .. n and combine the row vectors
1880
+ // X_{1}, X_{2}, ... X_{n} to form the inverse of A. Here, e_{i}'s are the
1881
+ // elements of the standard basis.
1882
+ for (unsigned j = 0; j < n; j++) {
1883
+ e.m_[j] = one;
1884
+
1885
+ forward_substitution(LU, e, x_);
1886
+ back_substitution(LU, x_, x);
1887
+
1888
+ for (i = 0; i < n; i++)
1889
+ B.m_[i * n + j] = x.m_[i];
1890
+
1891
+ e.m_[j] = zero;
1892
+ }
1893
+ }
1894
+
1895
+ void inverse_LU(const DenseMatrix &A, DenseMatrix &B)
1896
+ {
1897
+ SYMENGINE_ASSERT(A.row_ == A.col_ and B.row_ == B.col_
1898
+ and B.row_ == A.row_);
1899
+ DenseMatrix e = DenseMatrix(A.row_, A.col_);
1900
+ eye(e);
1901
+ LU_solve(A, e, B);
1902
+ }
1903
+
1904
+ void inverse_pivoted_LU(const DenseMatrix &A, DenseMatrix &B)
1905
+ {
1906
+ SYMENGINE_ASSERT(A.row_ == A.col_ and B.row_ == B.col_
1907
+ and B.row_ == A.row_);
1908
+ DenseMatrix e = DenseMatrix(A.row_, A.col_);
1909
+ eye(e);
1910
+ pivoted_LU_solve(A, e, B);
1911
+ }
1912
+
1913
+ void inverse_gauss_jordan(const DenseMatrix &A, DenseMatrix &B)
1914
+ {
1915
+ SYMENGINE_ASSERT(A.row_ == A.col_ and B.row_ == B.col_
1916
+ and B.row_ == A.row_);
1917
+
1918
+ unsigned n = A.row_;
1919
+ DenseMatrix e = DenseMatrix(n, n);
1920
+
1921
+ // Initialize matrices
1922
+ for (unsigned i = 0; i < n; i++)
1923
+ for (unsigned j = 0; j < n; j++) {
1924
+ if (i != j) {
1925
+ e.m_[i * n + j] = zero;
1926
+ } else {
1927
+ e.m_[i * n + i] = one;
1928
+ }
1929
+ B.m_[i * n + j] = zero;
1930
+ }
1931
+
1932
+ fraction_free_gauss_jordan_solve(A, e, B);
1933
+ }
1934
+
1935
+ // ----------------------- Vector-specific Methods --------------------------//
1936
+
1937
+ void dot(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &C)
1938
+ {
1939
+ if (A.col_ == B.row_) {
1940
+ if (B.col_ != 1) {
1941
+ DenseMatrix tmp1 = DenseMatrix(A.col_, A.row_);
1942
+ A.transpose(tmp1);
1943
+ DenseMatrix tmp2 = DenseMatrix(B.col_, B.row_);
1944
+ B.transpose(tmp2);
1945
+ C.resize(tmp1.row_, tmp2.col_);
1946
+ mul_dense_dense(tmp1, tmp2, C);
1947
+ } else {
1948
+ C.resize(A.row_, B.col_);
1949
+ mul_dense_dense(A, B, C);
1950
+ }
1951
+ C.resize(1, C.row_ * C.col_);
1952
+ } else if (A.col_ == B.col_) {
1953
+ DenseMatrix tmp2 = DenseMatrix(B.col_, B.row_);
1954
+ B.transpose(tmp2);
1955
+ dot(A, tmp2, C);
1956
+ } else if (A.row_ == B.row_) {
1957
+ DenseMatrix tmp1 = DenseMatrix(A.col_, A.row_);
1958
+ A.transpose(tmp1);
1959
+ dot(tmp1, B, C);
1960
+ } else {
1961
+ throw SymEngineException("Dimensions incorrect for dot product");
1962
+ }
1963
+ }
1964
+
1965
+ void cross(const DenseMatrix &A, const DenseMatrix &B, DenseMatrix &C)
1966
+ {
1967
+ SYMENGINE_ASSERT((A.row_ * A.col_ == 3 and B.row_ * B.col_ == 3)
1968
+ and (A.row_ == C.row_ and A.col_ == C.col_));
1969
+
1970
+ C.m_[0] = sub(mul(A.m_[1], B.m_[2]), mul(A.m_[2], B.m_[1]));
1971
+ C.m_[1] = sub(mul(A.m_[2], B.m_[0]), mul(A.m_[0], B.m_[2]));
1972
+ C.m_[2] = sub(mul(A.m_[0], B.m_[1]), mul(A.m_[1], B.m_[0]));
1973
+ }
1974
+
1975
+ RCP<const Set> eigen_values(const DenseMatrix &A)
1976
+ {
1977
+ unsigned n = A.nrows();
1978
+ if (A.is_lower() or A.is_upper()) {
1979
+ RCP<const Set> eigenvals = emptyset();
1980
+ set_basic x;
1981
+ for (unsigned i = 0; i < n; ++i) {
1982
+ x.insert(A.get(i, i));
1983
+ }
1984
+ eigenvals = finiteset(x);
1985
+ return eigenvals;
1986
+ }
1987
+
1988
+ DenseMatrix B = DenseMatrix(A.nrows() + 1, 1);
1989
+ char_poly(A, B);
1990
+ map_int_Expr coeffs;
1991
+ auto nr = A.nrows();
1992
+ for (unsigned i = 0; i <= nr; i++)
1993
+ insert(coeffs, nr - i, B.get(i, 0));
1994
+ auto lambda = symbol("lambda");
1995
+ return solve_poly(uexpr_poly(lambda, coeffs), lambda);
1996
+ }
1997
+
1998
+ // ------------------------- NumPy-like functions ----------------------------//
1999
+
2000
+ // Mimic `eye` function in NumPy
2001
+ void eye(DenseMatrix &A, int k)
2002
+ {
2003
+ if ((k >= 0 and (unsigned) k >= A.col_) or k + A.row_ <= 0) {
2004
+ zeros(A);
2005
+ }
2006
+
2007
+ vec_basic v = vec_basic(k > 0 ? A.col_ - k : A.row_ + k, one);
2008
+
2009
+ diag(A, v, k);
2010
+ }
2011
+
2012
+ // Create diagonal matrices directly
2013
+ void diag(DenseMatrix &A, vec_basic &v, int k)
2014
+ {
2015
+ SYMENGINE_ASSERT(v.size() > 0);
2016
+
2017
+ unsigned k_ = std::abs(k);
2018
+
2019
+ if (k >= 0) {
2020
+ for (unsigned i = 0; i < A.row_; i++) {
2021
+ for (unsigned j = 0; j < A.col_; j++) {
2022
+ if (j != (unsigned)k) {
2023
+ A.m_[i * A.col_ + j] = zero;
2024
+ } else {
2025
+ A.m_[i * A.col_ + j] = v[k - k_];
2026
+ }
2027
+ }
2028
+ k++;
2029
+ }
2030
+ } else {
2031
+ k = -k;
2032
+
2033
+ for (unsigned j = 0; j < A.col_; j++) {
2034
+ for (unsigned i = 0; i < A.row_; i++) {
2035
+ if (i != (unsigned)k) {
2036
+ A.m_[i * A.col_ + j] = zero;
2037
+ } else {
2038
+ A.m_[i * A.col_ + j] = v[k - k_];
2039
+ }
2040
+ }
2041
+ k++;
2042
+ }
2043
+ }
2044
+ }
2045
+
2046
+ // Create a matrix filled with ones
2047
+ void ones(DenseMatrix &A)
2048
+ {
2049
+ for (unsigned i = 0; i < A.row_ * A.col_; i++) {
2050
+ A.m_[i] = one;
2051
+ }
2052
+ }
2053
+
2054
+ // Create a matrix filled with zeros
2055
+ void zeros(DenseMatrix &A)
2056
+ {
2057
+ for (unsigned i = 0; i < A.row_ * A.col_; i++) {
2058
+ A.m_[i] = zero;
2059
+ }
2060
+ }
2061
+
2062
+ std::string DenseMatrix::dumps() const
2063
+ {
2064
+ #if HAVE_SYMENGINE_RTTI
2065
+ std::ostringstream oss;
2066
+ unsigned short major = SYMENGINE_MAJOR_VERSION;
2067
+ unsigned short minor = SYMENGINE_MINOR_VERSION;
2068
+ RCPBasicAwareOutputArchive<cereal::PortableBinaryOutputArchive>{oss}(
2069
+ major, minor, row_, col_, m_);
2070
+ return oss.str();
2071
+ #else
2072
+ throw NotImplementedError("Serialization not implemented in no-rtti mode");
2073
+ #endif
2074
+ }
2075
+
2076
+ DenseMatrix DenseMatrix::loads(const std::string &serialized)
2077
+ {
2078
+ #if HAVE_SYMENGINE_RTTI
2079
+ unsigned short major, minor;
2080
+ unsigned row, col;
2081
+ vec_basic obj;
2082
+ std::istringstream iss(serialized);
2083
+ RCPBasicAwareInputArchive<cereal::PortableBinaryInputArchive> iarchive{iss};
2084
+ iarchive(major, minor);
2085
+ if (major != SYMENGINE_MAJOR_VERSION or minor != SYMENGINE_MINOR_VERSION) {
2086
+ throw SerializationError(StreamFmt()
2087
+ << "SymEngine-" << SYMENGINE_MAJOR_VERSION
2088
+ << "." << SYMENGINE_MINOR_VERSION
2089
+ << " was asked to deserialize an object "
2090
+ << "created using SymEngine-" << major << "."
2091
+ << minor << ".");
2092
+ }
2093
+ iarchive(row, col, obj);
2094
+ return DenseMatrix(row, col, std::move(obj));
2095
+ #else
2096
+ throw NotImplementedError("Serialization not implemented in no-rtti mode");
2097
+ #endif
2098
+ }
2099
+
2100
+ } // namespace SymEngine