Skip to content

Commit

Permalink
added layout equality tests, modded Multivector.__checkother to refle…
Browse files Browse the repository at this point in the history
…ct this
  • Loading branch information
arsenovic committed Nov 1, 2017
1 parent cb1ece1 commit deb9648
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion clifford/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,12 @@ def __repr__(self):
self.bladeTupList, self.firstIdx, self.names))
return s

def __eq__(self,other):
return np.all(self.sig ==other.sig)

def __ne__(self,other):
return not self.__eq__(other)

def _sign(self, seq, orig):
"""Determine {even,odd}-ness of permutation seq or orig.
Expand Down Expand Up @@ -689,7 +695,7 @@ def _checkOther(self, other, coerce=1):

elif (
isinstance(other, self.__class__) and
other.layout is not self.layout):
other.layout != self.layout):
raise ValueError(
"cannot operate on MultiVectors with different Layouts")

Expand Down

0 comments on commit deb9648

Please sign in to comment.