Commit Graph

84 Commits

Author SHA1 Message Date
Gabriel Ozouf
0ed0cc56e9 [poincare] Remove characteristicXHalfRange
Method characteristicXHalfRange was used to compute the range on which
to display cartesian function in Graph. With the new zoom algorithm,
this method is deprecated.

Change-Id: Ic681fab8d58d0f5628a94302a7b49dacaaa1a6a3
2020-11-04 15:30:53 +01:00
Gabriel Ozouf
a9c94236c2 [poincare] Implemented further derivation methods and updated tests.
Derivation now works on tangents and the three hyperbolic functions.

Change-Id: I62049e79c661c3c4a031be0a93c403fb936d611b
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
5cf85368ea [poincare] Added framework to derivate unary functions, and implemented it for Sine
Added a method unaryFunctionDifferential to ExpressionNode and Expression, to be implemented by subclasses representing unary functions.
Added a function derivateUnaryFunction to Derivative, to factor (f°g)' -> g' * f'°g.

Change-Id: Id1780f1082ccd001f1282fe4ddfff2b7055d3a27
2020-11-04 14:45:34 +01:00
Gabriel Ozouf
051e608835 [poincare] Added method didDerivate to Expression and ExpressionNode
This method is to be implemented by derivable expression subclasses, for use in Derivative::shallowReduce. It performs the calculation for the derivative, and returns whether calculations happened.

Change-Id: I13cdb131e2044578392f5178a9f389314c1c4c8a
2020-11-04 14:45:34 +01:00
Émilie Feral
d805c59202 [poincare] Fix extractUnit into removeUnit paradigm 2020-06-04 14:50:01 +02:00
Ruben Dashyan
bf9653d510 [poincare/expression] Turn getUnit into extractUnits
Addition::shallowReduce factors the unit across its terms.
Previously expressions of the form 1_m+π_m were reduced to undef.
2020-06-04 14:50:01 +02:00
Ruben Dashyan
0c4434d088 [poincare/expression] getUnit returns an uninitialized Expression
when there is no Unit instead of Undefined
2020-06-04 14:50:01 +02:00
Léa Saviot
9988447b9a [poincare] Expression::isIdenticalToWithoutParentheses 2020-04-15 09:16:32 -04:00
Léa Saviot
94fb5815f9 [poincare] Fix replaceReplaceableSymbols for parametered expressions
Scenario: ans*int(0,x,0,0)->x then cos(x) crashed because replaceReplaceableSymbols
would not care if it was replacing parameters in a parametered
expression
2020-03-31 13:42:42 +02:00
Léa Saviot
d5b07f1f90 [poincare] Implemment getUnit 2020-02-12 15:13:25 +01:00
Émilie Feral
3df80ed780 [poincare] ParameteredExpression: overrides getVariables to avoid
considering parameter as a variable
2020-02-12 15:13:25 +01:00
Léa Saviot
424ee9fa15 [poincare] Add SymbolicComputation parameter to the reduction context
This way, in solver, we can reduce expression without expanding symbols
2020-02-12 15:13:24 +01:00
Léa Saviot
0e64e89496 [apps/solver] Do not use symbol context if no solution found
Still replace the functions
2020-02-12 15:13:23 +01:00
Ruben Dashyan
dd80be026d [poincare] Rename shallowReplaceReplaceableSymbols to deep... 2020-02-12 15:13:15 +01:00
Ruben Dashyan
47ed5814a2 [poincare] Remove hasReplaceableSymbols 2020-02-12 15:13:15 +01:00
Émilie Feral
11b8ed72a1 [poincare] Do not infer ReductionTarget but give it as parameter of
denominator, addMissingFactors, factorizeSineAndCosine
2019-11-21 09:47:16 +01:00
Ruben Dashyan
77860aeee9 [poincare] Remove replaceUnknown
Unused anymore
2019-09-27 17:57:29 +02:00
Ruben Dashyan
d506bb4442 [poincare] Remove Expression::defaultReplaceUnknown
and substitute defaultReplaceSymbolWithExpression instead
2019-09-27 17:57:29 +02:00
Léa Saviot
61cf762eef [poincare] Expression::ReductionContext 2019-08-08 16:29:37 +02:00
Léa Saviot
3554f441c1 [poincare] Remove symbolic computation 2019-04-12 15:16:53 +02:00
Émilie Feral
653bdd6cdb [sequence] Add Poincare::Symbol::SpecialSymbols::UnknownN used in
Sequence
2019-04-12 15:16:52 +02:00
Émilie Feral
f6026254be [poincare] Add an argument ReductionTarget to shallowBeautify 2019-01-10 11:42:05 +01:00
Léa Saviot
e5f0959239 [poincare] Static Expression methods start with uppercase 2019-01-10 11:42:05 +01:00
Émilie Feral
ad8f0a73d9 [poincare] Fix Addition::shallowBeautify
B+A should be beautified in A+B
1+x should be beautified in x+1
2019-01-10 11:42:04 +01:00
Émilie Feral
26e2e9be0d [poincare] Add complex format as an argument of simplification 2019-01-10 11:42:04 +01:00
Émilie Feral
38de794642 [poincare] Change signature setSign(Context, AngleUnit, ReductionTarget) 2019-01-10 11:42:03 +01:00
Émilie Feral
8a00aa16cc [poincare] Clean: remove complexCartesian and complexPolar methods 2019-01-10 11:42:03 +01:00
Émilie Feral
c62922ec5c [poincare] Change complex getters design: extract real and imaginary
parts at the same time in complexCartesian and norm and arg in
complexPolar
2019-01-10 11:42:03 +01:00
Émilie Feral
91163ae6f5 [poincare] Improve complexSquareNorm thanks to sign 2019-01-10 11:42:03 +01:00
Émilie Feral
64aebcf16d [poincare] Implement shallowReduce of ComplexArgument, AbsoluteValue,
RealPart and ImaginaryPart
2019-01-10 11:42:03 +01:00
Émilie Feral
be741415b0 [poincare] Fix comment 2019-01-10 11:42:03 +01:00
Émilie Feral
5dae60bc7e [poincare] Complex parts getters (realPart, imaginaryPart,
complexNorm...) simplify while building the complex part
2019-01-10 11:42:03 +01:00
Émilie Feral
fe6a5af47b [poincare] Change Expression::setSign signature 2019-01-10 11:42:03 +01:00
Émilie Feral
0c1e76c9c5 [poincare] Expression: add methods to get complex parts of expression 2019-01-10 11:42:02 +01:00
Léa Saviot
f6a5759a16 [poincare] Fix the replacement of unknowns in the storage
In the Graph app, define f(x) = cos(x) and g(x)=diff(f(x),x,x).
The graph and table are perfectly computed, but in the Calculation apps,
g(5) fails.
2018-12-19 09:40:37 +01:00
Émilie Feral
58eab04c5f [poincare] Expression: add an argument to reduce routine.
Reduction can be done for:
- the user
- a top-down computation
- a bottom-up computation
2018-11-30 09:53:31 +01:00
Émilie Feral
d126f6f9b2 [poincare] Get rid of Expression::reduceChildren which is very alike
deepReduceChildren
2018-11-30 09:53:31 +01:00
Émilie Feral
cf92eb8506 [poincare] Discard useless argument 'replaceSymbols' from simplification
routine
2018-11-30 09:53:31 +01:00
Léa Saviot
3273de4dac [poincare] Fix Expression::shallowReplaceReplaceableSymbols 2018-11-23 14:46:46 +01:00
Léa Saviot
d7d348deac [poincare] Fix ExpressionNode::shallowReplaceReplaceableSymbols 2018-11-23 12:04:10 +01:00
Émilie Feral
c01d66c77b [poincare] Change name: replaceReplaceableSymbols -->
shallowReplaceReplaceableSymbols
2018-11-23 12:04:08 +01:00
Léa Saviot
cb88dbc0a1 [poincare] Replacing iteratively only existing symbols 2018-11-23 12:04:06 +01:00
Léa Saviot
ada8f5f3c4 [poincare] Replace symbols with their expressions iteratively
... not recursively.
2018-11-23 12:04:06 +01:00
Léa Saviot
c7635c5e4d [poincare] Encapsulate deepReduce in reduce 2018-11-23 12:04:06 +01:00
Léa Saviot
af41c42a97 [poincare] Store symbol children are not replaced during reduction 2018-11-23 12:04:01 +01:00
Léa Saviot
907eedd4bc [poincare] Use SymbolAbstract in setExpressionForSymbol 2018-11-23 12:04:00 +01:00
Léa Saviot
3809ef222d [poincare] deep and shallow Reduce have a "replace symbol" bool param 2018-11-23 12:03:59 +01:00
Léa Saviot
a7a719df4a [poincare] Handle functions in replaceSymbolWithExp and similar methods 2018-11-23 12:03:59 +01:00
Léa Saviot
870cd926c1 [poincare] Fix getVariables argument type 2018-11-23 12:03:59 +01:00
Émilie Feral
8072520686 [poincare] Fix getLinearCoefficients, getVariables signature: the
variables table is a char * table
2018-11-23 12:03:58 +01:00