@cortex-js/compute-engine 0.22.0 → 0.23.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/dist/compute-engine.esm.js +7550 -6908
- package/dist/compute-engine.js +7549 -6907
- package/dist/compute-engine.min.esm.js +10 -10
- package/dist/compute-engine.min.js +10 -10
- package/dist/math-json.esm.js +12 -11
- package/dist/math-json.js +12 -11
- package/dist/math-json.min.esm.js +12 -11
- package/dist/math-json.min.js +2 -2
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +11 -10
- package/dist/types/compute-engine/boxed-expression/box.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +2 -1
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +16 -51
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/collection-utils.d.ts +1 -1
- package/dist/types/compute-engine/compile.d.ts +1 -1
- package/dist/types/compute-engine/compute-engine.d.ts +41 -39
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/domain-utils.d.ts +1 -1
- package/dist/types/compute-engine/function-utils.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +4 -2
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +2 -1
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/public.d.ts +13 -6
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +4 -3
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +6 -6
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-add.d.ts +13 -3
- package/dist/types/compute-engine/library/arithmetic-divide.d.ts +2 -1
- package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +6 -8
- package/dist/types/compute-engine/library/arithmetic-power.d.ts +3 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +1 -1
- package/dist/types/compute-engine/library/complex.d.ts +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/domains.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +1 -1
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +1 -1
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +24 -2
- package/dist/types/compute-engine/numerics/factor.d.ts +27 -0
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +3 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +8 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +8 -22
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/terms.d.ts +14 -0
- package/dist/types/compute-engine/public.d.ts +45 -37
- package/dist/types/compute-engine/rules.d.ts +1 -1
- package/dist/types/compute-engine/simplify-rules.d.ts +11 -1
- package/dist/types/compute-engine/solve.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/expand.d.ts +5 -1
- package/dist/types/compute-engine/symbolic/flatten.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/negate.d.ts +3 -2
- package/dist/types/compute-engine/symbolic/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/product.d.ts +8 -3
- package/dist/types/compute-engine/symbolic/tensor-fields.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/tensors.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/utils.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +2 -2
- package/dist/types/math-json/math-json-format.d.ts +1 -1
- package/dist/types/math-json/utils.d.ts +1 -1
- package/dist/types/math-json.d.ts +2 -2
- package/package.json +1 -1
- package/dist/types/compute-engine/symbolic/sum.d.ts +0 -33
package/dist/math-json.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS Compute Engine 0.
|
|
1
|
+
/** CortexJS Compute Engine 0.23.0 */
|
|
2
2
|
|
|
3
3
|
// src/math-json/utils.ts
|
|
4
4
|
function isSymbolObject(expr) {
|
|
@@ -110,8 +110,6 @@ function stringValue(expr) {
|
|
|
110
110
|
return expr.substring(1, expr.length - 1);
|
|
111
111
|
}
|
|
112
112
|
function head(expr) {
|
|
113
|
-
if (expr === null || expr === void 0)
|
|
114
|
-
return null;
|
|
115
113
|
if (Array.isArray(expr)) {
|
|
116
114
|
if (typeof expr[0] === "string" && !isValidIdentifier(expr[0])) {
|
|
117
115
|
console.error(
|
|
@@ -121,6 +119,8 @@ function head(expr) {
|
|
|
121
119
|
}
|
|
122
120
|
return expr[0];
|
|
123
121
|
}
|
|
122
|
+
if (expr === null || expr === void 0)
|
|
123
|
+
return null;
|
|
124
124
|
if (isFunctionObject(expr))
|
|
125
125
|
return expr.fn[0];
|
|
126
126
|
return null;
|
|
@@ -130,19 +130,19 @@ function headName(expr) {
|
|
|
130
130
|
return typeof h === "string" ? h : "";
|
|
131
131
|
}
|
|
132
132
|
function ops(expr) {
|
|
133
|
-
if (expr === null || expr === void 0)
|
|
134
|
-
return null;
|
|
135
133
|
if (Array.isArray(expr))
|
|
136
134
|
return expr.slice(1);
|
|
135
|
+
if (expr === null || expr === void 0)
|
|
136
|
+
return null;
|
|
137
137
|
if (isFunctionObject(expr))
|
|
138
138
|
return expr.fn.slice(1);
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
141
141
|
function op(expr, n) {
|
|
142
|
-
if (expr === null || expr === void 0)
|
|
143
|
-
return null;
|
|
144
142
|
if (Array.isArray(expr))
|
|
145
143
|
return expr[n] ?? null;
|
|
144
|
+
if (expr === null || expr === void 0)
|
|
145
|
+
return null;
|
|
146
146
|
if (isFunctionObject(expr))
|
|
147
147
|
return expr.fn[n] ?? null;
|
|
148
148
|
return null;
|
|
@@ -163,14 +163,15 @@ function nops(expr) {
|
|
|
163
163
|
return 0;
|
|
164
164
|
}
|
|
165
165
|
function symbol(expr) {
|
|
166
|
-
if (expr === null || expr === void 0)
|
|
167
|
-
return null;
|
|
168
166
|
if (typeof expr === "string") {
|
|
169
|
-
if (/^[
|
|
167
|
+
if (/^[+-]?[0-9\.]/.test(expr))
|
|
170
168
|
return null;
|
|
171
169
|
if (expr.length >= 2 && expr[0] === "'" && expr[expr.length - 1] === "'")
|
|
172
170
|
return null;
|
|
171
|
+
return expr;
|
|
173
172
|
}
|
|
173
|
+
if (expr === null || expr === void 0)
|
|
174
|
+
return null;
|
|
174
175
|
const s = isSymbolObject(expr) ? expr.sym : expr;
|
|
175
176
|
if (typeof s !== "string")
|
|
176
177
|
return null;
|
|
@@ -239,7 +240,7 @@ function mapArgs(expr, fn) {
|
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
// src/math-json.ts
|
|
242
|
-
var version = "0.
|
|
243
|
+
var version = "0.23.0";
|
|
243
244
|
export {
|
|
244
245
|
applyRecursively,
|
|
245
246
|
dictionary as getDictionary,
|
package/dist/math-json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS MathJSON 0.
|
|
1
|
+
/** CortexJS MathJSON 0.23.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
var MathJson = (() => {
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -148,8 +148,6 @@ var MathJson = (() => {
|
|
|
148
148
|
return expr.substring(1, expr.length - 1);
|
|
149
149
|
}
|
|
150
150
|
function head(expr) {
|
|
151
|
-
if (expr === null || expr === void 0)
|
|
152
|
-
return null;
|
|
153
151
|
if (Array.isArray(expr)) {
|
|
154
152
|
if (typeof expr[0] === "string" && !isValidIdentifier(expr[0])) {
|
|
155
153
|
console.error(
|
|
@@ -159,6 +157,8 @@ var MathJson = (() => {
|
|
|
159
157
|
}
|
|
160
158
|
return expr[0];
|
|
161
159
|
}
|
|
160
|
+
if (expr === null || expr === void 0)
|
|
161
|
+
return null;
|
|
162
162
|
if (isFunctionObject(expr))
|
|
163
163
|
return expr.fn[0];
|
|
164
164
|
return null;
|
|
@@ -168,19 +168,19 @@ var MathJson = (() => {
|
|
|
168
168
|
return typeof h === "string" ? h : "";
|
|
169
169
|
}
|
|
170
170
|
function ops(expr) {
|
|
171
|
-
if (expr === null || expr === void 0)
|
|
172
|
-
return null;
|
|
173
171
|
if (Array.isArray(expr))
|
|
174
172
|
return expr.slice(1);
|
|
173
|
+
if (expr === null || expr === void 0)
|
|
174
|
+
return null;
|
|
175
175
|
if (isFunctionObject(expr))
|
|
176
176
|
return expr.fn.slice(1);
|
|
177
177
|
return null;
|
|
178
178
|
}
|
|
179
179
|
function op(expr, n) {
|
|
180
|
-
if (expr === null || expr === void 0)
|
|
181
|
-
return null;
|
|
182
180
|
if (Array.isArray(expr))
|
|
183
181
|
return expr[n] ?? null;
|
|
182
|
+
if (expr === null || expr === void 0)
|
|
183
|
+
return null;
|
|
184
184
|
if (isFunctionObject(expr))
|
|
185
185
|
return expr.fn[n] ?? null;
|
|
186
186
|
return null;
|
|
@@ -201,14 +201,15 @@ var MathJson = (() => {
|
|
|
201
201
|
return 0;
|
|
202
202
|
}
|
|
203
203
|
function symbol(expr) {
|
|
204
|
-
if (expr === null || expr === void 0)
|
|
205
|
-
return null;
|
|
206
204
|
if (typeof expr === "string") {
|
|
207
|
-
if (/^[
|
|
205
|
+
if (/^[+-]?[0-9\.]/.test(expr))
|
|
208
206
|
return null;
|
|
209
207
|
if (expr.length >= 2 && expr[0] === "'" && expr[expr.length - 1] === "'")
|
|
210
208
|
return null;
|
|
209
|
+
return expr;
|
|
211
210
|
}
|
|
211
|
+
if (expr === null || expr === void 0)
|
|
212
|
+
return null;
|
|
212
213
|
const s = isSymbolObject(expr) ? expr.sym : expr;
|
|
213
214
|
if (typeof s !== "string")
|
|
214
215
|
return null;
|
|
@@ -277,7 +278,7 @@ var MathJson = (() => {
|
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
// src/math-json.ts
|
|
280
|
-
var version = "0.
|
|
281
|
+
var version = "0.23.0";
|
|
281
282
|
return __toCommonJS(math_json_exports);
|
|
282
283
|
})();
|
|
283
284
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS Compute Engine 0.
|
|
1
|
+
/** CortexJS Compute Engine 0.23.0 */
|
|
2
2
|
|
|
3
3
|
// src/math-json/utils.ts
|
|
4
4
|
function isSymbolObject(expr) {
|
|
@@ -110,8 +110,6 @@ function stringValue(expr) {
|
|
|
110
110
|
return expr.substring(1, expr.length - 1);
|
|
111
111
|
}
|
|
112
112
|
function head(expr) {
|
|
113
|
-
if (expr === null || expr === void 0)
|
|
114
|
-
return null;
|
|
115
113
|
if (Array.isArray(expr)) {
|
|
116
114
|
if (typeof expr[0] === "string" && !isValidIdentifier(expr[0])) {
|
|
117
115
|
console.error(
|
|
@@ -121,6 +119,8 @@ function head(expr) {
|
|
|
121
119
|
}
|
|
122
120
|
return expr[0];
|
|
123
121
|
}
|
|
122
|
+
if (expr === null || expr === void 0)
|
|
123
|
+
return null;
|
|
124
124
|
if (isFunctionObject(expr))
|
|
125
125
|
return expr.fn[0];
|
|
126
126
|
return null;
|
|
@@ -130,19 +130,19 @@ function headName(expr) {
|
|
|
130
130
|
return typeof h === "string" ? h : "";
|
|
131
131
|
}
|
|
132
132
|
function ops(expr) {
|
|
133
|
-
if (expr === null || expr === void 0)
|
|
134
|
-
return null;
|
|
135
133
|
if (Array.isArray(expr))
|
|
136
134
|
return expr.slice(1);
|
|
135
|
+
if (expr === null || expr === void 0)
|
|
136
|
+
return null;
|
|
137
137
|
if (isFunctionObject(expr))
|
|
138
138
|
return expr.fn.slice(1);
|
|
139
139
|
return null;
|
|
140
140
|
}
|
|
141
141
|
function op(expr, n) {
|
|
142
|
-
if (expr === null || expr === void 0)
|
|
143
|
-
return null;
|
|
144
142
|
if (Array.isArray(expr))
|
|
145
143
|
return expr[n] ?? null;
|
|
144
|
+
if (expr === null || expr === void 0)
|
|
145
|
+
return null;
|
|
146
146
|
if (isFunctionObject(expr))
|
|
147
147
|
return expr.fn[n] ?? null;
|
|
148
148
|
return null;
|
|
@@ -163,14 +163,15 @@ function nops(expr) {
|
|
|
163
163
|
return 0;
|
|
164
164
|
}
|
|
165
165
|
function symbol(expr) {
|
|
166
|
-
if (expr === null || expr === void 0)
|
|
167
|
-
return null;
|
|
168
166
|
if (typeof expr === "string") {
|
|
169
|
-
if (/^[
|
|
167
|
+
if (/^[+-]?[0-9\.]/.test(expr))
|
|
170
168
|
return null;
|
|
171
169
|
if (expr.length >= 2 && expr[0] === "'" && expr[expr.length - 1] === "'")
|
|
172
170
|
return null;
|
|
171
|
+
return expr;
|
|
173
172
|
}
|
|
173
|
+
if (expr === null || expr === void 0)
|
|
174
|
+
return null;
|
|
174
175
|
const s = isSymbolObject(expr) ? expr.sym : expr;
|
|
175
176
|
if (typeof s !== "string")
|
|
176
177
|
return null;
|
|
@@ -239,7 +240,7 @@ function mapArgs(expr, fn) {
|
|
|
239
240
|
}
|
|
240
241
|
|
|
241
242
|
// src/math-json.ts
|
|
242
|
-
var version = "0.
|
|
243
|
+
var version = "0.23.0";
|
|
243
244
|
export {
|
|
244
245
|
applyRecursively,
|
|
245
246
|
dictionary as getDictionary,
|
package/dist/math-json.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** CortexJS MathJSON 0.
|
|
1
|
+
/** CortexJS MathJSON 0.23.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.MathJson = {}));})(this, (function (exports) { 'use strict';
|
|
3
|
-
var MathJson=(()=>{var f=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var D=(n,t)=>{for(var e in t)f(n,e,{get:t[e],enumerable:!0})},R=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!k.call(n,r)&&r!==e&&f(n,r,{get:()=>t[r],enumerable:!(i=T(t,r))||i.enumerable});return n};var _=n=>R(f({},"__esModule",{value:!0}),n);var z={};D(z,{applyRecursively:()=>J,getDictionary:()=>y,getStringValue:()=>m,head:()=>o,headName:()=>I,isDictionaryObject:()=>M,isFunctionObject:()=>u,isStringObject:()=>S,isSymbolObject:()=>d,mapArgs:()=>$,nops:()=>E,op:()=>s,symbol:()=>A,version:()=>X});function d(n){return n!==null&&typeof n=="object"&&"sym"in n}function S(n){return n!==null&&typeof n=="object"&&"str"in n}function u(n){return n!==null&&typeof n=="object"&&"fn"in n}function M(n){return n!==null&&typeof n=="object"&&"dict"in n}var c;function N(n){if(!c){let e=`^[${["Zyyy","Zinh","Arab","Armn","Beng","Bopo","Cyrl","Deva","Ethi","Geor","Grek","Gujr","Guru","Hang","Hani","Hebr","Hira","Kana","Knda","Khmr","Laoo","Latn","Mlym","Mymr","Orya","Sinh","Taml","Telu","Thaa","Thai","Tibt"].map(i=>`\\p{Script=${i}}`).join("")}]*$`;c=new RegExp(e,"u")}return c.test(n)}function a(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||O.test(n)?!0:N(n)?/^[\p{XIDS}_]\p{XIDC}*$/u.test(n):!1}var F="\\u{FE0F}",V="\\u{20E3}",L="\\u{200D}",P="\\p{RI}\\p{RI}",w="(?:[\\u{E0020}-\\u{E007E}]+\\u{E007F})",b=`(?:\\p{EMod}|${F}${V}?|${w})`,C="(?:(?=\\P{XIDC})\\p{Emoji})",h=`(?:${C}${b}*|\\p{Emoji}${b}+|${P})`,j=`(?:${h})(${L}${h})*`,G=new RegExp(`(?:${j})+`,"u"),O=new RegExp(`^(?:${j})+$`,"u");function q(n){return typeof n!="string"?"not-a-string":n===""?"empty-string":n.normalize()!==n?"expected-nfc":/[\u200E\u200F\u2066-\u2069\u202A-\u202E]/.test(n)?"unexpected-bidi-marker":O.test(n)?"valid":/\p{XIDC}/u.test(n)&&G.test(n)?"unexpected-mixed-emoji":N(n)?a(n)?"valid":a(n[0])?"invalid-char":"invalid-first-char":"unexpected-script"}function m(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"||n.length<2||n[0]!=="'"||n[n.length-1]!=="'"?null:n.substring(1,n.length-1)}function o(n){return
|
|
3
|
+
var MathJson=(()=>{var f=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var D=(n,t)=>{for(var e in t)f(n,e,{get:t[e],enumerable:!0})},R=(n,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of v(t))!k.call(n,r)&&r!==e&&f(n,r,{get:()=>t[r],enumerable:!(i=T(t,r))||i.enumerable});return n};var _=n=>R(f({},"__esModule",{value:!0}),n);var z={};D(z,{applyRecursively:()=>J,getDictionary:()=>y,getStringValue:()=>m,head:()=>o,headName:()=>I,isDictionaryObject:()=>M,isFunctionObject:()=>u,isStringObject:()=>S,isSymbolObject:()=>d,mapArgs:()=>$,nops:()=>E,op:()=>s,symbol:()=>A,version:()=>X});function d(n){return n!==null&&typeof n=="object"&&"sym"in n}function S(n){return n!==null&&typeof n=="object"&&"str"in n}function u(n){return n!==null&&typeof n=="object"&&"fn"in n}function M(n){return n!==null&&typeof n=="object"&&"dict"in n}var c;function N(n){if(!c){let e=`^[${["Zyyy","Zinh","Arab","Armn","Beng","Bopo","Cyrl","Deva","Ethi","Geor","Grek","Gujr","Guru","Hang","Hani","Hebr","Hira","Kana","Knda","Khmr","Laoo","Latn","Mlym","Mymr","Orya","Sinh","Taml","Telu","Thaa","Thai","Tibt"].map(i=>`\\p{Script=${i}}`).join("")}]*$`;c=new RegExp(e,"u")}return c.test(n)}function a(n){return/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(n)||O.test(n)?!0:N(n)?/^[\p{XIDS}_]\p{XIDC}*$/u.test(n):!1}var F="\\u{FE0F}",V="\\u{20E3}",L="\\u{200D}",P="\\p{RI}\\p{RI}",w="(?:[\\u{E0020}-\\u{E007E}]+\\u{E007F})",b=`(?:\\p{EMod}|${F}${V}?|${w})`,C="(?:(?=\\P{XIDC})\\p{Emoji})",h=`(?:${C}${b}*|\\p{Emoji}${b}+|${P})`,j=`(?:${h})(${L}${h})*`,G=new RegExp(`(?:${j})+`,"u"),O=new RegExp(`^(?:${j})+$`,"u");function q(n){return typeof n!="string"?"not-a-string":n===""?"empty-string":n.normalize()!==n?"expected-nfc":/[\u200E\u200F\u2066-\u2069\u202A-\u202E]/.test(n)?"unexpected-bidi-marker":O.test(n)?"valid":/\p{XIDC}/u.test(n)&&G.test(n)?"unexpected-mixed-emoji":N(n)?a(n)?"valid":a(n[0])?"invalid-char":"invalid-first-char":"unexpected-script"}function m(n){return n==null?null:typeof n=="object"&&"str"in n?n.str:typeof n!="string"||n.length<2||n[0]!=="'"||n[n.length-1]!=="'"?null:n.substring(1,n.length-1)}function o(n){return Array.isArray(n)?typeof n[0]=="string"&&!a(n[0])?(console.error(`Invalid identifier "${n[0]}": ${q(n[0])}`),null):n[0]:n==null?null:u(n)?n.fn[0]:null}function I(n){let t=o(n);return typeof t=="string"?t:""}function H(n){return Array.isArray(n)?n.slice(1):n==null?null:u(n)?n.fn.slice(1):null}function s(n,t){return Array.isArray(n)?n[t]??null:n==null?null:u(n)?n.fn[t]??null:null}function K(n){return s(n,1)}function Z(n){return s(n,2)}function E(n){return n==null?0:Array.isArray(n)?Math.max(0,n.length-1):u(n)?Math.max(0,n.fn.length-1):0}function A(n){if(typeof n=="string")return/^[+-]?[0-9\.]/.test(n)||n.length>=2&&n[0]==="'"&&n[n.length-1]==="'"?null:n;if(n==null)return null;let t=d(n)?n.sym:n;return typeof t!="string"?null:t}function p(n){let t=o(n);if(t==="KeyValuePair"||t==="Tuple"||t==="Pair"){let e=m(K(n));return e?[e,Z(n)??"Nothing"]:null}return null}function y(n){if(n===null)return null;if(typeof n=="object"&&"dict"in n)return n.dict;let t=p(n);if(t)return{[t[0]]:t[1]};if(o(n)==="Dictionary"){let i={};for(let r=1;r<E(n);r++){let l=p(s(n,r));l&&(i[l[0]]=l[1])}return i}return null}function J(n,t){let e=o(n);if(e!==null)return[t(e),...(H(n)??[]).map(t)];let i=y(n);if(i!==null){let r=Object.keys(i),l={};for(let g of r)l[g]=t(i[g]);return{dict:l}}return t(n)}function $(n,t){let e=null;if(Array.isArray(n)&&(e=n),u(n)&&(e=n.fn),e===null)return[];let i=1,r=[];for(;i<e.length;)r.push(t(e[i])),i+=1;return r}var X="0.23.0";return _(z);})();
|
|
4
4
|
Object.assign(exports, MathJson); Object.defineProperty(exports, '__esModule', { value: true });}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
export type SignalCode = RuntimeSignalCode | ('invalid-name' | 'expected-predicate' | 'expected-symbol' | 'operator-requires-one-operand' | 'postfix-operator-requires-one-operand' | 'prefix-operator-requires-one-operand' | 'unbalanced-symbols' | 'expected-argument' | 'unexpected-command' | 'cyclic-definition' | 'invalid-supersets' | 'expected-supersets' | 'unknown-domain' | 'duplicate-wikidata' | 'invalid-dictionary-entry' | 'syntax-error');
|
|
3
3
|
export type SignalMessage = SignalCode | [SignalCode, ...any[]];
|
|
4
4
|
export type SignalOrigin = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import
|
|
1
|
+
/* 0.23.0 */
|
|
2
|
+
import { Decimal } from 'decimal.js';
|
|
3
3
|
import { Expression } from '../../math-json/math-json-format';
|
|
4
4
|
import { BoxedExpression, BoxedFunctionDefinition, BoxedRuleSet, BoxedSymbolDefinition, BoxedDomain, EvaluateOptions, IComputeEngine, LatexString, Metadata, NOptions, PatternMatchOptions, SimplifyOptions, Substitution, RuntimeScope, DomainCompatibility, DomainLiteral, BoxedBaseDefinition, Rational, BoxedSubstitution } from '../public';
|
|
5
5
|
/**
|
|
@@ -37,6 +37,7 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
|
|
|
37
37
|
get scope(): RuntimeScope | null;
|
|
38
38
|
/** Object.is() */
|
|
39
39
|
is(rhs: any): boolean;
|
|
40
|
+
get canonical(): BoxedExpression;
|
|
40
41
|
get latex(): LatexString;
|
|
41
42
|
set latex(val: LatexString);
|
|
42
43
|
get symbol(): string | null;
|
|
@@ -58,13 +59,6 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
|
|
|
58
59
|
get isExact(): boolean;
|
|
59
60
|
/** For a symbol, true if the symbol is a constant (unchangeable value) */
|
|
60
61
|
get isConstant(): boolean;
|
|
61
|
-
get canonical(): BoxedExpression;
|
|
62
|
-
subs(_sub: Substitution, options?: {
|
|
63
|
-
canonical: boolean;
|
|
64
|
-
}): BoxedExpression;
|
|
65
|
-
solve(_vars: Iterable<string>): null | BoxedExpression[];
|
|
66
|
-
replace(_rules: BoxedRuleSet): null | BoxedExpression;
|
|
67
|
-
has(_v: string | string[]): boolean;
|
|
68
62
|
get isNaN(): boolean | undefined;
|
|
69
63
|
get isZero(): boolean | undefined;
|
|
70
64
|
get isNotZero(): boolean | undefined;
|
|
@@ -77,9 +71,15 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
|
|
|
77
71
|
get isPrime(): boolean | undefined;
|
|
78
72
|
get isComposite(): boolean | undefined;
|
|
79
73
|
get numericValue(): number | Decimal | Complex | Rational | null;
|
|
74
|
+
get sgn(): -1 | 0 | 1 | undefined | null;
|
|
80
75
|
get shape(): number[];
|
|
81
76
|
get rank(): number;
|
|
82
|
-
|
|
77
|
+
subs(_sub: Substitution, options?: {
|
|
78
|
+
canonical: boolean;
|
|
79
|
+
}): BoxedExpression;
|
|
80
|
+
solve(_vars: Iterable<string>): null | BoxedExpression[];
|
|
81
|
+
replace(_rules: BoxedRuleSet): null | BoxedExpression;
|
|
82
|
+
has(_v: string | string[]): boolean;
|
|
83
83
|
isLess(_rhs: BoxedExpression): boolean | undefined;
|
|
84
84
|
isLessEqual(_rhs: BoxedExpression): boolean | undefined;
|
|
85
85
|
isGreater(_rhs: BoxedExpression): boolean | undefined;
|
|
@@ -123,3 +123,4 @@ export declare abstract class _BoxedExpression implements BoxedExpression {
|
|
|
123
123
|
optimize: ('simplify' | 'evaluate')[];
|
|
124
124
|
}): ((args: Record<string, any>) => any | undefined) | undefined;
|
|
125
125
|
}
|
|
126
|
+
export declare function getSubexpressions(expr: BoxedExpression, head: string): BoxedExpression[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { Decimal } from 'decimal.js';
|
|
3
3
|
import { IComputeEngine, SemiBoxedExpression, BoxedExpression, Metadata, Rational, CanonicalForm } from '../public';
|
|
4
4
|
import { MathJsonNumber } from '../../math-json/math-json-format';
|
|
@@ -68,7 +68,7 @@ export declare function boxNumber(ce: IComputeEngine, num: MathJsonNumber | numb
|
|
|
68
68
|
*
|
|
69
69
|
* If available, preserve LaTeX and wikidata metadata in the boxed expression.
|
|
70
70
|
*
|
|
71
|
-
* Note that `boxFunction()` should only be called from `ce.
|
|
71
|
+
* Note that `boxFunction()` should only be called from `ce.box()`
|
|
72
72
|
*/
|
|
73
73
|
export declare function boxFunction(ce: IComputeEngine, head: string, ops: SemiBoxedExpression[], options: {
|
|
74
74
|
metadata?: Metadata;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { BoxedExpression, IComputeEngine, EvaluateOptions, NOptions, BoxedRuleSet, SemiBoxedExpression, SimplifyOptions, ReplaceOptions, Substitution, Metadata, PatternMatchOptions, BoxedDomain, BoxedSubstitution } from '../public';
|
|
3
3
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { BoxedDomain, BoxedExpression, BoxedSubstitution, DomainCompatibility, DomainConstructor, DomainExpression, DomainLiteral, IComputeEngine, Metadata, PatternMatchOptions } from '../public';
|
|
3
3
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
4
4
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { Expression } from '../../math-json/math-json-format';
|
|
3
3
|
import { BoxedExpression, BoxedFunctionDefinition, IComputeEngine, NOptions, BoxedRuleSet, SemiBoxedExpression, SimplifyOptions, Substitution, ReplaceOptions, Metadata, PatternMatchOptions, BoxedDomain, RuntimeScope, BoxedSubstitution, EvaluateOptions, BoxedBaseDefinition, Hold } from '../public';
|
|
4
4
|
/**
|
|
@@ -30,6 +30,7 @@ export declare class BoxedFunction extends _BoxedExpression {
|
|
|
30
30
|
infer(domain: BoxedDomain): boolean;
|
|
31
31
|
bind(): void;
|
|
32
32
|
reset(): void;
|
|
33
|
+
get isExact(): boolean;
|
|
33
34
|
get isCanonical(): boolean;
|
|
34
35
|
set isCanonical(val: boolean);
|
|
35
36
|
get isPure(): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { Decimal } from 'decimal.js';
|
|
3
3
|
import { Expression } from '../../math-json/math-json-format';
|
|
4
4
|
import { BoxedExpression, BoxedDomain, IComputeEngine, Metadata, NOptions, PatternMatchOptions, Rational, SimplifyOptions, BoxedSubstitution, EvaluateOptions } from '../public';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
3
3
|
import { BoxedExpression, BoxedSubstitution, BoxedDomain, IComputeEngine, LatexString, Metadata, Pattern, PatternMatchOptions, SemiBoxedExpression, Substitution } from '../public';
|
|
4
4
|
export declare class BoxedPattern extends _BoxedExpression implements Pattern {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { BoxedExpression, IComputeEngine, EvaluateOptions, NOptions, SimplifyOptions, Metadata, BoxedDomain, BoxedSubstitution, PatternMatchOptions, BoxedBaseDefinition, BoxedFunctionDefinition } from '../public';
|
|
3
3
|
import { DataTypeMap, TensorDataType } from '../symbolic/tensor-fields';
|
|
4
4
|
import { AbstractTensor, TensorData } from '../symbolic/tensors';
|
|
@@ -16,9 +16,9 @@ import { _BoxedExpression } from './abstract-boxed-expression';
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
export declare class BoxedTensor extends _BoxedExpression {
|
|
19
|
+
private _tensor;
|
|
19
20
|
private readonly _head?;
|
|
20
21
|
private readonly _ops?;
|
|
21
|
-
private _tensor;
|
|
22
22
|
private _expression;
|
|
23
23
|
constructor(ce: IComputeEngine, input: {
|
|
24
24
|
head?: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
export declare function canonicalForm(expr: BoxedExpression, forms: boolean | CanonicalForm | CanonicalForm[]): BoxedExpression;
|
|
@@ -1,35 +1,27 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.23.0 */
|
|
2
2
|
import { Expression } from '../../math-json/math-json-format';
|
|
3
3
|
import { BoxedExpression, IComputeEngine } from '../public';
|
|
4
|
-
export declare function isLatexString(s: unknown): s is string;
|
|
5
|
-
export declare function latexString(s: unknown): string | null;
|
|
6
4
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* - ['Negate', 'ImaginaryUnit']
|
|
10
|
-
* - ['Negate', ['Multiply', 3, 'ImaginaryUnit']]
|
|
11
|
-
* - ['Multiply', 5, 'ImaginaryUnit']
|
|
12
|
-
* - ['Multiply', 'ImaginaryUnit', 5]
|
|
5
|
+
* For any numeric result, if `bignumPreferred()` is true, calculate using
|
|
6
|
+
* bignums. If `bignumPreferred()` is false, calculate using machine numbers
|
|
13
7
|
*/
|
|
14
|
-
export declare function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* Return the unknowns in the expression, recursively.
|
|
18
|
-
*
|
|
19
|
-
* An unknown is an identifier (symbol or function) that is not bound
|
|
20
|
-
* to a value.
|
|
21
|
-
*
|
|
8
|
+
export declare function bignumPreferred(ce: IComputeEngine): boolean;
|
|
9
|
+
/** When result of a numeric evaluation is a complex number,
|
|
10
|
+
* return `NaN` if not `complexallowed()`
|
|
22
11
|
*/
|
|
23
|
-
export declare function
|
|
12
|
+
export declare function complexAllowed(ce: IComputeEngine): boolean;
|
|
13
|
+
export declare function isLatexString(s: unknown): s is string;
|
|
14
|
+
export declare function asLatexString(s: unknown): string | null;
|
|
15
|
+
export declare function hashCode(s: string): number;
|
|
24
16
|
/**
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* A free variable is an identifier that is not an argument to a function,
|
|
29
|
-
* or a local variable.
|
|
17
|
+
* If `expr` is a number, return it as a Decimal (it might be
|
|
18
|
+
* in the machine value range or not). Use `isInMachineRange()` to check.
|
|
30
19
|
*
|
|
20
|
+
* Use this instead of `machineValue()` when possible, as `machineValue` will
|
|
21
|
+
* truncate bignums to machine numbers
|
|
31
22
|
*/
|
|
32
|
-
export declare function
|
|
23
|
+
export declare function bignumValue(ce: IComputeEngine, expr: Expression | null | undefined): Decimal | null;
|
|
24
|
+
export declare function asBigint(expr: BoxedExpression): bigint | null;
|
|
33
25
|
/** Return the local variables in the expression.
|
|
34
26
|
*
|
|
35
27
|
* A local variable is an identifier that is declared with a `Declare`
|
|
@@ -41,17 +33,6 @@ export declare function getFreeVariables(expr: BoxedExpression, result: Set<stri
|
|
|
41
33
|
* hoisted.
|
|
42
34
|
*
|
|
43
35
|
*/
|
|
44
|
-
export declare function getLocalVariables(expr: BoxedExpression, result: Set<string>): void;
|
|
45
|
-
export declare function getSubexpressions(expr: BoxedExpression, head: string): BoxedExpression[];
|
|
46
|
-
/**
|
|
47
|
-
* For any numeric result, if `bignumPreferred()` is true, calculate using
|
|
48
|
-
* bignums. If `bignumPreferred()` is false, calculate using machine numbers
|
|
49
|
-
*/
|
|
50
|
-
export declare function bignumPreferred(ce: IComputeEngine): boolean;
|
|
51
|
-
/** When result of a numeric evaluation is a complex number,
|
|
52
|
-
* return `NaN` if not `complexallowed()`
|
|
53
|
-
*/
|
|
54
|
-
export declare function complexAllowed(ce: IComputeEngine): boolean;
|
|
55
36
|
/**
|
|
56
37
|
* Assert that `expr` is in fact canonical.
|
|
57
38
|
*
|
|
@@ -60,19 +41,3 @@ export declare function complexAllowed(ce: IComputeEngine): boolean;
|
|
|
60
41
|
* To make an expression whose canonical status is unknown, canonical, call
|
|
61
42
|
* `expr.canonical`.
|
|
62
43
|
*/
|
|
63
|
-
export declare function asCanonical(expr: BoxedExpression): BoxedExpression;
|
|
64
|
-
export declare function hashCode(s: string): number;
|
|
65
|
-
export declare function isDictionaryLike(expr: BoxedExpression): boolean;
|
|
66
|
-
export declare function getDictionaryLike(expr: BoxedExpression): {
|
|
67
|
-
[key: string]: BoxedExpression;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* If `expr` is a number, return it as a Decimal (it might be
|
|
71
|
-
* in the machine value range or not). Use `isInMachineRange()` to check.
|
|
72
|
-
*
|
|
73
|
-
* Use this instead of `machineValue()` when possible, as `machineValue` will
|
|
74
|
-
* truncate bignums to machine numbers
|
|
75
|
-
*/
|
|
76
|
-
export declare function bignumValue(ce: IComputeEngine, expr: Expression | null | undefined): Decimal | null;
|
|
77
|
-
export declare function bigintValue(ce: IComputeEngine, expr: Expression | null | undefined): bigint | null;
|
|
78
|
-
export declare function asBigint(expr: BoxedExpression): bigint | null;
|