Commit Graph

87 Commits

Author SHA1 Message Date
Léa Saviot
93832549f1 [poincare] childNeedsUserParentheses takes childIndex param
Scenario:
0+exp^0 i->b
0+exp b^0 i->b
Go to VariableBox/expression -> Parentheses were not properly added when
b was replaced
2019-09-20 10:20:48 +02:00
Léa Saviot
e09e36a57f [poincare] When replacing symbols, if it contains itsef return undef
Circularly defined functions/symbols are detected more quickly, which
prevents some tree pool exhaustions.
For instance, with f(t) = [[f(t)][f(2t)]]
2019-09-12 11:04:12 +02:00
Léa Saviot
dcb5a061e9 [apps/poincare] Clearer method names 2019-08-27 17:24:57 +02:00
Léa Saviot
faca423a82 [poincare/symbol_abstract] Remove unused method 2019-08-27 17:24:57 +02:00
Émilie Feral
6c203a545a [poincare] Fix Expression::isReal method with Matrix reducing 2019-08-14 09:38:28 +02:00
Émilie Feral
5900dcae0e [poincare] Clean the use of System parentheses from normal parentheses:
System parentheses are used when serializing a tree to keep the
structure information in the serialization. For example, we serialize
 2+1
----- to [2+3]/3
  3

User parentheses can be added after parsing or when beautifying a
reduced expression to make a mathematically correct expression or more
conventionnal expression. For example, parsing "1+-2" will give
Addition(One, Opposite(2)) that we will transform into Addition(One,
Parenthesis(Opposite(2))) (1+-2 --> 1+(-2)).
2019-08-08 17:22:02 +02:00
Léa Saviot
956cfc2bc4 [poincare] Expression:replaceWithUndefinedInPlace 2019-08-08 16:29:37 +02:00
Léa Saviot
61cf762eef [poincare] Expression::ReductionContext 2019-08-08 16:29:37 +02:00
Léa Saviot
de2d9f7c57 [poincare] SerializationHelper::Map -> Expression::mapOnMatrixChild 2019-08-08 16:24:51 +02:00
Léa Saviot
3554f441c1 [poincare] Remove symbolic computation 2019-04-12 15:16:53 +02:00
Léa Saviot
82d5ff7799 [ion/unicode] Clean special code points 2019-04-12 15:16:53 +02:00
Émilie Feral
8ca4094e13 [poincare] Un-inline Symbol and Function UntypedBuilder 2019-02-21 11:29:35 +01:00
Émilie Feral
d29885028b [poincare] Factorize Builders of SymbolAbstract classes 2019-02-21 11:29:35 +01:00
Émilie Feral
fad3ad958d [poincare] SymbolAbstract: the node alignment is handled by the TreePool
and the TreeNode classes. SymbolAbstract and its children class don't
need to watch the alignment.
2019-02-21 11:29:35 +01:00
Émilie Feral
7b5f3c570d [poincare] Change the way Expression are built 2019-02-21 11:29:35 +01:00
Émilie Feral
ac6f23684d [poincare] Clean Expression and Layout builders
Before: Opposite(Opposite(Rational(1))) misleadingly created the
expression "-1"; now, Opposite::Builder(Opposite::Builder(Rational(1)))
creates "--1"
2019-02-21 11:29:35 +01:00
Émilie Feral
4841542750 [poincare] Add ComplexFormat argument to the approximation routine 2019-01-10 11:42:05 +01:00
Émilie Feral
ecf3f2ea0f [poincare] Create a a flag on Expression that is set when the
approximation encouters a complex value

All approximation methods take the complex format into account.
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
1f247b731d [poincare] Discard useless parameters of sign and isReal methods 2019-01-10 11:42:04 +01:00
Émilie Feral
8a00aa16cc [poincare] Clean: remove complexCartesian and complexPolar methods 2019-01-10 11:42:03 +01:00
Émilie Feral
cbef3dadb9 [poincare] Implement real and shallowReduce of ComplexCartesian on nodes: conjugate, function, symbol 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
d95585956c [poincare] Implement Expression::realPart, Expression::imaginaryPart,
Expression::complexNorm, Expression::complexArgument
2019-01-10 11:42:03 +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
cf92eb8506 [poincare] Discard useless argument 'replaceSymbols' from simplification
routine
2018-11-30 09:53:31 +01:00
Émilie Feral
19b3a8a479 [poincare] Factorize 'expand' and 'matches' methods between Symbol and
Function
2018-11-23 12:04:08 +01:00
Émilie Feral
c01d66c77b [poincare] Change name: replaceReplaceableSymbols -->
shallowReplaceReplaceableSymbols
2018-11-23 12:04:08 +01:00
Émilie Feral
e80512f362 [poincare] Context::expressionForSymbol takes a boolean notifying that
we want a copy or not
2018-11-23 12:04:08 +01:00
Émilie Feral
ac6f7346e0 [poincare] Fix Function: expand and replace child before getting
properties
2018-11-23 12:04:08 +01:00
Émilie Feral
a6ad7484a0 [poincare] FunctionNode: pay attention to parent context with UnknownX value to
avoid overriding it.

For example, when evaluating the expression 'f(x)' in a context where x =
2 and f: x-->x^2.
2018-11-23 12:04:08 +01:00
Émilie Feral
e042279471 [poincare] Function: fix replaceReplaceableSymbols 2018-11-23 12:04:08 +01:00
Léa Saviot
17eaadb280 [poincare] Replace functions when replacing symbols iteratively 2018-11-23 12:04:06 +01:00
Léa Saviot
58c995d63c [poincare] Symbol replacements limit for functions 2018-11-23 12:04:06 +01:00
Léa Saviot
667d373806 [poincare] Use deepreduce instead of reduce 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
7b2abfe591 Fix typo 2018-11-23 12:04:05 +01:00
Ruben Dashyan
4b72e4cef2 [poincare] Function constructor has additional length paramater 2018-11-23 12:04:05 +01:00
Émilie Feral
138e955cfd [poincare] Factorize Symbol and Function code in SymbolAbstract 2018-11-23 12:04:04 +01:00
Léa Saviot
7579294d9d [poincare] Fix Function (keep value after replaceSymbolWithExpression) 2018-11-23 12:04:03 +01:00
Léa Saviot
f3c4abe1c2 [apps/poincare] Use char constructor of Symbol instead of string 2018-11-23 12:04:01 +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
23f62b8dbe [poincare] Factorize approximate<T> in Function 2018-11-23 12:04:00 +01:00
Léa Saviot
6197ebd4c5 [poincare] SymbolAbstract is parent of Symbol and Function 2018-11-23 12:04:00 +01:00
Léa Saviot
aebeeda171 [poincare] Fix Function::size() 2018-11-23 12:04:00 +01:00
Léa Saviot
9cbca3c277 [poincare] Implement Function::shallowReduce 2018-11-23 12:03:59 +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
45df061dbf [poincare] Store::shallowReduce replaces unknown with UnknownX 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