@cortex-js/compute-engine 0.5.0 → 0.7.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 +16900 -13123
- package/dist/compute-engine.min.esm.js +2 -2
- package/dist/compute-engine.min.js +2 -2
- package/dist/math-json.esm.js +90 -36
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.js +2 -2
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +23 -10
- package/dist/types/compute-engine/boxed-expression/box.d.ts +4 -18
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +4 -4
- package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +49 -6
- 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 +14 -11
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +5 -5
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +10 -7
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +24 -10
- 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 +25 -8
- package/dist/types/compute-engine/compute-engine.d.ts +73 -47
- 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/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-core.d.ts +1 -3
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-inequalities.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-sets.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 +8 -8
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +3 -3
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +89 -63
- package/dist/types/compute-engine/latex-syntax/public.d.ts +85 -67
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +6 -4
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-add.d.ts +11 -0
- package/dist/types/compute-engine/library/arithmetic-divide.d.ts +15 -0
- package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +19 -0
- package/dist/types/compute-engine/{dictionary → library}/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +2 -0
- package/dist/types/compute-engine/library/calculus.d.ts +2 -0
- package/dist/types/compute-engine/library/collections.d.ts +2 -0
- package/dist/types/compute-engine/library/core.d.ts +2 -0
- package/dist/types/compute-engine/library/domains.d.ts +15 -0
- package/dist/types/compute-engine/library/library.d.ts +17 -0
- package/dist/types/compute-engine/library/logic.d.ts +2 -0
- package/dist/types/compute-engine/library/polynomials.d.ts +2 -0
- package/dist/types/compute-engine/library/relational-operator.d.ts +2 -0
- package/dist/types/compute-engine/library/sets.d.ts +2 -0
- package/dist/types/compute-engine/library/trigonometry.d.ts +2 -0
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-decimal.d.ts +5 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +4 -2
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/public.d.ts +265 -219
- package/dist/types/compute-engine/rules.d.ts +1 -1
- package/dist/types/compute-engine/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/expand.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/flatten.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/negate.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/sum.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/utils.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +3 -2
- package/dist/types/math-json/math-json-format.d.ts +27 -23
- package/dist/types/math-json/utils.d.ts +23 -18
- package/dist/types/math-json.d.ts +3 -3
- package/package.json +21 -22
- package/dist/types/compute-engine/dictionary/arithmetic-add.d.ts +0 -11
- package/dist/types/compute-engine/dictionary/arithmetic-divide.d.ts +0 -9
- package/dist/types/compute-engine/dictionary/arithmetic-multiply.d.ts +0 -17
- package/dist/types/compute-engine/dictionary/arithmetic.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/collections.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/core.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/dictionary.d.ts +0 -26
- package/dist/types/compute-engine/dictionary/logic.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/polynomials.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/relational-operator.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/sets.d.ts +0 -2
- package/dist/types/compute-engine/dictionary/trigonometry.d.ts +0 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* 0.7.0 */
|
|
2
|
+
/** The canonical form of `Multiply`:
|
|
3
|
+
* - remove `1`
|
|
4
|
+
* - combine literal small integers and rationals
|
|
5
|
+
* - any arg is literal 0 -> return 0
|
|
6
|
+
* - simplify signs
|
|
7
|
+
* - combine terms with same base
|
|
8
|
+
* `a a^3` -> `a^4`
|
|
9
|
+
* - simplify the signs:
|
|
10
|
+
* - i.e. `-2 \times -3` -> `2 \times 3`
|
|
11
|
+
* - `2 \times -x` -> `-2 \times x`
|
|
12
|
+
*
|
|
13
|
+
* The ops must be canonical, the result is canonical.
|
|
14
|
+
*/
|
|
15
|
+
export declare function canonicalMultiply(ce: IComputeEngine, ops: BoxedExpression[]): BoxedExpression;
|
|
16
|
+
export declare function simplifyMultiply(ce: IComputeEngine, ops: BoxedExpression[]): BoxedExpression | undefined;
|
|
17
|
+
export declare function evalMultiply(ce: IComputeEngine, ops: BoxedExpression[], mode?: 'N' | 'evaluate'): BoxedExpression | undefined;
|
|
18
|
+
export declare function canonicalMultiplication(ce: IComputeEngine, expr: BoxedExpression, range: BoxedExpression | undefined): BoxedExpression;
|
|
19
|
+
export declare function evalMultiplication(ce: IComputeEngine, expr: BoxedExpression, range: BoxedExpression, mode: 'simplify' | 'evaluate' | 'N'): BoxedExpression | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/* 0.7.0 */
|
|
2
|
+
export declare const DOMAIN_CONSTRUCTORS: string[];
|
|
3
|
+
export declare const DOMAIN_ALIAS: {
|
|
4
|
+
NumericFunction: (string | string[])[];
|
|
5
|
+
RealFunction: (string | string[])[];
|
|
6
|
+
TrigonometricFunction: string[];
|
|
7
|
+
LogicOperator: (string | string[])[];
|
|
8
|
+
Predicate: (string | string[])[];
|
|
9
|
+
RelationalOperator: string[];
|
|
10
|
+
};
|
|
11
|
+
export declare function isDomainLiteral(s: string | null): s is DomainLiteral;
|
|
12
|
+
export declare function isSubdomainLiteral(lhs: string, rhs: string): boolean;
|
|
13
|
+
/** Return all the domain literals that are an ancestor of `dom`
|
|
14
|
+
*/
|
|
15
|
+
export declare function ancestors(dom: string): string[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/* 0.7.0 */
|
|
2
|
+
import { IComputeEngine, SymbolTable } from '../public';
|
|
3
|
+
export declare function getStandardLibrary(categories: LibraryCategory[] | LibraryCategory | 'all'): Readonly<SymbolTable>[];
|
|
4
|
+
export declare const LIBRARIES: {
|
|
5
|
+
[category in LibraryCategory]?: Readonly<SymbolTable> | Readonly<SymbolTable>[];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Set the symbol table of the current context (`engine.context`) to `table`
|
|
9
|
+
*
|
|
10
|
+
* `table` can be an array of symbol tables, in order to deal with circular
|
|
11
|
+
* dependencies: it is possible to partition a library into multiple
|
|
12
|
+
* symbol tables, to control the order in which they are processed and
|
|
13
|
+
* avoid having expressions in the definition of an entry reference a symbol
|
|
14
|
+
* or function name that has not yet been added to the symbol table.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare function setCurrentContextSymbolTable(engine: IComputeEngine, table: SymbolTable): void;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.7.0 */
|
|
2
2
|
import { IComputeEngine } from '../public';
|
|
3
3
|
export declare function gcd(a: Decimal, b: Decimal): Decimal;
|
|
4
4
|
export declare function lcm(a: Decimal, b: Decimal): Decimal;
|
|
5
|
+
export declare function reducedRational([a, b]: [Decimal, Decimal]): [
|
|
6
|
+
Decimal,
|
|
7
|
+
Decimal
|
|
8
|
+
];
|
|
5
9
|
export declare function factorial(ce: IComputeEngine, n: Decimal): Decimal;
|
|
6
10
|
export declare function lngamma(ce: IComputeEngine, z: Decimal): Decimal;
|
|
7
11
|
export declare function gamma(ce: IComputeEngine, z: Decimal): Decimal;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.7.0 */
|
|
2
2
|
export declare const MACHINE_PRECISION: number;
|
|
3
3
|
export declare const MACHINE_TOLERANCE_BITS = 7;
|
|
4
4
|
export declare const MACHINE_TOLERANCE: number;
|
|
5
5
|
export declare const NUMERIC_TOLERANCE: number;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const SMALL_INTEGER = 1000000;
|
|
7
|
+
export declare const MAX_ITERATION = 1000000;
|
|
8
|
+
export declare const MAX_SYMBOLIC_TERMS = 200;
|
|
7
9
|
/**
|
|
8
10
|
* Returns the smallest floating-point number greater than x.
|
|
9
11
|
* Denormalized values may not be supported.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.7.0 */
|
|
2
2
|
export declare function isPrime(n: number): boolean | undefined;
|