Commit Graph

1406 Commits

Author SHA1 Message Date
Émilie Feral
4a0876b9cf [poincare] Implement Division::simplify
Change-Id: Ie938f410aa0dd1bf55060559e457b6003821471c
2017-10-06 18:26:15 +02:00
Émilie Feral
22540b8ed4 [poincare] Fix bugs in rational
Change-Id: I26c14911b6ea73672e70eb3d794201cc577f3015
2017-10-06 18:25:53 +02:00
Émilie Feral
8f03d672ce [poincare] Implement Subtraction::simplify
Change-Id: If6494c80c3c2c2132fb3f584c720f7b978917a8c
2017-10-06 18:14:46 +02:00
Émilie Feral
3ee128062c [poincare] Add new rule in Power::simplify
Change-Id: Ia8197f6d09467e986754dd0afdb6b5042927495e
2017-10-06 18:10:18 +02:00
Émilie Feral
76d2e1d8b9 [poincare] Add setNegative on Rationial
Change-Id: I9b7f297bea8f0c917919fb15405805865b7537b9
2017-10-06 18:09:46 +02:00
Émilie Feral
082e6468f7 [poincare] In power: (a^b)^c = a^(b+c) if a > 0 or c is integer
Change-Id: Iad7b559de5e15972a54e322bca832d78596abf53
2017-10-06 17:06:46 +02:00
Émilie Feral
d855ee8364 [poincare] Add a method isPositive on expressions
Change-Id: I3eb0064f8d64678326e74216517e0104eaa007fe
2017-10-06 17:06:23 +02:00
Émilie Feral
6524ab9286 [poincare] Clean Power::Simplify
Change-Id: Ic3ce764e38c6443f3918cdfb0347c6f6046df79a
2017-10-06 16:41:19 +02:00
Émilie Feral
61865fbfa0 [poincare] Improve Power::simplify
Change-Id: I4388f3580666620d490bc5e1967fe739cb7fb01b
2017-10-06 15:57:57 +02:00
Émilie Feral
ed9aae3003 [poincare] Correct Multiplication::simplify to avoid factorizing
2*2^(1/2)

Change-Id: I32d51584a372afa29a36a3e94f65b024bc9e9bc4
2017-10-06 15:55:42 +02:00
Émilie Feral
22be8032e1 [poincare] First version of Power::simplify
Change-Id: Ief654c8f57bacd84a3ee5e386548b131c1ed65d3
2017-10-06 13:53:29 +02:00
Émilie Feral
78b85ed0df [poincare] Add methods in rational
Change-Id: I4ed056792d3358f7c8502533c71c11dd93240fb9
2017-10-06 13:53:23 +02:00
Émilie Feral
1ede897a37 [poincare] Create a class undefined
Change-Id: I0d30b907179f38b77ed65136fddede6e16fb08e1
2017-10-06 12:03:54 +02:00
Émilie Feral
96661a53e2 [poincare] Opposite::simplify
Change-Id: I6af7c645f989e43b86a210430868e164f3f18f64
2017-10-05 18:24:35 +02:00
Émilie Feral
58cdf3e6c3 [poincare] Change name: privateSimplify->immediateSimplify
Change-Id: I08c46354c3ad8ebb5de2a152554dd7ad36a7d255
2017-10-05 18:05:01 +02:00
Émilie Feral
6533e115ec [poincare] Parenthesis simplify
Change-Id: I2ebcc1d5148eacb087be407559e5593c6ac6641e
2017-10-05 18:02:38 +02:00
Émilie Feral
e29872789c [poincare] add distribution in multiplication simplify
Change-Id: I9d159b1577f4e02ebdc24e19ff45b66a1b2eb2a3
2017-10-05 18:02:02 +02:00
Émilie Feral
34ff77f1ef [poincare] First version of Multiplication::simplification
Change-Id: I8e2486bde60629ffbbd1128e6e2a52c10f6b7bab
2017-10-05 15:57:59 +02:00
Émilie Feral
412aae7b48 [poincare] Addition simplify uses rational instead of integer
Change-Id: I92d54afc04b827a902aff17de836e4487effa968
2017-10-05 15:01:14 +02:00
Émilie Feral
40893e04c3 [poincare] Create rational class
Change-Id: I6cc8b42a473a3a7c7b96c369152c0c5eb5735de4
2017-10-05 15:01:14 +02:00
Émilie Feral
4eca9571bc [poincare] Clean useless methods
Change-Id: I6a960c2d774cc3c67dc3dafaae28386e7b5ac288
2017-10-05 15:01:14 +02:00
Émilie Feral
0e18a6ad14 [poincare] Delete method isCommutative
Change-Id: Id3a61aa4a0eb837e7a8f78ca2b1672b754a0cb4f
2017-10-05 15:01:14 +02:00
Émilie Feral
646ca4448d [poincare] Change simplification design: first version of simplify on addition
Change-Id: I54c54569068b5cce41b850dfe97ee2c980205acb
2017-10-05 15:01:07 +02:00
Émilie Feral
4a1d064f68 [poincare] Change sorting to sort like terms together
Change-Id: I3d87d1be1c5f1985980805ce4c37b7273f978c12
2017-10-04 17:16:49 +02:00
Romain Goyet
d00948171a [poincare] Normalize Zero (Integer(-0) becomes Integer(0)) 2017-09-30 19:10:27 +02:00
Romain Goyet
9c171525d0 [poincare] Add Expression::replaceWith and Expression::removeFromParent
Those are shorthands methods, but convenient nonetheless
2017-09-30 17:59:04 +02:00
Romain Goyet
6070ee8927 [poincare] Add DynamicHierarchy::removeOperandAtIndex 2017-09-30 17:57:09 +02:00
Romain Goyet
1b0708d224 [poincare] Add Expression::hasAncestor 2017-09-29 21:15:44 +02:00
Romain Goyet
dbdd2744ce [poincare] Add Hierarchy::detachOperand to detach a single operand 2017-09-29 21:13:10 +02:00
Émilie Feral
fe5e87fc0d [poincare] fix bug in Parenthesis
Change-Id: Id38f52db8e423a5ef0f5cff0e8151ae6d24976c8
2017-09-29 17:43:32 +02:00
Émilie Feral
0a6ff2edb0 [poincare] When building hierarchical expression, give a parent to
children

Change-Id: Ibeadbe98dc1ecde29be3b3c5e5d1cc9537c3c38a
2017-09-29 16:33:39 +02:00
Émilie Feral
ada3ed5b11 [poincare] Improve arithmetics
Change-Id: I95b03b254cceb90978d0e0848af41f647f24274a
2017-09-29 14:41:31 +02:00
Émilie Feral
9549e8ae85 [poincare] add a rule: int^int-> int or int^(-1)
Change-Id: I871c2e235debaac009c9d5e252e260ec3e0fc1d5
2017-09-29 09:50:41 +02:00
Émilie Feral
b5c06fd22b [poincare] Implement Integer::Division in Z (relative integers)
Change-Id: I72ccd4afd8188b0389b1f32863ecb1af59581c04
2017-09-28 16:17:32 +02:00
Émilie Feral
38ee1ef1df [poincare] Sort selectors before creating rules
Change-Id: I51da663d83f5759c499c14f603511e3b9cb3f92f
2017-09-27 18:58:26 +02:00
Émilie Feral
273efcc2f9 [poincare] Fix convention on compareTo
Change-Id: Ia1a7f2f23b93bec6a856da04baf109dfe8f49980
2017-09-27 18:58:26 +02:00
Émilie Feral
5d0dcbee1a [poincare] Change API of arithmetic
Change-Id: I1a558c5e269b5f3585feb2e031d0283e38a8f76b
2017-09-27 16:14:48 +02:00
Émilie Feral
6baa8d3d2a [poincare] Add a const qualifier on isNegative method in Integer
Change-Id: I85d23cda3e1b8603df471174b576502ae75b5f5e
2017-09-27 16:14:12 +02:00
Émilie Feral
83d1179993 [poincare] Implement copy constructor and copy assignment operator of
Integer

Change-Id: Iaed652f31c3336da5471727cf4c9190bec34d51e
2017-09-27 16:13:43 +02:00
Émilie Feral
372478a142 [poincare] Parse decimal number in fraction instead of complex
Change-Id: I52dd5dff950a1adf6abfe1281079f68333be5a66
2017-09-27 12:07:50 +02:00
Émilie Feral
553fa730de [poincare] add tests on arithmetic functions
Change-Id: Iac54616ebf8281179b5e832003a643da9122b007
2017-09-26 18:19:40 +02:00
Émilie Feral
4d2255d087 [poincare] Fix bounded static hierarchy
Change-Id: I7b6bee4eb40e54410720931074788383a36928b2
2017-09-26 16:31:17 +02:00
Émilie Feral
5f6e668d81 [poincare] Implement GCD and prime factorization
Change-Id: I900b6f52f74f21fee8f6e2c1df1e06c9b579f19a
2017-09-26 16:07:52 +02:00
Émilie Feral
f05a143dea [poincare] Add a sign getter in Integer
Change-Id: Iad63c3f2d4950f14cf93243379439d7af5596d78
2017-09-26 16:07:52 +02:00
Émilie Feral
483a8b1028 [poincare] Add a method to set sign on Integer
Change-Id: I88094af48775ff273eee0de198726bd91b33d5fe
2017-09-26 16:07:52 +02:00
Émilie Feral
febcea6955 [poincare] In Integer, create a static method Division returning a
struct

Change-Id: I1eb84a79c69e15cd815df87fe7b56bc7327c53be
2017-09-26 16:07:52 +02:00
Émilie Feral
5ef5410b6f [poincare] Change Fraction->Division
Change-Id: If8f06c60976a02b1b43439a0cea91fb0fee8e930
2017-09-26 16:07:36 +02:00
Émilie Feral
0979a26685 [poincare] Change checksum to identifier
Change-Id: I9e132ea5d731f9f3092a399c0b7fd883e3c22abd
2017-09-25 14:55:30 +02:00
Émilie Feral
ceeb43cd5f [poincare] Change comparesTo + virtual nodeCompareTo -> virtual compareTo
Change-Id: Ie54b3652ad1d5845f084b4b49ca0eb96198b853a
2017-09-25 14:54:12 +02:00
Émilie Feral
19b606c825 [poincare] Reel -> Real
Change-Id: Idaf6d7f6f885f0584a8444ab5503738e5499348a
2017-09-25 14:26:36 +02:00