nerdamer 1.1.13 → 2.0.0-rc.2

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 (387) hide show
  1. package/BREAKING_CHANGES.md +244 -5
  2. package/LICENSE.md +184 -0
  3. package/README.md +232 -318
  4. package/dist/bundle.js +2 -0
  5. package/dist/bundle.js.LICENSE.txt +7 -0
  6. package/dist/parser.js +2 -0
  7. package/dist/parser.js.LICENSE.txt +7 -0
  8. package/docs-data/parser-functions.json +2248 -0
  9. package/index.d.ts +10 -426
  10. package/output/algebra/adapters.d.ts +3 -0
  11. package/output/algebra/adapters.js +11 -0
  12. package/output/algebra/algorithms/arith.d.ts +84 -0
  13. package/output/algebra/algorithms/arith.js +324 -0
  14. package/output/algebra/algorithms/groebnerBase.d.ts +161 -0
  15. package/output/algebra/algorithms/groebnerBase.js +929 -0
  16. package/output/algebra/dispatch.d.ts +1 -0
  17. package/output/algebra/dispatch.js +25 -0
  18. package/output/algebra/factor/factor.d.ts +77 -0
  19. package/output/algebra/factor/factor.js +245 -0
  20. package/output/algebra/gcd/gcd.d.ts +30 -0
  21. package/output/algebra/gcd/gcd.js +95 -0
  22. package/output/algebra/groebner.d.ts +21 -0
  23. package/output/algebra/groebner.js +36 -0
  24. package/output/algebra/partfrac.d.ts +19 -0
  25. package/output/algebra/partfrac.js +365 -0
  26. package/output/algebra/polynomial/ModularSparsePolynomial.d.ts +131 -0
  27. package/output/algebra/polynomial/ModularSparsePolynomial.js +378 -0
  28. package/output/algebra/polynomial/ModularSparsePolynomialFactor.d.ts +40 -0
  29. package/output/algebra/polynomial/ModularSparsePolynomialFactor.js +661 -0
  30. package/output/algebra/polynomial/SparsePolynomialFactor.d.ts +64 -0
  31. package/output/algebra/polynomial/SparsePolynomialFactor.js +492 -0
  32. package/output/algebra/polynomial/SparsePolynomialGcd.d.ts +29 -0
  33. package/output/algebra/polynomial/SparsePolynomialGcd.js +259 -0
  34. package/output/algebra/polynomial/SparsePolynomialMultivariateFactor.d.ts +82 -0
  35. package/output/algebra/polynomial/SparsePolynomialMultivariateFactor.js +604 -0
  36. package/output/algebra/polynomial/modularGcd.d.ts +40 -0
  37. package/output/algebra/polynomial/modularGcd.js +365 -0
  38. package/output/algebra/polynomialize.d.ts +20 -0
  39. package/output/algebra/polynomialize.js +26 -0
  40. package/output/algebra/simplify/complexsimp.d.ts +7 -0
  41. package/output/algebra/simplify/complexsimp.js +24 -0
  42. package/output/algebra/simplify/factorCommon.d.ts +13 -0
  43. package/output/algebra/simplify/factorCommon.js +136 -0
  44. package/output/algebra/simplify/funcsimp.d.ts +26 -0
  45. package/output/algebra/simplify/funcsimp.js +633 -0
  46. package/output/algebra/simplify/invtrigrewrite.d.ts +10 -0
  47. package/output/algebra/simplify/invtrigrewrite.js +96 -0
  48. package/output/algebra/simplify/ratsimp.d.ts +21 -0
  49. package/output/algebra/simplify/ratsimp.js +140 -0
  50. package/output/algebra/simplify/simplify.d.ts +25 -0
  51. package/output/algebra/simplify/simplify.js +237 -0
  52. package/output/algebra/simplify/trigreduce.d.ts +38 -0
  53. package/output/algebra/simplify/trigreduce.js +424 -0
  54. package/output/algebra/simplify/trigrewrite.d.ts +17 -0
  55. package/output/algebra/simplify/trigrewrite.js +156 -0
  56. package/output/algebra/simplify/trigsimp.d.ts +11 -0
  57. package/output/algebra/simplify/trigsimp.js +369 -0
  58. package/output/algebra/simplify/utils.d.ts +32 -0
  59. package/output/algebra/simplify/utils.js +56 -0
  60. package/output/algebra/utils.d.ts +32 -0
  61. package/output/algebra/utils.js +48 -0
  62. package/output/api/advanced.d.ts +8 -0
  63. package/output/api/advanced.js +18 -0
  64. package/output/api/algebra.d.ts +17 -0
  65. package/output/api/algebra.js +35 -0
  66. package/output/api/assumptions.d.ts +4 -0
  67. package/output/api/assumptions.js +11 -0
  68. package/output/api/calculus.d.ts +10 -0
  69. package/output/api/calculus.js +22 -0
  70. package/output/api/core.d.ts +17 -0
  71. package/output/api/core.js +41 -0
  72. package/output/api/debug.d.ts +16 -0
  73. package/output/api/debug.js +23 -0
  74. package/output/api/languages/deu.d.ts +3 -0
  75. package/output/api/languages/deu.js +266 -0
  76. package/output/api/languages/fra.d.ts +3 -0
  77. package/output/api/languages/fra.js +266 -0
  78. package/output/api/languages/ita.d.ts +3 -0
  79. package/output/api/languages/ita.js +266 -0
  80. package/output/api/languages/nld.d.ts +3 -0
  81. package/output/api/languages/nld.js +266 -0
  82. package/output/api/languages/por.d.ts +3 -0
  83. package/output/api/languages/por.js +266 -0
  84. package/output/api/languages/spa.d.ts +3 -0
  85. package/output/api/languages/spa.js +266 -0
  86. package/output/api/parser.d.ts +93 -0
  87. package/output/api/parser.js +18 -0
  88. package/output/api/solve.d.ts +10 -0
  89. package/output/api/solve.js +17 -0
  90. package/output/api/structures.d.ts +10 -0
  91. package/output/api/structures.js +23 -0
  92. package/output/calculus/adapters.d.ts +8 -0
  93. package/output/calculus/adapters.js +41 -0
  94. package/output/calculus/derivative/diff.d.ts +30 -0
  95. package/output/calculus/derivative/diff.js +241 -0
  96. package/output/calculus/dispatch.d.ts +1 -0
  97. package/output/calculus/dispatch.js +25 -0
  98. package/output/calculus/fresnel.d.ts +16 -0
  99. package/output/calculus/fresnel.js +39 -0
  100. package/output/calculus/integrate/byParts.d.ts +18 -0
  101. package/output/calculus/integrate/byParts.js +339 -0
  102. package/output/calculus/integrate/bySubstitution.d.ts +135 -0
  103. package/output/calculus/integrate/bySubstitution.js +411 -0
  104. package/output/calculus/integrate/integrate.d.ts +38 -0
  105. package/output/calculus/integrate/integrate.js +652 -0
  106. package/output/calculus/integrate/integrationTable.d.ts +2 -0
  107. package/output/calculus/integrate/integrationTable.js +914 -0
  108. package/output/calculus/integrate/utils.d.ts +28 -0
  109. package/output/calculus/integrate/utils.js +96 -0
  110. package/output/calculus/laplace/ilaplace.d.ts +31 -0
  111. package/output/calculus/laplace/ilaplace.js +192 -0
  112. package/output/calculus/laplace/ilaplaceTable.d.ts +2 -0
  113. package/output/calculus/laplace/ilaplaceTable.js +200 -0
  114. package/output/calculus/laplace/laplace.d.ts +22 -0
  115. package/output/calculus/laplace/laplace.js +109 -0
  116. package/output/calculus/laplace/laplaceTable.d.ts +2 -0
  117. package/output/calculus/laplace/laplaceTable.js +187 -0
  118. package/output/calculus/limit/limit.d.ts +35 -0
  119. package/output/calculus/limit/limit.js +1183 -0
  120. package/output/calculus/limit/limitsTable.d.ts +2 -0
  121. package/output/calculus/limit/limitsTable.js +7 -0
  122. package/output/core/Settings.d.ts +32 -0
  123. package/output/core/Settings.js +68 -0
  124. package/output/core/classes/assumption/Assumption.d.ts +218 -0
  125. package/output/core/classes/assumption/Assumption.js +609 -0
  126. package/output/core/classes/assumption/assertiveFunctions.d.ts +6 -0
  127. package/output/core/classes/assumption/assertiveFunctions.js +64 -0
  128. package/output/core/classes/assumption/assume.d.ts +90 -0
  129. package/output/core/classes/assumption/assume.js +145 -0
  130. package/output/core/classes/assumption/dispatch.d.ts +1 -0
  131. package/output/core/classes/assumption/dispatch.js +11 -0
  132. package/output/core/classes/collection/Collection.d.ts +107 -0
  133. package/output/core/classes/collection/Collection.js +240 -0
  134. package/output/core/classes/complex/Complex.d.ts +109 -0
  135. package/output/core/classes/complex/Complex.js +153 -0
  136. package/output/core/classes/decimalSet/DecimalSet.d.ts +226 -0
  137. package/output/core/classes/decimalSet/DecimalSet.js +454 -0
  138. package/output/core/classes/dictionary/Dictionary.d.ts +102 -0
  139. package/output/core/classes/dictionary/Dictionary.js +216 -0
  140. package/output/core/classes/equation/Equation.d.ts +256 -0
  141. package/output/core/classes/equation/Equation.js +350 -0
  142. package/output/core/classes/expression/CoeffObject.d.ts +100 -0
  143. package/output/core/classes/expression/CoeffObject.js +197 -0
  144. package/output/core/classes/expression/Expression.d.ts +1691 -0
  145. package/output/core/classes/expression/Expression.js +2381 -0
  146. package/output/core/classes/expression/analysis.d.ts +25 -0
  147. package/output/core/classes/expression/analysis.js +218 -0
  148. package/output/core/classes/expression/collect.d.ts +9 -0
  149. package/output/core/classes/expression/collect.js +49 -0
  150. package/output/core/classes/expression/format.d.ts +54 -0
  151. package/output/core/classes/expression/format.js +340 -0
  152. package/output/core/classes/expression/products.d.ts +23 -0
  153. package/output/core/classes/expression/products.js +115 -0
  154. package/output/core/classes/expression/shortcuts.d.ts +35 -0
  155. package/output/core/classes/expression/shortcuts.js +129 -0
  156. package/output/core/classes/expression/traversal.d.ts +31 -0
  157. package/output/core/classes/expression/traversal.js +216 -0
  158. package/output/core/classes/expression/trig.d.ts +25 -0
  159. package/output/core/classes/expression/trig.js +40 -0
  160. package/output/core/classes/expression/utils.d.ts +61 -0
  161. package/output/core/classes/expression/utils.js +235 -0
  162. package/output/core/classes/lookupTable/LookupTable.d.ts +12 -0
  163. package/output/core/classes/lookupTable/LookupTable.js +55 -0
  164. package/output/core/classes/matrix/Matrix.d.ts +227 -0
  165. package/output/core/classes/matrix/Matrix.js +901 -0
  166. package/output/core/classes/matrix/Sylvester.d.ts +11 -0
  167. package/output/core/classes/matrix/Sylvester.js +54 -0
  168. package/output/core/classes/matrix/dispatch.d.ts +1 -0
  169. package/output/core/classes/matrix/dispatch.js +19 -0
  170. package/output/core/classes/matrix/functions.d.ts +28 -0
  171. package/output/core/classes/matrix/functions.js +57 -0
  172. package/output/core/classes/matrix/utils.d.ts +9 -0
  173. package/output/core/classes/matrix/utils.js +22 -0
  174. package/output/core/classes/parser/Parser.d.ts +493 -0
  175. package/output/core/classes/parser/Parser.js +1863 -0
  176. package/output/core/classes/parser/Token.d.ts +58 -0
  177. package/output/core/classes/parser/Token.js +137 -0
  178. package/output/core/classes/parser/constants.d.ts +162 -0
  179. package/output/core/classes/parser/constants.js +229 -0
  180. package/output/core/classes/parser/controlFlowSignals.d.ts +38 -0
  181. package/output/core/classes/parser/controlFlowSignals.js +60 -0
  182. package/output/core/classes/parser/helpers.d.ts +21 -0
  183. package/output/core/classes/parser/helpers.js +42 -0
  184. package/output/core/classes/parser/operations/add.d.ts +15 -0
  185. package/output/core/classes/parser/operations/add.js +236 -0
  186. package/output/core/classes/parser/operations/comma.d.ts +7 -0
  187. package/output/core/classes/parser/operations/comma.js +11 -0
  188. package/output/core/classes/parser/operations/compare.d.ts +21 -0
  189. package/output/core/classes/parser/operations/compare.js +474 -0
  190. package/output/core/classes/parser/operations/divide.d.ts +2 -0
  191. package/output/core/classes/parser/operations/divide.js +72 -0
  192. package/output/core/classes/parser/operations/functions.d.ts +46 -0
  193. package/output/core/classes/parser/operations/functions.js +438 -0
  194. package/output/core/classes/parser/operations/multiply.d.ts +11 -0
  195. package/output/core/classes/parser/operations/multiply.js +328 -0
  196. package/output/core/classes/parser/operations/power.d.ts +48 -0
  197. package/output/core/classes/parser/operations/power.js +673 -0
  198. package/output/core/classes/parser/operations/subtract.d.ts +3 -0
  199. package/output/core/classes/parser/operations/subtract.js +36 -0
  200. package/output/core/classes/parser/preprocess.d.ts +7 -0
  201. package/output/core/classes/parser/preprocess.js +246 -0
  202. package/output/core/classes/parser/scripting/controlFlow.d.ts +23 -0
  203. package/output/core/classes/parser/scripting/controlFlow.js +279 -0
  204. package/output/core/classes/parser/scripting/deferred.d.ts +4 -0
  205. package/output/core/classes/parser/scripting/deferred.js +65 -0
  206. package/output/core/classes/parser/scripting/dispatch.d.ts +1 -0
  207. package/output/core/classes/parser/scripting/dispatch.js +62 -0
  208. package/output/core/classes/parser/scripting/evaluate.d.ts +23 -0
  209. package/output/core/classes/parser/scripting/evaluate.js +128 -0
  210. package/output/core/classes/parser/scripting/functions.d.ts +14 -0
  211. package/output/core/classes/parser/scripting/functions.js +59 -0
  212. package/output/core/classes/parser/scripting/scope.d.ts +8 -0
  213. package/output/core/classes/parser/scripting/scope.js +132 -0
  214. package/output/core/classes/parser/types.d.ts +130 -0
  215. package/output/core/classes/parser/types.js +2 -0
  216. package/output/core/classes/parser/wrappers/IndexedReference.d.ts +31 -0
  217. package/output/core/classes/parser/wrappers/IndexedReference.js +68 -0
  218. package/output/core/classes/parser/wrappers/KeyValuePair.d.ts +24 -0
  219. package/output/core/classes/parser/wrappers/KeyValuePair.js +51 -0
  220. package/output/core/classes/polynomial/Polynomial.d.ts +504 -0
  221. package/output/core/classes/polynomial/Polynomial.js +1195 -0
  222. package/output/core/classes/polynomial/SparsePolynomial.d.ts +221 -0
  223. package/output/core/classes/polynomial/SparsePolynomial.js +824 -0
  224. package/output/core/classes/polynomial/SparsePolynomialAdapter.d.ts +56 -0
  225. package/output/core/classes/polynomial/SparsePolynomialAdapter.js +241 -0
  226. package/output/core/classes/polynomial/Term.d.ts +222 -0
  227. package/output/core/classes/polynomial/Term.js +430 -0
  228. package/output/core/classes/polynomial/adapters.d.ts +18 -0
  229. package/output/core/classes/polynomial/adapters.js +33 -0
  230. package/output/core/classes/polynomial/dispatch.d.ts +1 -0
  231. package/output/core/classes/polynomial/dispatch.js +14 -0
  232. package/output/core/classes/polynomial/functions.d.ts +77 -0
  233. package/output/core/classes/polynomial/functions.js +189 -0
  234. package/output/core/classes/polynomial/utils.d.ts +62 -0
  235. package/output/core/classes/polynomial/utils.js +207 -0
  236. package/output/core/classes/rational/Rational.d.ts +501 -0
  237. package/output/core/classes/rational/Rational.js +829 -0
  238. package/output/core/classes/seq/SEQ.d.ts +13 -0
  239. package/output/core/classes/seq/SEQ.js +137 -0
  240. package/output/core/classes/valuesSet/ValuesSet.d.ts +187 -0
  241. package/output/core/classes/valuesSet/ValuesSet.js +399 -0
  242. package/output/core/classes/vector/Vector.d.ts +222 -0
  243. package/output/core/classes/vector/Vector.js +501 -0
  244. package/output/core/classes/vector/dispatch.d.ts +1 -0
  245. package/output/core/classes/vector/dispatch.js +11 -0
  246. package/output/core/classes/vector/functions.d.ts +28 -0
  247. package/output/core/classes/vector/functions.js +47 -0
  248. package/output/core/common/classes/MathematicalAggregate.d.ts +53 -0
  249. package/output/core/common/classes/MathematicalAggregate.js +149 -0
  250. package/output/core/common/classes/Scope.d.ts +62 -0
  251. package/output/core/common/classes/Scope.js +122 -0
  252. package/output/core/common/classes/StructuredEntity.d.ts +55 -0
  253. package/output/core/common/classes/StructuredEntity.js +151 -0
  254. package/output/core/common/common.d.ts +62 -0
  255. package/output/core/common/common.js +74 -0
  256. package/output/core/common/functions/functions.d.ts +14 -0
  257. package/output/core/common/functions/functions.js +33 -0
  258. package/output/core/common/functions/structuredEntityUtils.d.ts +27 -0
  259. package/output/core/common/functions/structuredEntityUtils.js +40 -0
  260. package/output/core/converters/BaseConverter.d.ts +97 -0
  261. package/output/core/converters/BaseConverter.js +405 -0
  262. package/output/core/converters/Converter.d.ts +111 -0
  263. package/output/core/converters/Converter.js +806 -0
  264. package/output/core/converters/Pattern.d.ts +71 -0
  265. package/output/core/converters/Pattern.js +302 -0
  266. package/output/core/dispatch.d.ts +52 -0
  267. package/output/core/dispatch.js +26 -0
  268. package/output/core/errors.d.ts +316 -0
  269. package/output/core/errors.js +349 -0
  270. package/output/core/fullFunctions.d.ts +7 -0
  271. package/output/core/fullFunctions.js +31 -0
  272. package/output/core/functions/bigint/bigint.d.ts +133 -0
  273. package/output/core/functions/bigint/bigint.js +444 -0
  274. package/output/core/functions/bigint/primeFactor.d.ts +51 -0
  275. package/output/core/functions/bigint/primeFactor.js +267 -0
  276. package/output/core/functions/bigint/primes.d.ts +1 -0
  277. package/output/core/functions/bigint/primes.js +11 -0
  278. package/output/core/functions/build/definitions.d.ts +12 -0
  279. package/output/core/functions/build/definitions.js +139 -0
  280. package/output/core/functions/build/index.d.ts +32 -0
  281. package/output/core/functions/build/index.js +136 -0
  282. package/output/core/functions/complex.d.ts +90 -0
  283. package/output/core/functions/complex.dispatch.d.ts +1 -0
  284. package/output/core/functions/complex.dispatch.js +16 -0
  285. package/output/core/functions/complex.js +482 -0
  286. package/output/core/functions/decimal.d.ts +24 -0
  287. package/output/core/functions/decimal.js +665 -0
  288. package/output/core/functions/expand/expand.d.ts +42 -0
  289. package/output/core/functions/expand/expand.js +376 -0
  290. package/output/core/functions/fresnelNumeric.d.ts +12 -0
  291. package/output/core/functions/fresnelNumeric.js +123 -0
  292. package/output/core/functions/numeric.d.ts +140 -0
  293. package/output/core/functions/numeric.js +790 -0
  294. package/output/core/functions/rationalNormalization.d.ts +11 -0
  295. package/output/core/functions/rationalNormalization.js +117 -0
  296. package/output/core/functions/setFunction.d.ts +19 -0
  297. package/output/core/functions/setFunction.js +75 -0
  298. package/output/core/functions/string.d.ts +26 -0
  299. package/output/core/functions/string.js +102 -0
  300. package/output/core/functions/subst.d.ts +90 -0
  301. package/output/core/functions/subst.js +506 -0
  302. package/output/core/functions/utils.d.ts +24 -0
  303. package/output/core/functions/utils.js +51 -0
  304. package/output/core/parserFunctions.d.ts +7 -0
  305. package/output/core/parserFunctions.js +25 -0
  306. package/output/core/types.d.ts +48 -0
  307. package/output/core/types.js +2 -0
  308. package/output/index.d.ts +359 -0
  309. package/output/index.js +739 -0
  310. package/output/math/defint/defint.d.ts +18 -0
  311. package/output/math/defint/defint.js +60 -0
  312. package/output/math/defint/defintDecimal.d.ts +37 -0
  313. package/output/math/defint/defintDecimal.js +321 -0
  314. package/output/math/defint/defintNative.d.ts +57 -0
  315. package/output/math/defint/defintNative.js +281 -0
  316. package/output/math/dispatch.d.ts +1 -0
  317. package/output/math/dispatch.js +101 -0
  318. package/output/math/geometry.d.ts +12 -0
  319. package/output/math/geometry.js +55 -0
  320. package/output/math/math.d.ts +695 -0
  321. package/output/math/math.js +1955 -0
  322. package/output/math/trig.d.ts +518 -0
  323. package/output/math/trig.js +1444 -0
  324. package/output/math/trunc.d.ts +19 -0
  325. package/output/math/trunc.js +36 -0
  326. package/output/math/utils.d.ts +66 -0
  327. package/output/math/utils.js +219 -0
  328. package/output/solve/classes/DecimalMatrix.d.ts +17 -0
  329. package/output/solve/classes/DecimalMatrix.js +86 -0
  330. package/output/solve/classes/FunctionSolver.d.ts +135 -0
  331. package/output/solve/classes/FunctionSolver.js +433 -0
  332. package/output/solve/classes/MultivariateSolver.d.ts +84 -0
  333. package/output/solve/classes/MultivariateSolver.js +240 -0
  334. package/output/solve/classes/PolynomialSolver.d.ts +104 -0
  335. package/output/solve/classes/PolynomialSolver.js +492 -0
  336. package/output/solve/classes/SolutionSet.d.ts +172 -0
  337. package/output/solve/classes/SolutionSet.js +434 -0
  338. package/output/solve/classes/Solver.d.ts +17 -0
  339. package/output/solve/classes/Solver.js +132 -0
  340. package/output/solve/classes/SymbolicSolver.d.ts +74 -0
  341. package/output/solve/classes/SymbolicSolver.js +601 -0
  342. package/output/solve/dispatch.d.ts +1 -0
  343. package/output/solve/dispatch.js +13 -0
  344. package/output/solve/linsolve.d.ts +53 -0
  345. package/output/solve/linsolve.js +233 -0
  346. package/output/solve/solve.d.ts +44 -0
  347. package/output/solve/solve.js +368 -0
  348. package/output/solve/solveSystem.d.ts +31 -0
  349. package/output/solve/solveSystem.js +266 -0
  350. package/output/solve/utils.d.ts +10 -0
  351. package/output/solve/utils.js +58 -0
  352. package/output/utils/array.d.ts +42 -0
  353. package/output/utils/array.js +98 -0
  354. package/output/utils/debug.d.ts +131 -0
  355. package/output/utils/debug.js +296 -0
  356. package/output/utils/decimal.d.ts +3 -0
  357. package/output/utils/decimal.js +16 -0
  358. package/output/utils/numeric.d.ts +14 -0
  359. package/output/utils/numeric.js +51 -0
  360. package/output/utils/object.d.ts +26 -0
  361. package/output/utils/object.js +56 -0
  362. package/package.json +178 -57
  363. package/.travis.yml +0 -3
  364. package/Algebra.js +0 -4568
  365. package/CODE_OF_CONDUCT.md +0 -46
  366. package/CONTRIBUTING.md +0 -14
  367. package/Calculus.js +0 -2675
  368. package/Extra.js +0 -622
  369. package/Solve.js +0 -1783
  370. package/all.js +0 -16
  371. package/all.min.js +0 -1
  372. package/gulpfile.js +0 -16
  373. package/index.html +0 -158
  374. package/license.txt +0 -19
  375. package/nerdamer.core.js +0 -12510
  376. package/spec/LaTeX.spec.js +0 -302
  377. package/spec/TeXConvert.spec.js +0 -8
  378. package/spec/algebra.spec.js +0 -287
  379. package/spec/basic_parser.spec.js +0 -134
  380. package/spec/build.spec.js +0 -131
  381. package/spec/calculus.spec.js +0 -183
  382. package/spec/core.spec.js +0 -2970
  383. package/spec/extra.spec.js +0 -54
  384. package/spec/solve.spec.js +0 -126
  385. package/spec/support/jasmine.json +0 -11
  386. package/spec/support/utils.js +0 -42
  387. package/spec/text.spec.js +0 -132
@@ -0,0 +1,506 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.prodSubst = prodSubst;
4
+ exports.sumSubst = sumSubst;
5
+ exports.subst = subst;
6
+ exports.getU = getU;
7
+ exports.uSub = uSub;
8
+ exports.rewriteRadicals = rewriteRadicals;
9
+ exports.subRadicals = subRadicals;
10
+ exports.uUnSub = uUnSub;
11
+ exports.uSubConstants = uSubConstants;
12
+ exports.uSubFN = uSubFN;
13
+ exports.uSubEXP = uSubEXP;
14
+ const Expression_1 = require("../classes/expression/Expression");
15
+ const shortcuts_1 = require("../classes/expression/shortcuts");
16
+ const utils_1 = require("../classes/expression/utils");
17
+ const helpers_1 = require("../classes/parser/helpers");
18
+ const Settings_1 = require("../Settings");
19
+ function prodSubst(expression, value, withValue, includeNumeric) {
20
+ let retval;
21
+ /**
22
+ * The overview:
23
+ * We loop through the elements of each. The multiplier of the the power (meaning the power being substituted divided by the existing),
24
+ * has to match for each of the elements. Additionally, that ratio has to be an integer. If neither criteria is satisfied, then
25
+ * we exit and return the expression.
26
+ */
27
+ if (expression.isProduct()) {
28
+ if (value.isProduct()) {
29
+ // First check the multipliers. This has to be an integer
30
+ const m = expression.getMultiplier().div(value.getMultiplier());
31
+ if (!m.isInteger() && !Settings_1.Settings.ALLOW_RAT_SUBS) {
32
+ retval = expression.copy();
33
+ }
34
+ else {
35
+ let power;
36
+ // Get the expression elements
37
+ let expressionElements = expression.elementsArray();
38
+ // Get the elements of the value being subbed.
39
+ const valueElements = value.elementsArray();
40
+ // We'll loop through the elements of the value to be subbed
41
+ // Create an array of the items not substituted
42
+ // A flag to keep track if a substitution occurred
43
+ let success = false;
44
+ // The array of the elements encountered
45
+ let filtered = [];
46
+ // Keep track of the number of element substituted
47
+ let remaining = valueElements.length;
48
+ while (valueElements.length > 0) {
49
+ // Reset the filtered array
50
+ filtered = [];
51
+ // Start with the assumption that no substitution occurred
52
+ success = false;
53
+ const vc = valueElements[valueElements.length - 1];
54
+ valueElements.pop();
55
+ for (const ec of expressionElements) {
56
+ // First find the value
57
+ if (ec.value === vc.value) {
58
+ // Then get the ratio of their powers
59
+ const pr = ec.getPower().div(vc.getPower());
60
+ // If the power ratio is undefined then we're at the first value. So just set the value to this value
61
+ if (power === undefined) {
62
+ power = pr;
63
+ }
64
+ // If the ratio of the powers is not an integer then we're done and exit or
65
+ // If the power ratios don't match then we're done. For instance if we're substituting x*y in x^2*y,
66
+ // the ratio will be (2, 1) and it's therefore not a valid substitution
67
+ if ((!pr.isInteger() || !pr.eq(power)) && !ec.isEXP()) {
68
+ break;
69
+ }
70
+ success = true;
71
+ remaining--;
72
+ }
73
+ else {
74
+ filtered.push(subst(ec, value, withValue, includeNumeric));
75
+ }
76
+ }
77
+ // If any substitution failed then we're done and exit
78
+ if (!success) {
79
+ break;
80
+ }
81
+ // Update the list with the new one which doesn't have the substituted element
82
+ expressionElements = filtered;
83
+ }
84
+ // If all the elements weren't substituted then return the original expression
85
+ if (remaining !== 0 || power === undefined) {
86
+ retval = (0, utils_1.product)(...expression.elementsArray(true).map(x => {
87
+ return subst(x, value, withValue, includeNumeric);
88
+ })).pow(expression.getPower());
89
+ }
90
+ // Otherwise add the substituted value to the filtered set and return the sum product
91
+ else {
92
+ filtered.push(withValue.pow(power));
93
+ retval = (0, utils_1.product)(...filtered);
94
+ // Transfer the power and multiplier
95
+ retval.multiplier = retval.getMultiplier().times(m);
96
+ }
97
+ // Make substitutions in the power
98
+ retval = retval.pow(subst(expression.getPower(), value, withValue, includeNumeric));
99
+ }
100
+ }
101
+ else {
102
+ // Convert it to an array, substitute out each element, convert it back to a product
103
+ // but make sure to put back the expression multiplier.
104
+ retval = (0, utils_1.product)(...expression.elementsArray(true).map(x => {
105
+ return subst(x, value, withValue, includeNumeric);
106
+ })).pow(expression.getPower());
107
+ }
108
+ }
109
+ return retval || expression;
110
+ }
111
+ /**
112
+ * Performs a substitution on a sum
113
+ *
114
+ * @param expression
115
+ * @param value
116
+ * @param withValue
117
+ * @returns
118
+ */
119
+ function sumSubst(expression, value, withValue, includeNumeric) {
120
+ let retval;
121
+ if (!expression.isSum()) {
122
+ return expression;
123
+ }
124
+ // Put back later (do NOT mutate fields directly)
125
+ const exprPow = expression.getPower();
126
+ const exprMul = expression.getMultiplier();
127
+ if (value.isSum()) {
128
+ // Work on raw elements first (do not subst yet)
129
+ const remaining = expression.elementsArray().slice();
130
+ // Decide how to treat the value being substituted
131
+ const valueElements = value.isSum() && value.isLinear() ? value.elementsArray() : [value.toUnitMultiplier()];
132
+ const matched = [];
133
+ let m;
134
+ for (const vc of valueElements) {
135
+ // Find exactly one matching term in the remaining pool
136
+ const idx = remaining.findIndex(ec => ec.value === vc.value && ec.getPower().eq(vc.getPower()));
137
+ if (idx === -1) {
138
+ // Fail: cannot substitute, so just recurse normally on the whole sum
139
+ const out = (0, utils_1.sum)(...expression
140
+ .elementsArray()
141
+ .map(x => subst(x, value, withValue, includeNumeric)));
142
+ return out.pow(exprPow).times(exprMul);
143
+ }
144
+ const ec = remaining[idx];
145
+ remaining.splice(idx, 1);
146
+ matched.push(ec);
147
+ const tm = ec.div(vc);
148
+ if (!m) {
149
+ m = tm;
150
+ }
151
+ else if (!tm.eq(m)) {
152
+ // Ratio mismatch: fail -> normal recursion
153
+ const out = (0, utils_1.sum)(...expression
154
+ .elementsArray()
155
+ .map(x => subst(x, value, withValue, includeNumeric)));
156
+ return out.pow(exprPow).times(exprMul);
157
+ }
158
+ }
159
+ // Success: substitute the whole group by withValue * m,
160
+ // and recurse into the remaining terms (important!)
161
+ const substituted = withValue.times(m || (0, shortcuts_1.one)());
162
+ const rewrittenTerms = remaining.map(t => subst(t, value, withValue, includeNumeric));
163
+ rewrittenTerms.push(substituted);
164
+ retval = (0, utils_1.sum)(...rewrittenTerms)
165
+ .pow(exprPow)
166
+ .times(exprMul);
167
+ }
168
+ else {
169
+ // Original behavior for non-sum value: recurse per term
170
+ retval = (0, utils_1.sum)(...expression.elementsArray().map(x => subst(x, value, withValue, includeNumeric)))
171
+ .pow(exprPow)
172
+ .times(exprMul);
173
+ }
174
+ return retval || expression;
175
+ }
176
+ /**
177
+ * Replaces a value with another using the existing Expression tree.
178
+ *
179
+ * @param expression The expression being used to perform the substitution
180
+ * @param value The value currently in the expression
181
+ * @param withValue The value that the substitution is being replaced with
182
+ */
183
+ function subst(expression, value, withValue, includeNumeric = false) {
184
+ expression = Expression_1.Expression.create(expression);
185
+ value = Expression_1.Expression.create(value);
186
+ withValue = Expression_1.Expression.create(withValue);
187
+ let retval;
188
+ // If the value to be substituted is a sum or product but the value does not contain
189
+ // any then we're done. Also, we don't consider a number a proper LHS value.
190
+ if (expression.isNUM() && !includeNumeric) {
191
+ retval = expression;
192
+ }
193
+ // We next move to the most obvious substitution which is the expression is equal to the value
194
+ else if (expression.eq(value)) {
195
+ retval = withValue;
196
+ }
197
+ // A variable can carry its coefficient and numeric power on the node itself. Replace
198
+ // that base directly so a simple substitution stays within the existing expression tree.
199
+ else if (value.isVAR() &&
200
+ value.getPower().isOne() &&
201
+ value.getMultiplier().isOne() &&
202
+ expression.isVAR() &&
203
+ expression.value === value.value) {
204
+ const exponent = subst(expression.getPower(), value, withValue, includeNumeric);
205
+ const multiplier = expression.getMultiplier();
206
+ if (exponent.isNUM() && exponent.getMultiplier().isNegative()) {
207
+ retval = (0, shortcuts_1.one)().div(withValue.copy().pow(exponent.abs()));
208
+ }
209
+ else {
210
+ retval = withValue.copy().pow(exponent);
211
+ }
212
+ if (!multiplier.isOne()) {
213
+ retval = retval.times(multiplier);
214
+ }
215
+ }
216
+ else if (expression.isProduct()) {
217
+ retval = prodSubst(expression, value, withValue, includeNumeric);
218
+ }
219
+ // The power has to be one because we cannot swap terms otherwise
220
+ // TODO: SUM with nested GRP
221
+ else if (expression.isSum()) {
222
+ // Perform a simple sum factor on the expression so we can detect the t+1 in expression like a*t+a.
223
+ // This should not affect a substitution for the a*t since products are checked first.
224
+ // expression = sumFactor(expression);
225
+ // If it was factored then it belongs to the product substitution
226
+ retval = sumSubst(expression, value, withValue, includeNumeric);
227
+ }
228
+ else if (expression.isFunction()) {
229
+ if (expression.value === value.value) {
230
+ retval = withValue.copy();
231
+ }
232
+ else {
233
+ retval = Expression_1.Expression.Function(expression.name);
234
+ retval.args = expression.getArguments().map((x) => {
235
+ return subst(x, value, withValue, includeNumeric);
236
+ });
237
+ // Update the value to reflect the new argument(s)
238
+ retval.updateValue();
239
+ }
240
+ retval = retval.pow(expression.getPower()).times(expression.getMultiplier());
241
+ }
242
+ else if (expression.isEXP()) {
243
+ const base = subst(expression.getBase(), value, withValue, true);
244
+ const exp = subst(expression.getPower(), value, withValue, includeNumeric);
245
+ retval = base.pow(exp).times(expression.getMultiplier());
246
+ }
247
+ return retval || expression;
248
+ }
249
+ function getU(x, map) {
250
+ x = Expression_1.Expression.create(x);
251
+ const variables = x.variables();
252
+ map ??= {};
253
+ let count = 0;
254
+ let u;
255
+ do {
256
+ u = `u${count}`;
257
+ count++;
258
+ } while (variables.includes(u) || u in map);
259
+ return u;
260
+ }
261
+ /**
262
+ * Replaces one repeated sub-expression with a generated `uN` symbol.
263
+ *
264
+ * The generated symbol is chosen so it does not collide with variables already present
265
+ * in the expression or substitution map. Pass the returned map to later calls when
266
+ * several substitutions should share one namespace, then use {@link uUnSub} to restore
267
+ * the original expressions.
268
+ *
269
+ * @param x - Expression in which the substitution will occur.
270
+ * @param value - Sub-expression to replace.
271
+ * @param map - Existing substitution map to extend.
272
+ * @returns The substituted expression and the updated substitution map.
273
+ *
274
+ * @example
275
+ * ```ts
276
+ * const [substituted, map] = uSub('cos(x)^2+cos(x)+1', 'cos(x)');
277
+ * substituted.text({ sort: true }); // "u0^2+u0+1"
278
+ * uUnSub(substituted, map).eq('cos(x)^2+cos(x)+1'); // true
279
+ * ```
280
+ */
281
+ function uSub(x, value, map) {
282
+ // Create the map object is one wasn't provided
283
+ map ??= {};
284
+ x = Expression_1.Expression.create(x);
285
+ value = Expression_1.Expression.create(value);
286
+ // Get a suitable u
287
+ const u = getU(x, map);
288
+ // Perform the substitution
289
+ const subbed = subst(x, value, (0, helpers_1._)(u));
290
+ // Mark it as updated
291
+ if (!subbed.eq(x)) {
292
+ map[u] = value;
293
+ }
294
+ return [subbed, map];
295
+ }
296
+ /**
297
+ * Rewrites powers of one variable through a radical substitution without
298
+ * sending the replacement back through generic nested-power simplification.
299
+ * The caller supplies the substitution degree, so fractional powers become
300
+ * exact integer powers of the replacement variable when possible.
301
+ */
302
+ function rewriteRadicals(e, variable, newVar, n) {
303
+ let retval = e;
304
+ if ((e.isVAR() || e.isEXP()) && e.value === variable) {
305
+ const m = e.getMultiplier();
306
+ const p = e.getPower();
307
+ if (p.isNUM()) {
308
+ const r = p.getMultiplier();
309
+ const newNum = n * r.numerator;
310
+ const newDen = r.denominator < 0n ? -r.denominator : r.denominator;
311
+ if (newNum % newDen !== 0n) {
312
+ retval = Expression_1.Expression.fromRational(m).times(newVar.pow(`${newNum}/${newDen}`));
313
+ }
314
+ else {
315
+ const intPower = newNum / newDen;
316
+ retval = Expression_1.Expression.fromRational(m).times(newVar.pow(intPower.toString()));
317
+ }
318
+ }
319
+ else {
320
+ retval = Expression_1.Expression.fromRational(m).times(newVar.pow(p.times(n.toString())));
321
+ }
322
+ }
323
+ else if (e.isEXP()) {
324
+ const base = rewriteRadicals(e.getBase(), variable, newVar, n);
325
+ const power = rewriteRadicals(e.getPower(), variable, newVar, n);
326
+ retval = Expression_1.Expression.toEXP(base, power);
327
+ if (!e.getMultiplier().isOne()) {
328
+ retval = retval.times(Expression_1.Expression.fromRational(e.getMultiplier()));
329
+ }
330
+ }
331
+ else if (e.isSum()) {
332
+ const m = e.getMultiplier();
333
+ const p = e.getPower();
334
+ retval = (0, shortcuts_1.zero)();
335
+ for (const term of e.elementsArray()) {
336
+ retval = retval.plus(rewriteRadicals(term, variable, newVar, n));
337
+ }
338
+ if (!p.isOne()) {
339
+ retval = retval.pow(p);
340
+ }
341
+ if (!m.isOne()) {
342
+ retval = retval.times(Expression_1.Expression.fromRational(m));
343
+ }
344
+ }
345
+ else if (e.isProduct()) {
346
+ const m = e.getMultiplier();
347
+ const p = e.getPower();
348
+ retval = (0, shortcuts_1.one)();
349
+ for (const element of e.elementsArray()) {
350
+ retval = retval.times(rewriteRadicals(element, variable, newVar, n));
351
+ }
352
+ if (!p.isOne()) {
353
+ retval = retval.pow(p);
354
+ }
355
+ if (!m.isOne()) {
356
+ retval = retval.times(Expression_1.Expression.fromRational(m));
357
+ }
358
+ }
359
+ else if (e.isFunction()) {
360
+ const args = e.getArguments();
361
+ if (args.length > 0) {
362
+ const newArgs = args.map(a => rewriteRadicals(a, variable, newVar, n));
363
+ retval = Expression_1.Expression.toFunction(e.name, newArgs);
364
+ retval.multiplier = e.getMultiplier().copy();
365
+ retval = Expression_1.Expression.setPower(retval, e.getPower());
366
+ }
367
+ }
368
+ return retval;
369
+ }
370
+ function subRadicals(x) {
371
+ let num = x.getNumerator();
372
+ let den = x.getDenominator();
373
+ const subs = {};
374
+ // The map of uSubstitutions
375
+ const map = {};
376
+ // A record to track which variables already map to which u
377
+ const references = {};
378
+ function collectPowers(exp) {
379
+ const elements = exp.elementsArray();
380
+ // We're going to loop through the elements and look for radicals
381
+ // Like variables are just going to get their combined power so
382
+ // a^(1/n)+a^(1/m) will just be mapped to a: n*m
383
+ for (const e of elements) {
384
+ if (e.hasRadical()) {
385
+ // Don't touch numbers.
386
+ if (e.isNUM()) {
387
+ continue;
388
+ }
389
+ const n = e.getPower().getDenominator();
390
+ const v = e.value;
391
+ const existing = subs[v];
392
+ // Multiply the power on the existing if one already exists
393
+ subs[v] = existing ? subs[v].times(n) : n;
394
+ }
395
+ }
396
+ }
397
+ function makeSubstitutions(exp) {
398
+ // Make the substitutions
399
+ for (const y in subs) {
400
+ const u = references[y] ? references[y] : getU(exp, map);
401
+ // Map the u to the variable
402
+ references[y] = u;
403
+ const pow = subs[y];
404
+ // Make the substitution
405
+ const n = pow.getMultiplier().numerator;
406
+ map[u] = Expression_1.Expression.create(y).pow(pow.invert());
407
+ exp = rewriteRadicals(exp, y, Expression_1.Expression.create(u), n);
408
+ }
409
+ return exp;
410
+ }
411
+ collectPowers(num);
412
+ collectPowers(den);
413
+ num = makeSubstitutions(num);
414
+ den = makeSubstitutions(den);
415
+ return [num.div(den), map];
416
+ }
417
+ /**
418
+ * Restores substitutions produced by {@link uSub}.
419
+ *
420
+ * @param expression - Expression containing generated substitution symbols.
421
+ * @param map - Map returned by one or more u-substitution calls.
422
+ * @returns The expression after restoring every mapped value.
423
+ */
424
+ function uUnSub(expression, map) {
425
+ // Substitute back in all the elements. Remember that the order is not preserved.
426
+ for (const u in map) {
427
+ const value = map[u];
428
+ expression = subst(expression, (0, helpers_1._)(u), value);
429
+ }
430
+ return expression;
431
+ }
432
+ /**
433
+ * Performs a u-substitution of all the constants in the expression.
434
+ *
435
+ * @param expression
436
+ * @param map
437
+ * @returns
438
+ */
439
+ function uSubConstants(expression, map) {
440
+ map ??= {};
441
+ const constants = new Set();
442
+ function collectConstants(current) {
443
+ // The imaginary unit is a mathematical constant, but isConstant() only recognizes parser
444
+ // constants such as pi and e. Promote i here as well so polynomial factorization does not
445
+ // treat it as an ordinary polynomial variable.
446
+ if (current.isVAR() && (current.isConstant() || current.isI())) {
447
+ constants.add(current.value);
448
+ }
449
+ if (current.args) {
450
+ for (const argument of current.args) {
451
+ collectConstants(argument);
452
+ }
453
+ }
454
+ if (current.elements) {
455
+ for (const element of Object.values(current.elements)) {
456
+ collectConstants(element);
457
+ }
458
+ }
459
+ if (current.isEXP()) {
460
+ collectConstants(current.getBase());
461
+ collectConstants(current.getPower());
462
+ }
463
+ }
464
+ collectConstants(expression);
465
+ for (const c of constants) {
466
+ [expression, map] = uSub(expression, (0, helpers_1._)(c), map);
467
+ }
468
+ return [expression, map];
469
+ }
470
+ /**
471
+ * Performs a u-substitution on all the functions in the expression
472
+ *
473
+ * @param expression
474
+ * @param map
475
+ * @returns
476
+ */
477
+ function uSubFN(expression, map) {
478
+ // Create the map object if none was provided
479
+ map ??= {};
480
+ // We get all the functions in the expression. Next we'll u-substitute each one.
481
+ expression.functions(undefined, true).forEach(fn => {
482
+ [expression, map] = uSub(expression, (0, helpers_1._)(fn), map);
483
+ });
484
+ return [expression, map];
485
+ }
486
+ /**
487
+ * Performs a u-substitution on all the exponential functions in the expression
488
+ * @param expression
489
+ * @param map
490
+ * @returns
491
+ */
492
+ function uSubEXP(expression, map) {
493
+ map ??= {};
494
+ const elementSet = new Set();
495
+ // Create a list of all the EXP function
496
+ expression.forEveryElement(e => {
497
+ if (e.isEXP()) {
498
+ elementSet.add(e.toUnitMultiplier().text());
499
+ }
500
+ return e;
501
+ });
502
+ for (const x of elementSet) {
503
+ [expression, map] = uSub(expression, (0, helpers_1._)(x), map);
504
+ }
505
+ return [expression, map];
506
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Removes duplicates from an array
3
+ *
4
+ * @param arr
5
+ * @returns
6
+ */
7
+ export declare function arrayUnique<T>(arr: T[]): T[];
8
+ /**
9
+ * Similar to concat but only adds elements if they're unique
10
+ *
11
+ * @param fromArray The array being added from
12
+ * @param toArray The array being added to
13
+ */
14
+ export declare function arrayAddUnique<T>(fromArray: T[], toArray: T[]): T[];
15
+ /**
16
+ * Checks to see if the inverse of decimal is within a max bound.
17
+ * For example: given the number 0.01 it will return true for 0 - 100
18
+ *
19
+ * @param n
20
+ * @param max
21
+ * @returns
22
+ */
23
+ export declare function checkDecimal(n: number, max: number): boolean;
24
+ export declare function isSorted<T>(arr: T[]): boolean;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.arrayUnique = arrayUnique;
4
+ exports.arrayAddUnique = arrayAddUnique;
5
+ exports.checkDecimal = checkDecimal;
6
+ exports.isSorted = isSorted;
7
+ /**
8
+ * Removes duplicates from an array
9
+ *
10
+ * @param arr
11
+ * @returns
12
+ */
13
+ function arrayUnique(arr) {
14
+ return [...new Set(arr)];
15
+ }
16
+ /**
17
+ * Similar to concat but only adds elements if they're unique
18
+ *
19
+ * @param fromArray The array being added from
20
+ * @param toArray The array being added to
21
+ */
22
+ function arrayAddUnique(fromArray, toArray) {
23
+ for (const x of fromArray) {
24
+ if (!toArray.includes(x)) {
25
+ toArray.push(x);
26
+ }
27
+ }
28
+ return toArray;
29
+ }
30
+ /**
31
+ * Checks to see if the inverse of decimal is within a max bound.
32
+ * For example: given the number 0.01 it will return true for 0 - 100
33
+ *
34
+ * @param n
35
+ * @param max
36
+ * @returns
37
+ */
38
+ function checkDecimal(n, max) {
39
+ return 1 / (n % 1) <= max;
40
+ }
41
+ function isSorted(arr) {
42
+ if (arr.length <= 1) {
43
+ return true; // An empty array or an array with one element is considered sorted
44
+ }
45
+ for (let i = 1; i < arr.length; i++) {
46
+ if (arr[i - 1] > arr[i]) {
47
+ return false; // If any element is smaller than the previous one, the array is not sorted
48
+ }
49
+ }
50
+ return true; // If the loop completes without returning false, the array is sorted
51
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Registers the function surface supplied by the parser package.
3
+ *
4
+ * Algebra, calculus, and solving are higher-level CAS domains and are composed by
5
+ * the full package rather than the parser package.
6
+ */
7
+ export declare function loadParserFunctions(): void;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadParserFunctions = loadParserFunctions;
4
+ const dispatch_1 = require("./classes/assumption/dispatch");
5
+ const dispatch_2 = require("./classes/matrix/dispatch");
6
+ const dispatch_3 = require("./classes/polynomial/dispatch");
7
+ const dispatch_4 = require("./classes/parser/scripting/dispatch");
8
+ const dispatch_5 = require("./classes/vector/dispatch");
9
+ const complex_dispatch_1 = require("./functions/complex.dispatch");
10
+ const dispatch_6 = require("../math/dispatch");
11
+ /**
12
+ * Registers the function surface supplied by the parser package.
13
+ *
14
+ * Algebra, calculus, and solving are higher-level CAS domains and are composed by
15
+ * the full package rather than the parser package.
16
+ */
17
+ function loadParserFunctions() {
18
+ (0, dispatch_4.loadScriptingFunctions)();
19
+ (0, dispatch_1.loadAssumptionFunctions)();
20
+ (0, dispatch_2.loadMatrixFunctions)();
21
+ (0, dispatch_5.loadVectorFunctions)();
22
+ (0, dispatch_3.loadPolynomialFunctions)();
23
+ (0, complex_dispatch_1.loadComplexFunctions)();
24
+ (0, dispatch_6.loadMathFunctions)();
25
+ }
@@ -0,0 +1,48 @@
1
+ import type { Collection } from './classes/collection/Collection';
2
+ import type { Dictionary } from './classes/dictionary/Dictionary';
3
+ import type { Equation } from './classes/equation/Equation';
4
+ import type { Expression } from './classes/expression/Expression';
5
+ import type { Matrix } from './classes/matrix/Matrix';
6
+ import type { Rational } from './classes/rational/Rational';
7
+ import type { ValuesSet } from './classes/valuesSet/ValuesSet';
8
+ import type { Vector } from './classes/vector/Vector';
9
+ import type Decimal from 'decimal.js';
10
+ /**
11
+ * Values accepted by Nerdamer's expression-oriented parsing APIs.
12
+ *
13
+ * @remarks
14
+ * Strings are interpreted as parser notation. Primitive numbers, `bigint`, and
15
+ * `Decimal` instances are converted through their textual form; {@link Rational}
16
+ * values are converted directly, and existing {@link Expression} values retain their
17
+ * symbolic structure.
18
+ * An existing expression may be reused by identity by APIs such as
19
+ * {@link Expression.create}; request a copy at the receiving API when independent
20
+ * mutation is required.
21
+ */
22
+ export type ExpressionInput = number | string | Rational | Expression | bigint | Decimal;
23
+ /**
24
+ * Values accepted across Nerdamer's root API and direct object model.
25
+ *
26
+ * This extends {@link ExpressionInput} with the structured parser entities and
27
+ * equations that can be passed back into supported operations. Individual functions
28
+ * may accept a narrower subset and should document that restriction locally.
29
+ */
30
+ export type NerdamerInput = ExpressionInput | Vector | ValuesSet | Collection | Matrix | Dictionary | Equation;
31
+ /**
32
+ * Values that can be produced by Nerdamer's parser.
33
+ *
34
+ * @remarks
35
+ * Equality syntax produces an {@link Equation}; bracket, set, matrix, and dictionary
36
+ * syntax can produce the corresponding structured entity instead of an
37
+ * {@link Expression}. Callers of the general parser should therefore narrow this union
38
+ * before using expression-specific methods.
39
+ */
40
+ export type ParserEntity = Expression | Vector | ValuesSet | Collection | Matrix | Equation | Dictionary;
41
+ /**
42
+ * Structured parser entities that participate in aggregate operations.
43
+ *
44
+ * The union describes Nerdamer's supported matrix, vector, ordered collection, and
45
+ * keyed dictionary containers. It excludes value sets and equations, whose semantics
46
+ * are not ordinary elementwise structured operations.
47
+ */
48
+ export type StructuredEntityType = Matrix | Vector | Collection | Dictionary;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });