Example #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
Example #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
Example #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)
Example #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)
Example #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)
Example #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)
Example #7
0
 def __ne__(self, q):
     """Overload the coparison operator."""
     return (self.v!=q.v) or (not eq(self.w, q.w))
Example #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)
Example #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)
Example #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)
Example #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))
Example #12
0
 def __ne__(self, q):
     """Overload the coparison operator."""
     return (self.v != q.v) or (not eq(self.w, q.w))
Example #13
0
 def __eq__(self, q):
     """Overload the comparison operator."""
     return self.v == q.v and eq(self.w, q.w)
Example #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)
Example #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)
Example #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)
Example #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)
Example #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)
Example #19
0
 def __eq__(self, q):
     """Overload the comparison operator."""
     return self.v==q.v and eq(self.w, q.w)