Hi, I have noticed that relational(a,b,==).is_equal(relational(b,a,==)) returns 0 Is this expected behaviour for GiNaC internals? I just want to know whether it is worth to write a patch such that a==b .is_equal(b==a) -> 1 a<b .is_equal(b>a) -> 1 etc. that should be implemented in the method relational::is_equal_same_type right? Regards, Pearu Pearu Peterson <pearu@ioc.ee>, PhD, Researcher Department of Mechanics and Applied Mathematics http://cens.ioc.ee/~pearu/ Institute of Cybernetics at Tallinn Technical University Phone: (+372) 6204168 Akadeemia Rd. 21, 12618 Tallinn ESTONIA Fax: (+372) 6204161 *** the nonvalidity of rigorous causality is necessary and not just consistently possible (Heisenberg, 1925) ***
Hi, On Wed, 21 Nov 2001, Pearu Peterson wrote:
I have noticed that relational(a,b,==).is_equal(relational(b,a,==)) returns 0
Is this expected behaviour for GiNaC internals? I just want to know whether it is worth to write a patch such that a==b .is_equal(b==a) -> 1 a<b .is_equal(b>a) -> 1 etc. that should be implemented in the method relational::is_equal_same_type right?
Sounds good to me. Can you send a patch? I am planning to put out 1.0.1 tomorrow. Cheers -richy. -- Richard B. Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/>
On Wed, 21 Nov 2001, Richard B. Kreckel wrote:
Can you send a patch? I am planning to put out 1.0.1 tomorrow.
You can find patches attached. Features include (a<b).is_equal(b>a) -> true (a==b).is_equal(b==a) -> true etc. Note that I had to introduce also relational::calchash such that hash(a < b) == hash(b > a) hash(a == b) == hash(b == a) etc. in order to relational::is_equal_same_type will acctually called on (a<b).is_equal(b>a) Earlier a<b and b>a had different hash values and basic::is_equal used to return false on such cases. I run also `make check' to ensure that I didn't broke anything. All tests passed fine. Regards, Pearu
On Wed, 21 Nov 2001, Pearu Peterson wrote:
Can you send a patch? I am planning to put out 1.0.1 tomorrow.
You can find patches attached. Features include (a<b).is_equal(b>a) -> true (a==b).is_equal(b==a) -> true etc.
Note that I had to introduce also relational::calchash such that hash(a < b) == hash(b > a) hash(a == b) == hash(b == a) etc. in order to relational::is_equal_same_type will acctually called on (a<b).is_equal(b>a) Earlier a<b and b>a had different hash values and basic::is_equal used to return false on such cases.
Right, the patch looks okay. There is one minor tidbit, however: The method relational::compare_same_type() should also incorporate logic along the lines of what you did in relational::is_equal_same_type(). I have added this now and am spinning the release. Thanks a lot -richy. -- Richard B. Kreckel <Richard.Kreckel@Uni-Mainz.DE> <http://wwwthep.physik.uni-mainz.de/~kreckel/>
participants (2)
-
Pearu Peterson
-
Richard B. Kreckel