Re: [IMP-dev] strange behavior with Vector3D operator== under python
To: List for IMP development <>
Subject: Re: [IMP-dev] strange behavior with Vector3D operator== under python
From: Keren Lasker <>
Date: Wed, 23 Feb 2011 09:43:57 -0800
Reply-to: List for IMP development <>
also - the way to compare vectors in using algebra::get_distance
On Feb 23, 2011, at 9:22 AM, Daniel Russel wrote:
> It is "expected" in a certain sense in that one should not expect it to work right as comparisons on geometric objects like that can't be implemented very reliably (due to floating point values getting truncated unexpectedly as they are moved between floating point registers and memory). Specifically, algebra::Vector3D v= v2; assert(v==v2); is not guaranteed to succeed when optimizations are turned on.
> That said, we should probably do something on the python side to make it clearer that it isn't supported (on the C++ side there are no comparison operators). Perhaps provide an implementation of __cmp__ that throws an exception.
> On Feb 23, 2011, at 8:36 AM, Benjamin SCHWARZ wrote:
>> Don't know if it has already been reported or if this is an expected behavior…
>> Tested with latest IMP svn release.
>> import IMP
>> import IMP.algebra
>> --> False
>> --Ben (schwarz)
>> IMP-dev mailing list
> IMP-dev mailing list