Beispiel #1
0
 def __ne__(self, m2):
     """Overload the comparison operator."""
     for i in range(4):
         for j in range(4):
             if not eq(self.m[i][j], m2.m[i][j]):
                 return True
     return False
Beispiel #2
0
 def __ne__(self, m2):
     """Overload the comparison operator."""
     for i in range(4):
         for j in range(4):
             if not eq(self.m[i][j], m2.m[i][j]):
                 return True
     return False
Beispiel #3
0
 def __ne__(self, p):
     """Overload the comparison operator."""
     return not eq(self.x, p.x) or not eq(self.y, p.y) or not (self.z, p.z)
Beispiel #4
0
 def __eq__(self, p):
     """Overload the comparison operator."""
     return eq(self.x, p.x) and eq(self.y, p.y) and eq(self.z, p.z)
Beispiel #5
0
 def __ne__(self, v):
     """Overload the comparison operator."""
     return not eq(self.x, v.x) or not eq(self.y, v.y) or not (self.z, v.z)
Beispiel #6
0
 def __eq__(self, v):
     """Overload the comparison operator."""
     return eq(self.x, v.x) and eq(self.y, v.y) and eq(self.z, v.z)
Beispiel #7
0
 def __ne__(self, q):
     """Overload the coparison operator."""
     return (self.v!=q.v) or (not eq(self.w, q.w))
Beispiel #8
0
 def __eq__(self, v):
     """Overload the comparison operator."""
     return eq(self.x, v.x) and eq(self.y, v.y) and eq(self.z, v.z)
Beispiel #9
0
 def __ne__(self, p):
     """Overload the comparison operator."""
     return not eq(self.x, p.x) or not eq(self.y, p.y) or not (self.z, p.z)
Beispiel #10
0
 def __eq__(self, p):
     """Overload the comparison operator."""
     return eq(self.x, p.x) and eq(self.y, p.y) and eq(self.z, p.z)
Beispiel #11
0
 def test_eq(self):
     self.assertTrue(eq(1.0, 1.0+1e-15))
     self.assertFalse(eq(1.0, 1.0+1e-5))
     self.assertFalse(eq(1.0, float('inf')))
     self.assertFalse(eq(1.0, -float('inf')))
     self.assertFalse(eq(1.0, 3.0))
Beispiel #12
0
 def __ne__(self, q):
     """Overload the coparison operator."""
     return (self.v != q.v) or (not eq(self.w, q.w))
Beispiel #13
0
 def __eq__(self, q):
     """Overload the comparison operator."""
     return self.v == q.v and eq(self.w, q.w)
Beispiel #14
0
 def __eq__(self, n):
     """Overload the comparison operator."""
     return eq(self.x, n.x) and eq(self.y, n.y) and eq(self.z, n.z)
Beispiel #15
0
 def __eq__(self, n):
     """Overload the comparison operator."""
     return eq(self.x, n.x) and eq(self.y, n.y) and eq(self.z, n.z)
Beispiel #16
0
 def __ne__(self, n):
     """Overload the comparison operator."""
     return not eq(self.x, n.x) or not eq(self.y, n.y) or not (self.z, n.z)
Beispiel #17
0
 def __ne__(self, n):
     """Overload the comparison operator."""
     return not eq(self.x, n.x) or not eq(self.y, n.y) or not (self.z, n.z)
Beispiel #18
0
 def __ne__(self, v):
     """Overload the comparison operator."""
     return not eq(self.x, v.x) or not eq(self.y, v.y) or not (self.z, v.z)
Beispiel #19
0
 def __eq__(self, q):
     """Overload the comparison operator."""
     return self.v==q.v and eq(self.w, q.w)