示例#1
0
 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);
示例#2
0
 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);
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);