nerdamer 1.1.13 → 2.0.0-rc.1
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.
- package/LICENSE.md +184 -0
- package/README.md +293 -312
- package/dist/bundle.js +2 -0
- package/dist/bundle.js.LICENSE.txt +7 -0
- package/dist/parser.js +2 -0
- package/dist/parser.js.LICENSE.txt +7 -0
- package/docs-data/parser-functions.json +1960 -0
- package/index.d.ts +10 -426
- package/output/algebra/adapters.d.ts +33 -0
- package/output/algebra/adapters.js +109 -0
- package/output/algebra/algorithms/arith.d.ts +84 -0
- package/output/algebra/algorithms/arith.js +323 -0
- package/output/algebra/algorithms/factor.d.ts +3 -0
- package/output/algebra/algorithms/factor.js +5 -0
- package/output/algebra/algorithms/factorMultivariate.d.ts +23 -0
- package/output/algebra/algorithms/factorMultivariate.js +2393 -0
- package/output/algebra/algorithms/factorUnivariate.d.ts +72 -0
- package/output/algebra/algorithms/factorUnivariate.js +1072 -0
- package/output/algebra/algorithms/gcd.d.ts +22 -0
- package/output/algebra/algorithms/gcd.js +690 -0
- package/output/algebra/algorithms/groebnerBase.d.ts +157 -0
- package/output/algebra/algorithms/groebnerBase.js +1166 -0
- package/output/algebra/algorithms/multiPoly/MultiPoly.d.ts +137 -0
- package/output/algebra/algorithms/multiPoly/MultiPoly.js +346 -0
- package/output/algebra/algorithms/poly.d.ts +228 -0
- package/output/algebra/algorithms/poly.js +1299 -0
- package/output/algebra/algorithms/rational.d.ts +17 -0
- package/output/algebra/algorithms/rational.js +115 -0
- package/output/algebra/factor/factor.d.ts +62 -0
- package/output/algebra/factor/factor.js +158 -0
- package/output/algebra/gcd/gcd.d.ts +29 -0
- package/output/algebra/gcd/gcd.js +141 -0
- package/output/algebra/groebner.d.ts +21 -0
- package/output/algebra/groebner.js +42 -0
- package/output/algebra/partfrac.d.ts +19 -0
- package/output/algebra/partfrac.js +398 -0
- package/output/algebra/polynomialize.d.ts +20 -0
- package/output/algebra/polynomialize.js +24 -0
- package/output/algebra/simplify/complexsimp.d.ts +7 -0
- package/output/algebra/simplify/complexsimp.js +24 -0
- package/output/algebra/simplify/factorCommon.d.ts +13 -0
- package/output/algebra/simplify/factorCommon.js +136 -0
- package/output/algebra/simplify/funcsimp.d.ts +26 -0
- package/output/algebra/simplify/funcsimp.js +633 -0
- package/output/algebra/simplify/invtrigrewrite.d.ts +10 -0
- package/output/algebra/simplify/invtrigrewrite.js +96 -0
- package/output/algebra/simplify/ratsimp.d.ts +21 -0
- package/output/algebra/simplify/ratsimp.js +140 -0
- package/output/algebra/simplify/simplify.d.ts +25 -0
- package/output/algebra/simplify/simplify.js +228 -0
- package/output/algebra/simplify/trigreduce.d.ts +38 -0
- package/output/algebra/simplify/trigreduce.js +424 -0
- package/output/algebra/simplify/trigrewrite.d.ts +17 -0
- package/output/algebra/simplify/trigrewrite.js +156 -0
- package/output/algebra/simplify/trigsimp.d.ts +11 -0
- package/output/algebra/simplify/trigsimp.js +369 -0
- package/output/algebra/simplify/utils.d.ts +32 -0
- package/output/algebra/simplify/utils.js +56 -0
- package/output/algebra/utils.d.ts +32 -0
- package/output/algebra/utils.js +48 -0
- package/output/api/advanced.d.ts +7 -0
- package/output/api/advanced.js +18 -0
- package/output/api/algebra.d.ts +17 -0
- package/output/api/algebra.js +32 -0
- package/output/api/assumptions.d.ts +4 -0
- package/output/api/assumptions.js +11 -0
- package/output/api/calculus.d.ts +9 -0
- package/output/api/calculus.js +21 -0
- package/output/api/core.d.ts +17 -0
- package/output/api/core.js +41 -0
- package/output/api/debug.d.ts +16 -0
- package/output/api/debug.js +23 -0
- package/output/api/parser.d.ts +85 -0
- package/output/api/parser.js +16 -0
- package/output/api/solve.d.ts +10 -0
- package/output/api/solve.js +16 -0
- package/output/api/structures.d.ts +10 -0
- package/output/api/structures.js +22 -0
- package/output/calculus/derivative/diff.d.ts +30 -0
- package/output/calculus/derivative/diff.js +238 -0
- package/output/calculus/fresnel.d.ts +16 -0
- package/output/calculus/fresnel.js +39 -0
- package/output/calculus/integrate/byParts.d.ts +18 -0
- package/output/calculus/integrate/byParts.js +339 -0
- package/output/calculus/integrate/bySubstitution.d.ts +135 -0
- package/output/calculus/integrate/bySubstitution.js +411 -0
- package/output/calculus/integrate/integrate.d.ts +38 -0
- package/output/calculus/integrate/integrate.js +652 -0
- package/output/calculus/integrate/integrationTable.d.ts +2 -0
- package/output/calculus/integrate/integrationTable.js +914 -0
- package/output/calculus/integrate/utils.d.ts +28 -0
- package/output/calculus/integrate/utils.js +96 -0
- package/output/calculus/laplace/ilaplace.d.ts +31 -0
- package/output/calculus/laplace/ilaplace.js +192 -0
- package/output/calculus/laplace/ilaplaceTable.d.ts +2 -0
- package/output/calculus/laplace/ilaplaceTable.js +200 -0
- package/output/calculus/laplace/laplace.d.ts +22 -0
- package/output/calculus/laplace/laplace.js +109 -0
- package/output/calculus/laplace/laplaceTable.d.ts +2 -0
- package/output/calculus/laplace/laplaceTable.js +187 -0
- package/output/calculus/limit/limit.d.ts +35 -0
- package/output/calculus/limit/limit.js +1183 -0
- package/output/calculus/limit/limitsTable.d.ts +2 -0
- package/output/calculus/limit/limitsTable.js +7 -0
- package/output/core/Settings.d.ts +32 -0
- package/output/core/Settings.js +68 -0
- package/output/core/adapters.d.ts +18 -0
- package/output/core/adapters.js +40 -0
- package/output/core/classes/assumption/Assumption.d.ts +218 -0
- package/output/core/classes/assumption/Assumption.js +605 -0
- package/output/core/classes/assumption/assertiveFunctions.d.ts +6 -0
- package/output/core/classes/assumption/assertiveFunctions.js +64 -0
- package/output/core/classes/assumption/assume.d.ts +90 -0
- package/output/core/classes/assumption/assume.js +145 -0
- package/output/core/classes/collection/Collection.d.ts +107 -0
- package/output/core/classes/collection/Collection.js +231 -0
- package/output/core/classes/complex/Complex.d.ts +99 -0
- package/output/core/classes/complex/Complex.js +135 -0
- package/output/core/classes/decimalSet/DecimalSet.d.ts +226 -0
- package/output/core/classes/decimalSet/DecimalSet.js +453 -0
- package/output/core/classes/dictionary/Dictionary.d.ts +102 -0
- package/output/core/classes/dictionary/Dictionary.js +213 -0
- package/output/core/classes/equation/Equation.d.ts +256 -0
- package/output/core/classes/equation/Equation.js +350 -0
- package/output/core/classes/expression/CoeffObject.d.ts +100 -0
- package/output/core/classes/expression/CoeffObject.js +198 -0
- package/output/core/classes/expression/Expression.d.ts +1674 -0
- package/output/core/classes/expression/Expression.js +2332 -0
- package/output/core/classes/expression/analysis.d.ts +25 -0
- package/output/core/classes/expression/analysis.js +218 -0
- package/output/core/classes/expression/collect.d.ts +9 -0
- package/output/core/classes/expression/collect.js +49 -0
- package/output/core/classes/expression/format.d.ts +45 -0
- package/output/core/classes/expression/format.js +217 -0
- package/output/core/classes/expression/products.d.ts +23 -0
- package/output/core/classes/expression/products.js +115 -0
- package/output/core/classes/expression/shortcuts.d.ts +35 -0
- package/output/core/classes/expression/shortcuts.js +129 -0
- package/output/core/classes/expression/traversal.d.ts +31 -0
- package/output/core/classes/expression/traversal.js +216 -0
- package/output/core/classes/expression/trig.d.ts +25 -0
- package/output/core/classes/expression/trig.js +40 -0
- package/output/core/classes/expression/utils.d.ts +52 -0
- package/output/core/classes/expression/utils.js +189 -0
- package/output/core/classes/lookupTable/LookupTable.d.ts +12 -0
- package/output/core/classes/lookupTable/LookupTable.js +55 -0
- package/output/core/classes/matrix/Matrix.d.ts +227 -0
- package/output/core/classes/matrix/Matrix.js +889 -0
- package/output/core/classes/matrix/Sylvester.d.ts +11 -0
- package/output/core/classes/matrix/Sylvester.js +54 -0
- package/output/core/classes/matrix/functions.d.ts +26 -0
- package/output/core/classes/matrix/functions.js +52 -0
- package/output/core/classes/matrix/utils.d.ts +9 -0
- package/output/core/classes/matrix/utils.js +22 -0
- package/output/core/classes/parser/Parser.d.ts +480 -0
- package/output/core/classes/parser/Parser.js +1812 -0
- package/output/core/classes/parser/Token.d.ts +58 -0
- package/output/core/classes/parser/Token.js +137 -0
- package/output/core/classes/parser/constants.d.ts +160 -0
- package/output/core/classes/parser/constants.js +227 -0
- package/output/core/classes/parser/helpers.d.ts +21 -0
- package/output/core/classes/parser/helpers.js +42 -0
- package/output/core/classes/parser/operations/add.d.ts +15 -0
- package/output/core/classes/parser/operations/add.js +238 -0
- package/output/core/classes/parser/operations/comma.d.ts +7 -0
- package/output/core/classes/parser/operations/comma.js +11 -0
- package/output/core/classes/parser/operations/compare.d.ts +21 -0
- package/output/core/classes/parser/operations/compare.js +461 -0
- package/output/core/classes/parser/operations/divide.d.ts +2 -0
- package/output/core/classes/parser/operations/divide.js +72 -0
- package/output/core/classes/parser/operations/functions.d.ts +46 -0
- package/output/core/classes/parser/operations/functions.js +430 -0
- package/output/core/classes/parser/operations/multiply.d.ts +11 -0
- package/output/core/classes/parser/operations/multiply.js +321 -0
- package/output/core/classes/parser/operations/power.d.ts +48 -0
- package/output/core/classes/parser/operations/power.js +673 -0
- package/output/core/classes/parser/operations/subtract.d.ts +3 -0
- package/output/core/classes/parser/operations/subtract.js +35 -0
- package/output/core/classes/parser/preprocess.d.ts +14 -0
- package/output/core/classes/parser/preprocess.js +259 -0
- package/output/core/classes/parser/scripting/controlFlow.d.ts +121 -0
- package/output/core/classes/parser/scripting/controlFlow.js +355 -0
- package/output/core/classes/parser/scripting/evaluate.d.ts +10 -0
- package/output/core/classes/parser/scripting/evaluate.js +112 -0
- package/output/core/classes/parser/scripting/functions.d.ts +14 -0
- package/output/core/classes/parser/scripting/functions.js +59 -0
- package/output/core/classes/parser/scripting/scope.d.ts +35 -0
- package/output/core/classes/parser/scripting/scope.js +155 -0
- package/output/core/classes/parser/types.d.ts +125 -0
- package/output/core/classes/parser/types.js +2 -0
- package/output/core/classes/parser/wrappers/IndexedReference.d.ts +31 -0
- package/output/core/classes/parser/wrappers/IndexedReference.js +68 -0
- package/output/core/classes/parser/wrappers/KeyValuePair.d.ts +24 -0
- package/output/core/classes/parser/wrappers/KeyValuePair.js +51 -0
- package/output/core/classes/polynomial/Polynomial.d.ts +500 -0
- package/output/core/classes/polynomial/Polynomial.js +1149 -0
- package/output/core/classes/polynomial/Term.d.ts +222 -0
- package/output/core/classes/polynomial/Term.js +430 -0
- package/output/core/classes/polynomial/functions.d.ts +69 -0
- package/output/core/classes/polynomial/functions.js +126 -0
- package/output/core/classes/polynomial/utils.d.ts +62 -0
- package/output/core/classes/polynomial/utils.js +206 -0
- package/output/core/classes/rational/Rational.d.ts +504 -0
- package/output/core/classes/rational/Rational.js +779 -0
- package/output/core/classes/seq/SEQ.d.ts +13 -0
- package/output/core/classes/seq/SEQ.js +137 -0
- package/output/core/classes/valuesSet/ValuesSet.d.ts +179 -0
- package/output/core/classes/valuesSet/ValuesSet.js +381 -0
- package/output/core/classes/vector/Vector.d.ts +222 -0
- package/output/core/classes/vector/Vector.js +497 -0
- package/output/core/classes/vector/functions.d.ts +28 -0
- package/output/core/classes/vector/functions.js +47 -0
- package/output/core/common/classes/MathematicalAggregate.d.ts +53 -0
- package/output/core/common/classes/MathematicalAggregate.js +140 -0
- package/output/core/common/classes/Scope.d.ts +62 -0
- package/output/core/common/classes/Scope.js +122 -0
- package/output/core/common/classes/StructuredEntity.d.ts +55 -0
- package/output/core/common/classes/StructuredEntity.js +151 -0
- package/output/core/common/common.d.ts +63 -0
- package/output/core/common/common.js +279 -0
- package/output/core/common/functions/functions.d.ts +14 -0
- package/output/core/common/functions/functions.js +33 -0
- package/output/core/common/functions/structuredEntityUtils.d.ts +27 -0
- package/output/core/common/functions/structuredEntityUtils.js +40 -0
- package/output/core/converters/BaseConverter.d.ts +97 -0
- package/output/core/converters/BaseConverter.js +405 -0
- package/output/core/converters/Converter.d.ts +111 -0
- package/output/core/converters/Converter.js +802 -0
- package/output/core/converters/Pattern.d.ts +71 -0
- package/output/core/converters/Pattern.js +302 -0
- package/output/core/dispatch.d.ts +34 -0
- package/output/core/dispatch.js +304 -0
- package/output/core/errors.d.ts +531 -0
- package/output/core/errors.js +621 -0
- package/output/core/functions/bigint/bigint.d.ts +121 -0
- package/output/core/functions/bigint/bigint.js +392 -0
- package/output/core/functions/bigint/primeFactor.d.ts +49 -0
- package/output/core/functions/bigint/primeFactor.js +267 -0
- package/output/core/functions/bigint/primes.d.ts +1 -0
- package/output/core/functions/bigint/primes.js +11 -0
- package/output/core/functions/build/definitions.d.ts +12 -0
- package/output/core/functions/build/definitions.js +133 -0
- package/output/core/functions/build/index.d.ts +32 -0
- package/output/core/functions/build/index.js +136 -0
- package/output/core/functions/complex.d.ts +90 -0
- package/output/core/functions/complex.js +482 -0
- package/output/core/functions/decimal.d.ts +24 -0
- package/output/core/functions/decimal.js +664 -0
- package/output/core/functions/expand/expand.d.ts +42 -0
- package/output/core/functions/expand/expand.js +376 -0
- package/output/core/functions/fresnelNumeric.d.ts +12 -0
- package/output/core/functions/fresnelNumeric.js +123 -0
- package/output/core/functions/numeric.d.ts +140 -0
- package/output/core/functions/numeric.js +790 -0
- package/output/core/functions/rationalNormalization.d.ts +11 -0
- package/output/core/functions/rationalNormalization.js +117 -0
- package/output/core/functions/setFunction.d.ts +19 -0
- package/output/core/functions/setFunction.js +75 -0
- package/output/core/functions/string.d.ts +26 -0
- package/output/core/functions/string.js +101 -0
- package/output/core/functions/subst.d.ts +90 -0
- package/output/core/functions/subst.js +498 -0
- package/output/core/functions/utils.d.ts +24 -0
- package/output/core/functions/utils.js +51 -0
- package/output/core/types.d.ts +48 -0
- package/output/core/types.js +2 -0
- package/output/index.d.ts +339 -0
- package/output/index.js +715 -0
- package/output/math/defint/defintDecimal.d.ts +37 -0
- package/output/math/defint/defintDecimal.js +320 -0
- package/output/math/defint/defintNative.d.ts +57 -0
- package/output/math/defint/defintNative.js +292 -0
- package/output/math/geometry.d.ts +8 -0
- package/output/math/geometry.js +32 -0
- package/output/math/math.d.ts +655 -0
- package/output/math/math.js +1811 -0
- package/output/math/trig.d.ts +518 -0
- package/output/math/trig.js +1444 -0
- package/output/math/trunc.d.ts +19 -0
- package/output/math/trunc.js +36 -0
- package/output/math/utils.d.ts +60 -0
- package/output/math/utils.js +180 -0
- package/output/solve/classes/DecimalMatrix.d.ts +17 -0
- package/output/solve/classes/DecimalMatrix.js +86 -0
- package/output/solve/classes/FunctionSolver.d.ts +135 -0
- package/output/solve/classes/FunctionSolver.js +433 -0
- package/output/solve/classes/MultivariateSolver.d.ts +84 -0
- package/output/solve/classes/MultivariateSolver.js +240 -0
- package/output/solve/classes/PolynomialSolver.d.ts +85 -0
- package/output/solve/classes/PolynomialSolver.js +292 -0
- package/output/solve/classes/SolutionSet.d.ts +153 -0
- package/output/solve/classes/SolutionSet.js +357 -0
- package/output/solve/classes/Solver.d.ts +17 -0
- package/output/solve/classes/Solver.js +132 -0
- package/output/solve/classes/SymbolicSolver.d.ts +74 -0
- package/output/solve/classes/SymbolicSolver.js +601 -0
- package/output/solve/linsolve.d.ts +51 -0
- package/output/solve/linsolve.js +225 -0
- package/output/solve/solve.d.ts +34 -0
- package/output/solve/solve.js +260 -0
- package/output/solve/solveSystem.d.ts +31 -0
- package/output/solve/solveSystem.js +290 -0
- package/output/solve/utils.d.ts +9 -0
- package/output/solve/utils.js +62 -0
- package/output/utils/array.d.ts +42 -0
- package/output/utils/array.js +98 -0
- package/output/utils/debug.d.ts +131 -0
- package/output/utils/debug.js +295 -0
- package/output/utils/decimal.d.ts +3 -0
- package/output/utils/decimal.js +16 -0
- package/output/utils/numeric.d.ts +14 -0
- package/output/utils/numeric.js +51 -0
- package/output/utils/object.d.ts +26 -0
- package/output/utils/object.js +56 -0
- package/package.json +213 -57
- package/.travis.yml +0 -3
- package/Algebra.js +0 -4568
- package/BREAKING_CHANGES.md +0 -5
- package/CODE_OF_CONDUCT.md +0 -46
- package/CONTRIBUTING.md +0 -14
- package/Calculus.js +0 -2675
- package/Extra.js +0 -622
- package/Solve.js +0 -1783
- package/all.js +0 -16
- package/all.min.js +0 -1
- package/gulpfile.js +0 -16
- package/index.html +0 -158
- package/license.txt +0 -19
- package/nerdamer.core.js +0 -12510
- package/spec/LaTeX.spec.js +0 -302
- package/spec/TeXConvert.spec.js +0 -8
- package/spec/algebra.spec.js +0 -287
- package/spec/basic_parser.spec.js +0 -134
- package/spec/build.spec.js +0 -131
- package/spec/calculus.spec.js +0 -183
- package/spec/core.spec.js +0 -2970
- package/spec/extra.spec.js +0 -54
- package/spec/solve.spec.js +0 -126
- package/spec/support/jasmine.json +0 -11
- package/spec/support/utils.js +0 -42
- package/spec/text.spec.js +0 -132
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
import { sqcomp } from './algebra/utils';
|
|
2
|
+
import { Assumption } from './core/classes/assumption/Assumption';
|
|
3
|
+
import { Collection } from './core/classes/collection/Collection';
|
|
4
|
+
import { Dictionary } from './core/classes/dictionary/Dictionary';
|
|
5
|
+
import { Equation } from './core/classes/equation/Equation';
|
|
6
|
+
import { Expression } from './core/classes/expression/Expression';
|
|
7
|
+
import { Matrix } from './core/classes/matrix/Matrix';
|
|
8
|
+
import { Parser } from './core/classes/parser/Parser';
|
|
9
|
+
import { div as polynomialDiv, divide as polynomialDivide } from './core/classes/polynomial/functions';
|
|
10
|
+
import { Polynomial } from './core/classes/polynomial/Polynomial';
|
|
11
|
+
import { Rational } from './core/classes/rational/Rational';
|
|
12
|
+
import { ValuesSet } from './core/classes/valuesSet/ValuesSet';
|
|
13
|
+
import { Vector } from './core/classes/vector/Vector';
|
|
14
|
+
import { Converter } from './core/converters/Converter';
|
|
15
|
+
import { build } from './core/functions/build';
|
|
16
|
+
import { imagPart, polarForm, realPart, rectForm } from './core/functions/complex';
|
|
17
|
+
import { ceiling, dirac, doubleFactorial, fibonacci } from './math/math';
|
|
18
|
+
import { isprime } from './math/utils';
|
|
19
|
+
import { SolutionSet } from './solve/classes/SolutionSet';
|
|
20
|
+
import type { OptionsObject, ParserConstants, ParserValuesObject, TextOptions } from './core/classes/parser/types';
|
|
21
|
+
import type { ExpressionInput, ParserEntity } from './core/types';
|
|
22
|
+
export type TeXOptions = OptionsObject | 'decimal' | 'decimals';
|
|
23
|
+
export type { CompleteSquareResult } from './algebra/utils';
|
|
24
|
+
export type { SubstitutionMap, USubstitutionResult, } from './core/functions/subst';
|
|
25
|
+
export type { TextOptions };
|
|
26
|
+
/** Scalar-only methods exposed by the full package on parsed results. */
|
|
27
|
+
interface ScalarApi {
|
|
28
|
+
/**
|
|
29
|
+
* Compiles this value to a native JavaScript-number function when the parsed result
|
|
30
|
+
* is an Expression.
|
|
31
|
+
*
|
|
32
|
+
* Structured parser results expose this method so values returned by `nerdamer(...)`
|
|
33
|
+
* have one consistent TypeScript surface, but they cannot be compiled as scalar
|
|
34
|
+
* functions and throw {@link core!UnexpectedDataType} when called.
|
|
35
|
+
*
|
|
36
|
+
* @param argsArray - Optional variable names in positional call order.
|
|
37
|
+
* @returns A JavaScript-number function compiled from the scalar expression.
|
|
38
|
+
*/
|
|
39
|
+
buildFunction(argsArray?: string[]): (...args: number[]) => number;
|
|
40
|
+
}
|
|
41
|
+
/** Methods supplied by the full package as chainable instance operations. */
|
|
42
|
+
interface ChainableApi<T> extends ScalarApi {
|
|
43
|
+
diff(variable?: ExpressionInput, n?: Expression | number): T;
|
|
44
|
+
expand(): T;
|
|
45
|
+
factor(): T;
|
|
46
|
+
integrate(variable?: ExpressionInput): T;
|
|
47
|
+
numeric(precision?: ExpressionInput): T;
|
|
48
|
+
simplify(): T;
|
|
49
|
+
subst(value: ExpressionInput, withValue: ExpressionInput): T;
|
|
50
|
+
}
|
|
51
|
+
declare module './core/classes/expression/Expression' {
|
|
52
|
+
interface Expression {
|
|
53
|
+
/**
|
|
54
|
+
* Differentiates this expression symbolically.
|
|
55
|
+
*
|
|
56
|
+
* @param variable - Variable to differentiate with respect to. When omitted, the
|
|
57
|
+
* derivative implementation selects the first variable present in the expression.
|
|
58
|
+
* @param n - Derivative order. The derivative implementation uses first order when omitted.
|
|
59
|
+
* @returns The symbolic derivative; the receiver is not modified.
|
|
60
|
+
*/
|
|
61
|
+
diff(variable?: ExpressionInput, n?: Expression | number): Expression;
|
|
62
|
+
factor(): Expression;
|
|
63
|
+
integrate(variable?: ExpressionInput): Expression;
|
|
64
|
+
numeric(precision?: ExpressionInput): Expression;
|
|
65
|
+
simplify(): Expression;
|
|
66
|
+
/** Converts this expression to TeX using Nerdamer's converter. */
|
|
67
|
+
toTeX(options?: TeXOptions): string;
|
|
68
|
+
/** Converts this expression through Nerdamer's text converter. */
|
|
69
|
+
toText(): string;
|
|
70
|
+
/** Legacy alias for TeX conversion. */
|
|
71
|
+
latex(options?: TeXOptions): string;
|
|
72
|
+
/** Legacy alias for {@link Expression.isInf}. */
|
|
73
|
+
isInfinity(): boolean;
|
|
74
|
+
/** Returns whether this expression's numeric multiplier is fractional. */
|
|
75
|
+
isFraction(): boolean;
|
|
76
|
+
/** Returns whether this expression contains an integral. */
|
|
77
|
+
hasIntegral(): boolean;
|
|
78
|
+
/** Creates an equation with this expression on the left-hand side. */
|
|
79
|
+
equals(value: ExpressionInput): Equation;
|
|
80
|
+
/**
|
|
81
|
+
* Solves the equation formed by setting this expression equal to zero.
|
|
82
|
+
*
|
|
83
|
+
* @param variable - Variable to solve for.
|
|
84
|
+
* @returns The solver's {@link SolutionSet}, including any exclusions or root metadata it preserves.
|
|
85
|
+
*/
|
|
86
|
+
solveFor(variable: ExpressionInput): SolutionSet;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
declare module './core/classes/matrix/Matrix' {
|
|
90
|
+
interface Matrix extends ChainableApi<Matrix> {
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
declare module './core/classes/vector/Vector' {
|
|
94
|
+
interface Vector extends ChainableApi<Vector> {
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
declare module './core/classes/collection/Collection' {
|
|
98
|
+
interface Collection extends ChainableApi<Collection> {
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
declare module './core/classes/dictionary/Dictionary' {
|
|
102
|
+
interface Dictionary extends ChainableApi<Dictionary> {
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
declare module './core/classes/valuesSet/ValuesSet' {
|
|
106
|
+
interface ValuesSet extends ScalarApi {
|
|
107
|
+
diff(variable?: ExpressionInput, n?: Expression | number): this;
|
|
108
|
+
factor(): this;
|
|
109
|
+
integrate(variable?: ExpressionInput): this;
|
|
110
|
+
numeric(precision?: ExpressionInput): this;
|
|
111
|
+
simplify(): this;
|
|
112
|
+
subst(value: ExpressionInput, withValue: ExpressionInput): this;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
declare module './core/classes/equation/Equation' {
|
|
116
|
+
interface Equation extends ChainableApi<Equation> {
|
|
117
|
+
/**
|
|
118
|
+
* Solves this equation for the requested variable.
|
|
119
|
+
*
|
|
120
|
+
* @remarks
|
|
121
|
+
* The solver works from the equation's residual form, `LHS - RHS = 0`, and
|
|
122
|
+
* returns Nerdamer's {@link SolutionSet}. The equation itself is not modified.
|
|
123
|
+
*
|
|
124
|
+
* @param variable - Variable to solve for.
|
|
125
|
+
* @returns The solver's solution set, including exclusions or root metadata it preserves.
|
|
126
|
+
*/
|
|
127
|
+
solveFor(variable: ExpressionInput): SolutionSet;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Parses Nerdamer notation into a supported parser entity.
|
|
132
|
+
*
|
|
133
|
+
* The returned runtime type depends on the notation and can be an
|
|
134
|
+
* {@link Expression}, equation, or structured parser value. Most type-specific methods
|
|
135
|
+
* still require the corresponding class guard. Full-package methods declared across all
|
|
136
|
+
* parser results can be called directly; scalar-only methods such as `buildFunction()`
|
|
137
|
+
* reject structured results at runtime.
|
|
138
|
+
*
|
|
139
|
+
* @remarks
|
|
140
|
+
* Entries in `values` are substituted while parsing and take precedence over
|
|
141
|
+
* known parser values, including otherwise restricted names. Parser and
|
|
142
|
+
* registration settings are shared by this module-level Nerdamer instance.
|
|
143
|
+
*
|
|
144
|
+
* @param e - Expression-compatible input to parse.
|
|
145
|
+
* @param values - Optional name-to-value substitutions for this parse.
|
|
146
|
+
* @returns The parsed {@link ParserEntity}; inspect its runtime type when the
|
|
147
|
+
* input can produce more than an Expression.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* nerdamer('x+2*x+1').text(); // '1+3*x'
|
|
152
|
+
* nerdamer('2*[a, b, 3]').text(); // '[2*a, 2*b, 6]'
|
|
153
|
+
* nerdamer('x+6*y+a', {x: 1, y: 2, a:'t'}).text(); // '13+t'
|
|
154
|
+
*
|
|
155
|
+
* // Evaluation allows even restricted variables to be overridden
|
|
156
|
+
* nerdamer('e+pi', {π: 1, e: 2}).text(); // '2+pi'
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
declare function nerdamer(e: ExpressionInput, values?: ParserValuesObject): ParserEntity;
|
|
160
|
+
declare namespace nerdamer {
|
|
161
|
+
var pretty: (e: ParserEntity | string, type?: "TeX" | "text") => string;
|
|
162
|
+
var convertFromLaTeX: (TeX: string) => ParserEntity;
|
|
163
|
+
var convertToTeX: (expression: ParserEntity | string, options?: TeXOptions) => string;
|
|
164
|
+
var convertToLaTeX: (expression: ParserEntity | string, options?: TeXOptions) => string;
|
|
165
|
+
var setFunction: (name: string, args: string[], body: string) => typeof nerdamer;
|
|
166
|
+
var setConstant: (name: string, value: number | string) => typeof nerdamer;
|
|
167
|
+
var getConstant: (name: string) => string;
|
|
168
|
+
var set: (setting: string | OptionsObject, value?: boolean | string | number | bigint) => typeof nerdamer;
|
|
169
|
+
var get: (setting: Parameters<typeof Parser.get>[0] | "PRECISION") => number | bigint | boolean | "eng" | "spa" | "fra" | "deu" | "por" | "ita" | "nld";
|
|
170
|
+
var getOperator: (symbol: string) => import("./api/parser").Operator | undefined;
|
|
171
|
+
var setOperator: (operator: Parameters<typeof Parser.setOperator>[0], action?: Parameters<typeof Parser.setOperator>[1]) => typeof nerdamer;
|
|
172
|
+
var aliasOperator: (symbol: string, alias: string) => typeof nerdamer;
|
|
173
|
+
var setVar: (name: string, value: number | string | "delete") => void;
|
|
174
|
+
var clearVars: () => typeof nerdamer;
|
|
175
|
+
var getVars: (option?: "LaTeX" | "text") => Record<string, string>;
|
|
176
|
+
var functions: () => {
|
|
177
|
+
user: string[];
|
|
178
|
+
system: string[];
|
|
179
|
+
};
|
|
180
|
+
var symbols: typeof import("./core/classes/expression/shortcuts").symbols;
|
|
181
|
+
var version: () => string;
|
|
182
|
+
var errors: typeof import("./core/errors");
|
|
183
|
+
var buildFunction: typeof build;
|
|
184
|
+
var classes: {
|
|
185
|
+
Expression: typeof Expression;
|
|
186
|
+
Rational: typeof Rational;
|
|
187
|
+
Polynomial: typeof Polynomial;
|
|
188
|
+
Matrix: typeof Matrix;
|
|
189
|
+
Vector: typeof Vector;
|
|
190
|
+
Collection: typeof Collection;
|
|
191
|
+
Converter: typeof Converter;
|
|
192
|
+
Dictionary: typeof Dictionary;
|
|
193
|
+
ValuesSet: typeof ValuesSet;
|
|
194
|
+
SolutionSet: typeof SolutionSet;
|
|
195
|
+
Assumption: typeof Assumption;
|
|
196
|
+
Equation: typeof Equation;
|
|
197
|
+
instance: {
|
|
198
|
+
Parser: {
|
|
199
|
+
CONSTANTS: ParserConstants;
|
|
200
|
+
MAX_COMPOUND_OPERATOR_LENGTH: number;
|
|
201
|
+
operators: Record<string, import("./api/parser").Operator>;
|
|
202
|
+
VALUE_SETS: string[];
|
|
203
|
+
WHITE_SPACE: string[];
|
|
204
|
+
KNOWN_VALUES: Record<string, ParserEntity>;
|
|
205
|
+
extractIndices(scope: import("./core/common/classes/Scope").Scope, values?: ParserValuesObject, assertive?: boolean): number[] | Expression[];
|
|
206
|
+
extractStringKeys(scope: import("./core/common/classes/Scope").Scope): string[];
|
|
207
|
+
aliasOperator(symbol: string, alias: string): /*elided*/ any;
|
|
208
|
+
create(): /*elided*/ any;
|
|
209
|
+
evaluate(str: string, values?: ParserValuesObject): ParserEntity;
|
|
210
|
+
get(setting: keyof typeof import("./core/Settings").Settings): number | bigint | boolean | "eng" | "spa" | "fra" | "deu" | "por" | "ita" | "nld";
|
|
211
|
+
getI(): string;
|
|
212
|
+
getOperator(symbol: string): import("./api/parser").Operator | undefined;
|
|
213
|
+
getPrecision(): number;
|
|
214
|
+
parse(str: ExpressionInput, values?: ParserValuesObject): ParserEntity;
|
|
215
|
+
parseRPN(rpn: import("./core/common/classes/Scope").Scope, values?: ParserValuesObject, assertive?: boolean): ParserEntity;
|
|
216
|
+
parseTeXRPN(rpn: import("./core/common/classes/Scope").Scope): string;
|
|
217
|
+
scopedBlock(setting: string, value: boolean, callback: () => ParserEntity): ParserEntity;
|
|
218
|
+
set(setting: string | OptionsObject, value?: boolean | string | number | bigint): /*elided*/ any;
|
|
219
|
+
setConstants(constants: ParserConstants): void;
|
|
220
|
+
setI(variable: string): /*elided*/ any;
|
|
221
|
+
setImaginary(variable: string): /*elided*/ any;
|
|
222
|
+
setOperator(definition: import("./api/parser").OperatorDefinition, action?: import("./core/classes/parser/types").Operation | import("./core/classes/parser/types").PreFixFunction | import("./core/classes/parser/types").PostFixFunction): /*elided*/ any;
|
|
223
|
+
setPrecision(precision: number): void;
|
|
224
|
+
tokenize(inputStr: string, options?: OptionsObject): import("./core/common/classes/Scope").Scope;
|
|
225
|
+
toRPN(scope: import("./core/common/classes/Scope").Scope): import("./core/common/classes/Scope").Scope;
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
var cos: typeof import("./math/trig").cos;
|
|
230
|
+
var sin: typeof import("./math/trig").sin;
|
|
231
|
+
var tan: typeof import("./math/trig").tan;
|
|
232
|
+
var acos: typeof import("./math/trig").acos;
|
|
233
|
+
var asin: typeof import("./math/trig").asin;
|
|
234
|
+
var atan: typeof import("./math/trig").atan;
|
|
235
|
+
var arccos: typeof import("./math/trig").acos;
|
|
236
|
+
var arcsin: typeof import("./math/trig").asin;
|
|
237
|
+
var arctan: typeof import("./math/trig").atan;
|
|
238
|
+
var atan2: typeof import("./math/trig").atan2;
|
|
239
|
+
var sec: typeof import("./math/trig").sec;
|
|
240
|
+
var csc: typeof import("./math/trig").csc;
|
|
241
|
+
var cot: typeof import("./math/trig").cot;
|
|
242
|
+
var asec: typeof import("./math/trig").asec;
|
|
243
|
+
var acsc: typeof import("./math/trig").acsc;
|
|
244
|
+
var acot: typeof import("./math/trig").acot;
|
|
245
|
+
var cosh: typeof import("./math/trig").cosh;
|
|
246
|
+
var sinh: typeof import("./math/trig").sinh;
|
|
247
|
+
var tanh: typeof import("./math/trig").tanh;
|
|
248
|
+
var acosh: typeof import("./math/trig").acosh;
|
|
249
|
+
var asinh: typeof import("./math/trig").asinh;
|
|
250
|
+
var atanh: typeof import("./math/trig").atanh;
|
|
251
|
+
var sech: typeof import("./math/trig").sech;
|
|
252
|
+
var csch: typeof import("./math/trig").csch;
|
|
253
|
+
var coth: typeof import("./math/trig").coth;
|
|
254
|
+
var asech: typeof import("./math/trig").asech;
|
|
255
|
+
var acsch: typeof import("./math/trig").acsch;
|
|
256
|
+
var acoth: typeof import("./math/trig").acoth;
|
|
257
|
+
var log: typeof import("./math/math").log;
|
|
258
|
+
var exp: typeof import("./math/math").exp;
|
|
259
|
+
var sqrt: typeof import("./math/math").sqrt;
|
|
260
|
+
var cbrt: typeof import("./math/math").cbrt;
|
|
261
|
+
var nthroot: typeof import("./math/math").nthroot;
|
|
262
|
+
var numeric: typeof import("./math/math").numeric;
|
|
263
|
+
var abs: typeof import("./math/math").abs;
|
|
264
|
+
var sign: typeof import("./math/math").sign;
|
|
265
|
+
var min: typeof import("./math/math").min;
|
|
266
|
+
var max: typeof import("./math/math").max;
|
|
267
|
+
var round: typeof import("./math/math").round;
|
|
268
|
+
var floor: typeof import("./math/math").floor;
|
|
269
|
+
var ceil: typeof ceiling;
|
|
270
|
+
var trunc: typeof import("./math/trunc").trunc;
|
|
271
|
+
var hypot: typeof import("./math/geometry").hypot;
|
|
272
|
+
var fact: typeof import("./math/math").factorial;
|
|
273
|
+
var factorial: typeof import("./math/math").factorial;
|
|
274
|
+
var dfact: typeof doubleFactorial;
|
|
275
|
+
var dfactorial: typeof doubleFactorial;
|
|
276
|
+
var fib: typeof fibonacci;
|
|
277
|
+
var mod: typeof import("./math/math").mod;
|
|
278
|
+
var modInv: typeof import("./math/math").modInv;
|
|
279
|
+
var isPrime: typeof isprime;
|
|
280
|
+
var imagpart: typeof imagPart;
|
|
281
|
+
var realpart: typeof realPart;
|
|
282
|
+
var polarform: typeof polarForm;
|
|
283
|
+
var rectform: typeof rectForm;
|
|
284
|
+
var arg: typeof import("./core/functions/complex").arg;
|
|
285
|
+
var conjugate: typeof import("./core/functions/complex").conjugate;
|
|
286
|
+
var csgn: typeof import("./core/functions/complex").csgn;
|
|
287
|
+
var gamma: typeof import("./math/math").gamma;
|
|
288
|
+
var erf: typeof import("./math/math").erf;
|
|
289
|
+
var erfc: typeof import("./math/math").erfc;
|
|
290
|
+
var heaviside: typeof import("./math/math").heaviside;
|
|
291
|
+
var delta: typeof dirac;
|
|
292
|
+
var Ci: typeof import("./math/math").Ci;
|
|
293
|
+
var Chi: typeof import("./math/math").Chi;
|
|
294
|
+
var Si: typeof import("./math/math").Si;
|
|
295
|
+
var Shi: typeof import("./math/math").Shi;
|
|
296
|
+
var Li: typeof import("./math/math").Li;
|
|
297
|
+
var Ei: typeof import("./math/math").Ei;
|
|
298
|
+
var sinc: typeof import("./math/math").sinc;
|
|
299
|
+
var contains: typeof import("./math/math").contains;
|
|
300
|
+
var subst: typeof import("./core/functions/subst").subst;
|
|
301
|
+
var uSub: typeof import("./core/functions/subst").uSub;
|
|
302
|
+
var uUnSub: typeof import("./core/functions/subst").uUnSub;
|
|
303
|
+
var expand: typeof import("./core/functions/expand/expand").expand;
|
|
304
|
+
var factor: typeof import("./algebra/factor/factor").factor;
|
|
305
|
+
var polyFactors: typeof import("./algebra/factor/factor").polyFactors;
|
|
306
|
+
var completeSquare: typeof sqcomp;
|
|
307
|
+
var gcd: typeof import("./algebra/gcd/gcd").gcd;
|
|
308
|
+
var lcm: typeof import("./algebra/gcd/gcd").lcm;
|
|
309
|
+
var partfrac: typeof import("./algebra/partfrac").partfrac;
|
|
310
|
+
var div: typeof polynomialDiv;
|
|
311
|
+
var divide: typeof polynomialDivide;
|
|
312
|
+
var simplify: typeof import("./algebra/simplify/simplify").simplify;
|
|
313
|
+
var groebner: typeof import("./algebra/groebner").groebner;
|
|
314
|
+
var solve: typeof import("./solve/solve").solve;
|
|
315
|
+
var solveSystem: typeof import("./solve/solveSystem").solveSystem;
|
|
316
|
+
var solveeqs: typeof import("./solve/solveSystem").solveSystem;
|
|
317
|
+
var diff: typeof import("./calculus/derivative/diff").diff;
|
|
318
|
+
var integrate: typeof import("./calculus/integrate/integrate").integrate;
|
|
319
|
+
var laplace: typeof import("./calculus/laplace/laplace").laplace;
|
|
320
|
+
var ilaplace: typeof import("./calculus/laplace/ilaplace").ilaplace;
|
|
321
|
+
var ilt: typeof import("./calculus/laplace/ilaplace").ilaplace;
|
|
322
|
+
var sum: typeof import("./math/math").sum;
|
|
323
|
+
var product: typeof import("./math/math").product;
|
|
324
|
+
var limit: typeof import("./calculus/limit/limit").limit;
|
|
325
|
+
var defint: typeof import("./math/math").defint;
|
|
326
|
+
var S: typeof import("./calculus/fresnel").S;
|
|
327
|
+
var C: typeof import("./calculus/fresnel").C;
|
|
328
|
+
var matrix: typeof import("./math/math").matrix;
|
|
329
|
+
var imatrix: typeof import("./core/classes/matrix/utils").imatrix;
|
|
330
|
+
var determinant: typeof import("./core/classes/matrix/functions").determinant;
|
|
331
|
+
var nullspace: typeof import("./core/classes/matrix/functions").nullspace;
|
|
332
|
+
var dot: typeof import("./core/classes/vector/functions").dot;
|
|
333
|
+
var cross: typeof import("./core/classes/vector/functions").cross;
|
|
334
|
+
var deg: typeof import("./core/classes/polynomial/functions").deg;
|
|
335
|
+
var content: typeof import("./core/classes/polynomial/functions").content;
|
|
336
|
+
var assume: typeof import("./core/classes/assumption/assume").assume;
|
|
337
|
+
var updateAPI: () => typeof nerdamer;
|
|
338
|
+
}
|
|
339
|
+
export default nerdamer;
|