Commit Graph

1745 Commits

Author SHA1 Message Date
Émilie Feral
5fa50ec79d [poincare] Unit::BuildTimeSplit can split negative time 2020-06-04 14:50:03 +02:00
Émilie Feral
73a598e023 [poincare] Unit: enable to tune both the prefix and the Representant or
just the prefix on a given Unit
2020-06-04 14:50:03 +02:00
Émilie Feral
ec95ed0789 [poincare] Add Unit::ElectronVolt builder 2020-06-04 14:50:03 +02:00
Émilie Feral
53db27ffeb [poincare] Discard UnitConversion::Classic mode. This will be done in
Calculation app
2020-06-04 14:50:03 +02:00
Émilie Feral
7b28f760b7 [poincare] Float: float can be layouted 2020-06-04 14:50:03 +02:00
Émilie Feral
845a118073 [poincare] Add Unit::BuildTimeSplit and helpers for time units 2020-06-04 14:50:02 +02:00
Émilie Feral
94c5941fb5 [poincare] Unit: improve ChooseBestMultipleForValue 2020-06-04 14:50:02 +02:00
Émilie Feral
4d7b9aa2a9 [poincare] Add watthour representation to classic unit conversion 2020-06-04 14:50:02 +02:00
Émilie Feral
cc114900fa [poincare] Add Liter representation to classic unit conversion 2020-06-04 14:50:02 +02:00
Émilie Feral
e2dc79c2d5 [poincare] Partially implement simplification for UnitConversion::Classic 2020-06-04 14:50:02 +02:00
Émilie Feral
ae71c23147 [poincare] Override method Unit::node to return UnitNode 2020-06-04 14:50:01 +02:00
Émilie Feral
3308b13b9c [poincare] UnitConvert:
- do the smart part at beautification to avoid
requiring an escape case just for UnitConvert
- Use UnitConvert::None
2020-06-04 14:50:01 +02:00
Émilie Feral
3f34e5e644 [poincare] Enable to choose the "UnitConversion" mode at simplification
between: only SI, none, default...
2020-06-04 14:50:01 +02:00
Émilie Feral
d805c59202 [poincare] Fix extractUnit into removeUnit paradigm 2020-06-04 14:50:01 +02:00
Ruben Dashyan
f227cd719f [poincare/multiplication] Use extractUnits instead of splitIntoNormalForm in shallowBeautify 2020-06-04 14:50:01 +02:00
Ruben Dashyan
01b94f8543 [poincare/unit] Units homogeneity is already handled in each Expression subclass
specifically if needed or generically in defaultHandleUnitsInChildren
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
965e3b1d9a [poincare/n_ary_expression] Factor mergeMultiplicationChildrenInPlace
from Multiplication to NAryExpression so as to use it in Addition
2020-06-04 14:50:01 +02:00
Ruben Dashyan
2fea3c9b3a [poincare/addition] Addition has no Unit 2020-06-04 14:50:01 +02:00
Ruben Dashyan
121e16a6a5 [poincare/absolute_value] AbsoluteValue has no Unit
shallowReduce returns Undefined if its unique child has a Unit
2020-06-04 14:50:01 +02:00
Ruben Dashyan
e018c9ddc8 [poincare/trigonometry_cheat_table] Reorder parameter names correctly 2020-06-04 14:50:01 +02:00
Ruben Dashyan
8e71e03b6e [poincare] Remove ostream and iostream header inclusions and keep them precisely where needed 2020-06-04 14:50:01 +02:00
Ruben Dashyan
b05202f2ec [poincare] Remove stdio.h inclusions 2020-06-04 14:50:01 +02:00
Ruben Dashyan
394e86a28a [poincare] Unit::Dimension holds a Vector
The Vector does not need to be recomputed from a Representative's
definition, which requires parsing and time-consuming reduction.
2020-06-04 14:50:00 +02:00
Ruben Dashyan
67241bb564 [poincare] Make code more object oriented
Turn ExponentsOfBaseUnits function into a static method of the
Unit::Dimension::Vector class
2020-06-04 14:50:00 +02:00
Ruben Dashyan
b6d07cbd90 [poincare] Make code more object oriented
Turn ExponentsOfBaseUnits function into a method of the
Unit::Dimension::Vector class
2020-06-04 14:50:00 +02:00
Ruben Dashyan
e2cdf78605 [poincare] Define and use Unit::Dimension::Vector::Metrics 2020-06-04 14:50:00 +02:00
Ruben Dashyan
0eb6df27dc [poincare] Turn Unit::Dimension::Vector type into a struct 2020-06-04 14:50:00 +02:00
Ruben Dashyan
202beb3b13 [poincare/unit] Add comment about namespace and scope usage 2020-06-04 14:50:00 +02:00
Ruben Dashyan
2fa71e4350 [poincare] Define and use Unit::NumberOfBaseUnits instead of magic number 2020-06-04 14:50:00 +02:00
Ruben Dashyan
be2892eae5 [poincare] Define Unit::Dimension::Vector type 2020-06-04 14:50:00 +02:00
Léa Saviot
bbb8308a6d [poincare/normal_distribution] More values are computed
We limited the precision too much before.
2020-05-06 01:01:58 -07:00
Léa Saviot
9988447b9a [poincare] Expression::isIdenticalToWithoutParentheses 2020-04-15 09:16:32 -04:00
Romain Goyet
807dd73e7b [poincare] Use a Tuple instead of an ArrayBuilder for expression
The Tuple is simply an initializer_list along with a convenience method
to cast between a list of TreeHandle and a list of Expression
2020-04-10 13:35:14 -04:00
Neven Sajko
c92b770112 Performance fixes relating to floating point constants
This replaces unnecessary double-precision soft-float operations with
single-precision floating-point operations, mainly by casting.

In a couple places I also replace a function call with a constant.
2020-04-09 13:58:56 +02:00
Émilie Feral
82c4936e04 Coding style: remove unecessary 'virtual' keyword when 'override' is
present 1/2
2020-04-09 11:36:51 +02:00
Jean-Baptiste Boric
2f61b823d0 [poincare] Remove statically-allocated buffers 2020-04-08 10:09:47 +02:00
Romain Goyet
35d446353f [escher] Avoid long switches on Left/Up/Right/Down 2020-04-08 09:56:33 +02:00
Léa Saviot
620ef3f570 [poincare] Use SymbolAbstract::hasSameNameAs 2020-03-31 13:42:42 +02: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
Émilie Feral
f84b3dc5c1 [poincare] Power approximation: avoid approximating a power to 0 when
one of the real/imaginary part was not null
2020-03-24 16:22:43 +01:00
Émilie Feral
d222d13156 [poincare] CHange name PowerNode::tryComputeRealRootOfRationalPow -->
PowerNode::computeNotPrincipalRealRootOfRationalPow
2020-03-16 11:36:37 +01:00
Léa Saviot
576d1dcd6b [poincare/power] Rename and comment computeRealRootOfRationalPow 2020-03-12 14:41:50 +01:00
Émilie Feral
a2e9d8efd6 [poincare] Improve trigonometry functions and power functions
approximations. We neglect the real or imaginary parts when it is
neglectable compared to the input.
2020-03-12 14:41:50 +01:00
Émilie Feral
12a5f5499c [poincare] Handle real root finding in Power and NthRoot in order to
remove beautifying x^(p/q) -> root(x,q)^p. This triggered precision
loss!
2020-03-12 14:41:50 +01:00
Émilie Feral
515405a5df [poincare] In Power::approximation and SquareRoot::approximation, the
real (or imaginary) part negligence should depend on the argument value
relatively to some other values (norms of the parameters) and not of its
value absolutely!
2020-03-12 14:41:50 +01:00
Ruben Dashyan
ed98218e7b [poincare/grid_layout] Explicit the making of a protected member as public 2020-03-10 10:33:30 +01:00
Ruben Dashyan
aa4a33d849 [poincare/layout_node] Remove unused method 2020-03-10 10:33:30 +01:00
Léa Saviot
1dc6e77049 [poincare/matrix] Forbid nested matrices
Scenario: in calculation,
1/matrix(matrix(matrix(matrix(... matrix(1) ... )))) gave kind of a
weird result. These kind of computations also broke the fuzzer.
2020-03-04 16:21:25 +01:00
redgl0w
dfe51df321 Updated the month definition 2020-03-04 10:08:44 +01:00