Ejemplo n.º 1
0
 def test_get_index(self):
     for idx in [ (3, 0, 0, 1), (1,), () ]:
         m = MVPolyDictMonomial()
         m.index = idx
         self.assertTrue(m.index == idx,
                         "bad index:\n{0!s}".format(repr(m.index)))
     m = MVPolyDictMonomial(index = (3, 3, 0, 0))
     self.assertTrue(m.index == (3, 3),
                     "bad index:\n{0!s}".format(repr(m.index)))
Ejemplo n.º 2
0
 def test_set_index(self):
     exp = (3, 0, 0, 0, 0, 2)
     m = MVPolyDictMonomial()
     m.index = exp
     obt = m.index_of_length(6)
     self.assertTrue(obt == exp, "bad index:\n{0!s}".format(repr(obt)))