math-exercises 2.2.9 → 2.2.11
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/lib/exercises/exercise.d.ts +2 -1
- package/lib/exercises/exercise.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.d.ts.map +1 -1
- package/lib/exercises/math/calcul/arithmetics/commonDivisorsList.js +24 -7
- package/lib/exercises/math/calcul/decimals/index.d.ts +3 -0
- package/lib/exercises/math/calcul/decimals/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/index.js +18 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts +8 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByNegativeTens.js +53 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts +9 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.d.ts.map +1 -0
- package/lib/exercises/math/calcul/decimals/multiplyDecimalByTens.js +63 -0
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.d.ts.map +1 -1
- package/lib/exercises/math/calcul/fractions/fractionsSumsSameDenominators.js +33 -1
- package/lib/exercises/math/calcul/index.d.ts +2 -0
- package/lib/exercises/math/calcul/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/index.js +2 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/expressionNature.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/expressionNature.js +180 -80
- package/lib/exercises/math/calcul/operations/index.d.ts +3 -0
- package/lib/exercises/math/calcul/operations/index.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/index.js +3 -0
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPriorities.js +20 -5
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesis.js +111 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts +8 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.d.ts.map +1 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesParenthesisNoRelatives.js +127 -0
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.d.ts.map +1 -1
- package/lib/exercises/math/calcul/operations/operationsPrioritiesWithoutRelative.js +18 -1
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts +9 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/decimalOrdering.js +77 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts +10 -0
- package/lib/exercises/math/calcul/ordering/framing.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/framing.js +143 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts +4 -0
- package/lib/exercises/math/calcul/ordering/index.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/index.js +19 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts +8 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.d.ts.map +1 -0
- package/lib/exercises/math/calcul/ordering/integerOrdering.js +61 -0
- package/lib/exercises/math/calculLitteral/distributivity/doubleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/firstIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/secondIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/simpleDistributivity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/distributivity/thirdIdentity.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType2Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/equation/equationType4Exercise.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq1.d.ts.map +1 -1
- package/lib/exercises/math/calculLitteral/factorisation/factoIdRmq2.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/convexityQuadrinomials.d.ts.map +1 -1
- package/lib/exercises/math/derivation/derivative/powerFunctionDerivative.js +1 -1
- package/lib/exercises/math/functions/affines/leadingCoeffAndOriginOrdinate.js +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/graphicInequation.js +9 -6
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.d.ts.map +1 -1
- package/lib/exercises/math/functions/basics/twoFunctionsInequation.js +15 -4
- package/lib/exercises/math/functions/trinoms/canonicalFromDevForm.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVector.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/directionVectorEquation.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.d.ts.map +1 -1
- package/lib/exercises/math/geometry/cartesian/placeAPoint.js +0 -4
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/equalCaracteristicFromGraph.js +2 -3
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.d.ts.map +1 -1
- package/lib/exercises/math/geometry/vectors/vectorCoordinatesFromTwoPoints.js +17 -0
- package/lib/exercises/math/geometry/volumes/volumeOfCube.d.ts.map +1 -1
- package/lib/exercises/math/geometry/volumes/volumeOfCube.js +7 -1
- package/lib/exercises/math/index.d.ts +0 -1
- package/lib/exercises/math/index.d.ts.map +1 -1
- package/lib/exercises/math/index.js +0 -1
- package/lib/exercises/math/limits/rationalFracForbiddenValueLimit.d.ts.map +1 -1
- package/lib/exercises/math/percent/htToTTC.d.ts +8 -0
- package/lib/exercises/math/percent/htToTTC.d.ts.map +1 -0
- package/lib/exercises/math/percent/htToTTC.js +50 -0
- package/lib/exercises/math/percent/index.d.ts +2 -0
- package/lib/exercises/math/percent/index.d.ts.map +1 -1
- package/lib/exercises/math/percent/index.js +2 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts +8 -0
- package/lib/exercises/math/percent/ttcToHT.d.ts.map +1 -0
- package/lib/exercises/math/percent/ttcToHT.js +50 -0
- package/lib/exercises/math/powers/powersDivision.d.ts.map +1 -1
- package/lib/exercises/math/powers/powersDivision.js +35 -2
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/calculateProbaOfBinomialDistribution.js +21 -0
- package/lib/exercises/math/probaStat/probaFromTableWithContext.js +1 -1
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts +7 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/averageList.js +52 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts +7 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.d.ts.map +1 -0
- package/lib/exercises/math/probaStat/stats1var/etendueList.js +49 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts +2 -0
- package/lib/exercises/math/probaStat/stats1var/index.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/index.js +2 -0
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.d.ts.map +1 -1
- package/lib/exercises/math/probaStat/stats1var/marginalAndConditionalFrequency.js +2 -11
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/arithmeticFindTerm.js +42 -0
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.d.ts.map +1 -1
- package/lib/exercises/math/sequences/arithmetic/recognizeArithmeticFromFirstTerms.js +7 -2
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/geometricFindTerm.js +42 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts +10 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.d.ts.map +1 -0
- package/lib/exercises/math/sequences/geometric/geometricFirstTermsGeneralSum.js +56 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts +1 -0
- package/lib/exercises/math/sequences/geometric/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/geometric/index.js +1 -0
- package/lib/exercises/math/sequences/index.d.ts +2 -0
- package/lib/exercises/math/sequences/index.d.ts.map +1 -1
- package/lib/exercises/math/sequences/index.js +2 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts +10 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.d.ts.map +1 -0
- package/lib/exercises/math/sequences/sequenceEvaluation.js +143 -0
- package/lib/exercises/math/sequences/sequencePlot.d.ts +9 -0
- package/lib/exercises/math/sequences/sequencePlot.d.ts.map +1 -0
- package/lib/exercises/math/sequences/sequencePlot.js +94 -0
- package/lib/exercises/math/sets/intervals/intervalsIntersection.d.ts.map +1 -1
- package/lib/exercises/math/sets/intervals/intervalsIntersection.js +19 -1
- package/lib/exercises/math/sets/intervals/intervalsUnion.js +1 -1
- package/lib/exercises/math/trigonometry/arcValue.d.ts.map +1 -1
- package/lib/exercises/math/trigonometry/arcValue.js +23 -0
- package/lib/exercises/pc/chemicalReactions/stoichiometricReaction.js +1 -1
- package/lib/exercises/pc/electricity/ohmicConductorOrGenerator.js +1 -1
- package/lib/exercises/pc/motion/typeOfAcceleration.js +1 -1
- package/lib/exercises/pc/motion/typeOfMovement.js +1 -1
- package/lib/exercises/pc/recognizeRefractionOrReflectionAngles.js +1 -1
- package/lib/index.d.ts +54 -10
- package/lib/index.d.ts.map +1 -1
- package/lib/math/geometry/point.d.ts +11 -0
- package/lib/math/geometry/point.d.ts.map +1 -1
- package/lib/math/geometry/point.js +8 -0
- package/lib/math/numbers/decimals/decimal.d.ts +2 -0
- package/lib/math/numbers/decimals/decimal.d.ts.map +1 -1
- package/lib/math/numbers/decimals/decimal.js +18 -0
- package/lib/math/numbers/reals/extendedRingElement.d.ts +3 -1
- package/lib/math/numbers/reals/extendedRingElement.d.ts.map +1 -1
- package/lib/math/numbers/reals/real.d.ts +1 -1
- package/lib/math/polynomials/trinom.d.ts +1 -1
- package/lib/math/sets/intervals/intervals.d.ts +3 -1
- package/lib/math/sets/intervals/intervals.d.ts.map +1 -1
- package/lib/math/sets/intervals/intervals.js +9 -5
- package/lib/math/sets/mathSet.d.ts +2 -2
- package/lib/math/sets/mathSet.d.ts.map +1 -1
- package/lib/math/sets/mathSetInterface.d.ts +1 -1
- package/lib/playground.d.ts.map +1 -1
- package/lib/playground.js +13 -2
- package/lib/server.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.d.ts.map +1 -1
- package/lib/tree/nodes/algebraicNode.js +0 -3
- package/lib/tree/nodes/complex/complexNode.d.ts +10 -1
- package/lib/tree/nodes/complex/complexNode.d.ts.map +1 -1
- package/lib/tree/nodes/complex/complexNode.js +7 -0
- package/lib/tree/nodes/equations/equalNode.d.ts +10 -1
- package/lib/tree/nodes/equations/equalNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equalNode.js +7 -0
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts +10 -1
- package/lib/tree/nodes/equations/equationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/equationSolutionNode.js +6 -0
- package/lib/tree/nodes/equations/multiEqualNode.d.ts +7 -1
- package/lib/tree/nodes/equations/multiEqualNode.d.ts.map +1 -1
- package/lib/tree/nodes/equations/multiEqualNode.js +6 -0
- package/lib/tree/nodes/functions/absNode.d.ts +7 -1
- package/lib/tree/nodes/functions/absNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/absNode.js +6 -0
- package/lib/tree/nodes/functions/arcSinNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arcSinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arcSinNode.js +8 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arccosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arccosNode.js +8 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts +7 -1
- package/lib/tree/nodes/functions/arctanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/arctanNode.js +8 -1
- package/lib/tree/nodes/functions/cosNode.d.ts +7 -1
- package/lib/tree/nodes/functions/cosNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/cosNode.js +8 -1
- package/lib/tree/nodes/functions/expNode.d.ts +7 -1
- package/lib/tree/nodes/functions/expNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/expNode.js +6 -0
- package/lib/tree/nodes/functions/integralNode.d.ts +19 -2
- package/lib/tree/nodes/functions/integralNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/integralNode.js +20 -0
- package/lib/tree/nodes/functions/log10Node.d.ts +7 -1
- package/lib/tree/nodes/functions/log10Node.d.ts.map +1 -1
- package/lib/tree/nodes/functions/log10Node.js +6 -0
- package/lib/tree/nodes/functions/logNode.d.ts +7 -1
- package/lib/tree/nodes/functions/logNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/logNode.js +6 -0
- package/lib/tree/nodes/functions/oppositeNode.d.ts +7 -1
- package/lib/tree/nodes/functions/oppositeNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/oppositeNode.js +6 -0
- package/lib/tree/nodes/functions/sinNode.d.ts +7 -1
- package/lib/tree/nodes/functions/sinNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sinNode.js +8 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts +7 -1
- package/lib/tree/nodes/functions/sqrtNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/sqrtNode.js +6 -0
- package/lib/tree/nodes/functions/tanNode.d.ts +7 -1
- package/lib/tree/nodes/functions/tanNode.d.ts.map +1 -1
- package/lib/tree/nodes/functions/tanNode.js +8 -1
- package/lib/tree/nodes/geometry/degree.d.ts +5 -1
- package/lib/tree/nodes/geometry/degree.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/degree.js +6 -0
- package/lib/tree/nodes/geometry/lengthNode.d.ts +5 -1
- package/lib/tree/nodes/geometry/lengthNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/lengthNode.js +6 -0
- package/lib/tree/nodes/geometry/pointNode.d.ts +14 -1
- package/lib/tree/nodes/geometry/pointNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/pointNode.js +6 -0
- package/lib/tree/nodes/geometry/vectorNode.d.ts +5 -1
- package/lib/tree/nodes/geometry/vectorNode.d.ts.map +1 -1
- package/lib/tree/nodes/geometry/vectorNode.js +6 -0
- package/lib/tree/nodes/hasVariableNode.d.ts +3 -0
- package/lib/tree/nodes/hasVariableNode.d.ts.map +1 -0
- package/lib/tree/nodes/hasVariableNode.js +16 -0
- package/lib/tree/nodes/inequations/inequationNode.d.ts +8 -1
- package/lib/tree/nodes/inequations/inequationNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationNode.js +7 -0
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts +19 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.d.ts.map +1 -1
- package/lib/tree/nodes/inequations/inequationSolutionNode.js +7 -1
- package/lib/tree/nodes/node.d.ts +52 -8
- package/lib/tree/nodes/node.d.ts.map +1 -1
- package/lib/tree/nodes/node.js +49 -21
- package/lib/tree/nodes/nodeConstructor.d.ts +7 -0
- package/lib/tree/nodes/nodeConstructor.d.ts.map +1 -0
- package/lib/tree/nodes/nodeConstructor.js +170 -0
- package/lib/tree/nodes/numbers/constantNode.d.ts +7 -1
- package/lib/tree/nodes/numbers/constantNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/constantNode.js +9 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts +5 -1
- package/lib/tree/nodes/numbers/numberNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/numberNode.js +6 -0
- package/lib/tree/nodes/numbers/percentNode.d.ts +5 -1
- package/lib/tree/nodes/numbers/percentNode.d.ts.map +1 -1
- package/lib/tree/nodes/numbers/percentNode.js +6 -0
- package/lib/tree/nodes/operators/addNode.d.ts +10 -1
- package/lib/tree/nodes/operators/addNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/addNode.js +16 -6
- package/lib/tree/nodes/operators/divideNode.d.ts +11 -1
- package/lib/tree/nodes/operators/divideNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/divideNode.js +12 -0
- package/lib/tree/nodes/operators/fractionNode.d.ts +10 -1
- package/lib/tree/nodes/operators/fractionNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/fractionNode.js +7 -0
- package/lib/tree/nodes/operators/limitNode.d.ts +11 -1
- package/lib/tree/nodes/operators/limitNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/limitNode.js +8 -0
- package/lib/tree/nodes/operators/multiplyNode.d.ts +10 -1
- package/lib/tree/nodes/operators/multiplyNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/multiplyNode.js +7 -0
- package/lib/tree/nodes/operators/powerNode.d.ts +10 -1
- package/lib/tree/nodes/operators/powerNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/powerNode.js +7 -0
- package/lib/tree/nodes/operators/substractNode.d.ts +11 -1
- package/lib/tree/nodes/operators/substractNode.d.ts.map +1 -1
- package/lib/tree/nodes/operators/substractNode.js +12 -0
- package/lib/tree/nodes/sets/belongsNode.d.ts +10 -1
- package/lib/tree/nodes/sets/belongsNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/belongsNode.js +7 -0
- package/lib/tree/nodes/sets/closure.d.ts +2 -0
- package/lib/tree/nodes/sets/closure.d.ts.map +1 -1
- package/lib/tree/nodes/sets/closure.js +20 -0
- package/lib/tree/nodes/sets/discreteSetNode.d.ts +10 -2
- package/lib/tree/nodes/sets/discreteSetNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/discreteSetNode.js +13 -3
- package/lib/tree/nodes/sets/intervalNode.d.ts +14 -2
- package/lib/tree/nodes/sets/intervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/intervalNode.js +22 -1
- package/lib/tree/nodes/sets/setNode.d.ts +1 -0
- package/lib/tree/nodes/sets/setNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts +7 -1
- package/lib/tree/nodes/sets/unionIntervalNode.d.ts.map +1 -1
- package/lib/tree/nodes/sets/unionIntervalNode.js +7 -1
- package/lib/tree/nodes/variables/variableNode.d.ts +5 -1
- package/lib/tree/nodes/variables/variableNode.d.ts.map +1 -1
- package/lib/tree/nodes/variables/variableNode.js +6 -0
- package/lib/tree/utilities/operatorComposition.js +4 -2
- package/lib/types/keyProps.d.ts +13 -0
- package/lib/types/keyProps.d.ts.map +1 -0
- package/lib/types/keyProps.js +2 -0
- package/lib/utils/alignTex.js +11 -9
- package/lib/utils/diceFlip.d.ts.map +1 -1
- package/lib/utils/diceFlip.js +2 -6
- package/package.json +1 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NodeConstructor = void 0;
|
|
4
|
+
const point_1 = require("../../math/geometry/point");
|
|
5
|
+
const complexNode_1 = require("./complex/complexNode");
|
|
6
|
+
const equalNode_1 = require("./equations/equalNode");
|
|
7
|
+
const equationSolutionNode_1 = require("./equations/equationSolutionNode");
|
|
8
|
+
const multiEqualNode_1 = require("./equations/multiEqualNode");
|
|
9
|
+
const absNode_1 = require("./functions/absNode");
|
|
10
|
+
const arcSinNode_1 = require("./functions/arcSinNode");
|
|
11
|
+
const arccosNode_1 = require("./functions/arccosNode");
|
|
12
|
+
const arctanNode_1 = require("./functions/arctanNode");
|
|
13
|
+
const cosNode_1 = require("./functions/cosNode");
|
|
14
|
+
const expNode_1 = require("./functions/expNode");
|
|
15
|
+
const integralNode_1 = require("./functions/integralNode");
|
|
16
|
+
const log10Node_1 = require("./functions/log10Node");
|
|
17
|
+
const logNode_1 = require("./functions/logNode");
|
|
18
|
+
const oppositeNode_1 = require("./functions/oppositeNode");
|
|
19
|
+
const sinNode_1 = require("./functions/sinNode");
|
|
20
|
+
const sqrtNode_1 = require("./functions/sqrtNode");
|
|
21
|
+
const tanNode_1 = require("./functions/tanNode");
|
|
22
|
+
const degree_1 = require("./geometry/degree");
|
|
23
|
+
const lengthNode_1 = require("./geometry/lengthNode");
|
|
24
|
+
const pointNode_1 = require("./geometry/pointNode");
|
|
25
|
+
const vectorNode_1 = require("./geometry/vectorNode");
|
|
26
|
+
const inequationNode_1 = require("./inequations/inequationNode");
|
|
27
|
+
const inequationSolutionNode_1 = require("./inequations/inequationSolutionNode");
|
|
28
|
+
const node_1 = require("./node");
|
|
29
|
+
const constantNode_1 = require("./numbers/constantNode");
|
|
30
|
+
const numberNode_1 = require("./numbers/numberNode");
|
|
31
|
+
const percentNode_1 = require("./numbers/percentNode");
|
|
32
|
+
const addNode_1 = require("./operators/addNode");
|
|
33
|
+
const divideNode_1 = require("./operators/divideNode");
|
|
34
|
+
const fractionNode_1 = require("./operators/fractionNode");
|
|
35
|
+
const limitNode_1 = require("./operators/limitNode");
|
|
36
|
+
const multiplyNode_1 = require("./operators/multiplyNode");
|
|
37
|
+
const powerNode_1 = require("./operators/powerNode");
|
|
38
|
+
const substractNode_1 = require("./operators/substractNode");
|
|
39
|
+
const belongsNode_1 = require("./sets/belongsNode");
|
|
40
|
+
const discreteSetNode_1 = require("./sets/discreteSetNode");
|
|
41
|
+
const intervalNode_1 = require("./sets/intervalNode");
|
|
42
|
+
const unionIntervalNode_1 = require("./sets/unionIntervalNode");
|
|
43
|
+
const variableNode_1 = require("./variables/variableNode");
|
|
44
|
+
class NodeConstructor {
|
|
45
|
+
static fromIdentifiers(identifiers) {
|
|
46
|
+
switch (identifiers.id) {
|
|
47
|
+
case node_1.NodeIds.variable: {
|
|
48
|
+
return new variableNode_1.VariableNode(identifiers.name);
|
|
49
|
+
}
|
|
50
|
+
case node_1.NodeIds.number: {
|
|
51
|
+
return new numberNode_1.NumberNode(identifiers.value);
|
|
52
|
+
}
|
|
53
|
+
case node_1.NodeIds.constant: {
|
|
54
|
+
return new constantNode_1.ConstantNode(identifiers.tex, identifiers.mathString, identifiers.value);
|
|
55
|
+
}
|
|
56
|
+
case node_1.NodeIds.complex: {
|
|
57
|
+
return new complexNode_1.ComplexNode(NodeConstructor.fromIdentifiers(identifiers.re), NodeConstructor.fromIdentifiers(identifiers.im));
|
|
58
|
+
}
|
|
59
|
+
case node_1.NodeIds.percent: {
|
|
60
|
+
return new percentNode_1.PercentNode(identifiers.value);
|
|
61
|
+
}
|
|
62
|
+
/**Equations */
|
|
63
|
+
case node_1.NodeIds.equal: {
|
|
64
|
+
return new equalNode_1.EqualNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
65
|
+
}
|
|
66
|
+
case node_1.NodeIds.equationSolution: {
|
|
67
|
+
return new equationSolutionNode_1.EquationSolutionNode(NodeConstructor.fromIdentifiers(identifiers.solutionsSet));
|
|
68
|
+
}
|
|
69
|
+
case node_1.NodeIds.multiEqual: {
|
|
70
|
+
return new multiEqualNode_1.MultiEqualNode(identifiers.children.map((e) => NodeConstructor.fromIdentifiers(e)));
|
|
71
|
+
}
|
|
72
|
+
/**Inequations */
|
|
73
|
+
case node_1.NodeIds.inequation: {
|
|
74
|
+
return new inequationNode_1.InequationNode(identifiers.children.map((e) => NodeConstructor.fromIdentifiers(e)), identifiers.symbols);
|
|
75
|
+
}
|
|
76
|
+
case node_1.NodeIds.inequationSolution: {
|
|
77
|
+
return new inequationSolutionNode_1.InequationSolutionNode(NodeConstructor.fromIdentifiers(identifiers.intervalSolution));
|
|
78
|
+
}
|
|
79
|
+
/**Geométrie */
|
|
80
|
+
case node_1.NodeIds.degree: {
|
|
81
|
+
return new degree_1.DegreeNode(identifiers.value);
|
|
82
|
+
}
|
|
83
|
+
case node_1.NodeIds.point: {
|
|
84
|
+
return new pointNode_1.PointNode(new point_1.Point(identifiers.point.name, NodeConstructor.fromIdentifiers(identifiers.point.x), NodeConstructor.fromIdentifiers(identifiers.point.y)));
|
|
85
|
+
}
|
|
86
|
+
case node_1.NodeIds.length: {
|
|
87
|
+
return new lengthNode_1.LengthNode(identifiers.name);
|
|
88
|
+
}
|
|
89
|
+
case node_1.NodeIds.vector: {
|
|
90
|
+
return new vectorNode_1.VectorNode(identifiers.name);
|
|
91
|
+
}
|
|
92
|
+
/**Functions */
|
|
93
|
+
case node_1.NodeIds.abs: {
|
|
94
|
+
return new absNode_1.AbsNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
95
|
+
}
|
|
96
|
+
case node_1.NodeIds.arccos: {
|
|
97
|
+
return new arccosNode_1.ArccosNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
98
|
+
}
|
|
99
|
+
case node_1.NodeIds.arcsin: {
|
|
100
|
+
return new arcSinNode_1.ArcsinNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
101
|
+
}
|
|
102
|
+
case node_1.NodeIds.arctan: {
|
|
103
|
+
return new arctanNode_1.ArctanNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
104
|
+
}
|
|
105
|
+
case node_1.NodeIds.cos: {
|
|
106
|
+
return new cosNode_1.CosNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
107
|
+
}
|
|
108
|
+
case node_1.NodeIds.sin: {
|
|
109
|
+
return new sinNode_1.SinNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
110
|
+
}
|
|
111
|
+
case node_1.NodeIds.tan: {
|
|
112
|
+
return new tanNode_1.TanNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
113
|
+
}
|
|
114
|
+
case node_1.NodeIds.exp: {
|
|
115
|
+
return new expNode_1.ExpNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
116
|
+
}
|
|
117
|
+
case node_1.NodeIds.integral: {
|
|
118
|
+
return new integralNode_1.IntegralNode(NodeConstructor.fromIdentifiers(identifiers.functionNode), NodeConstructor.fromIdentifiers(identifiers.lowerBound), NodeConstructor.fromIdentifiers(identifiers.upperBound), identifiers.variable);
|
|
119
|
+
}
|
|
120
|
+
case node_1.NodeIds.log10: {
|
|
121
|
+
return new log10Node_1.Log10Node(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
122
|
+
}
|
|
123
|
+
case node_1.NodeIds.log: {
|
|
124
|
+
return new logNode_1.LogNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
125
|
+
}
|
|
126
|
+
case node_1.NodeIds.opposite: {
|
|
127
|
+
return new oppositeNode_1.OppositeNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
128
|
+
}
|
|
129
|
+
case node_1.NodeIds.sqrt: {
|
|
130
|
+
return new sqrtNode_1.SqrtNode(NodeConstructor.fromIdentifiers(identifiers.child));
|
|
131
|
+
}
|
|
132
|
+
/**Sets */
|
|
133
|
+
case node_1.NodeIds.discreteSet: {
|
|
134
|
+
return new discreteSetNode_1.DiscreteSetNode(identifiers.children.map((e) => NodeConstructor.fromIdentifiers(e)));
|
|
135
|
+
}
|
|
136
|
+
case node_1.NodeIds.belongs: {
|
|
137
|
+
return new belongsNode_1.BelongsNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
138
|
+
}
|
|
139
|
+
case node_1.NodeIds.interval: {
|
|
140
|
+
return new intervalNode_1.IntervalNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild), identifiers.closure);
|
|
141
|
+
}
|
|
142
|
+
case node_1.NodeIds.union: {
|
|
143
|
+
return new unionIntervalNode_1.UnionIntervalNode(identifiers.children.map((e) => NodeConstructor.fromIdentifiers(e)));
|
|
144
|
+
}
|
|
145
|
+
/**Operators */
|
|
146
|
+
case node_1.NodeIds.add: {
|
|
147
|
+
return new addNode_1.AddNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
148
|
+
}
|
|
149
|
+
case node_1.NodeIds.substract: {
|
|
150
|
+
return new substractNode_1.SubstractNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
151
|
+
}
|
|
152
|
+
case node_1.NodeIds.multiply: {
|
|
153
|
+
return new multiplyNode_1.MultiplyNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
154
|
+
}
|
|
155
|
+
case node_1.NodeIds.divide: {
|
|
156
|
+
return new divideNode_1.DivideNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
157
|
+
}
|
|
158
|
+
case node_1.NodeIds.fraction: {
|
|
159
|
+
return new fractionNode_1.FractionNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
160
|
+
}
|
|
161
|
+
case node_1.NodeIds.power: {
|
|
162
|
+
return new powerNode_1.PowerNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild));
|
|
163
|
+
}
|
|
164
|
+
case node_1.NodeIds.limit: {
|
|
165
|
+
return new limitNode_1.LimitNode(NodeConstructor.fromIdentifiers(identifiers.leftChild), NodeConstructor.fromIdentifiers(identifiers.rightChild), identifiers.from);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
exports.NodeConstructor = NodeConstructor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { AlgebraicNode } from "../algebraicNode";
|
|
3
3
|
export declare function isConstantNode(a: Node): a is ConstantNode;
|
|
4
4
|
export declare class ConstantNode implements AlgebraicNode {
|
|
@@ -11,6 +11,12 @@ export declare class ConstantNode implements AlgebraicNode {
|
|
|
11
11
|
toMathString(): string;
|
|
12
12
|
toTex(): string;
|
|
13
13
|
toAllValidTexs(): string[];
|
|
14
|
+
toIdentifiers(): {
|
|
15
|
+
id: NodeIds;
|
|
16
|
+
mathString: string;
|
|
17
|
+
tex: string;
|
|
18
|
+
value: number;
|
|
19
|
+
};
|
|
14
20
|
toEquivalentNodes(): this[];
|
|
15
21
|
evaluate(vars: Record<string, number>): number;
|
|
16
22
|
simplify(): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constantNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/constantNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"constantNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/constantNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AACD,qBAAa,YAAa,YAAW,aAAa;IAChD,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBACP,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAQ1D,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAMf,cAAc;IAGd,aAAa;;;;;;IAQb,iBAAiB;IAGjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAG3B"}
|
|
@@ -9,11 +9,11 @@ function isConstantNode(a) {
|
|
|
9
9
|
exports.isConstantNode = isConstantNode;
|
|
10
10
|
class ConstantNode {
|
|
11
11
|
constructor(tex, mathString, value) {
|
|
12
|
-
this.type = node_1.NodeType.constant;
|
|
13
12
|
this.tex = tex;
|
|
14
13
|
this.mathString = mathString;
|
|
15
14
|
this.value = value;
|
|
16
15
|
this.isNumeric = true;
|
|
16
|
+
this.type = node_1.NodeType.constant;
|
|
17
17
|
}
|
|
18
18
|
toMathString() {
|
|
19
19
|
return `${this.mathString}`;
|
|
@@ -27,6 +27,14 @@ class ConstantNode {
|
|
|
27
27
|
toAllValidTexs() {
|
|
28
28
|
return this.toEquivalentNodes().map((node) => node.toTex());
|
|
29
29
|
}
|
|
30
|
+
toIdentifiers() {
|
|
31
|
+
return {
|
|
32
|
+
id: node_1.NodeIds.constant,
|
|
33
|
+
mathString: this.mathString,
|
|
34
|
+
tex: this.tex,
|
|
35
|
+
value: this.value,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
30
38
|
toEquivalentNodes() {
|
|
31
39
|
return [this];
|
|
32
40
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { AlgebraicNode } from "../algebraicNode";
|
|
3
3
|
export declare function isNumberNode(a: Node): a is NumberNode;
|
|
4
4
|
export declare abstract class NumberNodeConstructor {
|
|
@@ -14,6 +14,10 @@ export declare class NumberNode implements AlgebraicNode {
|
|
|
14
14
|
toMathString(): string;
|
|
15
15
|
toTex(): string;
|
|
16
16
|
toMathjs(): string;
|
|
17
|
+
toIdentifiers(): {
|
|
18
|
+
id: NodeIds;
|
|
19
|
+
value: number;
|
|
20
|
+
};
|
|
17
21
|
toAllValidTexs(): string[];
|
|
18
22
|
toEquivalentNodes(): this[];
|
|
19
23
|
evaluate(vars: Record<string, number>): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numberNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/numberNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"numberNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/numberNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AAED,8BAAsB,qBAAqB;IACzC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAM,EAAO;CAGhE;AACD,qBAAa,UAAW,YAAW,aAAa;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAmB;IACjC,SAAS,EAAE,OAAO,CAAC;gBACP,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;IAO5D,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;IAGR,aAAa;;;;IAMb,cAAc;IAOd,iBAAiB;IAGjB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAGrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAG3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
export declare class PercentNode implements Node {
|
|
3
3
|
value: number;
|
|
4
4
|
type: NodeType;
|
|
@@ -7,6 +7,10 @@ export declare class PercentNode implements Node {
|
|
|
7
7
|
toTex(): string;
|
|
8
8
|
toMathjs(): string;
|
|
9
9
|
toAllValidTexs(): string[];
|
|
10
|
+
toIdentifiers(): {
|
|
11
|
+
id: NodeIds;
|
|
12
|
+
value: number;
|
|
13
|
+
};
|
|
10
14
|
toEquivalentNodes(): this[];
|
|
11
15
|
}
|
|
12
16
|
//# sourceMappingURL=percentNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"percentNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/percentNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"percentNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/numbers/percentNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAElD,qBAAa,WAAY,YAAW,IAAI;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;gBAEH,KAAK,EAAE,MAAM;IAKzB,YAAY,IAAI,MAAM;IAGtB,KAAK,IAAI,MAAM;IAGf,QAAQ;IAGR,cAAc;IAGd,aAAa;;;;IAMb,iBAAiB;CAGlB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { CommutativeOperatorNode, OperatorIds } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isAddNode(a: Node): a is AddNode;
|
|
@@ -18,6 +18,15 @@ export declare class AddNode implements CommutativeOperatorNode {
|
|
|
18
18
|
toTex(): string;
|
|
19
19
|
evaluate(vars: Record<string, number>): number;
|
|
20
20
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
21
|
+
toIdentifiers(): {
|
|
22
|
+
id: NodeIds;
|
|
23
|
+
leftChild: {
|
|
24
|
+
id: NodeIds;
|
|
25
|
+
} & Record<string, any>;
|
|
26
|
+
rightChild: {
|
|
27
|
+
id: NodeIds;
|
|
28
|
+
} & Record<string, any>;
|
|
29
|
+
};
|
|
21
30
|
equals(node: AlgebraicNode): boolean;
|
|
22
31
|
}
|
|
23
32
|
//# sourceMappingURL=addNode.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/addNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,
|
|
1
|
+
{"version":3,"file":"addNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/addNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAgB,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,uBAAuB,EACvB,WAAW,EAGZ,MAAM,gBAAgB,CAAC;AAKxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAOlE,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,OAAO,CAE/C;AAED,qBAAa,OAAQ,YAAW,uBAAuB;IACrD,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IASpB,OAAO,aAGL;IAEF,YAAY,IAAI,MAAM;IAItB,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,aAAa,EAAE;IAoCtD,SAAS,IAAI,MAAM,EAAE;IAIrB,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAK5C,KAAK,IAAI,MAAM;IAUf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMrC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IA0K/C,aAAa;;;;;;;;;IAOb,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAUrC"}
|
|
@@ -17,11 +17,6 @@ function isAddNode(a) {
|
|
|
17
17
|
return (0, operatorNode_1.isOperatorNode)(a) && a.id === operatorNode_1.OperatorIds.add;
|
|
18
18
|
}
|
|
19
19
|
exports.isAddNode = isAddNode;
|
|
20
|
-
const addNodeToTex = (leftTex, rightTex) => {
|
|
21
|
-
if (rightTex === "0")
|
|
22
|
-
return leftTex;
|
|
23
|
-
return `${leftTex}${rightTex[0] === "-" ? "" : "+"}${rightTex}`;
|
|
24
|
-
};
|
|
25
20
|
class AddNode {
|
|
26
21
|
constructor(leftChild, rightChild, opts) {
|
|
27
22
|
this.shuffle = () => {
|
|
@@ -79,7 +74,15 @@ class AddNode {
|
|
|
79
74
|
}
|
|
80
75
|
toTex() {
|
|
81
76
|
const rightTex = this.rightChild.toTex();
|
|
82
|
-
|
|
77
|
+
const leftTex = this.leftChild.toTex();
|
|
78
|
+
if (rightTex === "0")
|
|
79
|
+
return leftTex;
|
|
80
|
+
const tex = `${leftTex}${rightTex[0] === "-" ? "" : "+"}${rightTex}`;
|
|
81
|
+
if (this.opts?.forceParenthesis) {
|
|
82
|
+
return `\\left(${tex}\\right)`;
|
|
83
|
+
}
|
|
84
|
+
else
|
|
85
|
+
return tex;
|
|
83
86
|
}
|
|
84
87
|
evaluate(vars) {
|
|
85
88
|
return this.leftChild.evaluate(vars) + this.rightChild.evaluate(vars);
|
|
@@ -245,6 +248,13 @@ class AddNode {
|
|
|
245
248
|
return externals[0];
|
|
246
249
|
return (0, operatorComposition_1.operatorComposition)(AddNode, externals);
|
|
247
250
|
}
|
|
251
|
+
toIdentifiers() {
|
|
252
|
+
return {
|
|
253
|
+
id: node_1.NodeIds.add,
|
|
254
|
+
leftChild: this.leftChild.toIdentifiers(),
|
|
255
|
+
rightChild: this.rightChild.toIdentifiers(),
|
|
256
|
+
};
|
|
257
|
+
}
|
|
248
258
|
equals(node) {
|
|
249
259
|
//!incorrect, il faut plutot vérifier qu'ils ont les meme externals
|
|
250
260
|
return (isAddNode(node) &&
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { OperatorIds, OperatorNode } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode } from "../algebraicNode";
|
|
4
4
|
export declare function isDivideNode(a: Node): a is DivideNode;
|
|
@@ -14,6 +14,16 @@ export declare class DivideNode implements OperatorNode {
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(leftChild: AlgebraicNode, rightChild: AlgebraicNode);
|
|
16
16
|
toMathString(): string;
|
|
17
|
+
dangerouslyShuffle(): void;
|
|
18
|
+
toIdentifiers(): {
|
|
19
|
+
id: NodeIds;
|
|
20
|
+
leftChild: {
|
|
21
|
+
id: NodeIds;
|
|
22
|
+
} & Record<string, any>;
|
|
23
|
+
rightChild: {
|
|
24
|
+
id: NodeIds;
|
|
25
|
+
} & Record<string, any>;
|
|
26
|
+
};
|
|
17
27
|
toEquivalentNodes(opts?: NodeOptions): AlgebraicNode[];
|
|
18
28
|
toAllValidTexs(): string[];
|
|
19
29
|
toTex(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divideNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/divideNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"divideNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/divideNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,UAAU,CAErD;AA0BD,qBAAa,UAAW,YAAW,YAAY;IAC7C,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;gBAES,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa;IAQ/D,YAAY,IAAI,MAAM;IAGtB,kBAAkB;IAIlB,aAAa;;;;;;;;;IAQb,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IAYpC,cAAc,IAAI,MAAM,EAAE;IAI1B,KAAK,IAAI,MAAM;IAGf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMrC,QAAQ;IAGR,MAAM,CAAC,IAAI,EAAE,aAAa;CAO3B"}
|
|
@@ -4,6 +4,7 @@ exports.DivideNode = exports.isDivideNode = void 0;
|
|
|
4
4
|
// import { divide } from "mathjs";
|
|
5
5
|
const node_1 = require("../node");
|
|
6
6
|
const operatorNode_1 = require("./operatorNode");
|
|
7
|
+
const coinFlip_1 = require("../../../utils/coinFlip");
|
|
7
8
|
function isDivideNode(a) {
|
|
8
9
|
return (0, operatorNode_1.isOperatorNode)(a) && a.id === operatorNode_1.OperatorIds.divide;
|
|
9
10
|
}
|
|
@@ -43,6 +44,17 @@ class DivideNode {
|
|
|
43
44
|
toMathString() {
|
|
44
45
|
return `(${this.leftChild.toMathString()}) / (${this.rightChild.toMathString()})`;
|
|
45
46
|
}
|
|
47
|
+
dangerouslyShuffle() {
|
|
48
|
+
if ((0, coinFlip_1.coinFlip)())
|
|
49
|
+
[this.leftChild, this.rightChild] = [this.rightChild, this.leftChild];
|
|
50
|
+
}
|
|
51
|
+
toIdentifiers() {
|
|
52
|
+
return {
|
|
53
|
+
id: node_1.NodeIds.divide,
|
|
54
|
+
leftChild: this.leftChild.toIdentifiers(),
|
|
55
|
+
rightChild: this.rightChild.toIdentifiers(),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
46
58
|
toEquivalentNodes(opts) {
|
|
47
59
|
const res = [];
|
|
48
60
|
const rightNodes = this.rightChild.toEquivalentNodes();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { OperatorIds, OperatorNode } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isFractionNode(a: Node): a is FractionNode;
|
|
@@ -15,6 +15,15 @@ export declare class FractionNode implements OperatorNode {
|
|
|
15
15
|
isNumeric: boolean;
|
|
16
16
|
constructor(leftChild: AlgebraicNode, rightChild: AlgebraicNode, opts?: NodeOptions);
|
|
17
17
|
toMathString(): string;
|
|
18
|
+
toIdentifiers(): {
|
|
19
|
+
id: NodeIds;
|
|
20
|
+
leftChild: {
|
|
21
|
+
id: NodeIds;
|
|
22
|
+
} & Record<string, any>;
|
|
23
|
+
rightChild: {
|
|
24
|
+
id: NodeIds;
|
|
25
|
+
} & Record<string, any>;
|
|
26
|
+
};
|
|
18
27
|
toInversed(): FractionNode;
|
|
19
28
|
toEquivalentNodes(opts?: NodeOptions): AlgebraicNode[];
|
|
20
29
|
toAllValidTexs(opts?: NodeOptions): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fractionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/fractionNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"fractionNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/fractionNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAK3E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAKlE,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AACD,qBAAa,YAAa,YAAW,YAAY;IAC/C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB;;;OAGG;IACH,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IAUpB,YAAY,IAAI,MAAM;IAItB,aAAa;;;;;;;;;IAQb,UAAU;IAGV,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW;IA2BpC,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAI5C,KAAK,IAAI,MAAM;IAaf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAMrC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IAgJ/C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAOrC"}
|
|
@@ -27,6 +27,13 @@ class FractionNode {
|
|
|
27
27
|
toMathString() {
|
|
28
28
|
return `(${this.leftChild.toMathString()}) / (${this.rightChild.toMathString()})`;
|
|
29
29
|
}
|
|
30
|
+
toIdentifiers() {
|
|
31
|
+
return {
|
|
32
|
+
id: node_1.NodeIds.fraction,
|
|
33
|
+
leftChild: this.leftChild.toIdentifiers(),
|
|
34
|
+
rightChild: this.rightChild.toIdentifiers(),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
30
37
|
toInversed() {
|
|
31
38
|
return new FractionNode(this.rightChild, this.leftChild);
|
|
32
39
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType, ToTexOptions } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType, ToTexOptions } from "../node";
|
|
2
2
|
import { OperatorIds, OperatorNode } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isLimitNode(a: Node): a is LimitNode;
|
|
@@ -20,6 +20,16 @@ export declare class LimitNode implements OperatorNode {
|
|
|
20
20
|
constructor(leftChild: AlgebraicNode, rightChild: AlgebraicNode, from?: "+" | "-", opts?: NodeOptions);
|
|
21
21
|
toMathString(): string;
|
|
22
22
|
toEquivalentNodes(opts?: NodeOptions | undefined): this[];
|
|
23
|
+
toIdentifiers(): {
|
|
24
|
+
id: NodeIds;
|
|
25
|
+
leftChild: {
|
|
26
|
+
id: NodeIds;
|
|
27
|
+
} & Record<string, any>;
|
|
28
|
+
rightChild: {
|
|
29
|
+
id: NodeIds;
|
|
30
|
+
} & Record<string, any>;
|
|
31
|
+
from: "-" | "+" | undefined;
|
|
32
|
+
};
|
|
23
33
|
toAllValidTexs(): string[];
|
|
24
34
|
toTex(opts?: ToTexOptions): string;
|
|
25
35
|
evaluate(vars: Record<string, number>): number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limitNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/limitNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"limitNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/limitNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAG3E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAElE,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,SAAS,CAEnD;AAED,qBAAa,SAAU,YAAW,YAAY;IAC5C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,EAAE,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC;IAE5B;;;;;;OAMG;gBAED,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,GAAG,GAAG,GAAG,EAChB,IAAI,CAAC,EAAE,WAAW;IAWpB,YAAY,IAAI,MAAM;IAItB,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,SAAS;IAGhD,aAAa;;;;;;;;;;IAQb,cAAc,IAAI,MAAM,EAAE;IAI1B,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM;IAWlC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM;IAI9C,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IAG/C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAOrC"}
|
|
@@ -31,6 +31,14 @@ class LimitNode {
|
|
|
31
31
|
toEquivalentNodes(opts) {
|
|
32
32
|
return [this];
|
|
33
33
|
}
|
|
34
|
+
toIdentifiers() {
|
|
35
|
+
return {
|
|
36
|
+
id: node_1.NodeIds.limit,
|
|
37
|
+
leftChild: this.leftChild.toIdentifiers(),
|
|
38
|
+
rightChild: this.rightChild.toIdentifiers(),
|
|
39
|
+
from: this.from,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
34
42
|
toAllValidTexs() {
|
|
35
43
|
return this.toEquivalentNodes().map((node) => node.toTex());
|
|
36
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType, ToTexOptions } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType, ToTexOptions } from "../node";
|
|
2
2
|
import { CommutativeOperatorNode, OperatorIds } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isMultiplyNode(a: Node): a is MultiplyNode;
|
|
@@ -17,6 +17,15 @@ export declare class MultiplyNode implements CommutativeOperatorNode {
|
|
|
17
17
|
toAllTexs(): string[];
|
|
18
18
|
toEquivalentNodes(opts?: NodeOptions): MultiplyNode[];
|
|
19
19
|
toAllValidTexs(opts?: NodeOptions): string[];
|
|
20
|
+
toIdentifiers(): {
|
|
21
|
+
id: NodeIds;
|
|
22
|
+
leftChild: {
|
|
23
|
+
id: NodeIds;
|
|
24
|
+
} & Record<string, any>;
|
|
25
|
+
rightChild: {
|
|
26
|
+
id: NodeIds;
|
|
27
|
+
} & Record<string, any>;
|
|
28
|
+
};
|
|
20
29
|
evaluate(vars: Record<string, number>): number;
|
|
21
30
|
copy(): MultiplyNode;
|
|
22
31
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multiplyNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/multiplyNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"multiplyNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/multiplyNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EACL,uBAAuB,EACvB,WAAW,EAEZ,MAAM,gBAAgB,CAAC;AAYxB,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAOlE,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,YAAY,CAEzD;AAED,eAAO,MAAM,iBAAiB,QAAS,aAAa,EAAE,SAWrD,CAAC;AACF,qBAAa,YAAa,YAAW,uBAAuB;IAC1D,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IAUpB,OAAO,aAGL;IAEF,YAAY,IAAI,MAAM;IAItB,KAAK,CAAC,IAAI,CAAC,EAAE,YAAY,GAAG,MAAM;IA4DlC,SAAS;IAkDT,iBAAiB,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,YAAY,EAAE;IAwFrD,cAAc,CAAC,IAAI,CAAC,EAAE,WAAW,GAAG,MAAM,EAAE;IAG5C,aAAa;;;;;;;;;IAYb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIrC,IAAI;IAGJ,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IA0H/C,MAAM,CAAC,IAAI,EAAE,aAAa;CAU3B"}
|
|
@@ -202,6 +202,13 @@ class MultiplyNode {
|
|
|
202
202
|
toAllValidTexs(opts) {
|
|
203
203
|
return this.toEquivalentNodes(opts).flatMap((node) => node.toAllTexs());
|
|
204
204
|
}
|
|
205
|
+
toIdentifiers() {
|
|
206
|
+
return {
|
|
207
|
+
id: node_1.NodeIds.multiply,
|
|
208
|
+
leftChild: this.leftChild.toIdentifiers(),
|
|
209
|
+
rightChild: this.rightChild.toIdentifiers(),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
205
212
|
// toMathjs() {
|
|
206
213
|
// return multiply(this.leftChild.toMathjs(), this.rightChild.toMathjs());
|
|
207
214
|
// }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeOptions, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeOptions, NodeType } from "../node";
|
|
2
2
|
import { OperatorIds, OperatorNode } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isPowerNode(a: Node): a is PowerNode;
|
|
@@ -11,6 +11,15 @@ export declare class PowerNode implements OperatorNode {
|
|
|
11
11
|
isNumeric: boolean;
|
|
12
12
|
constructor(leftChild: AlgebraicNode, rightChild: AlgebraicNode, opts?: NodeOptions);
|
|
13
13
|
toMathString(): string;
|
|
14
|
+
toIdentifiers(): {
|
|
15
|
+
id: NodeIds;
|
|
16
|
+
left: {
|
|
17
|
+
id: NodeIds;
|
|
18
|
+
} & Record<string, any>;
|
|
19
|
+
right: {
|
|
20
|
+
id: NodeIds;
|
|
21
|
+
} & Record<string, any>;
|
|
22
|
+
};
|
|
14
23
|
toEquivalentNodes(): AlgebraicNode[];
|
|
15
24
|
toAllValidTexs(): string[];
|
|
16
25
|
toTex(): string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powerNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/powerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"powerNode.d.ts","sourceRoot":"","sources":["../../../../src/tree/nodes/operators/powerNode.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;AAG3E,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAElE,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,GAAG,CAAC,IAAI,SAAS,CAEnD;AAED,qBAAa,SAAU,YAAW,YAAY;IAC5C,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,EAAE,EAAE,WAAW,CAAC;IAChB,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,aAAa,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;gBAEjB,SAAS,EAAE,aAAa,EACxB,UAAU,EAAE,aAAa,EACzB,IAAI,CAAC,EAAE,WAAW;IAUpB,YAAY,IAAI,MAAM;IAGtB,aAAa;;;;;;;;;IAOb,iBAAiB;IAqBjB,cAAc,IAAI,MAAM,EAAE;IAI1B,KAAK,IAAI,MAAM;IAuBf,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IA+FrC,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,aAAa;IAqC/C,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;CAOrC;AAED,qBAAa,UAAW,SAAQ,SAAS;gBAC3B,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,WAAW;CAGrD"}
|
|
@@ -22,6 +22,13 @@ class PowerNode {
|
|
|
22
22
|
toMathString() {
|
|
23
23
|
return `(${this.leftChild.toMathString()})^(${this.rightChild.toMathString()})`;
|
|
24
24
|
}
|
|
25
|
+
toIdentifiers() {
|
|
26
|
+
return {
|
|
27
|
+
id: node_1.NodeIds.power,
|
|
28
|
+
left: this.leftChild.toIdentifiers(),
|
|
29
|
+
right: this.rightChild.toIdentifiers(),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
25
32
|
toEquivalentNodes() {
|
|
26
33
|
const res = [];
|
|
27
34
|
const rightNodes = this.rightChild.toEquivalentNodes();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Node, NodeType } from "../node";
|
|
1
|
+
import { Node, NodeIds, NodeType } from "../node";
|
|
2
2
|
import { OperatorIds, OperatorNode } from "./operatorNode";
|
|
3
3
|
import { AlgebraicNode, SimplifyOptions } from "../algebraicNode";
|
|
4
4
|
export declare function isSubstractNode(a: Node): a is SubstractNode;
|
|
@@ -10,8 +10,18 @@ export declare class SubstractNode implements OperatorNode {
|
|
|
10
10
|
isNumeric: boolean;
|
|
11
11
|
constructor(leftChild: AlgebraicNode, rightChild: AlgebraicNode);
|
|
12
12
|
toMathString(): string;
|
|
13
|
+
toIdentifiers(): {
|
|
14
|
+
id: NodeIds;
|
|
15
|
+
left: {
|
|
16
|
+
id: NodeIds;
|
|
17
|
+
} & Record<string, any>;
|
|
18
|
+
right: {
|
|
19
|
+
id: NodeIds;
|
|
20
|
+
} & Record<string, any>;
|
|
21
|
+
};
|
|
13
22
|
toEquivalentNodes(): AlgebraicNode[];
|
|
14
23
|
toAllValidTexs(): string[];
|
|
24
|
+
dangerouslyShuffle(): void;
|
|
15
25
|
toTex(): string;
|
|
16
26
|
evaluate(vars: Record<string, number>): number;
|
|
17
27
|
simplify(opts?: SimplifyOptions): AlgebraicNode;
|