Ejemplo n.º 1
0
 def test_convert_univarient(self):
     y = self.y
     sym_poly = 4 * self.vars[1]**4 + self.vars[1] * self.vars[
         1]**12 * self.vars[1] - self.vars[1]
     poly = convert_symbolic_to_polynomial(sym_poly, self.poly_ring,
                                           self.vars)
     self.assertEqual(poly, 4 * y**4 + y * y**12 * y - y)
 def test_convert(self):
   x = self.x
   y = self.y
   z = self.z
   sym_poly = 4*self.vars[0]**4 + self.vars[1]*self.vars[0]**12*self.vars[1]-self.vars[2]
   poly = convert_symbolic_to_polynomial(sym_poly,self.poly_ring,self.vars)
   self.assertEqual(poly,4*x**4+y*x**12*y-z)
Ejemplo n.º 3
0
 def test_convert_partial(self):
     y = self.y
     z = self.z
     sym_poly = 4 * self.vars[2]**4 + self.vars[1] * self.vars[
         1]**12 * self.vars[1] - self.vars[1]
     poly = convert_symbolic_to_polynomial(sym_poly, self.poly_ring,
                                           self.vars)
     self.assertEqual(poly, 4 * z**4 + y * y**12 * y - y)
Ejemplo n.º 4
0
 def test_convert(self):
     x = self.x
     y = self.y
     z = self.z
     sym_poly = 4 * self.vars[0]**4 + self.vars[1] * self.vars[
         0]**12 * self.vars[1] - self.vars[2]
     poly = convert_symbolic_to_polynomial(sym_poly, self.poly_ring,
                                           self.vars)
     self.assertEqual(poly, 4 * x**4 + y * x**12 * y - z)
 def test_convert_partial(self):
   y = self.y
   z = self.z
   sym_poly = 4*self.vars[2]**4 + self.vars[1]*self.vars[1]**12*self.vars[1]-self.vars[1]
   poly = convert_symbolic_to_polynomial(sym_poly,self.poly_ring,self.vars)
   self.assertEqual(poly,4*z**4+y*y**12*y-y)
 def test_convert_univarient(self):
   y = self.y
   sym_poly = 4*self.vars[1]**4 + self.vars[1]*self.vars[1]**12*self.vars[1]-self.vars[1]
   poly = convert_symbolic_to_polynomial(sym_poly,self.poly_ring,self.vars)
   self.assertEqual(poly,4*y**4+y*y**12*y-y)
 def test_zero(self):
   zero = 0*self.vars[0]
   poly = convert_symbolic_to_polynomial(zero,self.poly_ring,self.vars)
   self.assertEqual(poly,self.poly_ring.zero())
 def _convert_p_form_to_p_vec(self,p,p_form):
   p_vec = []
   for _,v in enumerate(skew_iter(self.poly_ring.ngens(),p)):
     poly = convert_symbolic_to_polynomial(p_form[tuple(v)],self.poly_ring,self.form_vars)
     p_vec.append(poly)
   return p_vec
Ejemplo n.º 9
0
 def test_zero(self):
     zero = 0 * self.vars[0]
     poly = convert_symbolic_to_polynomial(zero, self.poly_ring, self.vars)
     self.assertEqual(poly, self.poly_ring.zero())