Code: Select all
$p=new Polynomial("(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24 + x11*x25 + x12*x25 + x13*x25 + x14*x25 + x15*x25)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23)*(x11*x21 + x11*x22 + x12*x22)*(x21*x31 + x21*x32 + x22*x32 + x21*x33 + x22*x33 + x23*x33 + x21*x34 + x22*x34 + x23*x34 + x24*x34 + x21*x35 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x22*x32 + x22*x33 + x23*x33 + x22*x34 + x23*x34 + x24*x34 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x23*x33 + x23*x34 + x24*x34 + x23*x35 + x24*x35 + x25*x35)*(x24*x34 + x24*x35 + x25*x35)*x31*x32^2*x33^2*x34*x35");
$np = newton($p);
Code: Select all
polytope > $str = "(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24 + x11*x25 + x12*x25 + x13*x25 + x14*x25 + x15*x25)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23 + x11*x24 + x12*x24 + x13*x24 + x14*x24)*(x11*x21 + x11*x22 + x12*x22 + x11*x23 + x12*x23 + x13*x23)*(x11*x21 + x11*x22 + x12*x22)*(x21*x31 + x21*x32 + x22*x32 + x21*x33 + x22*x33 + x23*x33 + x21*x34 + x22*x34 + x23*x34 + x24*x34 + x21*x35 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x22*x32 + x22*x33 + x23*x33 + x22*x34 + x23*x34 + x24*x34 + x22*x35 + x23*x35 + x24*x35 + x25*x35)*(x23*x33 + x23*x34 + x24*x34 + x23*x35 + x24*x35 + x25*x35)*(x24*x34 + x24*x35 + x25*x35)*x31*x32^2*x33^2*x34*x35";
polytope > $str =~ s/x/x_/g;
polytope > $p = new Polynomial($str);
polytope > print $p->n_vars;
36