def optimizeCoeffQuot(self): '''Optimize the term order on the variables of the quotient coefficients. ''' p = self.pset; l = p.list; r = p.ring; q = r.coFac; c = q.ring; rc = GenPolynomialRing( c, r.nvar, r.tord, r.vars ); #print "rc = ", rc; lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); #print "lp = ", lp; pp = PolynomialList(rc,lp); #print "pp = ", pp; oq = TermOrderOptimization.optimizeTermOrderOnCoefficients(pp); oor = oq.ring; qo = oor.coFac; cq = QuotientRing( qo ); rq = GenPolynomialRing( cq, r.nvar, r.tord, r.vars ); #print "rq = ", rq; o = PolyUfdUtil.quotientFromIntegralCoefficients(rq,oq.list); r = Ring("",rq); return ParamIdeal(r,"",o);
def toIntegralCoeff(self): '''Convert rational function coefficients to integral function coefficients. ''' p = self.pset; l = p.list; r = p.ring; q = r.coFac; c = q.ring; rc = GenPolynomialRing( c, r.nvar, r.tord, r.vars ); #print "rc = ", rc; lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); #print "lp = ", lp; r = Ring("",rc); return ParamIdeal(r,"",lp);
def toQuotientCoeff(self): '''Convert integral function coefficients to rational function coefficients. ''' p = self.pset; l = p.list; r = p.ring; c = r.coFac; #print "c = ", c; q = QuotientRing(c); #print "q = ", q; qm = GenPolynomialRing( q, r.nvar, r.tord, r.vars ); #print "qm = ", qm; pm = PolyUfdUtil.quotientFromIntegralCoefficients(qm,l); r = Ring("",qm); return ParamIdeal(r,"",pm);
def toModularCoeff(self,mf): '''Convert integral function coefficients to modular function coefficients. ''' p = self.pset; l = p.list; r = p.ring; c = r.coFac; #print "c = ", c; cm = GenPolynomialRing( mf, c.nvar, c.tord, c.vars ); #print "cm = ", cm; rm = GenPolynomialRing( cm, r.nvar, r.tord, r.vars ); #print "rm = ", rm; pm = PolyUfdUtil.fromIntegerCoefficients(rm,l); r = Ring("",rm); return ParamIdeal(r,"",pm);
sr = ModuleList(f.ring.ring, s); print "rightSyzygy for f:\n" + str(sr.toScript()); print "#rightSyzygy for f = " + str(s.size()); print "#rightSyzygy[0] for f = " + str(s[0].size()); print; #for p in sr.list: # print "p = " + str( [ str(pc.toScript()) for pc in p] ); #print # optional: ir = GenSolvablePolynomialRing(sr.ring.coFac.ring,sr.ring); print "ir = " + str(ir.toScript()); qrel = sr.ring.table.relationList(); irel = PolyUfdUtil.integralFromQuotientCoefficients(ir,qrel); ir.addRelations(irel); print "qr = " + str(sr.ring.toScript()); print "ir = " + str(ir.toScript()); soi = [ PolyUfdUtil.integralFromQuotientCoefficients(ir,sop) for sop in s]; isr = ModuleList(ir, soi); print "integral f:\n" + str(isr.toScript()); print; #terminate(); #sys.exit(); t = System.currentTimeMillis(); #imr = ModSolvableGroebnerBaseSeq(isr.ring.coFac).rightGB(isr); #imr = ModSolvableGroebnerBaseSeq(isr.ring.coFac).leftGB(isr); #imr = ModSolvableGroebnerBaseSeq(isr.ring.coFac).twosidedGB(isr);