Exemplo n.º 1
0
 def test_contains_gen(self):
     x = self.x
     y = self.y
     z = self.z
     sm = SingularModule([[x, y + z, z**3 - 2 * y], [x, y, z]])
     #Assert we contain our generators
     self.assertTrue(sm.contains([x, y + z, z**3 - 2 * y]))
     self.assertTrue(sm.contains([x, y, z]))
Exemplo n.º 2
0
 def test_contains_fail(self):
     x = self.x
     y = self.y
     z = self.z
     one = self.poly_ring.one()
     sm = SingularModule([[x, y + z, z**3 - 2 * y], [x, y, z]])
     #Detect that certain vectors are not contained
     self.assertFalse(sm.contains([one, x, z]))
     self.assertFalse(sm.contains([y, y, y]))
     self.assertFalse(sm.contains([z, y, x]))
Exemplo n.º 3
0
 def test_intersect_contains(self):
     x = self.x
     y = self.y
     z = self.z
     sm1 = SingularModule([[x, y + z, z**3 - 2 * y], [x, y, z],
                           [x, y, z**2]])
     sm2 = SingularModule([[x, y**2, z**3]])
     #Assert the intersection is contained in both modules
     gens = (sm1.intersection(sm2)).gens
     for gen in gens:
         self.assertTrue(sm1.contains(gen))
     for gen in gens:
         self.assertTrue(sm2.contains(gen))
Exemplo n.º 4
0
 def test_contains_fail_multiple(self):
     x = self.x
     y = self.y
     z = self.z
     sm = SingularModule([[x**2, x * y, x * z]])
     #Detect that this is not contianed even though a multiple is
     self.assertFalse(sm.contains([x, y, z]))
Exemplo n.º 5
0
 def test_contains_combination(self):
     x = self.x
     y = self.y
     z = self.z
     sm = SingularModule([[x, y + z, z**3 - 2 * y], [x, y, z]])
     #Assert we contain a combination of the generorators
     self.assertTrue(sm.contains([2 * x, 2 * y + z, z**3 - 2 * y + z]))
Exemplo n.º 6
0
 def test_contains_zero(self):
     x = self.x
     y = self.y
     z = self.z
     sm = SingularModule([[x, y + z, z**3 - 2 * y], [x, y, z]])
     zero = self.poly_ring.zero()
     #Assert we always contain zero
     self.assertTrue(sm.contains([zero, zero, zero]))
Exemplo n.º 7
0
 def test_contains_module(self):
     x = self.x
     y = self.y
     z = self.z
     zero = self.poly_ring.zero()
     smA = SingularModule([[x**2, x * y, y * z], [x, y, z]])
     smB = SingularModule([[x**2 + x, x * y + y, y * z + z],
                           [zero, zero, y * z - x * z]])
     self.assertTrue(smA.contains(smB))