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