Émilie Feral
cbbb827532
[poincare] Clean recursive tests on expression (isApproximate, IsRandom,
...
IsMatrix etc)
2019-05-03 15:54:22 +02:00
Émilie Feral
7f373a5c3c
[calculation] Calculations involving matrices display only approximate
...
results and should not toggle the exact output.
2019-05-03 15:54:22 +02:00
Léa Saviot
204b9fe5cb
[poincare] Poincare::IsMatrix returns true for MatrixIdentity
2019-05-03 15:54:22 +02:00
Léa Saviot
267d27f114
[poincare] Remove symbolic computation
2019-05-03 15:53:21 +02:00
Émilie Feral
be76784bb4
[sequence] Add Poincare::Symbol::SpecialSymbols::UnknownN used in
...
Sequence
2019-05-03 15:53:20 +02:00
Léa Saviot
210ec62cab
[poincare] Do not simplify random nor randint
...
For instance, random()+random() is simplified into random()+random(),
not 2*random()
2019-05-03 15:53:20 +02:00
Léa Saviot
9e06b23bbb
[escher/ion] Standard methods in UTF8Helper used in text_area
...
String manipulations need to be done using an UTF8 decoder, but some
manipulations can be optimized if the code points we manipulate are only
one char long. These optimizations are done inside UTF8Helper methods.
2019-05-03 15:53:19 +02:00
Léa Saviot
bbb10f1993
[ion/kandinsky] Move unicode to ion
2019-05-03 15:53:19 +02:00
Léa Saviot
41afa92f10
[unicode] Use the UTF8Decoder to scan const char *
2019-05-03 15:53:19 +02:00
Léa Saviot
65e5adafac
Remove Ion::Charset
2019-05-03 15:53:19 +02:00
Émilie Feral
d26c98e9d5
[poincare] Fix comments
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
4f3bd12fea
[poincare] Fix bug: undef*x--> undef
2019-02-05 16:42:24 +01:00
Léa Saviot
0bf3e678d9
[poincare] Add tests and asserts about sign, such as sign(0)==0
2019-01-21 11:22:55 +01:00
Émilie Feral
f6026254be
[poincare] Add an argument ReductionTarget to shallowBeautify
2019-01-10 11:42:05 +01:00
Émilie Feral
1251821d3e
[poincare] Change name: ReductionTarget::TopDownComputation -->
...
ReductionTarget::System
2019-01-10 11:42:05 +01:00
Émilie Feral
4841542750
[poincare] Add ComplexFormat argument to the approximation routine
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
Léa Saviot
8a2bdb4c42
[poincare] When reducing store, handle non reductible left side
2019-01-10 11:42:04 +01:00
Émilie Feral
83bb2f1221
[poincare] Fix Expression::CreateComplexExpression: should not check the sApproximationEncounteredComplex here as this method is also used int the reduction routine
2019-01-10 11:42:04 +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
fe8825df35
[shared] PoincareHelpers: update the complexFormat (force it to
...
Cartesian with complex input).
2019-01-10 11:42:04 +01:00
Émilie Feral
3fd737ab72
[poincare] Change name: sApproximationEncounterComplex -->
...
sApproximationEncounteredComplex
2019-01-10 11:42:04 +01:00
Émilie Feral
2268817738
[poincare] The reduction routine is unterrupted if one of the expression
...
leaves is unreal or undefined. If any leaf is unreal the result is
unreal (unreal > undefined)
2019-01-10 11:42:04 +01:00
Émilie Feral
2052ee43ae
[apps][poincare] An expression is undefined if it is of type 'unreal' or
...
'undefined'
2019-01-10 11:42:04 +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
3de8901c22
[poincare] Use reduce instead of setting the
...
sSimplificationHasBeenInterrupted flag and deepReducing
2019-01-10 11:42:04 +01:00
Émilie Feral
8bc1a7be05
[poincare] Preferences: add a ComplexFormat::Real
2019-01-10 11:42:04 +01:00
Émilie Feral
f00f639bed
[poincare] Interrupt simplification of when too many nodes where
...
generated while bubbling up ComplexCartesian. Retry with another
ReductionTarget
2019-01-10 11:42:03 +01:00
Émilie Feral
e4b59ddf69
[poincare] Fix Expression::simplifyAndApproximate to display polar form
...
of negative real expression. -5 --> 5*e^(i*Pi)
2019-01-10 11:42:03 +01:00
Émilie Feral
c6039423a9
[poincare] When simplifying an expression, also compute the approximation from the reduced
...
expression to avoid loss of precision.
If an expression is reduced to a ComplexCartesian(a, b), we compute the
approximation from ComplexCartesian(a,b) instead of going through the
potentially complicated expression resulting from beautifying
(sqrt(a^2+b^2)*exp(i*(arctan(b/a) -Pi/2*sign(b)) for example)
2019-01-10 11:42:03 +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
383ac004cf
[poincare] Take into account complex format in simplify
2019-01-10 11:42:03 +01:00
Émilie Feral
4b45d40bf8
[poincare] Fix Expression::degreeToRadian
2019-01-10 11:42:03 +01:00
Émilie Feral
a6ac075442
[poincare] Fix Expression::CreateComplexExpression
2019-01-10 11:42:03 +01:00
Émilie Feral
3292bdfd44
[poincare] Sketch of complex reduction as part of the reduce routine
2019-01-10 11:42:03 +01:00
Émilie Feral
f714699575
[poincare] Clean Expression::CreateComplexExpression
2019-01-10 11:42:03 +01:00
Émilie Feral
9efc9e02e6
[poincare] Revert simplifyForComplexFormat
2019-01-10 11:42:03 +01:00
Émilie Feral
2e89f8b7de
[poincare] Expression::simplifyForComplexFormat: Use a shortcut if the expression approximation is a real pure
2019-01-10 11:42:03 +01:00
Émilie Feral
7d9c49919c
[poincare] simplifyForComplexFormat: before extracting
...
ComplexCartesian/ComplexPolar, deepReduce instead of simplify to avoid
generating uselessly big trees. To make it work, implement shortcuts for
Power::complexCartesian and Power::complexPolar to return nice cartesian
expression when the power index is -1, 1/2 or -1/2
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
2f8ede54f2
[poincare] The sign function was used to decide wether an expression was
...
of form -x. However, ln(0.3) has a negative sign but is not of form -x.
This commit fixes the misuse of ExpressionNode::Sign::negative.
For example, we do not turn sin(tan(9)) in -sin(-tan(9)) or
arcsin(sin(12)) in -arcsin(-sin(12) because tan(9)<0 and sin(12)<0
2019-01-10 11:42:03 +01:00
Émilie Feral
9e2b709fcb
[poincare] Change sign() signature to sign(context, angleUnit)
2019-01-10 11:42:03 +01:00
Émilie Feral
a13246fca1
[poincare] simplifyForComplexFormat: simplify instead of reducing before extracting
...
real and imaginary parts
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
56c8e8b704
[poincare] Expression: create method ParseAndSimplifyForComplexFormat
2019-01-10 11:42:03 +01:00