Commit Graph

1406 Commits

Author SHA1 Message Date
Émilie Feral
d53d97c620 [poincare] Integer: avoid copy when possible, work with Reference 2018-08-17 11:47:21 +02:00
Émilie Feral
719dbf4f2e [poincare] Add Rational tests 2018-08-17 11:15:21 +02:00
Émilie Feral
4d870f33de [poincare] Fix Rational constructors 2018-08-17 11:15:21 +02:00
Léa Saviot
c627b5067a [poincare] Fix Ghost, AllocationF an Uninitilized nodes staticNode methods 2018-08-17 10:46:05 +02:00
Émilie Feral
466dafa2fa [poincare] Forbid unitiliazed Number (protect the method). Create a
Static Integer 0 to optimize the pool
2018-08-17 10:36:55 +02:00
Émilie Feral
df2019061a [poincare] Increase TreePool 2018-08-16 16:46:36 +02:00
Émilie Feral
7375783703 [poincare] Fix digit(0) of Integer(0) 2018-08-16 16:46:36 +02:00
Émilie Feral
48094850a0 [poincare] Digits are a token of the lexer instead of created at parsing 2018-08-16 16:46:36 +02:00
Léa Saviot
e0dbb59c20 [poincare] Update some Power simplification methods 2018-08-16 15:39:33 +02:00
Émilie Feral
6068631b0a [poincare] Fix Integer::Division: enable to divide Integers up to
(2^32)^maxNumberOfDigits-1
2018-08-16 11:12:20 +02:00
Léa Saviot
cdb487792b [poincare] Fix Rational logger 2018-08-16 10:37:11 +02:00
Émilie Feral
c9a33d05ef [poincare] Log rational 2018-08-16 10:15:06 +02:00
Émilie Feral
503edea946 [poincare] Decimal: shallowReduce can turn into Float if we cannot
create a Rational
2018-08-14 18:17:19 +02:00
Émilie Feral
4174289d34 [poincare] Rational: shallowReduce turn them into Infinity or 0 when the
numerator or the denominator is infinity
2018-08-14 18:17:19 +02:00
Émilie Feral
5b25c0c890 [poincare] Integer, Rational, Decimal: discard premature optimizations.
Overflow on Integer, Rational, Decimal nodes have a size corresponding to
their number of digits
2018-08-14 18:17:19 +02:00
Léa Saviot
06ac37cbc1 [poincare] Remove wrong asserts 2018-08-14 18:01:02 +02:00
Léa Saviot
942e1a8f25 [poincare] TreeNode::parent() should never return nullptr 2018-08-14 17:53:32 +02:00
Léa Saviot
cd43d84b1e [poincare] Fix TreeRef deletion: releaseNode shouldn't create a TreeRef 2018-08-14 17:31:47 +02:00
Léa Saviot
71c807b565 [poincare] Node->isDefined becomes !Node->isUninitialized 2018-08-14 16:40:12 +02:00
Léa Saviot
a3d09bde1c [poincare] Fix typos 2018-08-14 16:03:42 +02:00
Léa Saviot
d8732a9e2f [poincare] TreeRefs should never have the NoNode identifier 2018-08-14 15:27:25 +02:00
Léa Saviot
5d9e69dedc [poincare] Remove Tree constructors that use nullptr as parameter 2018-08-14 14:58:47 +02:00
Léa Saviot
423dfa0654 [poincare] AllocationFail and Uninitialized inherit from Exception
Implemented for expressions, layouts, and evaluations
2018-08-14 14:22:29 +02:00
Émilie Feral
67f4c3de77 [poincare] Expression: methods that should return an Expression HAVE to
be implemented on Expression and not on ExpressionNode in order to copy
the returned Expression.
2018-08-14 13:41:45 +02:00
Émilie Feral
dab9b5cd21 [poincare] Fix and add tests on Integer::Division 2018-08-14 13:21:13 +02:00
Léa Saviot
b49d898b89 [poincare] Some code cleaning 2018-08-13 17:58:31 +02:00
Léa Saviot
cbc26a8508 [poincare] ExceptionNode and ExceptionExpressionNode 2018-08-13 17:57:53 +02:00
Léa Saviot
fcaa32c753 [poincare] Write Simplification code of Addition 2018-08-13 17:28:39 +02:00
Léa Saviot
80c7cf0f82 [poincare] Expression::simpleShallowReduce 2018-08-13 17:27:01 +02:00
Émilie Feral
256cf5203d [poincare] Fix various bugs 2018-08-13 16:54:40 +02:00
Émilie Feral
071fc1dff4 [poincare] TreeByValue: copy constructor call setTo (forgot to call
destructor before assigning)
2018-08-13 16:36:09 +02:00
Émilie Feral
c2bb07c948 [poincare] Fix size() of IntegerNode, RationalNode, DecimalNode 2018-08-13 14:57:10 +02:00
Émilie Feral
22aa86bc61 [poincare] Fix constructors of Integer, Rational and Decimal 2018-08-13 14:50:40 +02:00
Léa Saviot
4dd48139c0 [poincare] Add forgotten child retaining 2018-08-13 13:49:31 +02:00
Émilie Feral
ce64568bf4 [poincare] Integer: fix Overflow handling 2018-08-13 13:40:08 +02:00
Émilie Feral
2a4da23272 [poincare] Fix Integer constructor: avoid creating Integer without
setting the digits because at destruction the size() is wrong and
corrupt the pool
2018-08-13 13:40:08 +02:00
Léa Saviot
3d524df8f8 [poincare] Increase TreePool::MaxNumberOfStaticNodes 2018-08-13 13:15:47 +02:00
Léa Saviot
fe0fa95235 [poincare] Temporary commit that handles nullptr nodes in References 2018-08-13 12:22:46 +02:00
Léa Saviot
6352bbcdd9 [poincare] Fix Rational constructors to prevent malformed Rationals 2018-08-13 12:20:37 +02:00
Émilie Feral
c06662196f [poincare] TreePool: cannot call a virtual method on a destructed object
(fix blob tests on device)
2018-08-13 11:13:44 +02:00
Léa Saviot
d51844a5a6 [poincare] Fix Complex and Decimal constructors (did not retain nodes) 2018-08-13 10:51:38 +02:00
Romain Goyet
6d5d61cac5 [poincare] Expose "log" on TreeByValue 2018-08-13 09:04:46 +02:00
Romain Goyet
30a4db3e34 [poincare] Allow logging of an Expression (e.g. Integer("123").log()) 2018-08-10 21:32:27 +02:00
Romain Goyet
7998233fea [poincare] Log IntegerNode m_negative 2018-08-10 21:32:06 +02:00
Romain Goyet
dae71c0a4a [poincare] Fix (or silence) clang warnings 2018-08-10 21:04:09 +02:00
Léa Saviot
a6f61f91a9 ’poincare] Clean some layouts 2018-08-10 17:21:53 +02:00
Émilie Feral
3914e9ed9f [poincare] Matrix: avoid infinite loop in node() implementation 2018-08-10 17:13:51 +02:00
Émilie Feral
86399938c1 [poincare] TreeByValue: fix copy assignment 2018-08-10 17:13:51 +02:00
Léa Saviot
5dd043bf75 [poincare] Clean some layouts 2018-08-10 16:27:56 +02:00
Romain Goyet
50d6eee4f4 [poincare] Add some integer tests 2018-08-10 16:27:13 +02:00