[SciPy-user] Faster allclose, comparing arrays

Tom Johnson tjhnson@gmail....
Fri Feb 1 13:47:37 CST 2008

Frequently, I am comparing vectors to one another, and I am finding
that a good portion of my time is spent in allclose.  This is done
through a class which stores a bunch of metadata and also a 'vector'

def __eq__(self, other):
      return allclose(self.vector, other.vector, rtol=RTOL, atol=ATOL)

So I place these objects in a list and check equality via "if x in
objlist".   Couple of questions:

1) Is this a "good" method for comparing arrays?
2) Is there any way to speed up allclose?


More information about the SciPy-user mailing list