@cortex-js/compute-engine 0.12.5 → 0.12.6

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.
Files changed (89) hide show
  1. package/dist/compute-engine.esm.js +835 -735
  2. package/dist/compute-engine.js +835 -735
  3. package/dist/compute-engine.min.esm.js +835 -735
  4. package/dist/compute-engine.min.js +835 -735
  5. package/dist/math-json.esm.js +2 -2
  6. package/dist/math-json.js +2 -2
  7. package/dist/math-json.min.esm.js +2 -2
  8. package/dist/math-json.min.js +2 -2
  9. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  10. package/dist/types/common/signals.d.ts +1 -1
  11. package/dist/types/common/utils.d.ts +1 -1
  12. package/dist/types/compute-engine/assume.d.ts +1 -1
  13. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
  14. package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
  15. package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
  16. package/dist/types/compute-engine/boxed-expression/boxed-domain.d.ts +1 -1
  17. package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +1 -1
  18. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
  19. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
  20. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
  21. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
  22. package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +1 -1
  23. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
  24. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
  25. package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
  26. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
  27. package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
  28. package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
  29. package/dist/types/compute-engine/compute-engine.d.ts +5 -5
  30. package/dist/types/compute-engine/cost-function.d.ts +1 -1
  31. package/dist/types/compute-engine/domain-utils.d.ts +1 -1
  32. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  33. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  34. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  35. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  36. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-inequalities.d.ts +1 -1
  37. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  38. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  39. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  40. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  41. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  42. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +14 -9
  43. package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +2 -2
  44. package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +2 -2
  45. package/dist/types/compute-engine/latex-syntax/parse.d.ts +101 -76
  46. package/dist/types/compute-engine/latex-syntax/public.d.ts +137 -135
  47. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
  48. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
  49. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +4 -4
  50. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  51. package/dist/types/compute-engine/library/arithmetic-add.d.ts +1 -1
  52. package/dist/types/compute-engine/library/arithmetic-divide.d.ts +1 -1
  53. package/dist/types/compute-engine/library/arithmetic-multiply.d.ts +1 -1
  54. package/dist/types/compute-engine/library/arithmetic-power.d.ts +1 -1
  55. package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
  56. package/dist/types/compute-engine/library/calculus.d.ts +1 -1
  57. package/dist/types/compute-engine/library/collections.d.ts +1 -1
  58. package/dist/types/compute-engine/library/core.d.ts +1 -1
  59. package/dist/types/compute-engine/library/domains.d.ts +2 -1
  60. package/dist/types/compute-engine/library/library.d.ts +1 -1
  61. package/dist/types/compute-engine/library/logic.d.ts +1 -1
  62. package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
  63. package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
  64. package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
  65. package/dist/types/compute-engine/library/sets.d.ts +1 -1
  66. package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
  67. package/dist/types/compute-engine/library/utils.d.ts +1 -1
  68. package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
  69. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
  70. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  71. package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
  72. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  73. package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
  74. package/dist/types/compute-engine/public.d.ts +98 -3
  75. package/dist/types/compute-engine/rules.d.ts +1 -1
  76. package/dist/types/compute-engine/simplify-rules.d.ts +1 -1
  77. package/dist/types/compute-engine/solve.d.ts +1 -1
  78. package/dist/types/compute-engine/symbolic/expand.d.ts +1 -1
  79. package/dist/types/compute-engine/symbolic/flatten.d.ts +1 -1
  80. package/dist/types/compute-engine/symbolic/negate.d.ts +1 -1
  81. package/dist/types/compute-engine/symbolic/polynomials.d.ts +1 -1
  82. package/dist/types/compute-engine/symbolic/product.d.ts +1 -1
  83. package/dist/types/compute-engine/symbolic/sum.d.ts +1 -1
  84. package/dist/types/compute-engine/symbolic/utils.d.ts +1 -1
  85. package/dist/types/compute-engine.d.ts +2 -2
  86. package/dist/types/math-json/math-json-format.d.ts +1 -1
  87. package/dist/types/math-json/utils.d.ts +2 -1
  88. package/dist/types/math-json.d.ts +2 -2
  89. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  * The most important classes are {@link ComputeEngine} and
3
3
  * {@link BoxedExpression}.
4
4
  *
@@ -1573,10 +1573,105 @@ export interface IComputeEngine {
1573
1573
  chop(n: Decimal): Decimal | 0;
1574
1574
  chop(n: Complex): Complex | 0;
1575
1575
  chop(n: number | Decimal | Complex): number | Decimal | Complex;
1576
- /** @internal */
1576
+ /** Create an arbitrary precision number.
1577
+ *
1578
+ * The return value is an object with methods to perform arithmetic
1579
+ * operations:
1580
+ * - `toNumber()`: convert to a JavaScript `number` with potential loss of precision
1581
+ * - `add()`
1582
+ * - `sub()`
1583
+ * - `neg()` (unary minus)
1584
+ * - `mul()`
1585
+ * - `div()`
1586
+ * - `pow()`
1587
+ * - `sqrt()` (square root)
1588
+ * - `cbrt()` (cube root)
1589
+ * - `exp()` (e^x)
1590
+ * - `log()`
1591
+ * - `ln()` (natural logarithm)
1592
+ * - `mod()`
1593
+
1594
+ * - `abs()`
1595
+ * - `ceil()`
1596
+ * - `floor()`
1597
+ * - `round()`
1598
+
1599
+ * - `equals()`
1600
+ * - `gt()`
1601
+ * - `gte()`
1602
+ * - `lt()`
1603
+ * - `lte()`
1604
+ *
1605
+ * - `cos()`
1606
+ * - `sin()`
1607
+ * - `tanh()`
1608
+ * - `acos()`
1609
+ * - `asin()`
1610
+ * - `atan()`
1611
+ * - `cosh()`
1612
+ * - `sinh()`
1613
+ * - `acosh()`
1614
+ * - `asinh()`
1615
+ * - `atanh()`
1616
+ *
1617
+ * - `isFinite()`
1618
+ * - `isInteger()`
1619
+ * - `isNaN()`
1620
+ * - `isNegative()`
1621
+ * - `isPositive()`
1622
+ * - `isZero()`
1623
+ * - `sign()` (1, 0 or -1)
1624
+ *
1625
+ */
1577
1626
  bignum: (a: Decimal.Value | bigint) => Decimal;
1578
- /** @internal */
1627
+ /** Create a complex number.
1628
+ * The return value is an object with methods to perform arithmetic
1629
+ * operations:
1630
+ * - `re` (real part, as a JavaScript `number`)
1631
+ * - `im` (imaginary part, as a JavaScript `number`)
1632
+ * - `add()`
1633
+ * - `sub()`
1634
+ * - `neg()` (unary minus)
1635
+ * - `mul()`
1636
+ * - `div()`
1637
+ * - `pow()`
1638
+ * - `sqrt()` (square root)
1639
+ * - `exp()` (e^x)
1640
+ * - `log()`
1641
+ * - `ln()` (natural logarithm)
1642
+ * - `mod()`
1643
+
1644
+ * - `abs()`
1645
+ * - `ceil()`
1646
+ * - `floor()`
1647
+ * - `round()`
1648
+
1649
+ * - `arg()` the angle of the complex number
1650
+ * - `inverse()` the inverse of the complex number 1/z
1651
+ * - `conjugate()` the conjugate of the complex number
1652
+
1653
+ * - `equals()`
1654
+ *
1655
+ * - `cos()`
1656
+ * - `sin()`
1657
+ * - `tanh()`
1658
+ * - `acos()`
1659
+ * - `asin()`
1660
+ * - `atan()`
1661
+ * - `cosh()`
1662
+ * - `sinh()`
1663
+ * - `acosh()`
1664
+ * - `asinh()`
1665
+ * - `atanh()`
1666
+ *
1667
+ * - `isFinite()`
1668
+ * - `isNaN()`
1669
+ * - `isZero()`
1670
+ * - `sign()` (1, 0 or -1)
1671
+ */
1579
1672
  complex: (a: number | Complex, b?: number) => Complex;
1673
+ isBignum(a: unknown): a is Decimal;
1674
+ isComplex(a: unknown): a is Complex;
1580
1675
  set precision(p: number | 'machine');
1581
1676
  get precision(): number;
1582
1677
  costFunction: (expr: BoxedExpression) => number;
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  /**
3
3
  * Go through all the rules in the rule set, and for all the rules that match
4
4
  * return the rhs of the rule applied to `expr`.
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  /**
3
3
  * A set of simplification rules.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  export declare const UNIVARIATE_ROOTS: Rule[];
3
3
  /**
4
4
  * Expression is a function of a single variable (`x`) or an Equality
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
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,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  /**
3
3
  * Flatten the arguments.
4
4
  * If `expr` was canonical, the result it canonical.
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  /**
3
3
  * Distribute `Negate` (multiply by -1) if expr is a number literal, an
4
4
  * addition or multiplication or another `Negate`.
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  /**
3
3
  * Coefficient of a univariate (single variable) polynomial.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  /**
3
3
  * Group terms in a product by common term.
4
4
  *
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  export declare class Sum {
3
3
  private engine;
4
4
  private _isCanonical;
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  import Decimal from 'decimal.js';
3
3
  import { BoxedExpression, Rational } from '../public';
4
4
  /**
@@ -1,3 +1,3 @@
1
- /* 0.12.5 */
2
- export declare const version = "0.12.5";
1
+ /* 0.12.6 */
2
+ export declare const version = "0.12.6";
3
3
  export { ComputeEngine } from './compute-engine/compute-engine';
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
2
2
  /** A human readable string to annotate this expression, since JSON does not
3
3
  * allow comments in its encoding */
4
4
  comment?: string;
@@ -1,4 +1,4 @@
1
- /* 0.12.5 */
1
+ /* 0.12.6 */
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.5 */
1
+ /* 0.12.6 */
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.5";
3
+ export declare const version = "0.12.6";
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.12.5",
2
+ "version": "0.12.6",
3
3
  "scripts": {
4
4
  "build": "bash ./scripts/build.sh",
5
5
  "clean": "bash ./scripts/clean.sh",