@cortex-js/compute-engine 0.25.1 → 0.26.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 +26832 -23014
- package/dist/compute-engine.js +26836 -23006
- package/dist/compute-engine.min.esm.js +88 -23
- package/dist/compute-engine.min.js +88 -23
- package/dist/math-json.esm.js +22 -139
- package/dist/math-json.js +22 -139
- package/dist/math-json.min.esm.js +22 -139
- package/dist/math-json.min.js +2 -2
- package/dist/types/common/ansi-codes.d.ts +30 -4
- package/dist/types/common/buffer.d.ts +9 -0
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/one-of.d.ts +9 -0
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/styled-text.d.ts +28 -0
- package/dist/types/common/suggest.d.ts +1 -0
- package/dist/types/common/syntax-highlighter.d.ts +40 -0
- package/dist/types/common/terminal.d.ts +19 -0
- package/dist/types/common/type/parse.d.ts +4 -0
- package/dist/types/common/type/primitive.d.ts +8 -0
- package/dist/types/common/type/serialize.d.ts +2 -0
- package/dist/types/common/type/subtype.d.ts +6 -0
- package/dist/types/common/type/types.d.ts +249 -0
- package/dist/types/common/type/utils.d.ts +39 -0
- package/dist/types/common/utils.d.ts +2 -1
- package/dist/types/compute-engine/assume.d.ts +13 -13
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +70 -47
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +5 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +15 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-divide.d.ts +12 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-multiply.d.ts +16 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +20 -0
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +11 -0
- package/dist/types/compute-engine/boxed-expression/box.d.ts +13 -71
- package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +31 -13
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +66 -45
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +41 -37
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +13 -9
- package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +34 -66
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +63 -41
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +44 -27
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +6 -0
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +13 -0
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +20 -0
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +7 -6
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +25 -0
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +9 -0
- package/dist/types/compute-engine/boxed-expression/match.d.ts +2 -4
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +10 -0
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +5 -39
- package/dist/types/compute-engine/boxed-expression/order.d.ts +26 -14
- package/dist/types/compute-engine/{symbolic → boxed-expression}/polynomials.d.ts +11 -15
- package/dist/types/compute-engine/{symbolic → boxed-expression}/product.d.ts +18 -24
- package/dist/types/compute-engine/boxed-expression/public.d.ts +906 -634
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +129 -0
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +6 -0
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +6 -0
- package/dist/types/compute-engine/{solve.d.ts → boxed-expression/solve.d.ts} +5 -5
- package/dist/types/compute-engine/{symbolic → boxed-expression}/tensor-fields.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/terms.d.ts +10 -0
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +10 -0
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +22 -16
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +10 -7
- package/dist/types/compute-engine/collection-utils.d.ts +24 -2
- package/dist/types/compute-engine/compile.d.ts +3 -3
- package/dist/types/compute-engine/compute-engine.d.ts +132 -165
- package/dist/types/compute-engine/cost-function.d.ts +11 -1
- package/dist/types/compute-engine/function-utils.d.ts +5 -5
- 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 +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-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 +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +25 -30
- package/dist/types/compute-engine/latex-syntax/public.d.ts +22 -18
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +5 -8
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +4 -2
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +24 -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 -3
- package/dist/types/compute-engine/library/invisible-operator.d.ts +4 -0
- package/dist/types/compute-engine/library/library.d.ts +2 -4
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +5 -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 +46 -40
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +59 -0
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +77 -0
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +58 -0
- package/dist/types/compute-engine/numeric-value/public.d.ts +110 -0
- package/dist/types/compute-engine/numerics/bigint.d.ts +2 -0
- package/dist/types/compute-engine/numerics/bignum.d.ts +12 -0
- package/dist/types/compute-engine/numerics/expression.d.ts +4 -0
- package/dist/types/compute-engine/numerics/interval.d.ts +12 -0
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +19 -0
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +4 -14
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +6 -9
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +9 -59
- package/dist/types/compute-engine/numerics/primes.d.ts +3 -3
- package/dist/types/compute-engine/numerics/rationals.d.ts +29 -13
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +28 -0
- package/dist/types/compute-engine/numerics/strings.d.ts +2 -0
- package/dist/types/compute-engine/public.d.ts +8 -4
- package/dist/types/compute-engine/symbolic/derivative.d.ts +2 -2
- package/dist/types/compute-engine/symbolic/distribute.d.ts +5 -0
- package/dist/types/compute-engine/{simplify-rules.d.ts → symbolic/simplify-rules.d.ts} +1 -1
- package/dist/types/compute-engine/{symbolic → tensor}/tensors.d.ts +3 -3
- package/dist/types/compute-engine.d.ts +4 -2
- package/dist/types/math-json/identifiers.d.ts +11 -0
- package/dist/types/math-json/{math-json-format.d.ts → types.d.ts} +4 -9
- package/dist/types/math-json/utils.d.ts +15 -23
- package/dist/types/math-json.d.ts +3 -3
- package/package.json +3 -3
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +0 -48
- package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +0 -40
- package/dist/types/compute-engine/boxed-expression/coefficient-field.d.ts +0 -56
- package/dist/types/compute-engine/domain-utils.d.ts +0 -19
- package/dist/types/compute-engine/library/arithmetic-add.d.ts +0 -21
- package/dist/types/compute-engine/library/arithmetic-divide.d.ts +0 -16
- package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +0 -16
- package/dist/types/compute-engine/library/arithmetic-power.d.ts +0 -11
- package/dist/types/compute-engine/library/domains.d.ts +0 -16
- package/dist/types/compute-engine/numerics/terms.d.ts +0 -17
- package/dist/types/compute-engine/rules.d.ts +0 -20
- package/dist/types/compute-engine/symbolic/expand.d.ts +0 -23
- package/dist/types/compute-engine/symbolic/flatten.d.ts +0 -9
- package/dist/types/compute-engine/symbolic/negate.d.ts +0 -11
- package/dist/types/compute-engine/symbolic/utils.d.ts +0 -22
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.26.0 */
|
|
2
2
|
import { Decimal } from 'decimal.js';
|
|
3
|
-
import { BoxedExpression,
|
|
3
|
+
import type { BoxedExpression, IComputeEngine, Metadata, PatternMatchOptions, BoxedSubstitution, EvaluateOptions, BoxedRuleSet, ReplaceOptions, Rule, Substitution, CanonicalOptions, SimplifyOptions, Sign } from '../public';
|
|
4
|
+
import type { Expression, MathJsonNumber } from '../../math-json';
|
|
5
|
+
import { SmallInteger } from '../numerics/numeric';
|
|
4
6
|
import { Rational } from '../numerics/rationals';
|
|
7
|
+
import { ExactNumericValueData, NumericValue, NumericValueData } from '../numeric-value/public';
|
|
5
8
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
6
|
-
import {
|
|
9
|
+
import { Type } from '../../common/type/types';
|
|
7
10
|
/**
|
|
8
11
|
* BoxedNumber
|
|
9
12
|
*
|
|
10
13
|
* @noInheritDoc
|
|
11
14
|
*/
|
|
12
15
|
export declare class BoxedNumber extends _BoxedExpression {
|
|
13
|
-
protected readonly _value:
|
|
14
|
-
private _domain;
|
|
16
|
+
protected readonly _value: SmallInteger | NumericValue;
|
|
15
17
|
private _hash;
|
|
16
|
-
protected _isCanonical: boolean;
|
|
17
18
|
/**
|
|
18
19
|
* By the time the constructor is called, the `value` should have been
|
|
19
20
|
* screened for cases where it's a well-known value (0, NaN, +Infinity,
|
|
@@ -26,33 +27,42 @@ export declare class BoxedNumber extends _BoxedExpression {
|
|
|
26
27
|
* We may store as a machine number if a Decimal is passed that is in machine
|
|
27
28
|
* range
|
|
28
29
|
*/
|
|
29
|
-
constructor(ce: IComputeEngine, value:
|
|
30
|
+
constructor(ce: IComputeEngine, value: SmallInteger | NumericValueData | ExactNumericValueData | NumericValue, options?: {
|
|
30
31
|
metadata?: Metadata;
|
|
31
32
|
canonical?: boolean;
|
|
32
33
|
});
|
|
33
34
|
get hash(): number;
|
|
34
35
|
get json(): Expression;
|
|
35
|
-
get
|
|
36
|
+
get operator(): string;
|
|
36
37
|
get isPure(): boolean;
|
|
37
|
-
get isExact(): boolean;
|
|
38
38
|
get isCanonical(): boolean;
|
|
39
39
|
set isCanonical(val: boolean);
|
|
40
40
|
get complexity(): number;
|
|
41
|
-
get numericValue(): number |
|
|
42
|
-
get
|
|
43
|
-
get
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
get numericValue(): number | NumericValue;
|
|
42
|
+
get re(): number;
|
|
43
|
+
get im(): number;
|
|
44
|
+
get bignumRe(): Decimal | undefined;
|
|
45
|
+
get bignumIm(): Decimal | undefined;
|
|
46
|
+
neg(): BoxedExpression;
|
|
47
|
+
inv(): BoxedExpression;
|
|
48
|
+
abs(): BoxedExpression;
|
|
49
|
+
add(rhs: number | BoxedExpression): BoxedExpression;
|
|
50
|
+
mul(rhs: NumericValue | number | BoxedExpression): BoxedExpression;
|
|
51
|
+
div(rhs: number | BoxedExpression): BoxedExpression;
|
|
52
|
+
pow(exp: number | BoxedExpression): BoxedExpression;
|
|
53
|
+
root(exp: number | BoxedExpression): BoxedExpression;
|
|
54
|
+
sqrt(): BoxedExpression;
|
|
55
|
+
ln(semiBase?: number | BoxedExpression): BoxedExpression;
|
|
56
|
+
get type(): Type;
|
|
57
|
+
get sgn(): Sign | undefined;
|
|
58
|
+
get numerator(): BoxedExpression;
|
|
59
|
+
get denominator(): BoxedExpression;
|
|
60
|
+
get numeratorDenominator(): [BoxedExpression, BoxedExpression];
|
|
61
|
+
subs(sub: Substitution, options?: {
|
|
62
|
+
canonical?: CanonicalOptions;
|
|
63
|
+
}): BoxedExpression;
|
|
64
|
+
replace(rules: BoxedRuleSet | Rule | Rule[], options?: Partial<ReplaceOptions>): BoxedExpression | null;
|
|
65
|
+
match(pattern: BoxedExpression, options?: PatternMatchOptions): BoxedSubstitution | null;
|
|
56
66
|
/** x > 0, same as `isGreater(0)` */
|
|
57
67
|
get isPositive(): boolean | undefined;
|
|
58
68
|
/** x >= 0, same as `isGreaterEqual(0)` */
|
|
@@ -61,28 +71,22 @@ export declare class BoxedNumber extends _BoxedExpression {
|
|
|
61
71
|
get isNegative(): boolean | undefined;
|
|
62
72
|
/** x <= 0, same as `isLessEqual(0)` */
|
|
63
73
|
get isNonPositive(): boolean | undefined;
|
|
64
|
-
get isZero(): boolean;
|
|
65
|
-
get isNotZero(): boolean;
|
|
66
|
-
get isOne(): boolean;
|
|
67
|
-
get isNegativeOne(): boolean;
|
|
68
74
|
get isOdd(): boolean | undefined;
|
|
69
75
|
get isEven(): boolean | undefined;
|
|
70
|
-
get isPrime(): boolean | undefined;
|
|
71
|
-
get isComposite(): boolean | undefined;
|
|
72
76
|
get isInfinity(): boolean;
|
|
73
77
|
get isNaN(): boolean;
|
|
74
78
|
get isFinite(): boolean;
|
|
75
79
|
get isNumber(): true;
|
|
76
80
|
get isInteger(): boolean;
|
|
77
81
|
get isRational(): boolean;
|
|
78
|
-
get isAlgebraic(): boolean | undefined;
|
|
79
82
|
get isReal(): boolean;
|
|
80
|
-
|
|
81
|
-
get isComplex(): boolean | undefined;
|
|
82
|
-
get isImaginary(): boolean | undefined;
|
|
83
|
-
get isExtendedComplex(): boolean | undefined;
|
|
83
|
+
is(rhs: any): boolean;
|
|
84
84
|
get canonical(): BoxedExpression;
|
|
85
|
-
|
|
85
|
+
get isStructural(): boolean;
|
|
86
|
+
get structural(): BoxedExpression;
|
|
87
|
+
toNumericValue(): [NumericValue, BoxedExpression];
|
|
88
|
+
simplify(options?: Partial<SimplifyOptions>): BoxedExpression;
|
|
86
89
|
evaluate(options?: EvaluateOptions): BoxedExpression;
|
|
87
|
-
N(
|
|
90
|
+
N(): BoxedExpression;
|
|
88
91
|
}
|
|
92
|
+
export declare function canonicalNumber(ce: IComputeEngine, value: number | bigint | string | Decimal | Complex | Rational | NumericValue | MathJsonNumber): number | NumericValue;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { BoxedExpression } from './public';
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
import type { BoxedExpression } from './public';
|
|
3
3
|
export declare function isWildcard(expr: BoxedExpression): expr is BoxedSymbol;
|
|
4
4
|
export declare function wildcardName(expr: BoxedExpression): string | null;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import Decimal from 'decimal.js';
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
3
|
+
import { Type } from '../../common/type/types';
|
|
5
4
|
/**
|
|
6
5
|
* BoxedString
|
|
7
6
|
*
|
|
@@ -12,14 +11,19 @@ export declare class BoxedString extends _BoxedExpression {
|
|
|
12
11
|
constructor(ce: IComputeEngine, expr: string, metadata?: Metadata);
|
|
13
12
|
get json(): string;
|
|
14
13
|
get hash(): number;
|
|
15
|
-
get
|
|
14
|
+
get operator(): string;
|
|
16
15
|
get isPure(): boolean;
|
|
17
16
|
get isCanonical(): boolean;
|
|
18
17
|
set isCanonical(_va: boolean);
|
|
19
|
-
get
|
|
18
|
+
get type(): Type;
|
|
20
19
|
get complexity(): number;
|
|
21
20
|
get string(): string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
match(pattern: BoxedExpression, _options?: PatternMatchOptions): BoxedSubstitution | null;
|
|
22
|
+
get isCollection(): boolean;
|
|
23
|
+
contains(rhs: BoxedExpression): boolean;
|
|
24
|
+
get size(): number;
|
|
25
|
+
each(start?: number, count?: number): Iterator<BoxedExpression, undefined>;
|
|
26
|
+
at(index: number): BoxedExpression | undefined;
|
|
27
|
+
get(key: string | BoxedExpression): BoxedExpression | undefined;
|
|
28
|
+
indexOf(expr: BoxedExpression): number;
|
|
25
29
|
}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
import { Type } from '../../common/type/types';
|
|
2
3
|
/**
|
|
3
4
|
* ### THEORY OF OPERATIONS
|
|
4
5
|
*
|
|
5
|
-
* - The value or
|
|
6
|
+
* - The value or type of a constant cannot be changed.
|
|
7
|
+
*
|
|
6
8
|
* - If set explicitly, the value is the source of truth: it overrides any
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
9
|
+
* flags.
|
|
10
|
+
*
|
|
11
|
+
* - Once the type has been set, it can only be changed from a numeric type
|
|
12
|
+
* to another numeric type (some expressions may have been validated with
|
|
13
|
+
* assumptions that the just a number).
|
|
14
|
+
*
|
|
15
|
+
* - When the type is changed, the value is preserved if it is compatible
|
|
16
|
+
* with the new type, otherwise it is reset to no value. Flags are adjusted
|
|
17
|
+
* to match the type (discarded if not a numeric type).
|
|
18
|
+
*
|
|
19
|
+
* - When the value is changed, the type is unaffected. If the value is not
|
|
20
|
+
* compatible with the type (setting a def with a numeric type to a value
|
|
21
|
+
* of `True` for example), the value is discarded.
|
|
22
|
+
*
|
|
17
23
|
* - When getting a flag, if a value is available, it is the source of truth.
|
|
18
|
-
*
|
|
24
|
+
* Otherwise, the stored flags are (the stored flags are also set when the
|
|
25
|
+
* type is changed)
|
|
19
26
|
*
|
|
20
27
|
*/
|
|
21
28
|
export declare class _BoxedSymbolDefinition implements BoxedSymbolDefinition {
|
|
@@ -27,69 +34,30 @@ export declare class _BoxedSymbolDefinition implements BoxedSymbolDefinition {
|
|
|
27
34
|
readonly scope: RuntimeScope | undefined;
|
|
28
35
|
private _defValue?;
|
|
29
36
|
private _value;
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
private _flags;
|
|
37
|
+
private _type;
|
|
38
|
+
inferredType: boolean;
|
|
33
39
|
constant: boolean;
|
|
34
|
-
holdUntil: 'never' | '
|
|
35
|
-
|
|
36
|
-
|
|
40
|
+
holdUntil: 'never' | 'evaluate' | 'N';
|
|
41
|
+
private _flags;
|
|
42
|
+
eq?: (a: BoxedExpression) => boolean | undefined;
|
|
43
|
+
neq?: (a: BoxedExpression) => boolean | undefined;
|
|
44
|
+
cmp?: (a: BoxedExpression) => '=' | '>' | '<' | undefined;
|
|
45
|
+
collection?: Partial<CollectionHandlers>;
|
|
37
46
|
constructor(ce: IComputeEngine, name: string, def: SymbolDefinition);
|
|
47
|
+
get isFunction(): boolean;
|
|
48
|
+
get isConstant(): boolean;
|
|
38
49
|
/** The symbol was previously inferred, but now it has a declaration. Update the def accordingly (we can't replace defs, as other expressions may be referencing them) */
|
|
39
50
|
update(def: SymbolDefinition): void;
|
|
40
51
|
reset(): void;
|
|
41
52
|
get value(): BoxedExpression | undefined;
|
|
42
53
|
set value(val: SemiBoxedExpression | number | undefined);
|
|
43
|
-
get
|
|
44
|
-
set
|
|
45
|
-
get
|
|
46
|
-
set
|
|
47
|
-
get integer(): boolean | undefined;
|
|
48
|
-
set integer(val: boolean | undefined);
|
|
49
|
-
get rational(): boolean | undefined;
|
|
50
|
-
set rational(val: boolean | undefined);
|
|
51
|
-
get algebraic(): boolean | undefined;
|
|
52
|
-
set algebraic(val: boolean | undefined);
|
|
53
|
-
get real(): boolean | undefined;
|
|
54
|
-
set real(val: boolean | undefined);
|
|
55
|
-
get extendedReal(): boolean | undefined;
|
|
56
|
-
set extendedReal(val: boolean | undefined);
|
|
57
|
-
get complex(): boolean | undefined;
|
|
58
|
-
set complex(val: boolean | undefined);
|
|
59
|
-
get extendedComplex(): boolean | undefined;
|
|
60
|
-
set extendedComplex(val: boolean | undefined);
|
|
61
|
-
get imaginary(): boolean | undefined;
|
|
62
|
-
set imaginary(val: boolean | undefined);
|
|
63
|
-
get positive(): boolean | undefined;
|
|
64
|
-
set positive(val: boolean | undefined);
|
|
65
|
-
get nonPositive(): boolean | undefined;
|
|
66
|
-
set nonPositive(val: boolean | undefined);
|
|
67
|
-
get negative(): boolean | undefined;
|
|
68
|
-
set negative(val: boolean | undefined);
|
|
69
|
-
get nonNegative(): boolean | undefined;
|
|
70
|
-
set nonNegative(val: boolean | undefined);
|
|
71
|
-
get zero(): boolean | undefined;
|
|
72
|
-
set zero(val: boolean | undefined);
|
|
73
|
-
get notZero(): boolean | undefined;
|
|
74
|
-
set notZero(val: boolean | undefined);
|
|
75
|
-
get one(): boolean | undefined;
|
|
76
|
-
set one(val: boolean | undefined);
|
|
77
|
-
get negativeOne(): boolean | undefined;
|
|
78
|
-
set negativeOne(val: boolean | undefined);
|
|
79
|
-
get infinity(): boolean | undefined;
|
|
80
|
-
set infinity(val: boolean | undefined);
|
|
81
|
-
get finite(): boolean | undefined;
|
|
82
|
-
set finite(val: boolean | undefined);
|
|
83
|
-
get NaN(): boolean | undefined;
|
|
84
|
-
set NaN(val: boolean | undefined);
|
|
54
|
+
get type(): Type;
|
|
55
|
+
set type(type: Type);
|
|
56
|
+
get sgn(): Sign | undefined;
|
|
57
|
+
set sgn(val: Sign | undefined);
|
|
85
58
|
get even(): boolean | undefined;
|
|
86
59
|
set even(val: boolean | undefined);
|
|
87
60
|
get odd(): boolean | undefined;
|
|
88
61
|
set odd(val: boolean | undefined);
|
|
89
|
-
get prime(): boolean | undefined;
|
|
90
|
-
set prime(val: boolean | undefined);
|
|
91
|
-
get composite(): boolean | undefined;
|
|
92
|
-
set composite(val: boolean | undefined);
|
|
93
62
|
updateFlags(flags: Partial<NumericFlags>): void;
|
|
94
63
|
}
|
|
95
|
-
export declare function domainToFlags(dom: BoxedDomain | undefined | null): Partial<NumericFlags>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
import type { Expression } from '../../math-json/types';
|
|
3
|
+
import type { Type, TypeString } from '../../common/type/types';
|
|
4
|
+
import type { BoxedExpression, BoxedRuleSet, BoxedSymbolDefinition, IComputeEngine, EvaluateOptions, ReplaceOptions, SimplifyOptions, Substitution, Metadata, PatternMatchOptions, RuntimeScope, BoxedFunctionDefinition, BoxedBaseDefinition, BoxedSubstitution, Rule, CanonicalOptions, BoxedRule, Sign } from './public';
|
|
5
|
+
import { NumericValue } from '../numeric-value/public';
|
|
4
6
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
5
|
-
import {
|
|
7
|
+
import { BigNum } from '../numerics/bignum';
|
|
8
|
+
import type { OneOf } from '../../common/one-of';
|
|
6
9
|
/**
|
|
7
10
|
* BoxedSymbol
|
|
8
11
|
*
|
|
@@ -24,16 +27,23 @@ export declare class BoxedSymbol extends _BoxedExpression {
|
|
|
24
27
|
protected _id: string;
|
|
25
28
|
private _hash;
|
|
26
29
|
private _def;
|
|
30
|
+
private _isStructural;
|
|
27
31
|
constructor(ce: IComputeEngine, name: string, options?: {
|
|
28
32
|
metadata?: Metadata;
|
|
29
33
|
canonical?: CanonicalOptions;
|
|
30
|
-
|
|
34
|
+
structural?: boolean;
|
|
35
|
+
def?: OneOf<[BoxedSymbolDefinition, BoxedFunctionDefinition]>;
|
|
31
36
|
});
|
|
32
37
|
get json(): Expression;
|
|
33
38
|
get hash(): number;
|
|
34
39
|
get isPure(): boolean;
|
|
40
|
+
get isStructural(): boolean;
|
|
41
|
+
get structural(): BoxedExpression;
|
|
35
42
|
get scope(): RuntimeScope | null;
|
|
36
43
|
get isConstant(): boolean;
|
|
44
|
+
private _lookupDef;
|
|
45
|
+
/** This method returns the definition associated with the value of this symbol, or associated with the symbol if it has no value. This is the definition to use with most operations on the symbol. Indeed, "x[2]" is accessing the second element of **the value** of "x".*/
|
|
46
|
+
private _getDef;
|
|
37
47
|
/**
|
|
38
48
|
* Associate a definition with this symbol
|
|
39
49
|
*/
|
|
@@ -41,49 +51,53 @@ export declare class BoxedSymbol extends _BoxedExpression {
|
|
|
41
51
|
reset(): void;
|
|
42
52
|
get isCanonical(): boolean;
|
|
43
53
|
set isCanonical(val: boolean);
|
|
54
|
+
is(rhs: any): boolean;
|
|
44
55
|
get canonical(): BoxedExpression;
|
|
56
|
+
toNumericValue(): [NumericValue, BoxedExpression];
|
|
57
|
+
neg(): BoxedExpression;
|
|
58
|
+
inv(): BoxedExpression;
|
|
59
|
+
abs(): BoxedExpression;
|
|
60
|
+
add(rhs: number | BoxedExpression): BoxedExpression;
|
|
61
|
+
mul(rhs: NumericValue | number | BoxedExpression): BoxedExpression;
|
|
62
|
+
div(rhs: number | BoxedExpression): BoxedExpression;
|
|
63
|
+
pow(exp: number | BoxedExpression): BoxedExpression;
|
|
64
|
+
root(n: number | BoxedExpression): BoxedExpression;
|
|
65
|
+
sqrt(): BoxedExpression;
|
|
66
|
+
ln(semiBase?: number | BoxedExpression): BoxedExpression;
|
|
45
67
|
solve(vars: Iterable<string> | string | BoxedExpression | Iterable<BoxedExpression>): null | ReadonlyArray<BoxedExpression>;
|
|
46
68
|
get complexity(): number;
|
|
47
|
-
get
|
|
69
|
+
get operator(): string;
|
|
48
70
|
get symbol(): string;
|
|
49
71
|
get baseDefinition(): BoxedBaseDefinition | undefined;
|
|
50
72
|
get symbolDefinition(): BoxedSymbolDefinition | undefined;
|
|
51
73
|
get functionDefinition(): BoxedFunctionDefinition | undefined;
|
|
52
74
|
/**
|
|
53
75
|
* Subsequence inferences will narrow the domain of the symbol.
|
|
54
|
-
* f
|
|
55
|
-
* g(x) => x:real
|
|
56
|
-
* f(x) => x:integer narrowed from integer to real
|
|
76
|
+
* f: integer -> real, g: real -> real
|
|
77
|
+
* g(x) => x: real
|
|
78
|
+
* f(x) => x: integer narrowed from integer to real
|
|
57
79
|
*/
|
|
58
|
-
infer(
|
|
59
|
-
get value(): number | boolean | string |
|
|
60
|
-
set value(value: boolean | string | Decimal |
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
80
|
+
infer(t: Type): boolean;
|
|
81
|
+
get value(): number | boolean | string | object | undefined;
|
|
82
|
+
set value(value: boolean | string | Decimal | number[] | OneOf<[
|
|
83
|
+
{
|
|
84
|
+
re: number;
|
|
85
|
+
im: number;
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
num: number;
|
|
89
|
+
denom: number;
|
|
90
|
+
},
|
|
91
|
+
BoxedExpression
|
|
92
|
+
]> | number | object | undefined);
|
|
93
|
+
get type(): Type;
|
|
94
|
+
set type(t: Type | TypeString);
|
|
95
|
+
get sgn(): Sign | undefined;
|
|
70
96
|
has(x: string | string[]): boolean;
|
|
71
|
-
|
|
72
|
-
match(pattern: Decimal | Complex | [num: number, denom: number] | SemiBoxedExpression | BoxedExpression, options?: PatternMatchOptions): BoxedSubstitution | null;
|
|
73
|
-
isEqual(rhs: BoxedExpression): boolean;
|
|
74
|
-
isLess(rhs: BoxedExpression): boolean | undefined;
|
|
75
|
-
isLessEqual(rhs: BoxedExpression): boolean | undefined;
|
|
76
|
-
isGreater(rhs: BoxedExpression): boolean | undefined;
|
|
77
|
-
isGreaterEqual(rhs: BoxedExpression): boolean | undefined;
|
|
97
|
+
match(pattern: BoxedExpression, options?: PatternMatchOptions): BoxedSubstitution | null;
|
|
78
98
|
get isFunction(): boolean | undefined;
|
|
79
|
-
get isZero(): boolean | undefined;
|
|
80
|
-
get isNotZero(): boolean | undefined;
|
|
81
|
-
get isOne(): boolean | undefined;
|
|
82
|
-
get isNegativeOne(): boolean | undefined;
|
|
83
99
|
get isOdd(): boolean | undefined;
|
|
84
100
|
get isEven(): boolean | undefined;
|
|
85
|
-
get isPrime(): boolean | undefined;
|
|
86
|
-
get isComposite(): boolean | undefined;
|
|
87
101
|
get isInfinity(): boolean | undefined;
|
|
88
102
|
get isNaN(): boolean | undefined;
|
|
89
103
|
get isPositive(): boolean | undefined;
|
|
@@ -93,17 +107,25 @@ export declare class BoxedSymbol extends _BoxedExpression {
|
|
|
93
107
|
get isNumber(): boolean | undefined;
|
|
94
108
|
get isInteger(): boolean | undefined;
|
|
95
109
|
get isRational(): boolean | undefined;
|
|
96
|
-
get isAlgebraic(): boolean | undefined;
|
|
97
110
|
get isReal(): boolean | undefined;
|
|
98
|
-
get
|
|
99
|
-
get
|
|
100
|
-
get
|
|
101
|
-
|
|
111
|
+
get re(): number;
|
|
112
|
+
get im(): number;
|
|
113
|
+
get bignumRe(): BigNum | undefined;
|
|
114
|
+
get bignumIm(): BigNum | undefined;
|
|
115
|
+
simplify(options?: Partial<SimplifyOptions>): BoxedExpression;
|
|
102
116
|
evaluate(options?: EvaluateOptions): BoxedExpression;
|
|
103
|
-
N(
|
|
104
|
-
replace(rules:
|
|
117
|
+
N(): BoxedExpression;
|
|
118
|
+
replace(rules: Rule | (Rule | BoxedRule)[] | BoxedRuleSet, options?: Partial<ReplaceOptions>): BoxedExpression | null;
|
|
105
119
|
subs(sub: Substitution, options?: {
|
|
106
120
|
canonical?: CanonicalOptions;
|
|
107
121
|
}): BoxedExpression;
|
|
122
|
+
get isCollection(): boolean;
|
|
123
|
+
contains(rhs: BoxedExpression): boolean;
|
|
124
|
+
get size(): number;
|
|
125
|
+
each(start?: number, count?: number): Iterator<BoxedExpression, undefined>;
|
|
126
|
+
at(index: number): BoxedExpression | undefined;
|
|
127
|
+
get(index: BoxedExpression | string): BoxedExpression | undefined;
|
|
128
|
+
indexOf(expr: BoxedExpression): number;
|
|
129
|
+
subsetOf(rhs: BoxedExpression, strict: boolean): boolean;
|
|
108
130
|
}
|
|
109
131
|
export declare function makeCanonicalSymbol(ce: IComputeEngine, name: string): BoxedExpression;
|
|
@@ -1,37 +1,40 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { DataTypeMap, TensorDataType } from '../symbolic/tensor-fields';
|
|
6
|
-
import { AbstractTensor, TensorData } from '../symbolic/tensors';
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
import type { BoxedExpression, IComputeEngine, EvaluateOptions, SimplifyOptions, Metadata, BoxedSubstitution, PatternMatchOptions, BoxedBaseDefinition, BoxedFunctionDefinition } from '../public';
|
|
3
|
+
import { TensorDataType } from './tensor-fields';
|
|
4
|
+
import { NumericValue } from '../numeric-value/public';
|
|
7
5
|
import { _BoxedExpression } from './abstract-boxed-expression';
|
|
6
|
+
import { AbstractTensor, TensorData } from '../tensor/tensors';
|
|
7
|
+
import { Type } from '../../common/type/types';
|
|
8
8
|
/**
|
|
9
|
-
* A boxed tensor represents an expression that can be
|
|
10
|
-
*
|
|
11
|
-
* or multi-dimensional array.
|
|
9
|
+
* A boxed tensor represents an expression that can be represented by a tensor.
|
|
10
|
+
* This could be a vector, matrix or multi-dimensional array.
|
|
12
11
|
*
|
|
13
|
-
* The object can be created either from a tensor or from
|
|
14
|
-
*
|
|
12
|
+
* The object can be created either from a tensor or from an expression that
|
|
13
|
+
* can be represented as a tensor.
|
|
15
14
|
*
|
|
16
|
-
* The counterpart (expression if input is tensor, or tensor
|
|
15
|
+
* The structural counterpart (expression if input is tensor, or tensor
|
|
17
16
|
* if input is expression) is created lazily.
|
|
18
17
|
*
|
|
19
18
|
* @noInheritDoc
|
|
20
19
|
*
|
|
21
20
|
*/
|
|
22
21
|
export declare class BoxedTensor extends _BoxedExpression {
|
|
22
|
+
readonly options?: {
|
|
23
|
+
metadata?: Metadata;
|
|
24
|
+
canonical?: boolean;
|
|
25
|
+
};
|
|
23
26
|
private _tensor;
|
|
24
|
-
private readonly
|
|
27
|
+
private readonly _operator?;
|
|
25
28
|
private readonly _ops?;
|
|
26
29
|
private _expression;
|
|
27
30
|
constructor(ce: IComputeEngine, input: {
|
|
28
|
-
|
|
31
|
+
op?: string;
|
|
29
32
|
ops: ReadonlyArray<BoxedExpression>;
|
|
30
33
|
} | AbstractTensor<'expression'>, options?: {
|
|
31
34
|
metadata?: Metadata;
|
|
32
35
|
canonical?: boolean;
|
|
33
36
|
});
|
|
34
|
-
get
|
|
37
|
+
get structural(): BoxedExpression;
|
|
35
38
|
/** Create the tensor on demand */
|
|
36
39
|
get tensor(): AbstractTensor<'expression'>;
|
|
37
40
|
get baseDefinition(): BoxedBaseDefinition | undefined;
|
|
@@ -45,28 +48,42 @@ export declare class BoxedTensor extends _BoxedExpression {
|
|
|
45
48
|
get isPure(): boolean;
|
|
46
49
|
get isValid(): boolean;
|
|
47
50
|
get complexity(): number;
|
|
48
|
-
get
|
|
51
|
+
get operator(): string;
|
|
49
52
|
get nops(): number;
|
|
50
53
|
get ops(): ReadonlyArray<BoxedExpression>;
|
|
51
54
|
get op1(): BoxedExpression;
|
|
52
55
|
get op2(): BoxedExpression;
|
|
53
56
|
get op3(): BoxedExpression;
|
|
57
|
+
neg(): BoxedExpression;
|
|
58
|
+
inv(): BoxedExpression;
|
|
59
|
+
abs(): BoxedExpression;
|
|
60
|
+
add(rhs: number | BoxedExpression): BoxedExpression;
|
|
61
|
+
sub(rhs: BoxedExpression): BoxedExpression;
|
|
62
|
+
mul(rhs: NumericValue | number | BoxedExpression): BoxedExpression;
|
|
63
|
+
div(rhs: number | BoxedExpression): BoxedExpression;
|
|
64
|
+
pow(exp: number | BoxedExpression): BoxedExpression;
|
|
65
|
+
root(exp: number | BoxedExpression): BoxedExpression;
|
|
66
|
+
sqrt(): BoxedExpression;
|
|
54
67
|
get shape(): number[];
|
|
55
68
|
get rank(): number;
|
|
56
|
-
get
|
|
69
|
+
get type(): Type;
|
|
57
70
|
get json(): Expression;
|
|
58
|
-
/** Structural equality */
|
|
59
|
-
isSame(rhs: BoxedExpression): boolean;
|
|
60
71
|
/** Mathematical equality */
|
|
61
|
-
isEqual(rhs: BoxedExpression): boolean;
|
|
62
|
-
|
|
72
|
+
isEqual(rhs: number | BoxedExpression): boolean | undefined;
|
|
73
|
+
get isCollection(): boolean;
|
|
74
|
+
contains(rhs: BoxedExpression): boolean;
|
|
75
|
+
get size(): number;
|
|
76
|
+
each(start?: number, count?: number): Iterator<BoxedExpression, undefined>;
|
|
77
|
+
at(_index: number): BoxedExpression | undefined;
|
|
78
|
+
indexOf(_expr: BoxedExpression): number;
|
|
79
|
+
match(pattern: BoxedExpression, options?: PatternMatchOptions): BoxedSubstitution | null;
|
|
63
80
|
evaluate(options?: EvaluateOptions): BoxedExpression;
|
|
64
|
-
simplify(options?: SimplifyOptions): BoxedExpression;
|
|
65
|
-
N(
|
|
81
|
+
simplify(options?: Partial<SimplifyOptions>): BoxedExpression;
|
|
82
|
+
N(): BoxedExpression;
|
|
66
83
|
}
|
|
67
84
|
export declare function isBoxedTensor(val: unknown): val is BoxedTensor;
|
|
68
|
-
export declare function expressionTensorInfo(
|
|
85
|
+
export declare function expressionTensorInfo(operator: string, rows: ReadonlyArray<BoxedExpression>): {
|
|
69
86
|
shape: number[];
|
|
70
|
-
dtype:
|
|
71
|
-
};
|
|
72
|
-
export declare function expressionAsTensor<T extends TensorDataType>(
|
|
87
|
+
dtype: TensorDataType | undefined;
|
|
88
|
+
} | undefined;
|
|
89
|
+
export declare function expressionAsTensor<T extends TensorDataType = 'expression'>(operator: string, rows: ReadonlyArray<BoxedExpression>): TensorData<T> | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.26.0 */
|
|
2
2
|
export declare function canonicalForm(expr: BoxedExpression, forms: CanonicalOptions): BoxedExpression;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
/**
|
|
3
|
+
* Structural equality of boxed expressions.
|
|
4
|
+
*/
|
|
5
|
+
export declare function same(a: BoxedExpression, b: BoxedExpression): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Mathematically equality of two boxed expressions.
|
|
8
|
+
*
|
|
9
|
+
* In general, it is impossible to always prove equality
|
|
10
|
+
* ([Richardson's theorem](https://en.wikipedia.org/wiki/Richardson%27s_theorem)) but this works often...
|
|
11
|
+
*/
|
|
12
|
+
export declare function eq(a: BoxedExpression, b: number | BoxedExpression): boolean | undefined;
|
|
13
|
+
export declare function cmp(a: BoxedExpression, b: number | BoxedExpression): '<' | '=' | '>' | '>=' | '<=' | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
export declare function expandProducts(ce: IComputeEngine, ops: ReadonlyArray<BoxedExpression>): BoxedExpression | null;
|
|
3
|
+
export declare function choose(n: number, k: number): number;
|
|
4
|
+
/** Attempt to transform the expression (h, ops) into a sum */
|
|
5
|
+
export declare function expandFunction(ce: IComputeEngine, h: string, ops: ReadonlyArray<BoxedExpression>): BoxedExpression | null;
|
|
6
|
+
/** Apply the distributive law if the expression is a product of sums.
|
|
7
|
+
* For example, a(b + c) = ab + ac
|
|
8
|
+
* Expand the expression if it is a power of a sum.
|
|
9
|
+
* Expand the terms of the expression if it is a sum or negate.
|
|
10
|
+
* If the expression is a fraction, expand the numerator.
|
|
11
|
+
* If the exression is a relational operator, expand the operands.
|
|
12
|
+
* Return null if the expression cannot be expanded.
|
|
13
|
+
*/
|
|
14
|
+
export declare function expand(expr: BoxedExpression | undefined): BoxedExpression | null;
|
|
15
|
+
/**
|
|
16
|
+
* Recursive expand of all terms in the expression.
|
|
17
|
+
*
|
|
18
|
+
* `expand()` only expands the top level of the expression.
|
|
19
|
+
*/
|
|
20
|
+
export declare function expandAll(expr: BoxedExpression): BoxedExpression | null;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import
|
|
3
|
-
import { Rational } from '../numerics/rationals';
|
|
4
|
-
import { BoxedExpression } from './public';
|
|
5
|
-
export declare function applyCoefficient(value: number | Decimal | Complex | Rational | null, coef: Rational): number | Decimal | Complex | Rational | null;
|
|
1
|
+
/* 0.26.0 */
|
|
2
|
+
import { NumericValue } from '../numeric-value/public';
|
|
6
3
|
/** Combine rational expressions into a single fraction */
|
|
7
4
|
export declare function together(op: BoxedExpression): BoxedExpression;
|
|
8
5
|
/**
|
|
9
|
-
* Return
|
|
6
|
+
* Return an expression factored as a product.
|
|
7
|
+
* - 2x + 4 -> 2(x + 2)
|
|
8
|
+
* - 2x < 4 -> x < 2
|
|
9
|
+
* - (2x) * (2y) -> 4xy
|
|
10
10
|
*/
|
|
11
11
|
export declare function factor(expr: BoxedExpression): BoxedExpression;
|
|
12
|
+
export declare function getPiTerm(expr: BoxedExpression): [k: NumericValue, t: NumericValue];
|