nerdamer 2.0.0-rc.1 → 2.0.0
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/BREAKING_CHANGES.md +244 -0
- package/README.md +168 -229
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.LICENSE.txt +6 -6
- package/output/algebra/adapters.d.ts +3 -33
- package/output/algebra/adapters.js +7 -105
- package/output/algebra/algorithms/arith.js +10 -9
- package/output/algebra/algorithms/groebnerBase.d.ts +24 -20
- package/output/algebra/algorithms/groebnerBase.js +486 -723
- package/output/algebra/dispatch.d.ts +1 -0
- package/output/algebra/dispatch.js +25 -0
- package/output/algebra/factor/factor.d.ts +15 -0
- package/output/algebra/factor/factor.js +99 -12
- package/output/algebra/gcd/gcd.d.ts +8 -7
- package/output/algebra/gcd/gcd.js +32 -78
- package/output/algebra/groebner.d.ts +2 -2
- package/output/algebra/groebner.js +6 -12
- package/output/algebra/partfrac.d.ts +3 -3
- package/output/algebra/partfrac.js +28 -61
- package/output/algebra/polynomial/ModularSparsePolynomial.d.ts +131 -0
- package/output/algebra/polynomial/ModularSparsePolynomial.js +378 -0
- package/output/algebra/polynomial/ModularSparsePolynomialFactor.d.ts +40 -0
- package/output/algebra/polynomial/ModularSparsePolynomialFactor.js +661 -0
- package/output/algebra/polynomial/SparsePolynomialFactor.d.ts +64 -0
- package/output/algebra/polynomial/SparsePolynomialFactor.js +492 -0
- package/output/algebra/polynomial/SparsePolynomialGcd.d.ts +29 -0
- package/output/algebra/polynomial/SparsePolynomialGcd.js +259 -0
- package/output/algebra/polynomial/SparsePolynomialMultivariateFactor.d.ts +82 -0
- package/output/algebra/polynomial/SparsePolynomialMultivariateFactor.js +604 -0
- package/output/algebra/polynomial/modularGcd.d.ts +40 -0
- package/output/algebra/polynomial/modularGcd.js +365 -0
- package/output/algebra/polynomialize.js +4 -2
- package/output/algebra/simplify/funcsimp.js +1 -1
- package/output/algebra/simplify/ratsimp.js +1 -1
- package/output/algebra/simplify/simplify.js +11 -2
- package/output/algebra/utils.d.ts +1 -1
- package/output/algebra/utils.js +3 -3
- package/output/api/advanced.d.ts +2 -1
- package/output/api/advanced.js +3 -3
- package/output/api/algebra.d.ts +21 -4
- package/output/api/algebra.js +22 -3
- package/output/api/assumptions.d.ts +1 -1
- package/output/api/assumptions.js +2 -1
- package/output/api/calculus.d.ts +2 -1
- package/output/api/calculus.js +2 -1
- package/output/api/core.d.ts +28 -7
- package/output/api/core.js +28 -2
- package/output/api/languages/deu.d.ts +3 -0
- package/output/api/languages/deu.js +266 -0
- package/output/api/languages/fra.d.ts +3 -0
- package/output/api/languages/fra.js +266 -0
- package/output/api/languages/ita.d.ts +3 -0
- package/output/api/languages/ita.js +266 -0
- package/output/api/languages/nld.d.ts +3 -0
- package/output/api/languages/nld.js +266 -0
- package/output/api/languages/por.d.ts +3 -0
- package/output/api/languages/por.js +266 -0
- package/output/api/languages/spa.d.ts +3 -0
- package/output/api/languages/spa.js +266 -0
- package/output/api/parser.d.ts +10 -2
- package/output/api/parser.js +2 -0
- package/output/api/solve.d.ts +1 -1
- package/output/api/solve.js +2 -1
- package/output/api/structures.d.ts +1 -1
- package/output/api/structures.js +2 -1
- package/output/calculus/adapters.d.ts +8 -0
- package/output/calculus/adapters.js +41 -0
- package/output/calculus/derivative/diff.js +6 -3
- package/output/calculus/dispatch.d.ts +1 -0
- package/output/calculus/dispatch.js +25 -0
- package/output/calculus/integrate/integrate.js +4 -4
- package/output/calculus/integrate/integrationTable.js +16 -16
- package/output/calculus/laplace/ilaplace.js +1 -1
- package/output/calculus/laplace/ilaplaceTable.js +18 -17
- package/output/calculus/laplace/laplaceTable.js +3 -2
- package/output/calculus/limit/limit.js +1 -1
- package/output/core/classes/assumption/Assumption.js +14 -10
- package/output/core/classes/assumption/assume.d.ts +6 -0
- package/output/core/classes/assumption/assume.js +9 -0
- package/output/core/classes/assumption/dispatch.d.ts +1 -0
- package/output/core/classes/assumption/dispatch.js +11 -0
- package/output/core/classes/collection/Collection.js +11 -2
- package/output/core/classes/complex/Complex.d.ts +10 -0
- package/output/core/classes/complex/Complex.js +19 -1
- package/output/core/classes/decimalSet/DecimalSet.js +5 -4
- package/output/core/classes/dictionary/Dictionary.js +4 -1
- package/output/core/classes/expression/CoeffObject.d.ts +1 -1
- package/output/core/classes/expression/CoeffObject.js +1 -2
- package/output/core/classes/expression/Expression.d.ts +35 -26
- package/output/core/classes/expression/Expression.js +77 -50
- package/output/core/classes/expression/analysis.d.ts +1 -1
- package/output/core/classes/expression/analysis.js +7 -7
- package/output/core/classes/expression/format.d.ts +9 -0
- package/output/core/classes/expression/format.js +130 -7
- package/output/core/classes/expression/utils.d.ts +9 -0
- package/output/core/classes/expression/utils.js +52 -6
- package/output/core/classes/matrix/Matrix.d.ts +2 -3
- package/output/core/classes/matrix/Matrix.js +26 -23
- package/output/core/classes/matrix/dispatch.d.ts +1 -0
- package/output/core/classes/matrix/dispatch.js +19 -0
- package/output/core/classes/matrix/functions.d.ts +2 -0
- package/output/core/classes/matrix/functions.js +5 -0
- package/output/core/classes/parser/Parser.d.ts +31 -5
- package/output/core/classes/parser/Parser.js +357 -444
- package/output/core/classes/parser/constants.d.ts +2 -0
- package/output/core/classes/parser/constants.js +4 -2
- package/output/core/classes/parser/controlFlowSignals.d.ts +38 -0
- package/output/core/classes/parser/controlFlowSignals.js +60 -0
- package/output/core/classes/parser/operations/add.js +14 -16
- package/output/core/classes/parser/operations/compare.js +13 -0
- package/output/core/classes/parser/operations/functions.d.ts +3 -4
- package/output/core/classes/parser/operations/functions.js +48 -102
- package/output/core/classes/parser/operations/multiply.js +22 -15
- package/output/core/classes/parser/operations/power.js +11 -11
- package/output/core/classes/parser/operations/subtract.js +2 -1
- package/output/core/classes/parser/preprocess.d.ts +0 -7
- package/output/core/classes/parser/preprocess.js +33 -39
- package/output/core/classes/parser/scripting/controlFlow.d.ts +4 -102
- package/output/core/classes/parser/scripting/controlFlow.js +134 -186
- package/output/core/classes/parser/scripting/deferred.d.ts +4 -0
- package/output/core/classes/parser/scripting/deferred.js +65 -0
- package/output/core/classes/parser/scripting/dispatch.d.ts +1 -0
- package/output/core/classes/parser/scripting/dispatch.js +62 -0
- package/output/core/classes/parser/scripting/evaluate.d.ts +13 -0
- package/output/core/classes/parser/scripting/evaluate.js +17 -1
- package/output/core/classes/parser/scripting/scope.d.ts +1 -28
- package/output/core/classes/parser/scripting/scope.js +36 -40
- package/output/core/classes/parser/types.d.ts +5 -5
- package/output/core/classes/parser/wrappers/IndexedReference.d.ts +4 -3
- package/output/core/classes/parser/wrappers/IndexedReference.js +8 -0
- package/output/core/classes/parser/wrappers/KeyValuePair.d.ts +2 -2
- package/output/core/classes/polynomial/Polynomial.d.ts +5 -1
- package/output/core/classes/polynomial/Polynomial.js +53 -7
- package/output/core/classes/polynomial/SparsePolynomial.d.ts +221 -0
- package/output/core/classes/polynomial/SparsePolynomial.js +824 -0
- package/output/core/classes/polynomial/SparsePolynomialAdapter.d.ts +56 -0
- package/output/core/classes/polynomial/SparsePolynomialAdapter.js +241 -0
- package/output/core/classes/polynomial/Term.js +2 -2
- package/output/core/{adapters.d.ts → classes/polynomial/adapters.d.ts} +2 -2
- package/output/core/classes/polynomial/adapters.js +33 -0
- package/output/core/classes/polynomial/dispatch.d.ts +1 -0
- package/output/core/classes/polynomial/dispatch.js +14 -0
- package/output/core/classes/polynomial/functions.d.ts +8 -0
- package/output/core/classes/polynomial/functions.js +71 -8
- package/output/core/classes/polynomial/utils.js +2 -1
- package/output/core/classes/rational/Rational.d.ts +8 -11
- package/output/core/classes/rational/Rational.js +70 -20
- package/output/core/classes/seq/SEQ.js +4 -4
- package/output/core/classes/valuesSet/ValuesSet.d.ts +9 -1
- package/output/core/classes/valuesSet/ValuesSet.js +22 -4
- package/output/core/classes/vector/Vector.d.ts +2 -3
- package/output/core/classes/vector/Vector.js +11 -15
- package/output/core/classes/vector/dispatch.d.ts +1 -0
- package/output/core/classes/vector/dispatch.js +11 -0
- package/output/core/common/classes/MathematicalAggregate.js +11 -2
- package/output/core/common/classes/StructuredEntity.d.ts +0 -17
- package/output/core/common/classes/StructuredEntity.js +3 -64
- package/output/core/common/common.d.ts +0 -1
- package/output/core/common/common.js +29 -234
- package/output/core/converters/BaseConverter.js +3 -2
- package/output/core/converters/Converter.js +9 -5
- package/output/core/converters/Pattern.js +1 -1
- package/output/core/dispatch.d.ts +18 -0
- package/output/core/dispatch.js +3 -281
- package/output/core/errors.d.ts +259 -474
- package/output/core/errors.js +270 -542
- package/output/core/fullFunctions.d.ts +7 -0
- package/output/core/fullFunctions.js +31 -0
- package/output/core/functions/bigint/bigint.d.ts +13 -1
- package/output/core/functions/bigint/bigint.js +56 -4
- package/output/core/functions/bigint/primeFactor.d.ts +2 -0
- package/output/core/functions/bigint/primeFactor.js +13 -13
- package/output/core/functions/build/definitions.js +6 -0
- package/output/core/functions/complex.d.ts +2 -2
- package/output/core/functions/complex.dispatch.d.ts +1 -0
- package/output/core/functions/complex.dispatch.js +16 -0
- package/output/core/functions/complex.js +7 -7
- package/output/core/functions/decimal.js +2 -1
- package/output/core/functions/expand/expand.js +2 -2
- package/output/core/functions/numeric.d.ts +1 -1
- package/output/core/functions/string.js +2 -1
- package/output/core/functions/subst.js +21 -13
- package/output/core/parserFunctions.d.ts +7 -0
- package/output/core/parserFunctions.js +25 -0
- package/output/index.d.ts +50 -30
- package/output/index.js +147 -19
- package/output/math/defint/defint.d.ts +18 -0
- package/output/math/defint/defint.js +60 -0
- package/output/math/defint/defintDecimal.js +6 -5
- package/output/math/defint/defintNative.js +7 -18
- package/output/math/dispatch.d.ts +1 -0
- package/output/math/dispatch.js +101 -0
- package/output/math/geometry.d.ts +4 -0
- package/output/math/geometry.js +23 -0
- package/output/math/math.d.ts +59 -19
- package/output/math/math.js +244 -100
- package/output/math/trig.js +4 -4
- package/output/math/utils.d.ts +6 -0
- package/output/math/utils.js +39 -0
- package/output/solve/classes/PolynomialSolver.d.ts +33 -14
- package/output/solve/classes/PolynomialSolver.js +267 -67
- package/output/solve/classes/SolutionSet.d.ts +20 -1
- package/output/solve/classes/SolutionSet.js +82 -5
- package/output/solve/dispatch.d.ts +1 -0
- package/output/solve/dispatch.js +13 -0
- package/output/solve/linsolve.d.ts +2 -0
- package/output/solve/linsolve.js +13 -5
- package/output/solve/solve.d.ts +10 -0
- package/output/solve/solve.js +128 -20
- package/output/solve/solveSystem.d.ts +1 -1
- package/output/solve/solveSystem.js +8 -32
- package/output/solve/utils.d.ts +2 -1
- package/output/solve/utils.js +18 -22
- package/output/utils/array.d.ts +1 -1
- package/output/utils/debug.js +2 -1
- package/package.json +22 -38
- package/dist/parser.js +0 -2
- package/dist/parser.js.LICENSE.txt +0 -7
- package/docs-data/parser-functions.json +0 -1960
- package/output/algebra/algorithms/factor.d.ts +0 -3
- package/output/algebra/algorithms/factor.js +0 -5
- package/output/algebra/algorithms/factorMultivariate.d.ts +0 -23
- package/output/algebra/algorithms/factorMultivariate.js +0 -2393
- package/output/algebra/algorithms/factorUnivariate.d.ts +0 -72
- package/output/algebra/algorithms/factorUnivariate.js +0 -1072
- package/output/algebra/algorithms/gcd.d.ts +0 -22
- package/output/algebra/algorithms/gcd.js +0 -690
- package/output/algebra/algorithms/multiPoly/MultiPoly.d.ts +0 -137
- package/output/algebra/algorithms/multiPoly/MultiPoly.js +0 -346
- package/output/algebra/algorithms/poly.d.ts +0 -228
- package/output/algebra/algorithms/poly.js +0 -1299
- package/output/algebra/algorithms/rational.d.ts +0 -17
- package/output/algebra/algorithms/rational.js +0 -115
- package/output/core/adapters.js +0 -40
- package/output/core/classes/parser/operations/comma.d.ts +0 -7
- package/output/core/classes/parser/operations/comma.js +0 -11
package/output/core/dispatch.js
CHANGED
|
@@ -1,52 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.mathFunctionRegistry = void 0;
|
|
4
|
-
|
|
5
|
-
const gcd_1 = require("../algebra/gcd/gcd");
|
|
6
|
-
const groebner_1 = require("../algebra/groebner");
|
|
7
|
-
const partfrac_1 = require("../algebra/partfrac");
|
|
8
|
-
const simplify_1 = require("../algebra/simplify/simplify");
|
|
9
|
-
const utils_1 = require("../algebra/utils");
|
|
10
|
-
const diff_1 = require("../calculus/derivative/diff");
|
|
11
|
-
const fresnel_1 = require("../calculus/fresnel");
|
|
12
|
-
const integrate_1 = require("../calculus/integrate/integrate");
|
|
13
|
-
const ilaplace_1 = require("../calculus/laplace/ilaplace");
|
|
14
|
-
const laplace_1 = require("../calculus/laplace/laplace");
|
|
15
|
-
const limit_1 = require("../calculus/limit/limit");
|
|
16
|
-
const geometry_1 = require("../math/geometry");
|
|
17
|
-
const math_1 = require("../math/math");
|
|
18
|
-
const trig_1 = require("../math/trig");
|
|
19
|
-
const trunc_1 = require("../math/trunc");
|
|
20
|
-
const utils_2 = require("../math/utils");
|
|
21
|
-
const solve_1 = require("../solve/solve");
|
|
22
|
-
const solveSystem_1 = require("../solve/solveSystem");
|
|
23
|
-
const assume_1 = require("./classes/assumption/assume");
|
|
24
|
-
const Collection_1 = require("./classes/collection/Collection");
|
|
25
|
-
const Dictionary_1 = require("./classes/dictionary/Dictionary");
|
|
26
|
-
const Equation_1 = require("./classes/equation/Equation");
|
|
27
|
-
const shortcuts_1 = require("./classes/expression/shortcuts");
|
|
28
|
-
const utils_3 = require("./classes/expression/utils");
|
|
29
|
-
const functions_1 = require("./classes/matrix/functions");
|
|
30
|
-
const Matrix_1 = require("./classes/matrix/Matrix");
|
|
31
|
-
const utils_4 = require("./classes/matrix/utils");
|
|
32
|
-
const constants_1 = require("./classes/parser/constants");
|
|
33
|
-
const controlFlow_1 = require("./classes/parser/scripting/controlFlow");
|
|
34
|
-
const evaluate_1 = require("./classes/parser/scripting/evaluate");
|
|
35
|
-
const scope_1 = require("./classes/parser/scripting/scope");
|
|
36
|
-
const functions_2 = require("./classes/polynomial/functions");
|
|
37
|
-
const ValuesSet_1 = require("./classes/valuesSet/ValuesSet");
|
|
38
|
-
const functions_3 = require("./classes/vector/functions");
|
|
39
|
-
const Vector_1 = require("./classes/vector/Vector");
|
|
40
|
-
const errors_1 = require("./errors");
|
|
41
|
-
const complex_1 = require("./functions/complex");
|
|
42
|
-
const expand_1 = require("./functions/expand/expand");
|
|
43
|
-
const subst_1 = require("./functions/subst");
|
|
4
|
+
exports.systemFunction = systemFunction;
|
|
44
5
|
/**
|
|
45
6
|
* Registers a system-level function in the dispatch table. Registered functions can use
|
|
46
7
|
* narrower parameter types, so `RegisteredMathFunction` does not define a common argument
|
|
47
8
|
* type. Dynamic invocation is handled by `callFunction`.
|
|
48
9
|
*/
|
|
49
|
-
function
|
|
10
|
+
function systemFunction(opts) {
|
|
50
11
|
return {
|
|
51
12
|
fn: opts.fn,
|
|
52
13
|
minArgs: opts.minArgs,
|
|
@@ -62,243 +23,4 @@ function entry(opts) {
|
|
|
62
23
|
level: 'system',
|
|
63
24
|
};
|
|
64
25
|
}
|
|
65
|
-
|
|
66
|
-
function parserDiff(expr, variable, n) {
|
|
67
|
-
let retval;
|
|
68
|
-
if (Equation_1.Equation.isEquation(expr)) {
|
|
69
|
-
retval = expr.each(e => parserDiff(e, variable, n));
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
retval = (0, diff_1.diff)(expr, variable, n);
|
|
73
|
-
}
|
|
74
|
-
return retval;
|
|
75
|
-
}
|
|
76
|
-
/** Applies parser integration to both sides when the input is an Equation. */
|
|
77
|
-
function parserIntegrate(expr, variable) {
|
|
78
|
-
let retval;
|
|
79
|
-
if (Equation_1.Equation.isEquation(expr)) {
|
|
80
|
-
retval = expr.each(e => parserIntegrate(e, variable));
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
retval = (0, integrate_1.integrate)(expr, variable);
|
|
84
|
-
}
|
|
85
|
-
return retval;
|
|
86
|
-
}
|
|
87
|
-
/** Maps the parser's symbolic direction token to the public limit direction representation. */
|
|
88
|
-
function parserLimit(expr, x, val, dir) {
|
|
89
|
-
let direction = 'both';
|
|
90
|
-
if (dir) {
|
|
91
|
-
direction = (0, utils_3.assertPlainVariableAndGetString)(dir);
|
|
92
|
-
}
|
|
93
|
-
const retval = (0, limit_1.limit)(expr, x, val, direction);
|
|
94
|
-
return retval;
|
|
95
|
-
}
|
|
96
|
-
/** Completes the square while returning the parser-facing expression result. */
|
|
97
|
-
function parserSqcomp(expr, variable) {
|
|
98
|
-
const variableName = variable === undefined ? undefined : (0, utils_3.assertPlainVariableAndGetString)(variable);
|
|
99
|
-
const retval = (0, utils_1.sqcomp)(expr, variableName).expression;
|
|
100
|
-
return retval;
|
|
101
|
-
}
|
|
102
|
-
/** Iterates parser containers while keeping the iteration variable local to each body call. */
|
|
103
|
-
function parserEach(collection, variable, body) {
|
|
104
|
-
const target = collection();
|
|
105
|
-
const values = [];
|
|
106
|
-
if (Vector_1.Vector.isVector(target) ||
|
|
107
|
-
Collection_1.Collection.isCollection(target) ||
|
|
108
|
-
ValuesSet_1.ValuesSet.isValuesSet(target)) {
|
|
109
|
-
target.forEach(value => values.push(value.copy()));
|
|
110
|
-
}
|
|
111
|
-
else if (Matrix_1.Matrix.isMatrix(target)) {
|
|
112
|
-
target.forEach(value => values.push(value.copy()));
|
|
113
|
-
}
|
|
114
|
-
else if (Dictionary_1.Dictionary.isDictionary(target)) {
|
|
115
|
-
target.forEach(value => values.push(value.copy()));
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
throw new errors_1.UnexpectedDataType((0, errors_1.message)('unsupportedType', { type: constants_1.dataTypes[target.dataType] }));
|
|
119
|
-
}
|
|
120
|
-
let index = 0;
|
|
121
|
-
const retval = (0, controlFlow_1.FOR)(() => (0, shortcuts_1.zero)(), () => (index < values.length ? (0, shortcuts_1.one)() : (0, shortcuts_1.zero)()), () => {
|
|
122
|
-
index++;
|
|
123
|
-
return (0, shortcuts_1.zero)();
|
|
124
|
-
}, () => (0, scope_1.LET)(variable, () => values[index], body));
|
|
125
|
-
return retval;
|
|
126
|
-
}
|
|
127
|
-
exports.mathFunctionRegistry = {
|
|
128
|
-
// Trigonometric
|
|
129
|
-
cos: entry({ fn: trig_1.cos, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
130
|
-
sin: entry({ fn: trig_1.sin, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
131
|
-
tan: entry({ fn: trig_1.tan, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
132
|
-
sec: entry({ fn: trig_1.sec, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
133
|
-
csc: entry({ fn: trig_1.csc, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
134
|
-
cot: entry({ fn: trig_1.cot, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
135
|
-
acos: entry({ fn: trig_1.acos, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
136
|
-
asin: entry({ fn: trig_1.asin, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
137
|
-
atan: entry({ fn: trig_1.atan, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
138
|
-
asec: entry({ fn: trig_1.asec, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
139
|
-
acsc: entry({ fn: trig_1.acsc, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
140
|
-
acot: entry({ fn: trig_1.acot, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
141
|
-
atan2: entry({ fn: trig_1.atan2, minArgs: 2, maxArgs: 2, distElWise: true }),
|
|
142
|
-
cosh: entry({ fn: trig_1.cosh, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
143
|
-
sinh: entry({ fn: trig_1.sinh, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
144
|
-
tanh: entry({ fn: trig_1.tanh, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
145
|
-
sech: entry({ fn: trig_1.sech, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
146
|
-
csch: entry({ fn: trig_1.csch, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
147
|
-
coth: entry({ fn: trig_1.coth, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
148
|
-
acosh: entry({ fn: trig_1.acosh, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
149
|
-
asinh: entry({ fn: trig_1.asinh, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
150
|
-
atanh: entry({ fn: trig_1.atanh, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
151
|
-
asech: entry({ fn: trig_1.asech, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
152
|
-
acsch: entry({ fn: trig_1.acsch, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
153
|
-
acoth: entry({ fn: trig_1.acoth, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
154
|
-
// Math
|
|
155
|
-
abs: entry({ fn: math_1.abs, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
156
|
-
sqrt: entry({ fn: math_1.sqrt, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
157
|
-
nthroot: entry({ fn: math_1.nthroot, minArgs: 2, maxArgs: 2, distElWise: true }),
|
|
158
|
-
cbrt: entry({ fn: math_1.cbrt, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
159
|
-
subst: entry({ fn: subst_1.subst, minArgs: 3, maxArgs: 3, distElWise: true }),
|
|
160
|
-
log: entry({ fn: math_1.log, minArgs: 1, maxArgs: 2, distElWise: true }),
|
|
161
|
-
exp: entry({ fn: math_1.exp, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
162
|
-
erf: entry({ fn: math_1.erf, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
163
|
-
erfc: entry({ fn: math_1.erfc, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
164
|
-
gamma: entry({ fn: math_1.gamma, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
165
|
-
[constants_1.DIRAC]: entry({ fn: math_1.dirac, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
166
|
-
[constants_1.HEAVISIDE]: entry({ fn: math_1.heaviside, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
167
|
-
hypot: entry({ fn: geometry_1.hypot, minArgs: 2, maxArgs: 2, distElWise: true }),
|
|
168
|
-
[constants_1.FACTORIAL]: entry({ fn: math_1.factorial, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
169
|
-
factorial: entry({ fn: math_1.factorial, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
170
|
-
[constants_1.DOUBLE_FACTORIAL]: entry({ fn: math_1.doubleFactorial, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
171
|
-
expand: entry({ fn: expand_1.expand, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
172
|
-
numeric: entry({
|
|
173
|
-
fn: evaluate_1.numeric,
|
|
174
|
-
minArgs: 1,
|
|
175
|
-
maxArgs: 2,
|
|
176
|
-
equationArgs: [0],
|
|
177
|
-
distElWise: false,
|
|
178
|
-
deferArguments: true,
|
|
179
|
-
}),
|
|
180
|
-
round: entry({ fn: math_1.round, minArgs: 1, maxArgs: 2, distElWise: true }),
|
|
181
|
-
sign: entry({ fn: math_1.sign, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
182
|
-
floor: entry({ fn: math_1.floor, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
183
|
-
ceil: entry({ fn: math_1.ceiling, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
184
|
-
ceiling: entry({ fn: math_1.ceiling, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
185
|
-
trunc: entry({ fn: trunc_1.trunc, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
186
|
-
mod: entry({ fn: math_1.mod, minArgs: 2, maxArgs: 2, distElWise: true }),
|
|
187
|
-
modinv: entry({ fn: math_1.modInv, minArgs: 2, maxArgs: 2, distElWise: true }),
|
|
188
|
-
parens: entry({ fn: math_1.parens, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
189
|
-
count: entry({ fn: utils_2.count, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
190
|
-
size: entry({ fn: utils_2.size, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
191
|
-
contains: entry({ fn: math_1.contains, minArgs: 2, maxArgs: 2, distElWise: false }),
|
|
192
|
-
max: entry({ fn: math_1.max, minArgs: 2, maxArgs: -1, distElWise: true }),
|
|
193
|
-
min: entry({ fn: math_1.min, minArgs: 2, maxArgs: -1, distElWise: true }),
|
|
194
|
-
// Complex
|
|
195
|
-
imagpart: entry({ fn: complex_1.imagPart, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
196
|
-
realpart: entry({ fn: complex_1.realPart, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
197
|
-
polarform: entry({ fn: complex_1.polarForm, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
198
|
-
rectform: entry({ fn: complex_1.rectForm, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
199
|
-
arg: entry({ fn: complex_1.arg, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
200
|
-
csgn: entry({ fn: complex_1.csgn, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
201
|
-
conjugate: entry({ fn: complex_1.conjugate, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
202
|
-
// Matrices and Vector
|
|
203
|
-
matrix: entry({ fn: math_1.matrix, minArgs: 1, maxArgs: -1, distElWise: false }),
|
|
204
|
-
imatrix: entry({ fn: utils_4.imatrix, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
205
|
-
determinant: entry({ fn: functions_1.determinant, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
206
|
-
transpose: entry({ fn: (M) => M.transpose(), minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
207
|
-
augment: entry({ fn: (M, N) => M.augment(N), minArgs: 2, maxArgs: 2, distElWise: false }),
|
|
208
|
-
rref: entry({ fn: (M, prime) => M.rref(prime), minArgs: 1, maxArgs: 2, distElWise: false }),
|
|
209
|
-
nullspace: entry({ fn: functions_1.nullspace, minArgs: 1, maxArgs: 2, distElWise: false }),
|
|
210
|
-
dot: entry({ fn: functions_3.dot, minArgs: 2, maxArgs: 2, distElWise: false }),
|
|
211
|
-
cross: entry({ fn: functions_3.cross, minArgs: 2, maxArgs: 2, distElWise: false }),
|
|
212
|
-
// Polynomials
|
|
213
|
-
deg: entry({ fn: functions_2.deg, minArgs: 1, maxArgs: 2, distElWise: true }),
|
|
214
|
-
content: entry({ fn: functions_2.content, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
215
|
-
div: entry({ fn: functions_2.div, minArgs: 2, maxArgs: 2, distElWise: false }),
|
|
216
|
-
divide: entry({ fn: functions_2.divide, minArgs: 2, maxArgs: 2, distElWise: false }),
|
|
217
|
-
// Calculus
|
|
218
|
-
diff: entry({ fn: parserDiff, minArgs: 1, maxArgs: 3, equationArgs: [0], distElWise: true }),
|
|
219
|
-
integrate: entry({ fn: parserIntegrate, minArgs: 1, maxArgs: 2, equationArgs: [0], distElWise: true }),
|
|
220
|
-
limit: entry({ fn: parserLimit, minArgs: 3, maxArgs: 4, distElWise: true }),
|
|
221
|
-
laplace: entry({ fn: laplace_1.laplace, minArgs: 3, maxArgs: 3, distElWise: true }),
|
|
222
|
-
ilaplace: entry({ fn: ilaplace_1.ilaplace, minArgs: 3, maxArgs: 3, distElWise: true }),
|
|
223
|
-
sum: entry({ fn: math_1.sum, minArgs: 4, maxArgs: 4, distElWise: true }),
|
|
224
|
-
product: entry({ fn: math_1.product, minArgs: 4, maxArgs: 4, distElWise: true }),
|
|
225
|
-
defint: entry({ fn: math_1.defint, minArgs: 4, maxArgs: 4, distElWise: true }),
|
|
226
|
-
[constants_1.FRESNEL_S]: entry({ fn: fresnel_1.S, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
227
|
-
[constants_1.FRESNEL_C]: entry({ fn: fresnel_1.C, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
228
|
-
// Algebra
|
|
229
|
-
polyfactors: entry({ fn: factor_1.polyFactors, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
230
|
-
factor: entry({ fn: factor_1.factor, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
231
|
-
simplify: entry({ fn: simplify_1.simplify, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
232
|
-
partfrac: entry({ fn: partfrac_1.partfrac, minArgs: 1, maxArgs: 2, distElWise: true }),
|
|
233
|
-
gcd: entry({ fn: gcd_1.gcd, minArgs: 2, maxArgs: 2, distElWise: true }),
|
|
234
|
-
lcm: entry({ fn: gcd_1.lcm, minArgs: 2, maxArgs: 2, distElWise: true }),
|
|
235
|
-
groebner: entry({ fn: groebner_1.groebner, minArgs: 1, maxArgs: 2, distElWise: false }),
|
|
236
|
-
sqcomp: entry({ fn: parserSqcomp, minArgs: 1, maxArgs: 2, distElWise: true }),
|
|
237
|
-
// Solver
|
|
238
|
-
solve: entry({ fn: solve_1.solve, minArgs: 2, maxArgs: 2, equationArgs: [0], distElWise: false }),
|
|
239
|
-
solveeqs: entry({ fn: solveSystem_1.solveSystem, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
240
|
-
// Assumptions and Sets
|
|
241
|
-
assume: entry({ fn: assume_1.assuming, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
242
|
-
forget: entry({ fn: assume_1.forget, minArgs: 1, maxArgs: 1, distElWise: false }),
|
|
243
|
-
unassign: entry({ fn: scope_1.unassign, minArgs: 1, maxArgs: 1, distElWise: false, deferArguments: true }),
|
|
244
|
-
// Parser scripting
|
|
245
|
-
evaluate: entry({
|
|
246
|
-
fn: evaluate_1.evaluate,
|
|
247
|
-
minArgs: 1,
|
|
248
|
-
maxArgs: 3,
|
|
249
|
-
equationArgs: [0],
|
|
250
|
-
distElWise: false,
|
|
251
|
-
deferArguments: true,
|
|
252
|
-
usage: 'scripting',
|
|
253
|
-
}),
|
|
254
|
-
return: entry({
|
|
255
|
-
fn: controlFlow_1.RETURN,
|
|
256
|
-
minArgs: 1,
|
|
257
|
-
maxArgs: 1,
|
|
258
|
-
equationArgs: [0],
|
|
259
|
-
distElWise: false,
|
|
260
|
-
bracketlessStatement: true,
|
|
261
|
-
usage: 'scripting',
|
|
262
|
-
}),
|
|
263
|
-
break: entry({ fn: controlFlow_1.BREAK, minArgs: 0, maxArgs: 0, distElWise: false, usage: 'scripting' }),
|
|
264
|
-
continue: entry({ fn: controlFlow_1.CONTINUE, minArgs: 0, maxArgs: 0, distElWise: false, usage: 'scripting' }),
|
|
265
|
-
and: entry({ fn: controlFlow_1.AND, minArgs: 2, maxArgs: -1, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
266
|
-
or: entry({ fn: controlFlow_1.OR, minArgs: 2, maxArgs: -1, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
267
|
-
not: entry({ fn: controlFlow_1.NOT, minArgs: 1, maxArgs: 1, distElWise: false, usage: 'scripting' }),
|
|
268
|
-
xor: entry({ fn: controlFlow_1.XOR, minArgs: 2, maxArgs: -1, distElWise: false, usage: 'scripting' }),
|
|
269
|
-
iferror: entry({ fn: controlFlow_1.IFERROR, minArgs: 2, maxArgs: 2, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
270
|
-
iserror: entry({ fn: controlFlow_1.ISERROR, minArgs: 1, maxArgs: 1, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
271
|
-
if: entry({ fn: controlFlow_1.IF, minArgs: 2, maxArgs: 3, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
272
|
-
while: entry({ fn: controlFlow_1.WHILE, minArgs: 2, maxArgs: 2, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
273
|
-
for: entry({ fn: controlFlow_1.FOR, minArgs: 4, maxArgs: 4, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
274
|
-
each: entry({ fn: parserEach, minArgs: 3, maxArgs: 3, distElWise: false, deferArguments: true, usage: 'scripting' }),
|
|
275
|
-
let: entry({
|
|
276
|
-
fn: scope_1.LET,
|
|
277
|
-
minArgs: 3,
|
|
278
|
-
maxArgs: -1,
|
|
279
|
-
distElWise: false,
|
|
280
|
-
deferArguments: true,
|
|
281
|
-
normalizeDeferredArguments: scope_1.normalizeLetArguments,
|
|
282
|
-
returnBoundary: true,
|
|
283
|
-
usage: 'scripting',
|
|
284
|
-
}),
|
|
285
|
-
block: entry({
|
|
286
|
-
fn: controlFlow_1.BLOCK,
|
|
287
|
-
minArgs: -1,
|
|
288
|
-
maxArgs: -1,
|
|
289
|
-
distElWise: false,
|
|
290
|
-
deferArguments: true,
|
|
291
|
-
returnBoundary: true,
|
|
292
|
-
usage: 'scripting',
|
|
293
|
-
}),
|
|
294
|
-
// Special
|
|
295
|
-
isprime: entry({ fn: utils_2.isprime, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
296
|
-
fib: entry({ fn: math_1.fibonacci, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
297
|
-
sinc: entry({ fn: math_1.sinc, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
298
|
-
Shi: entry({ fn: math_1.Shi, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
299
|
-
Si: entry({ fn: math_1.Si, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
300
|
-
Chi: entry({ fn: math_1.Chi, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
301
|
-
Ci: entry({ fn: math_1.Ci, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
302
|
-
Ei: entry({ fn: math_1.Ei, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
303
|
-
[constants_1.LI]: entry({ fn: math_1.Li, minArgs: 1, maxArgs: 1, distElWise: true }),
|
|
304
|
-
};
|
|
26
|
+
exports.mathFunctionRegistry = {};
|