These are chat archives for symengine/symengine

15th
Apr 2016
Akash Trehan
@CodeMaxx
Apr 15 2016 04:10
@abinashmeher999 Thanks!! That was indeed the problem. Is there any easy way to detect this? I mean some flag during compilation that shows a warning or error. Or is it to be done manually?
Nitin Chaudhary
@Nitin216
Apr 15 2016 05:38
@CodeMaxx Thanks for your support and information. :)
Abinash Meher
@abinashmeher999
Apr 15 2016 06:08
Sadly, I don't know of any. Usually when the inclusion of a header file is the problem, I check for circular dependency first. The error that you saw might not explicitly say that there is a circular dependency but might be indicative of it.
Iris Lui
@irislq
Apr 15 2016 06:13
@isuruf Hey Isuru, can you look at our code sometime soon? Also, what kind of methods should be tested for speed benchmarks?
symengine/symengine#868
Akash Trehan
@CodeMaxx
Apr 15 2016 06:46
In what cases is the __hash__() of two objects equal ? Does it depend on the value of the member variables or their address?( from the results I’m getting it should be address)
Akash Trehan
@CodeMaxx
Apr 15 2016 06:56
Also equal when there are no member variables for an object.
Isuru Fernando
@isuruf
Apr 15 2016 06:56
__hash__ should be equal when the two objects are equal according to eq
Akash Trehan
@CodeMaxx
Apr 15 2016 07:01
RCP<const Infinit> a = infinit(1);
RCP<const Infinit> b = infinit(1);

REQUIRE(a->__hash__() == b->__hash__()); //Gives false
REQUIRE(eq(*a,*b)); //Gives true
Isuru Fernando
@isuruf
Apr 15 2016 07:02
That's wrong
You have to respect the hash contract
Akash Trehan
@CodeMaxx
Apr 15 2016 07:06
Do you think there is some problem with __hash__() ?
I have not done any changes to eq
Isuru Fernando
@isuruf
Apr 15 2016 07:07
You have to implement both __hash__ and __eq__
Akash Trehan
@CodeMaxx
Apr 15 2016 07:10
Yeah I did.
Charles Chen
@chenchfort
Apr 15 2016 09:11
@isuruf Should the test case in test_series.cpp be removed now that we have a generic implementation?
This message was deleted
Akash Trehan
@CodeMaxx
Apr 15 2016 12:19
@isuruf Should eq(zoo, zoo) be true? They don’t have a defined direction. Also zoo.compare(zoo)?
zoo = ComplexInfinity
Isuru Fernando
@isuruf
Apr 15 2016 12:22
Yes. zoo should be equal to zoo
Akash Trehan
@CodeMaxx
Apr 15 2016 12:24
Doesn’t it sound like undefined = undefined?
Isuru Fernando
@isuruf
Apr 15 2016 12:25
I don't get the last comment
Akash Trehan
@CodeMaxx
Apr 15 2016 12:26
ComplexInfinity has undefined direction.
Isuru Fernando
@isuruf
Apr 15 2016 12:27
Okay, but what's the problem here?
Akash Trehan
@CodeMaxx
Apr 15 2016 12:27
Like we have NaN != NaN similarly for zoo
Isuru Fernando
@isuruf
Apr 15 2016 12:28
I don't know how SymPy handles it, but zoo != zoo would break a lot of things
Akash Trehan
@CodeMaxx
Apr 15 2016 12:29
For example? With sympy I’m getting awkward result…SymPy gives Eq(-oo, oo) as true
Isuru Fernando
@isuruf
Apr 15 2016 12:30
Containers we are using, map, unordered_map, set all require a == a
Akash Trehan
@CodeMaxx
Apr 15 2016 12:31
Oh right.. then I’m keeping zoo = zoo but oo != -oo
unlike sympy
Isuru Fernando
@isuruf
Apr 15 2016 12:36
In [45]: zoo == oo
Out[45]: False

In [46]: zoo == -oo
Out[46]: False

In [47]: oo == -oo
Out[47]: False
Akash Trehan
@CodeMaxx
Apr 15 2016 12:40
Eq(oo, -oo) on the other hand gives True
Isuru Fernando
@isuruf
Apr 15 2016 12:40
No, it doesn't
Which SymPy version are you using?
Akash Trehan
@CodeMaxx
Apr 15 2016 12:41
1.0.1.dev
I’m using isympy
Isuru Fernando
@isuruf
Apr 15 2016 12:41
Which commit?
Akash Trehan
@CodeMaxx
Apr 15 2016 12:43
Do you need the commit ID?
Isuru Fernando
@isuruf
Apr 15 2016 12:43
yes
Akash Trehan
@CodeMaxx
Apr 15 2016 12:43
20a7244
Akash Trehan
@CodeMaxx
Apr 15 2016 12:49
Also
In [32]: S.Infinity.compare(-oo)                                                          
Out[32]: -1

In [33]: S.Infinity.compare(zoo)                                                          
Out[33]: -1
I believe this should be +1
Isuru Fernando
@isuruf
Apr 15 2016 13:04
@CodeMaxx, see sympy/sympy#10927
Akash Trehan
@CodeMaxx
Apr 15 2016 13:08
Cool so its a bug :+1:
Charles Chen
@chenchfort
Apr 15 2016 18:30
@isuruf Ready for another review!