Commit Graph

87 Commits

Author SHA1 Message Date
Hugo Saint-Vignes
4a3f749cc6 [poincare] Add NullStatus for expressions
Change-Id: Ibaba72e3e3589ba259c7b22d402e2b27937f27c1
2020-11-04 15:58:34 +01:00
Hugo Saint-Vignes
98499f6c9f [poincare] Rename isRationalZero to isNumberZero
Change-Id: I554dd5e9b9ab3af4364ca23cde590f9e0a458ef8
2020-11-04 15:58:33 +01:00
Arthur Camouseigt
960335c330 [Sequences] Fixed a few crashes
Change-Id: Ib929bbae0f9ca06409706336ff799075e1288694
2020-11-04 15:32:59 +01:00
Arthur Camouseigt
913c81a0d3 [solver] Modified the way to solve some equations
The solutions of equations that need numerical approximations to be
solved are now computed base on the undeveloped equation (instead of
fully the expended one used to identify polynomials)

This allow (x-10)^7=0 to yield x=10 as result (9.95 before)
Change-Id: Ia8acbe57a9cfebf0b5016e9c896d21c8ddac7a64
2020-11-04 15:32:59 +01:00
Gabriel Ozouf
fad375c11c [poincare] Add unitFormat to ReductionContext
Change-Id: I1d3fcd2f47c973c041e1be84e9a902dd58de3562
2020-11-04 15:11:44 +01:00
Léa Saviot
cf4eaa3d1f [apps/poincare] Use symbolicComputation in recursivelyMatches
This fixes a failed assertion for the scenario:
[3]->x then, in the Equation app, solve x+1->0
2020-06-15 16:20:09 +02:00
Léa Saviot
213d3d322d [apps/solver] Fix symbol replacement in equation solving
If the symbol replacement led to an undefined reduce equation, we did
not realize we could try without replacing the symbol.
2020-06-08 17:11:59 +02:00
Léa Saviot
764cf1087a [apps/solver] Fix EquationStore::resolveLinearSystem
Scenario: solve a system with the maximum number of variables -> our
routine to compute the number of variables did not use
k_maxNumberOfVariables, so we ended up adding the same children to the
matrix Ab, which created ghosts, which made the deep reduction crash.
2020-03-31 12:05:38 +02:00
Émilie Feral
e17ae9024e [apps] Gather all code regarding exam mode in ExamModeCOnfiguration file 2020-02-12 15:13:26 +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
25ef10a0c5 [tests/solver] Add test on solver + user defined symbols 2020-02-12 15:13:24 +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
db0e7f0d8b [apps/solver] Display user variables in the solutions 2020-02-12 15:13:23 +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
Émilie Feral
551e4998f4 [apps/calculation][apps/solver][poincare] Simplify sign =/≈ computation
between outputs in Calculation/Solver
2020-02-12 15:13:23 +01:00
Émilie Feral
5491dee5ce [calculation][solver] Do not display exact solutions in Dutch exam mode 2019-12-19 15:52:45 +01:00
Émilie Feral
ccf848a9eb [poincare] Add test: do not expand multinome when reduction target is
System
2019-11-21 09:47:16 +01:00
Émilie Feral
503e07fe5a [apps/sequence] Fix SequenceStore: sequences are not memoized but all
kept in the store (because we need all of them to evaluate one
sequence). setMemoizedModelAtIndex now store u, v and w sequences in
this order to avoid requiring expiring pointers.
2019-08-13 09:44:00 +02:00
Émilie Feral
9fbec16db4 [poincare] Merge MultiplicationImplicit and MultiplicationExplicit (they
were required if we wanted to parse into two distincts expression 2π and
2*π but don't)
2019-08-08 17:22:05 +02:00
Émilie Feral
c1cd0302b8 [poincare] Fix typo: explicite --> explicit, implicite --> implicit 2019-08-08 17:22:04 +02:00
Émilie Feral
fd25b678ce [poincare] Split Multiplication into MultiplicationExplicite and
MultiplicationImplicite
2019-08-08 17:22:02 +02:00
Léa Saviot
61cf762eef [poincare] Expression::ReductionContext 2019-08-08 16:29:37 +02:00
Émilie Feral
d0665d8558 [shared] Clean class names containing storage 2019-04-12 15:16:52 +02:00
Émilie Feral
3c1e35ec04 [shared] Rename classes:
ExpressionModelHandle --> ExpressionModel
SingleExpressionModelHandle --> ExpressionModelHandle
StorageFunction --> Function
StorageCartesianFunction --> CartesianFunction
StorageFunctionApp --> FunctionApp
2019-04-12 15:16:52 +02:00
Émilie Feral
58f9a59d6e [ion] Move Storage extensions declaration in Storage class 2019-04-12 15:16:52 +02:00
Émilie Feral
a7192df59c [apps/shared] Split ExpressionModelHandle into ExpressionModelHandle and
SingleExpressionModelHandle (in perspective of Sequence model who will
be composed of 3 ExpressionModelHandle)
2019-04-12 15:16:52 +02:00
Émilie Feral
0f37ee25f7 [solver] Make EquationStore inherits from StorageExpressionModelStore 2019-04-12 15:16:52 +02:00
Léa Saviot
b6eb663f53 [ion/kandinsky] Move unicode to ion 2019-04-12 15:16:51 +02:00
Léa Saviot
63d7155376 Remove Ion::Charset 2019-04-12 15:16:50 +02: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
4ccf1f08a9 [solver] Delta discriminant is counted as a solution to clear the code 2019-01-10 11:42:05 +01:00
Léa Saviot
d6e7f78705 [apps/solver] Clean comments 2019-01-10 11:42:04 +01:00
Léa Saviot
014b481a9b [apps/solver] Fix iteration max index 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
64d6450728 [solver] Handle unreal equations and equations whose solutions are
unreal
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
05ef7008dc [solver] Fix bug: when the number of solutions is infinite, do not try
to find the solution layouts
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
aa80710f4d [solver] Take into account the complexFormat Real 2019-01-10 11:42:04 +01:00
Émilie Feral
42aad48ec4 [solver] Fix EquationStore::oneDimensialPolynomialSolve 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
383ac004cf [poincare] Take into account complex format in simplify 2019-01-10 11:42:03 +01:00
Léa Saviot
94603b2b7d [poincare] Layout::serialize is serializeForParsing or ParsedExpression
serializeForParsing serializes the layout once,
serializeParsedExpression serializes the layout, parses it and
serializes it again.
2018-11-23 12:04:09 +01:00
Léa Saviot
07d1aabb56 [apps/solver] Remove max variable name size redefinition 2018-11-23 12:04:07 +01:00
Ruben Dashyan
61b1b8a09d [poincare] Add Expression::FunctionHelper class
That class is meant to contain data about named functions (e.g. sin,
tan...) in one place: their name, their number of children and a pointer to
a builder. The derived class corresponding to each such function
contains a private instance (m_functionHelper) and a getter.
The previous parser is removed, along with unecessary
constructors (used by the previous parsers).
2018-11-23 12:04:05 +01:00
Émilie Feral
8770c9010a [poincare] Create Constant inheriting from SymbolAbstrac
pi, e and i are not symbols anymore but constant
2018-11-23 12:04:04 +01:00
Émilie Feral
d0d81c4eca [solver] Fix resolveLinearSystem (special case: no variable) 2018-11-23 12:04:04 +01:00
Émilie Feral
9197e8ffbf [solver] Clean EquationStore 2018-11-23 12:04:04 +01:00