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,349 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ErrorMessages = exports.EnglishErrorMessages = exports.AssignmentError = exports.ZeroToZeroPowerError = exports.MissingReferenceError = exports.NotImplementedError = exports.DimensionError = exports.NaNError = exports.MathError = exports.ParserSyntaxError = exports.UnsupportedOperationError = exports.PolynomialError = exports.UndefinedError = exports.NullError = exports.ParserError = exports.OperatorError = exports.DivisionByZeroError = exports.UnexpectedInputError = exports.UnexpectedDataType = exports.UnexpectedTokenError = void 0;
4
+ exports.registerLanguage = registerLanguage;
5
+ exports.message = message;
6
+ const string_1 = require("./functions/string");
7
+ const Settings_1 = require("./Settings");
8
+ /** Thrown when tokenization encounters invalid adjacency, punctuation, or bracket structure. */
9
+ class UnexpectedTokenError extends Error {
10
+ }
11
+ exports.UnexpectedTokenError = UnexpectedTokenError;
12
+ /** Thrown when an operation receives a Nerdamer entity of the wrong runtime type. */
13
+ class UnexpectedDataType extends Error {
14
+ }
15
+ exports.UnexpectedDataType = UnexpectedDataType;
16
+ /** Used when input parses successfully but does not have the form an operation requires. */
17
+ class UnexpectedInputError extends Error {
18
+ }
19
+ exports.UnexpectedInputError = UnexpectedInputError;
20
+ /** Thrown for exact division by zero. Small nonzero numerical values are not treated as zero. */
21
+ class DivisionByZeroError extends Error {
22
+ }
23
+ exports.DivisionByZeroError = DivisionByZeroError;
24
+ /** Used for invalid parser-operator definitions and operator dispatch failures. */
25
+ class OperatorError extends Error {
26
+ }
27
+ exports.OperatorError = OperatorError;
28
+ /** General parser error for construction, evaluation, and registered-function failures. */
29
+ class ParserError extends Error {
30
+ }
31
+ exports.ParserError = ParserError;
32
+ /** Thrown when evaluation requires a value but a construct produces no value. */
33
+ class NullError extends Error {
34
+ }
35
+ exports.NullError = NullError;
36
+ /** Used when a mathematical operation has no defined value in the handled domain. */
37
+ class UndefinedError extends Error {
38
+ }
39
+ exports.UndefinedError = UndefinedError;
40
+ /** Thrown when input cannot be represented as a polynomial under the requested requirements. */
41
+ class PolynomialError extends Error {
42
+ }
43
+ exports.PolynomialError = PolynomialError;
44
+ /** Thrown when an operation is known but unsupported for the supplied form or domain. */
45
+ class UnsupportedOperationError extends Error {
46
+ }
47
+ exports.UnsupportedOperationError = UnsupportedOperationError;
48
+ /** Parser syntax error kept separate from lower-level tokenization failures. */
49
+ class ParserSyntaxError extends Error {
50
+ }
51
+ exports.ParserSyntaxError = ParserSyntaxError;
52
+ /** General mathematical precondition error for cases without a more specific error type. */
53
+ class MathError extends Error {
54
+ }
55
+ exports.MathError = MathError;
56
+ /** Thrown when a required numeric conversion produces `NaN`. */
57
+ class NaNError extends Error {
58
+ }
59
+ exports.NaNError = NaNError;
60
+ /** Thrown when vector, matrix, or structured-entity dimensions are incompatible. */
61
+ class DimensionError extends Error {
62
+ }
63
+ exports.DimensionError = DimensionError;
64
+ /** Used for recognized operations that have not been implemented yet. */
65
+ class NotImplementedError extends Error {
66
+ }
67
+ exports.NotImplementedError = NotImplementedError;
68
+ /** Thrown when a named converter or pattern reference cannot be resolved. */
69
+ class MissingReferenceError extends Error {
70
+ }
71
+ exports.MissingReferenceError = MissingReferenceError;
72
+ /** Thrown for the indeterminate symbolic form `0^0`. */
73
+ class ZeroToZeroPowerError extends Error {
74
+ }
75
+ exports.ZeroToZeroPowerError = ZeroToZeroPowerError;
76
+ /** Thrown when code attempts to assign to a reserved or otherwise non-assignable parser name. */
77
+ class AssignmentError extends Error {
78
+ }
79
+ exports.AssignmentError = AssignmentError;
80
+ /** Internal localized message templates used when constructing Nerdamer errors. */
81
+ exports.EnglishErrorMessages = {
82
+ // General
83
+ notImplemented: 'This method has not yet been implemented.',
84
+ noInverse: 'Unable to calculate inverse!',
85
+ undefinedValue: 'The requested value is undefined!',
86
+ nullValue: 'Value expected but received null.',
87
+ univariateInputOnly: 'The input for this function must be univariate!',
88
+ differentSignsAtEndPointsRequired: 'Function must have opposite signs at endpoints a and b!',
89
+ integerRequired: 'This function requires the coefficient to be an integer!',
90
+ plainVariableExpected: 'Expected plain variable! Received {{input}}.',
91
+ missingReference: 'The reference "{{ref}}" does not exist on this pattern!!',
92
+ undefinedDivision: 'Division not defined expression of this type! {{type}}',
93
+ restrictedVariableName: 'Cannot assign the requested value to the reserved name "{{name}}"!',
94
+ noVariableInExpression: 'No variable found in expression!',
95
+ quadraticExpressionExpected: 'Expression must be quadratic!',
96
+ wrongInput: 'Wrong input! Expected {{expected}} but received {{received}}.',
97
+ unsupportedFunction: 'Unsupported function {{function}}',
98
+ functionMinArgs: '{{function}} requires a minimum of {{min}} arguments but {{actual}} provided!',
99
+ functionMaxArgs: '{{function}} allows a maximum of {{max}} arguments but {{actual}} provided!',
100
+ invalidFunctionDeclaration: 'Invalid function declaration {{declaration}}.',
101
+ indexOutOfBounds: 'Index {{index}} out of bounds for {{type}} of length {{length}}',
102
+ matrixRowIndexOutOfBounds: 'Row index {{index}} out of bounds for Matrix with {{length}} rows',
103
+ matrixColumnIndexOutOfBounds: 'Column index {{index}} out of bounds for Matrix with {{length}} columns',
104
+ dictionaryKeyNotFound: 'Key "{{key}}" not found in Dictionary. Available keys: {{keys}}',
105
+ rangeValuesFinite: 'Range values must be finite.',
106
+ rangeStepNonzero: 'Step cannot be zero',
107
+ rangeStepNoAdvance: 'Step does not advance range at current precision',
108
+ sparseVariableCountInvalid: 'SparsePolynomial variableCount must be a non-negative safe integer.',
109
+ sparseExponentVectorLengthMismatch: 'SparsePolynomial exponent vector length must equal variableCount.',
110
+ sparseExponentsNonNegativeBigInt: 'SparsePolynomial exponents must be non-negative bigints.',
111
+ sparseVariableIndexOutOfRing: 'SparsePolynomial variable index is outside the polynomial ring.',
112
+ sparseAdditionRingMismatch: 'SparsePolynomial addition requires the same polynomial ring.',
113
+ sparseCoefficientExponentNonNegative: 'SparsePolynomial coefficient exponent must be non-negative.',
114
+ sparseZeroMonomialDivision: 'SparsePolynomial cannot divide by a zero monomial.',
115
+ sparseZeroScalarDivision: 'SparsePolynomial cannot divide by zero.',
116
+ sparseScalarDivisionExact: 'SparsePolynomial scalar division must be exact for every coefficient.',
117
+ sparseDivisionRingMismatch: 'SparsePolynomial division requires the same polynomial ring.',
118
+ sparseZeroPolynomialDivision: 'SparsePolynomial cannot divide by the zero polynomial.',
119
+ sparseMonomialOrderUnsupported: 'SparsePolynomial monomial order is not supported.',
120
+ sparseMultiplicationRingMismatch: 'SparsePolynomial multiplication requires the same polynomial ring.',
121
+ sparseExponentNonNegative: 'SparsePolynomial exponent must be non-negative.',
122
+ sparseSubtractionRingMismatch: 'SparsePolynomial subtraction requires the same polynomial ring.',
123
+ invalidDecimal: 'Invalid Decimal: "{{value}}"',
124
+ invalidInterval: 'Invalid interval: ({{start}}, {{end}})',
125
+ invalidAssumption: 'Invalid assumption: "{{input}}"',
126
+ assumptionIdentifierExpected: 'Expected identifier',
127
+ assumptionOperatorMissing: 'Missing operator',
128
+ assumptionValueMissing: 'Missing value',
129
+ assumptionOperatorUnsupported: 'Unsupported operator "{{operator}}"',
130
+ matrixStringKeyUnsupported: 'Matrix does not support string key access',
131
+ matrixTraceUnavailable: 'Unable to calculate trace for the matrix',
132
+ defintMaxEvals: 'defint: maxEvals exceeded ({{max}}).',
133
+ defintNonFiniteValue: 'defint: non-finite f(x) at x={{x}}',
134
+ defintEndpointSingularity: 'defint: endpoint singularity could not be regularized near x={{x}}',
135
+ defintSingularity: 'defint: singular/non-finite encountered near [{{a}}, {{b}}]',
136
+ defintInfiniteBounds: 'defint: infinite bounds require allowInfinite: true',
137
+ defintUnsupportedInfiniteBounds: 'defint: unsupported infinite bound configuration',
138
+ symbolicAccessNamedTargetRequired: 'Symbolic indexed access requires a named Vector or Matrix target.',
139
+ symbolicVectorIndexCount: 'Symbolic Vector access requires exactly one index.',
140
+ symbolicMatrixRowNonScalar: 'Symbolic Matrix row access is not scalar and cannot be deferred as an Expression.',
141
+ symbolicMatrixCellIndexCount: 'Symbolic Matrix cell access requires exactly two indices.',
142
+ symbolicAccessMaxIndices: 'Symbolic indexed access supports at most two unresolved indices.',
143
+ symbolicAccessIndexScalar: 'Symbolic accessor indices must evaluate to scalar expressions.',
144
+ symbolicAccessTargetType: 'Symbolic indexed access target must resolve to a Vector or Matrix.',
145
+ expectedOperatorOrFunction: 'Expected operator or function name but "{{value}}" found!',
146
+ missingOpeningBracket: 'Missing opening bracket for "{{bracket}}":{{position}}',
147
+ missingClosingBracket: 'Missing closing bracket for "{{bracket}}":{{position}}',
148
+ prefixOperatorExpected: 'Prefix operator expected but {{operator}} encountered.',
149
+ groebnerBasisSizeBudgetExceeded: 'Groebner budget exceeded: basis size > {{max}}',
150
+ groebnerPairsBudgetExceeded: 'Groebner budget exceeded: pairsPopped > {{max}}',
151
+ unsupportedParserEntity: 'Unsupported parser entity',
152
+ factorialNegativeUndefined: 'Factorial is undefined for negative integers.',
153
+ erfConvergenceFailed: 'erf not converging. Exiting!',
154
+ defintInfiniteBoundsDecimal: 'defint: infinite bounds require allowInfinite:true',
155
+ seqStartsAtInteger: "startsAt must be an integer",
156
+ seqPolynomialOrMaxPower: "Sequence is not a polynomial or exceeds maxPower",
157
+ seqInsufficientData: "Insufficient data points for detected degree",
158
+ arithPowNegativeExponent: "pow: negative exponent",
159
+ arithPowNNonnegativeInteger: "powN: exponent must be a nonnegative integer",
160
+ arithBigIntSqrtNegative: "bigIntSqrt: negative input",
161
+ arithNthRootPositiveInteger: "intNthRootExact: n must be a positive integer",
162
+ arithDivisorsPositive: "getDivisors: n must be positive",
163
+ arithModNormNonzeroModulus: "modNorm: modulus must be nonzero",
164
+ arithModSymmetricNonzeroModulus: "modSymmetric: modulus must be nonzero",
165
+ arithModInvZeroNoninvertible: "modInv: non-invertible (0)",
166
+ arithModInvNoninvertible: "modInv: non-invertible",
167
+ integerSqrtNonnegative: "Integer square root requires a non-negative value.",
168
+ modularExponentiationPositiveModulus: "Modular exponentiation requires a positive modulus.",
169
+ modularExponentiationNonnegativeExponent: "Modular exponentiation requires a non-negative exponent.",
170
+ maxBigIntRequiresArgument: "maxBigInt() requires at least one argument",
171
+ minBigIntEmpty: "Min of empty list is not defined for BigInt.",
172
+ binomBigIntNonnegativeN: "binomBigInt: n must be non-negative",
173
+ invalidDecimalValue: "Invalid decimal value: {{value}}",
174
+ subtractionNotDefined: "Subtraction not defined for {{leftType}}-{{rightType}} | {{left}}-{{right}}",
175
+ sparseAdapterVariablesUnique: "Sparse polynomial adapter variables must be unique.",
176
+ sparseAdapterVariablesIncludeEvery: "Sparse polynomial adapter variables must include every polynomial variable.",
177
+ sparseExpressionConversionNameCount: "Sparse polynomial expression conversion requires one name per ring variable.",
178
+ converterMissingArgumentScope: "Missing argument scope for function {{function}}",
179
+ converterMissingPrefixOperand: "Missing operand for prefix operator {{operator}}",
180
+ converterMissingOperandMetadata: "Missing operand or metadata for operator {{operator}}",
181
+ converterMissingLeftOperand: "Missing left operand for operator {{operator}}",
182
+ converterTexConversionFailed: "Unable to convert source expression to TeX",
183
+ unknownOperator: "Unknown operator {{operator}}",
184
+ polynomialMaximumIterations: "Maximum iterations reached",
185
+ polyRequires: "{{operation}} requires {{requirement}}.",
186
+ polyVariablesUnique: "{{operation}} variables must be unique.",
187
+ polyVariablesRingOrder: "{{operation}} variables must follow polynomial-ring order.",
188
+ polyVariablesIncludeActive: "{{operation}} variables must include every active variable.",
189
+ polyInputsSelectedOnly: "{{operation}} inputs may use only the selected variables.",
190
+ polyCannotFactorZeroPolynomial: "{{operation}} cannot factor the zero polynomial.",
191
+ polyCannotFactorZero: "{{operation}} cannot factor zero.",
192
+ polyModulusGreaterThanOne: "ModularSparsePolynomial modulus must be greater than one.",
193
+ polyVariableCountMatch: "ModularSparsePolynomial variableCount must match the supplied sparse polynomial.",
194
+ polyInterpolationCannotDepend: "ModularSparsePolynomial interpolation samples cannot depend on the interpolated variable.",
195
+ polyInterpolationInvertibleDifferences: "ModularSparsePolynomial interpolation points must have invertible pairwise differences.",
196
+ polyCoefficientExponentNonnegative: "ModularSparsePolynomial coefficient exponent must be non-negative.",
197
+ polyCannotDivideZero: "ModularSparsePolynomial cannot divide by the zero polynomial.",
198
+ polyDivisorLeadingCoefficientInvertible: "ModularSparsePolynomial divisor leading coefficient is not invertible.",
199
+ polyLeadingCoefficientInvertible: "ModularSparsePolynomial leading coefficient is not invertible.",
200
+ polyExponentNonnegative: "ModularSparsePolynomial exponent must be non-negative.",
201
+ polyDegreeMatrixLimit: "Modular factorization degree exceeds the supported matrix dimension.",
202
+ polyExtendedGcdTwoZeroUndefined: "Modular extended GCD is undefined for two zero polynomials.",
203
+ polyHenselPrimeExceedsTailDegree: "Multivariate Hensel lifting prime must exceed every tail-variable degree.",
204
+ polyHenselTargetNotSmaller: "Hensel lifting target modulus cannot be smaller than the base prime.",
205
+ polyHenselTargetRepeatedSquaring: "Hensel lifting target modulus must be obtained by repeated squaring of the base prime.",
206
+ polyHenselFactorsReconstructModuloBase: "Hensel lifting factors do not reconstruct the integer polynomial modulo the base prime.",
207
+ polyZassenhausFactorsReconstructModuloLift: "Zassenhaus recombination factors do not reconstruct the input modulo the lift modulus.",
208
+ polyWangCannotSpecializeZero: "Wang evaluation search cannot specialize zero.",
209
+ polyModularContentExactDivision: "Modular polynomial content must divide the polynomial exactly.",
210
+ factorizationNoFactors: "Nonconstant factorization returned no factors.",
211
+ polyCrtModuliInvertible: "Polynomial CRT moduli must be invertible.",
212
+ polyIntegerFactorPrimeZero: "Integer factorization cannot choose a prime for zero.",
213
+ polySquareFreeNonExactDivision: "Square-free factorization encountered a non-exact polynomial division.",
214
+ polyZassenhausLostRemaining: "Zassenhaus recombination lost the remaining polynomial.",
215
+ polyZassenhausReconstructionFailed: "Zassenhaus recombination factors do not reconstruct the integer polynomial.",
216
+ polyIntegerFactorLostLeading: "Integer factorization lost the leading term.",
217
+ parserMalformedSymbolicAccessor: "Malformed internal symbolic accessor.",
218
+ parserMalformedSymbolicAccessorIndex: "Malformed internal symbolic accessor index.",
219
+ unknownOperatorAction: "Unknown operator action {{action}}",
220
+ parserBracketTokenMissingCharacter: "Bracket token is missing its character.",
221
+ polyWangLeadingEvaluationInteger: "Wang leading-coefficient evaluation did not produce an integer.",
222
+ polyWangSpecializedLeadingInteger: "Wang specialized factor did not have an integer leading coefficient.",
223
+ polyMultivariateContentDivisionFailed: "Multivariate factorization could not divide a square-free block by its main-variable content.",
224
+ polyMultivariateContentVariableMissing: "Multivariate main-variable content did not retain an active coefficient variable.",
225
+ polyMultivariateReconstructionFailed: "Complete multivariate factorization does not reconstruct the input polynomial.",
226
+ polyBerlekampNoninvertiblePivot: "Berlekamp elimination encountered a noninvertible pivot.",
227
+ polyHenselZeroFactorGroup: "Hensel lifting cannot lift a zero factor group.",
228
+ polyHenselCannotLiftZero: "Hensel lifting cannot lift the zero polynomial.",
229
+ polyHenselModulusExceeded: "Hensel lifting exceeded the requested prime-power modulus.",
230
+ polyHenselLeadingLost: "Hensel lifting lost the target leading coefficient.",
231
+ polyHenselReconstructionFailed: "Hensel-lifted factors do not reconstruct the target polynomial.",
232
+ polyBerlekampNonExactSplit: "Berlekamp splitting produced a non-exact factor division.",
233
+ polyBerlekampIncompleteSplit: "Berlekamp factorization did not fully split the polynomial.",
234
+ polyBerlekampReconstructionFailed: "Berlekamp factors do not reconstruct the input polynomial.",
235
+ expressionKeyValueUnsupported: "The function 'keyValue' is not implemented for type {{type}}.",
236
+ solveLinearNonlinearDegree: "Nonlinear term detected in equation {{equation}}: degree {{degree}} term found. solveLinearSystem only handles linear systems.",
237
+ solveLinearNonPolynomialVariable: "Nonlinear term detected in equation {{equation}}: variable \"{{variable}}\" appears in a non-polynomial position. solveLinearSystem only handles linear systems.",
238
+ polyReqPrimeModulus: "a prime modulus",
239
+ polyReqUnivariatePolynomial: "a univariate polynomial",
240
+ polyReqSquareFreeInput: "square-free input",
241
+ polyReqSamePolynomialRing: "the same polynomial ring",
242
+ polyReqAtLeastOneVariable: "at least one variable",
243
+ polyReqAtLeastTwoSelectedVariables: "at least two selected variables",
244
+ polyReqOneEvaluationPerTailVariable: "one evaluation value per tail variable",
245
+ polyReqMatchingFactorLeadingLists: "matching factor and leading-coefficient lists",
246
+ polyReqPairwiseCoprimeModularFactors: "pairwise coprime modular factors",
247
+ polyReqPrimeBaseModulus: "a prime base modulus",
248
+ polyReqAtLeastOneModularFactor: "at least one modular factor",
249
+ polyReqUnivariateIntegerPolynomial: "a univariate integer polynomial",
250
+ polyReqFactorsSameRingAndPrime: "factors from the same integer polynomial ring and base prime",
251
+ polyReqUnivariateFactors: "univariate factors",
252
+ polyReqMonicModularFactors: "monic modular factors",
253
+ polyReqPrimitiveIntegerPolynomial: "a primitive integer polynomial",
254
+ polyReqPositiveLeadingCoefficient: "a positive leading coefficient",
255
+ polyReqLiftedModularFactors: "lifted modular factors",
256
+ polyReqLiftedFactorsSameRing: "lifted factors from one polynomial ring",
257
+ polyReqUnivariateLiftedFactors: "univariate lifted factors",
258
+ polyReqMonicLiftedFactors: "monic lifted factors",
259
+ polyReqLargerHenselModulus: "a larger Hensel lifting modulus",
260
+ polyReqPrimitivePolynomial: "a primitive polynomial",
261
+ polyReqPositiveLexLeadingSign: "positive lexicographic leading sign",
262
+ polyReqSquareFreeMainVariable: "square-free input in the main variable",
263
+ polyReqExactlyTwoSelectedVariables: "exactly two selected variables",
264
+ polyReqExactlyTwoVariables: "exactly two variables",
265
+ polyReqOneValuePerNonMainVariable: "one value for every non-main selected variable",
266
+ polyReqOneValuePerTailVariable: "one value for every tail variable",
267
+ polyReqPositiveDegreeMainVariable: "positive degree in the main variable",
268
+ polyReqAllOtherVariablesDormant: "all other variables to be dormant",
269
+ polyReqPositiveModuli: "positive moduli",
270
+ polyReqCoprimeModuli: "coprime moduli",
271
+ polyReqAtLeastOneSample: "at least one sample",
272
+ polyReqInvertibleLeadingCoefficient: "an invertible leading coefficient",
273
+ polyReqIntegerLeadingCoefficientInvertible: "the integer leading coefficient to be invertible modulo the base prime",
274
+ infinityMinusInfinityUndefined: 'Infinity-Infinity is undefined!',
275
+ // Assumptions
276
+ inconsistentAssumptions: 'Assumptions are inconsistent (empty intersection)!',
277
+ // Parser
278
+ unsupportedType: 'The provided type ({{type}}) is not supported for this function!',
279
+ unsupportedOperation: 'This operation is currently not supported!',
280
+ buildFunctionUnsupportedFunction: 'buildFunction cannot compile the function "{{function}}" to JavaScript number arithmetic!',
281
+ buildFunctionComplexUnsupported: 'buildFunction cannot compile expressions containing the imaginary unit to JavaScript number arithmetic!',
282
+ nonMatchingDimensions: "This operation cannot be completed because the dimensions don't match!",
283
+ malformedExpression: 'Unable to parse malformed expression!',
284
+ unsupportedCharacter: 'Unsupported character "{{character}}" at position {{position}}.',
285
+ missingCommentDelimiter: 'Missing closing comment delimiter "{{delimiter}}".',
286
+ divisionByZero: 'Division by zero is not defined!',
287
+ zeroToZeroPower: '0^0 is undefined!',
288
+ infinityToPowerZero: 'Infinity^0 is not defined!',
289
+ infinityTimesZero: '0*Infinity is not defined!',
290
+ infinityToInfinity: 'Infinity^Infinity is not defined!',
291
+ valueToInfinityUndefined: '{{value}}^Infinity is not defined!',
292
+ atan2Undefined: 'atan2 is undefined for 0, 0!',
293
+ tanUndefined: 'tan is undefined for multiples of pi/2!',
294
+ loopIterationLimitExceeded: 'Loop exceeded the maximum of {{max}} iterations.',
295
+ breakOutsideLoop: 'break can only be used inside a loop.',
296
+ continueOutsideLoop: 'continue can only be used inside a loop.',
297
+ letRequiresBindingsAndBody: 'let requires one or more name/value pairs followed by a body expression.',
298
+ secUndefined: 'sec is undefined for odd multiples of pi/2!',
299
+ cscUndefined: 'csc is undefined for multiples of pi!',
300
+ cotUndefined: 'cot is undefined for multiples of pi!',
301
+ cothUndefined: 'coth is undefined for 0!',
302
+ cschUndefined: 'csch is undefined for 0!',
303
+ atanhUndefined: 'atanh is undefined for 0!',
304
+ cannotCreateArrayFromNaN: 'Cannot create array from NaN!',
305
+ expressionExpected: 'Expression expected!. Received {{type}}!',
306
+ // TeX Converter.
307
+ unrecognizedMode: '"{{mode}}" is is not a valid mode!',
308
+ // Polynomials
309
+ notAPolynomial: 'The expression is not a valid polynomial!',
310
+ multidegreeMismatch: 'The number of variables must match the multidegree of the polynomial!',
311
+ // Matrix
312
+ cannotCreateMatrix: 'Unable to create Matrix. Row dimensions do not match!',
313
+ cannotMultiplyMatrix: 'Cannot multiply matrix!',
314
+ squareMatrixRequired: 'The matrix must be square!',
315
+ rowsMustMatch: 'The rows of the matrices must match!',
316
+ columnsMustMatch: 'The columns of the matrices must match!',
317
+ singularMatrix: 'The provided matrix is singular!',
318
+ matrixExpected: 'Matrix expected! Received {{type}}.',
319
+ // Vector
320
+ mismatchedDimensions: 'The dimensions must match for the function "{{function}}"!',
321
+ incorrectCrossDimension: 'The cross product is only defined for vectors of dimension 3!',
322
+ vectorExpected: 'Expected Vector! Received {{type}}.',
323
+ // Polynomial
324
+ univariatePolynomialOnly: 'This function is only supported for univariate polynomials!',
325
+ unknownVariable: 'Unknown variable! "{{variable}}"',
326
+ // Solve
327
+ convergenceFailed: 'Failed to converge! {{iters}} iterations were tried.',
328
+ endPointIsRoot: 'End point is root.',
329
+ zeroDerivative: 'The derivative is zero at x = {{x}}. Cannot continue.',
330
+ tooManyUnknowns: 'Too many unknowns!',
331
+ solveSystemInfiniteSolutions: 'This system does not have a finite isolated solution set!',
332
+ solveSystemPolynomialOnly: 'solveSystem currently supports only linear or polynomial systems!',
333
+ solveSystemNonRationalUnsupported: 'This nonlinear polynomial system requires non-rational or non-symbolic solving, which is not yet supported!',
334
+ // Set function
335
+ setJSFunctionExpectsFunction: 'The function parameter when setting a JS function must be of type function!',
336
+ functionRequiresMinAndMaxArgs: 'You must provide a min and max arg when setting the function!',
337
+ };
338
+ exports.ErrorMessages = {
339
+ eng: exports.EnglishErrorMessages,
340
+ };
341
+ /** Registers one optional localized message catalog. */
342
+ function registerLanguage(language, catalog) {
343
+ exports.ErrorMessages[language] = catalog;
344
+ }
345
+ /** Formats an internal localized error message with named template values. */
346
+ function message(e, values) {
347
+ const catalog = exports.ErrorMessages[Settings_1.Settings.LANGUAGE] ?? exports.ErrorMessages.eng;
348
+ return (0, string_1.format)(catalog[e], values || {});
349
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Registers the complete Nerdamer parser function surface.
3
+ *
4
+ * Core parser modules do not import higher-level mathematical domains. Entry points
5
+ * and consumers that require the complete Nerdamer notation surface call this registration function.
6
+ */
7
+ export declare function registerNerdamerFunctions(): void;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerNerdamerFunctions = registerNerdamerFunctions;
4
+ const dispatch_1 = require("../algebra/dispatch");
5
+ const dispatch_2 = require("../calculus/dispatch");
6
+ const dispatch_3 = require("./classes/assumption/dispatch");
7
+ const dispatch_4 = require("./classes/matrix/dispatch");
8
+ const dispatch_5 = require("./classes/polynomial/dispatch");
9
+ const dispatch_6 = require("./classes/parser/scripting/dispatch");
10
+ const dispatch_7 = require("./classes/vector/dispatch");
11
+ const complex_dispatch_1 = require("./functions/complex.dispatch");
12
+ const dispatch_8 = require("../math/dispatch");
13
+ const dispatch_9 = require("../solve/dispatch");
14
+ /**
15
+ * Registers the complete Nerdamer parser function surface.
16
+ *
17
+ * Core parser modules do not import higher-level mathematical domains. Entry points
18
+ * and consumers that require the complete Nerdamer notation surface call this registration function.
19
+ */
20
+ function registerNerdamerFunctions() {
21
+ (0, dispatch_6.loadScriptingFunctions)();
22
+ (0, dispatch_3.loadAssumptionFunctions)();
23
+ (0, dispatch_4.loadMatrixFunctions)();
24
+ (0, dispatch_7.loadVectorFunctions)();
25
+ (0, complex_dispatch_1.loadComplexFunctions)();
26
+ (0, dispatch_5.loadPolynomialFunctions)();
27
+ (0, dispatch_8.loadMathFunctions)();
28
+ (0, dispatch_1.loadAlgebraFunctions)();
29
+ (0, dispatch_2.loadCalculusFunctions)();
30
+ (0, dispatch_9.loadSolveFunctions)();
31
+ }
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Returns the absolute value of a bigint
3
+ *
4
+ * @param x
5
+ * @returns
6
+ */
7
+ export declare function abs(x: bigint): bigint;
8
+ /**
9
+ * Returns an array with unique values, sorted, and in reverse order.
10
+ *
11
+ * @param array
12
+ * @returns
13
+ */
14
+ export declare function uniqueSortedArray(array: bigint[]): bigint[];
15
+ /**
16
+ * Calculates the gcd of a set of bigints
17
+ *
18
+ * @returns
19
+ */
20
+ export declare function GCD(...args: bigint[]): bigint;
21
+ /**
22
+ * Calculates the LCM of a set of bigints
23
+ *
24
+ * @param args
25
+ */
26
+ export declare function LCM(...args: bigint[]): bigint;
27
+ /**
28
+ * Simplifies a ratio of two bigints
29
+ *
30
+ * @param numerator
31
+ * @param denominator
32
+ * @returns
33
+ */
34
+ export declare function simplifyRatio(numerator: bigint, denominator: bigint): [bigint, bigint];
35
+ /**
36
+ * Converts a decimal number to a rational
37
+ *
38
+ * @param numStr
39
+ * @returns
40
+ */
41
+ export declare function convert(numStr: string): [bigint, bigint];
42
+ /**
43
+ * Returns the sign of a bigint
44
+ *
45
+ * @param n
46
+ * @returns -1 if negative and 1 for positive and 0 for zero
47
+ */
48
+ export declare function sign(n: bigint): 0 | 1 | -1;
49
+ /**
50
+ * Checks if a bigint is an even number
51
+ *
52
+ * @param n
53
+ * @returns
54
+ */
55
+ export declare function isEven(n: bigint): boolean;
56
+ /**
57
+ * Returns the floor of the exact square root of a non-negative bigint.
58
+ */
59
+ export declare function integerSquareRoot(value: bigint): bigint;
60
+ /** Returns the least bigint whose square is at least value. */
61
+ export declare function ceilIntegerSquareRoot(value: bigint): bigint;
62
+ /**
63
+ * Computes the nth Fibonacci number exactly using fast doubling.
64
+ *
65
+ * Negative indices use the negafibonacci identity F(-n) = (-1)^(n+1)F(n).
66
+ *
67
+ * @param n - Integer index.
68
+ * @returns The exact Fibonacci number.
69
+ */
70
+ export declare function fibonacci(n: bigint): bigint;
71
+ /**
72
+ * The big number version
73
+ */
74
+ export declare const factorial: (n: number | bigint) => bigint;
75
+ /**
76
+ * Calculates the modulo of two numbers
77
+ *
78
+ * @param a
79
+ * @param b
80
+ * @returns
81
+ */
82
+ export declare function mod(a: bigint, b: bigint): bigint;
83
+ /**
84
+ * Raises a bigint base to a non-negative bigint exponent modulo a positive modulus.
85
+ *
86
+ * Binary exponentiation keeps every intermediate value in bigint modular arithmetic.
87
+ */
88
+ export declare function powMod(base: bigint, exponent: bigint, modulus: bigint): bigint;
89
+ /**
90
+ * Finds the multiplicative inverse of a modulo m.
91
+ *
92
+ * Returns -1 when the inverse does not exist. The extended Euclidean algorithm keeps
93
+ * the operation exact for bigint inputs without scanning every possible residue.
94
+ *
95
+ * @param a
96
+ * @param m
97
+ * @returns
98
+ */
99
+ export declare function invMod(a: bigint, m: bigint): bigint;
100
+ /**
101
+ * Gets the product given a number range start and finish
102
+ *
103
+ * @param start The start of the range
104
+ * @param end The end of the range
105
+ * @param step The increment step
106
+ */
107
+ export declare function productInRange(start: number, end: number, step?: number): bigint;
108
+ /**
109
+ * Returns the largest of a set of bigints
110
+ * @param args
111
+ * @returns
112
+ */
113
+ export declare function max(...args: bigint[]): bigint;
114
+ /**
115
+ * Returns the smallest of a set of bigints
116
+ * @param args
117
+ * @returns
118
+ */
119
+ export declare function min(...args: bigint[]): bigint;
120
+ export declare function recoverCoeffsZ(num: bigint, primes: {
121
+ [variable: string]: bigint;
122
+ }): Record<string, number | bigint>;
123
+ /**
124
+ * The binomial function using bigint
125
+ * @param n
126
+ * @param k
127
+ * @returns
128
+ */
129
+ export declare function binom(n: bigint, k: bigint): bigint;
130
+ /**
131
+ * Computes the LCM of an array of positive bigints.
132
+ */
133
+ export declare function bigintLCM(values: bigint[]): bigint;