@cortex-js/compute-engine 0.12.5 → 0.12.7
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 +847 -733
- package/dist/compute-engine.js +847 -733
- package/dist/compute-engine.min.esm.js +847 -733
- package/dist/compute-engine.min.js +847 -733
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.js +2 -2
- 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/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 +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
- 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 +1 -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/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 +1 -1
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/compute-engine.d.ts +7 -5
- 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 -1
- 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 +15 -10
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +5 -2
- package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +101 -76
- package/dist/types/compute-engine/latex-syntax/public.d.ts +137 -135
- 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 +4 -4
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-add.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-divide.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic-power.d.ts +1 -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/core.d.ts +1 -1
- package/dist/types/compute-engine/library/domains.d.ts +2 -1
- package/dist/types/compute-engine/library/library.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/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -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 +1 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
- package/dist/types/compute-engine/public.d.ts +100 -4
- 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/solve.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 +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 +2 -1
- package/dist/types/math-json.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.12.
|
|
1
|
+
/* 0.12.7 */
|
|
2
2
|
* The most important classes are {@link ComputeEngine} and
|
|
3
3
|
* {@link BoxedExpression}.
|
|
4
4
|
*
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import type { Decimal } from 'decimal.js';
|
|
11
11
|
import type { Complex } from 'complex.js';
|
|
12
12
|
import type { Expression, MathJsonDictionary, MathJsonFunction, MathJsonNumber, MathJsonString, MathJsonSymbol } from '../math-json/math-json-format';
|
|
13
|
-
import type { NumberFormattingOptions, ParseLatexOptions, SerializeLatexOptions } from './latex-syntax/public';
|
|
13
|
+
import type { LatexDictionaryEntry, NumberFormattingOptions, ParseLatexOptions, SerializeLatexOptions } from './latex-syntax/public';
|
|
14
14
|
export * from './latex-syntax/public';
|
|
15
15
|
export type Rational = [number, number] | [bigint, bigint];
|
|
16
16
|
/**
|
|
@@ -1521,6 +1521,7 @@ export interface ComputeEngineStats {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
/** @internal */
|
|
1523
1523
|
export interface IComputeEngine {
|
|
1524
|
+
latexDictionary: readonly LatexDictionaryEntry[];
|
|
1524
1525
|
/** @internal */
|
|
1525
1526
|
readonly _ZERO: BoxedExpression;
|
|
1526
1527
|
/** @internal */
|
|
@@ -1573,10 +1574,105 @@ export interface IComputeEngine {
|
|
|
1573
1574
|
chop(n: Decimal): Decimal | 0;
|
|
1574
1575
|
chop(n: Complex): Complex | 0;
|
|
1575
1576
|
chop(n: number | Decimal | Complex): number | Decimal | Complex;
|
|
1576
|
-
/**
|
|
1577
|
+
/** Create an arbitrary precision number.
|
|
1578
|
+
*
|
|
1579
|
+
* The return value is an object with methods to perform arithmetic
|
|
1580
|
+
* operations:
|
|
1581
|
+
* - `toNumber()`: convert to a JavaScript `number` with potential loss of precision
|
|
1582
|
+
* - `add()`
|
|
1583
|
+
* - `sub()`
|
|
1584
|
+
* - `neg()` (unary minus)
|
|
1585
|
+
* - `mul()`
|
|
1586
|
+
* - `div()`
|
|
1587
|
+
* - `pow()`
|
|
1588
|
+
* - `sqrt()` (square root)
|
|
1589
|
+
* - `cbrt()` (cube root)
|
|
1590
|
+
* - `exp()` (e^x)
|
|
1591
|
+
* - `log()`
|
|
1592
|
+
* - `ln()` (natural logarithm)
|
|
1593
|
+
* - `mod()`
|
|
1594
|
+
|
|
1595
|
+
* - `abs()`
|
|
1596
|
+
* - `ceil()`
|
|
1597
|
+
* - `floor()`
|
|
1598
|
+
* - `round()`
|
|
1599
|
+
|
|
1600
|
+
* - `equals()`
|
|
1601
|
+
* - `gt()`
|
|
1602
|
+
* - `gte()`
|
|
1603
|
+
* - `lt()`
|
|
1604
|
+
* - `lte()`
|
|
1605
|
+
*
|
|
1606
|
+
* - `cos()`
|
|
1607
|
+
* - `sin()`
|
|
1608
|
+
* - `tanh()`
|
|
1609
|
+
* - `acos()`
|
|
1610
|
+
* - `asin()`
|
|
1611
|
+
* - `atan()`
|
|
1612
|
+
* - `cosh()`
|
|
1613
|
+
* - `sinh()`
|
|
1614
|
+
* - `acosh()`
|
|
1615
|
+
* - `asinh()`
|
|
1616
|
+
* - `atanh()`
|
|
1617
|
+
*
|
|
1618
|
+
* - `isFinite()`
|
|
1619
|
+
* - `isInteger()`
|
|
1620
|
+
* - `isNaN()`
|
|
1621
|
+
* - `isNegative()`
|
|
1622
|
+
* - `isPositive()`
|
|
1623
|
+
* - `isZero()`
|
|
1624
|
+
* - `sign()` (1, 0 or -1)
|
|
1625
|
+
*
|
|
1626
|
+
*/
|
|
1577
1627
|
bignum: (a: Decimal.Value | bigint) => Decimal;
|
|
1578
|
-
/**
|
|
1628
|
+
/** Create a complex number.
|
|
1629
|
+
* The return value is an object with methods to perform arithmetic
|
|
1630
|
+
* operations:
|
|
1631
|
+
* - `re` (real part, as a JavaScript `number`)
|
|
1632
|
+
* - `im` (imaginary part, as a JavaScript `number`)
|
|
1633
|
+
* - `add()`
|
|
1634
|
+
* - `sub()`
|
|
1635
|
+
* - `neg()` (unary minus)
|
|
1636
|
+
* - `mul()`
|
|
1637
|
+
* - `div()`
|
|
1638
|
+
* - `pow()`
|
|
1639
|
+
* - `sqrt()` (square root)
|
|
1640
|
+
* - `exp()` (e^x)
|
|
1641
|
+
* - `log()`
|
|
1642
|
+
* - `ln()` (natural logarithm)
|
|
1643
|
+
* - `mod()`
|
|
1644
|
+
|
|
1645
|
+
* - `abs()`
|
|
1646
|
+
* - `ceil()`
|
|
1647
|
+
* - `floor()`
|
|
1648
|
+
* - `round()`
|
|
1649
|
+
|
|
1650
|
+
* - `arg()` the angle of the complex number
|
|
1651
|
+
* - `inverse()` the inverse of the complex number 1/z
|
|
1652
|
+
* - `conjugate()` the conjugate of the complex number
|
|
1653
|
+
|
|
1654
|
+
* - `equals()`
|
|
1655
|
+
*
|
|
1656
|
+
* - `cos()`
|
|
1657
|
+
* - `sin()`
|
|
1658
|
+
* - `tanh()`
|
|
1659
|
+
* - `acos()`
|
|
1660
|
+
* - `asin()`
|
|
1661
|
+
* - `atan()`
|
|
1662
|
+
* - `cosh()`
|
|
1663
|
+
* - `sinh()`
|
|
1664
|
+
* - `acosh()`
|
|
1665
|
+
* - `asinh()`
|
|
1666
|
+
* - `atanh()`
|
|
1667
|
+
*
|
|
1668
|
+
* - `isFinite()`
|
|
1669
|
+
* - `isNaN()`
|
|
1670
|
+
* - `isZero()`
|
|
1671
|
+
* - `sign()` (1, 0 or -1)
|
|
1672
|
+
*/
|
|
1579
1673
|
complex: (a: number | Complex, b?: number) => Complex;
|
|
1674
|
+
isBignum(a: unknown): a is Decimal;
|
|
1675
|
+
isComplex(a: unknown): a is Complex;
|
|
1580
1676
|
set precision(p: number | 'machine');
|
|
1581
1677
|
get precision(): number;
|
|
1582
1678
|
costFunction: (expr: BoxedExpression) => number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.12.
|
|
1
|
+
/* 0.12.7 */
|
|
2
2
|
export declare function distribute(expr: BoxedExpression[]): BoxedExpression;
|
|
3
3
|
/** Use the multinomial theorem (https://en.wikipedia.org/wiki/Multinomial_theorem) to expand the expression.
|
|
4
4
|
* The expression must be a power of a sum of terms.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* 0.12.
|
|
2
|
-
export declare const version = "0.12.
|
|
1
|
+
/* 0.12.7 */
|
|
2
|
+
export declare const version = "0.12.7";
|
|
3
3
|
export { ComputeEngine } from './compute-engine/compute-engine';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.12.
|
|
1
|
+
/* 0.12.7 */
|
|
2
2
|
export declare const MISSING: Expression;
|
|
3
3
|
export declare function isNumberExpression(expr: Expression | null): expr is number | string | MathJsonNumber;
|
|
4
4
|
export declare function isNumberObject(expr: Expression | null): expr is MathJsonNumber;
|
|
@@ -69,6 +69,7 @@ export declare function mapArgs<T>(expr: Expression, fn: (x: Expression) => T):
|
|
|
69
69
|
*
|
|
70
70
|
*/
|
|
71
71
|
export declare function applyAssociativeOperator(op: string, lhs: Expression, rhs: Expression, associativity?: 'right' | 'left' | 'non' | 'both'): Expression;
|
|
72
|
+
/** Return the elements of a sequence, or null if the expression is not a sequence. The sequence can be optionally enclosed by a`["Delimiter"]` expression */
|
|
72
73
|
export declare function getSequence(expr: Expression | null): Expression[] | null;
|
|
73
74
|
export declare function isEmptySequence(expr: Expression | null): boolean;
|
|
74
75
|
export declare function missingIfEmpty(expr: Expression | null): Expression;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/* 0.12.
|
|
1
|
+
/* 0.12.7 */
|
|
2
2
|
export { isSymbolObject, isStringObject, isFunctionObject, isDictionaryObject, stringValue as getStringValue, head, headName, symbol, applyRecursively, mapArgs, op, nops, dictionary as getDictionary, } from './math-json/utils';
|
|
3
|
-
export declare const version = "0.12.
|
|
3
|
+
export declare const version = "0.12.7";
|
package/package.json
CHANGED