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