[PYTHON MATRIX-SIG] Final (hopefully) alpha release available

Jim Hugunin hugunin@mit.edu
Tue, 22 Oct 1996 17:21:42 -0400


> I was thinking about comparison operators (<, ==, etc) today and I had
> a question. I understand that there is no good way for <, >, etc to
> work on matrices because you have to return and integer value. And,
> apparently, there is no way to raise an exception here
> either. However, it seems like A == B, and A != B are perfectly valid
> matrix expressions that should evaluate to true and false respectively
> if A and B are the same shape and have equal values. In other words, 
> A == B <=> A.shape == B.shape and and.reduce(equal(ravel(A), ravel(B))).
> 
> Yes? No?

I just had to explain to someone yesterday how to determine if A == B, and
let me tell you it wasn't pleasant.  I'll add this in before the beta
release, as it's better than the current approach.  I'm a little
uncomfortable that I might be giving sanction to this sort of equality
comparision for arrays of floats, but since it's allowed for python floats
I probably shouldn't worry.

BTW - There's going to be at least one more alpha release coming out fairly
soon in order to be compatible with the new name for Ellipsis in
Python1.4Final.  It'll also probably have small changes like this one in
it.  Nothing that'll break user code though.  Unless you depend on the
current behavior of "a == b" always being false, in which case your code is
already broken ;-)

-Jim

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================