class JAS::ParamIdeal

Represents a JAS polynomial ideal with polynomial coefficients.

Methods to compute comprehensive Groebner bases.

Public Class Methods

new(ring,polystr="",list=nil,gbsys=nil) click to toggle source

Parametric ideal constructor.

     # File examples/jas.rb
3472 def initialize(ring,polystr="",list=nil,gbsys=nil)
3473     @ring = ring;
3474     if list == nil and polystr != nil
3475        sr = StringReader.new( polystr );
3476        tok = GenPolynomialTokenizer.new(ring.ring,sr);
3477        @list = tok.nextPolynomialList();
3478     else
3479        @list = rbarray2arraylist(list,rec=1);
3480     end
3481     @gbsys = gbsys;
3482     @pset = OrderedPolynomialList.new(ring.ring,@list);
3483 end

Public Instance Methods

CGB() click to toggle source

Compute a comprehensive Groebner base.

     # File examples/jas.rb
3609 def CGB()
3610     s = @pset;
3611     ff = s.list;
3612     t = System.currentTimeMillis();
3613     if @gbsys == nil
3614         @gbsys = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff);
3615     end
3616     gg = @gbsys.getCGB();
3617     t = System.currentTimeMillis() - t;
3618     puts "sequential comprehensive executed in #{t} ms\n"; 
3619     return ParamIdeal.new(@ring,"",gg,@gbsys);
3620 end
CGBsystem() click to toggle source

Compute a comprehensive Groebner system.

     # File examples/jas.rb
3625 def CGBsystem()
3626     s = @pset;
3627     ff = s.list;
3628     t = System.currentTimeMillis();
3629     ss = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff);
3630     t = System.currentTimeMillis() - t;
3631     puts "sequential comprehensive system executed in #{t} ms\n"; 
3632     return ParamIdeal.new(@ring,nil,ff,ss);
3633 end
GB() click to toggle source

Compute a Groebner base.

     # File examples/jas.rb
3592 def GB()
3593     ii = SimIdeal.new(@ring,"",@pset.list);
3594     g = ii.GB();
3595     return ParamIdeal.new(g.ring,"",g.pset.list);
3596 end
isCGB() click to toggle source

Test if this is a comprehensive Groebner base.

     # File examples/jas.rb
3638 def isCGB()
3639     s = @pset;
3640     ff = s.list;
3641     t = System.currentTimeMillis();
3642     b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGB(ff);
3643     t = System.currentTimeMillis() - t;
3644     puts "isCGB = #{b} executed in #{t} ms\n"; 
3645     return b;
3646 end
isCGBsystem() click to toggle source

Test if this is a comprehensive Groebner system.

     # File examples/jas.rb
3651 def isCGBsystem()
3652     s = @pset;
3653     ss = @gbsys;
3654     t = System.currentTimeMillis();
3655     b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGBsys(ss);
3656     t = System.currentTimeMillis() - t;
3657     puts "isCGBsystem = #{b} executed in #{t} ms\n"; 
3658     return b;
3659 end
isGB() click to toggle source

Test if this is a Groebner base.

     # File examples/jas.rb
3601 def isGB()
3602     ii = SimIdeal.new(@ring,"",@pset.list);
3603     return ii.isGB();
3604 end
isRegularGB() click to toggle source

Test if this is Groebner base over a regular ring.

     # File examples/jas.rb
3703 def isRegularGB()
3704     s = @pset;
3705     ff = s.list;
3706     t = System.currentTimeMillis();
3707     b = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).isGB(ff);
3708     t = System.currentTimeMillis() - t;
3709     puts "isRegularGB = #{b} executed in #{t} ms\n"; 
3710     return b;
3711 end
optimizeCoeff() click to toggle source

Optimize the term order on the variables of the coefficients.

     # File examples/jas.rb
3500 def optimizeCoeff()
3501     p = @pset;
3502     o = TermOrderOptimization.optimizeTermOrderOnCoefficients(p);
3503     r = Ring.new("",o.ring);
3504     return ParamIdeal.new(r,"",o.list);
3505 end
optimizeCoeffQuot() click to toggle source

Optimize the term order on the variables of the quotient coefficients.

     # File examples/jas.rb
3510 def optimizeCoeffQuot()
3511     p = @pset;
3512     l = p.list;
3513     r = p.ring;
3514     q = r.coFac;
3515     c = q.ring;
3516     rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars );
3517     #puts "rc = ", rc;
3518     lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l);
3519     #puts "lp = ", lp;
3520     pp = PolynomialList.new(rc,lp);
3521     #puts "pp = ", pp;
3522     oq = TermOrderOptimization.optimizeTermOrderOnCoefficients(pp);
3523     oor = oq.ring;
3524     qo = oor.coFac;
3525     cq = QuotientRing.new( qo );
3526     rq = GenPolynomialRing.new( cq, r.nvar, r.tord, r.vars );
3527     #puts "rq = ", rq;
3528     o = PolyUfdUtil.quotientFromIntegralCoefficients(rq,oq.list);
3529     r = Ring.new("",rq);
3530     return ParamIdeal.new(r,"",o);
3531 end
regularGB() click to toggle source

Compute a Groebner base over a regular ring.

     # File examples/jas.rb
3690 def regularGB()
3691     s = @pset;
3692     ff = s.list;
3693     t = System.currentTimeMillis();
3694     gg = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).GB(ff);
3695     t = System.currentTimeMillis() - t;
3696     puts "sequential regular GB executed in #{t} ms\n"; 
3697     return ParamIdeal.new(@ring,nil,gg);
3698 end
regularRepresentation() click to toggle source

Convert Groebner system to a representation with regular ring coefficents.

     # File examples/jas.rb
3664 def regularRepresentation()
3665     if @gbsys == nil
3666         return nil;
3667     end
3668     gg = PolyUtilApp.toProductRes(@gbsys.list);
3669     ring = Ring.new(nil,gg[0].ring);
3670     return ParamIdeal.new(ring,nil,gg);
3671 end
regularRepresentationBC() click to toggle source

Convert Groebner system to a boolean closed representation with regular ring coefficents.

     # File examples/jas.rb
3676 def regularRepresentationBC()
3677     if @gbsys == nil
3678         return nil;
3679     end
3680     gg = PolyUtilApp.toProductRes(@gbsys.list);
3681     ring = Ring.new(nil,gg[0].ring);
3682     res = RReductionSeq.new();
3683     gg = res.booleanClosure(gg);
3684     return ParamIdeal.new(ring,nil,gg);
3685 end
stringSlice() click to toggle source

Get each component (slice) of regular ring coefficients separate.

     # File examples/jas.rb
3716 def stringSlice()
3717     s = @pset;
3718     b = PolyUtilApp.productToString(s);
3719     return b;
3720 end
toIntegralCoeff() click to toggle source

Convert rational function coefficients to integral function coefficients.

     # File examples/jas.rb
3536 def toIntegralCoeff()
3537     p = @pset;
3538     l = p.list;
3539     r = p.ring;
3540     q = r.coFac;
3541     c = q.ring;
3542     rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars );
3543     #puts "rc = ", rc;
3544     lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l);
3545     #puts "lp = ", lp;
3546     r = Ring.new("",rc);
3547     return ParamIdeal.new(r,"",lp);
3548 end
toModularCoeff(mf) click to toggle source

Convert integral function coefficients to modular function coefficients.

     # File examples/jas.rb
3553 def toModularCoeff(mf)
3554     p = @pset;
3555     l = p.list;
3556     r = p.ring;
3557     c = r.coFac;
3558     #puts "c = ", c;
3559     if mf.is_a? RingElem
3560         mf = mf.ring;
3561     end
3562     cm = GenPolynomialRing.new( mf, c.nvar, c.tord, c.vars );
3563     #puts "cm = ", cm;
3564     rm = GenPolynomialRing.new( cm, r.nvar, r.tord, r.vars );
3565     #puts "rm = ", rm;
3566     pm = PolyUfdUtil.fromIntegerCoefficients(rm,l);
3567     r = Ring.new("",rm);
3568     return ParamIdeal.new(r,"",pm);
3569 end
toQuotientCoeff() click to toggle source

Convert integral function coefficients to rational function coefficients.

     # File examples/jas.rb
3574 def toQuotientCoeff()
3575     p = @pset;
3576     l = p.list;
3577     r = p.ring;
3578     c = r.coFac;
3579     #puts "c = ", c;
3580     q = QuotientRing.new(c);
3581     #puts "q = ", q;
3582     qm = GenPolynomialRing.new( q, r.nvar, r.tord, r.vars );
3583     #puts "qm = ", qm;
3584     pm = PolyUfdUtil.quotientFromIntegralCoefficients(qm,l);
3585     r = Ring.new("",qm);
3586     return ParamIdeal.new(r,"",pm);
3587 end
to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
3488     def to_s()
3489         if @gbsys == nil
3490             return @pset.toScript();
3491         else
3492             return @pset.toScript() + "\n" + @gbsys.toScript();
3493 #            return @pset.toScript() + "\n" + @gbsys.to_s;
3494         end
3495     end