// Singular-library. // AUHTOR: Martin Albrecht <[email protected]> info = "efficient format to talk to SAGE"; category="Utilities"; proc sage_poly(poly f) { poly g = f; list ret; int i = 1; //ret[1] = list(leadexp(1),0); //make sure to handle 0 for(i=1; g!=0 ; i=i+1) { ret[i]=list(leadexp(g),leadcoef(g)); g = g - lead(g); } return(ret); }