예제 #1
0
 def test_nonzero_mononomial(self):
     m = MVPolyDictMonomial(dict = {0:3, 3:1})
     obt = m.dict
     self.assertTrue(obt == {0:3, 3:1},
                     "zero poly bad dict:\n{0!s}".format(repr(obt)))
     obt = m.key
     self.assertTrue(obt == ((0, 3), (3, 1)),
                     "zero poly bad key:\n{0!s}".format(repr(obt)))
     obt = m.index_of_length(4)
     self.assertTrue(obt == (3, 0, 0, 1),
                     "zero poly bad idx:\n{0!s}".format(repr(obt)))
예제 #2
0
 def test_zero_mononomial(self):
     m = MVPolyDictMonomial(dict = {})
     obt = m.dict
     self.assertTrue(obt == {},
                     "zero poly bad dict:\n{0!s}".format(repr(obt)))
     obt = m.key
     self.assertTrue(obt == (),
                     "zero poly bad key:\n{0!s}".format(repr(obt)))
     obt = m.index_of_length(4)
     self.assertTrue(obt == (0, 0, 0, 0),
                     "zero poly bad idx:\n{0!s}".format(repr(obt)))
예제 #3
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)))
예제 #4
0
 def test_construct_from_index(self):
     exp = (3, 0, 1, 0)
     m = MVPolyDictMonomial(index = exp)
     obt = m.index_of_length(4)
     self.assertTrue(obt == exp,
                     "bad constructor:\n{0!s}".format(repr(obt)))