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
3865 def initialize(ring,polystr="",list=nil,gbsys=nil)
3866     @ring = ring;
3867     if list == nil and polystr != nil
3868        sr = StringReader.new( polystr );
3869        tok = GenPolynomialTokenizer.new(ring.ring,sr);
3870        @list = tok.nextPolynomialList();
3871     else
3872        @list = rbarray2arraylist(list,rec=1);
3873     end
3874     @gbsys = gbsys;
3875     @pset = OrderedPolynomialList.new(ring.ring,@list);
3876 end

Public Instance Methods

CGB() click to toggle source

Compute a comprehensive Groebner base.

     # File examples/jas.rb
4002 def CGB()
4003     s = @pset;
4004     ff = s.list;
4005     t = System.currentTimeMillis();
4006     if @gbsys == nil
4007         @gbsys = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff);
4008     end
4009     gg = @gbsys.getCGB();
4010     t = System.currentTimeMillis() - t;
4011     puts "sequential comprehensive executed in #{t} ms\n"; 
4012     return ParamIdeal.new(@ring,"",gg,@gbsys);
4013 end
CGBsystem() click to toggle source

Compute a comprehensive Groebner system.

     # File examples/jas.rb
4018 def CGBsystem()
4019     s = @pset;
4020     ff = s.list;
4021     t = System.currentTimeMillis();
4022     ss = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff);
4023     t = System.currentTimeMillis() - t;
4024     puts "sequential comprehensive system executed in #{t} ms\n"; 
4025     return ParamIdeal.new(@ring,nil,ff,ss);
4026 end
GB() click to toggle source

Compute a Groebner base.

     # File examples/jas.rb
3985 def GB()
3986     ii = SimIdeal.new(@ring,"",@pset.list);
3987     g = ii.GB();
3988     return ParamIdeal.new(g.ring,"",g.pset.list);
3989 end
isCGB() click to toggle source

Test if this is a comprehensive Groebner base.

     # File examples/jas.rb
4031 def isCGB()
4032     s = @pset;
4033     ff = s.list;
4034     t = System.currentTimeMillis();
4035     b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGB(ff);
4036     t = System.currentTimeMillis() - t;
4037     puts "isCGB = #{b} executed in #{t} ms\n"; 
4038     return b;
4039 end
isCGBsystem() click to toggle source

Test if this is a comprehensive Groebner system.

     # File examples/jas.rb
4044 def isCGBsystem()
4045     s = @pset;
4046     ss = @gbsys;
4047     t = System.currentTimeMillis();
4048     b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGBsys(ss);
4049     t = System.currentTimeMillis() - t;
4050     puts "isCGBsystem = #{b} executed in #{t} ms\n"; 
4051     return b;
4052 end
isGB() click to toggle source

Test if this is a Groebner base.

     # File examples/jas.rb
3994 def isGB()
3995     ii = SimIdeal.new(@ring,"",@pset.list);
3996     return ii.isGB();
3997 end
isRegularGB() click to toggle source

Test if this is Groebner base over a regular ring.

     # File examples/jas.rb
4096 def isRegularGB()
4097     s = @pset;
4098     ff = s.list;
4099     t = System.currentTimeMillis();
4100     b = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).isGB(ff);
4101     t = System.currentTimeMillis() - t;
4102     puts "isRegularGB = #{b} executed in #{t} ms\n"; 
4103     return b;
4104 end
optimizeCoeff() click to toggle source

Optimize the term order on the variables of the coefficients.

     # File examples/jas.rb
3893 def optimizeCoeff()
3894     p = @pset;
3895     o = TermOrderOptimization.optimizeTermOrderOnCoefficients(p);
3896     r = Ring.new("",o.ring);
3897     return ParamIdeal.new(r,"",o.list);
3898 end
optimizeCoeffQuot() click to toggle source

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

     # File examples/jas.rb
3903 def optimizeCoeffQuot()
3904     p = @pset;
3905     l = p.list;
3906     r = p.ring;
3907     q = r.coFac;
3908     c = q.ring;
3909     rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars );
3910     #puts "rc = ", rc;
3911     lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l);
3912     #puts "lp = ", lp;
3913     pp = PolynomialList.new(rc,lp);
3914     #puts "pp = ", pp;
3915     oq = TermOrderOptimization.optimizeTermOrderOnCoefficients(pp);
3916     oor = oq.ring;
3917     qo = oor.coFac;
3918     cq = QuotientRing.new( qo );
3919     rq = GenPolynomialRing.new( cq, r.nvar, r.tord, r.vars );
3920     #puts "rq = ", rq;
3921     o = PolyUfdUtil.quotientFromIntegralCoefficients(rq,oq.list);
3922     r = Ring.new("",rq);
3923     return ParamIdeal.new(r,"",o);
3924 end
regularGB() click to toggle source

Compute a Groebner base over a regular ring.

     # File examples/jas.rb
4083 def regularGB()
4084     s = @pset;
4085     ff = s.list;
4086     t = System.currentTimeMillis();
4087     gg = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).GB(ff);
4088     t = System.currentTimeMillis() - t;
4089     puts "sequential regular GB executed in #{t} ms\n"; 
4090     return ParamIdeal.new(@ring,nil,gg);
4091 end
regularRepresentation() click to toggle source

Convert Groebner system to a representation with regular ring coefficents.

     # File examples/jas.rb
4057 def regularRepresentation()
4058     if @gbsys == nil
4059         return nil;
4060     end
4061     gg = PolyUtilApp.toProductRes(@gbsys.list);
4062     ring = Ring.new(nil,gg[0].ring);
4063     return ParamIdeal.new(ring,nil,gg);
4064 end
regularRepresentationBC() click to toggle source

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

     # File examples/jas.rb
4069 def regularRepresentationBC()
4070     if @gbsys == nil
4071         return nil;
4072     end
4073     gg = PolyUtilApp.toProductRes(@gbsys.list);
4074     ring = Ring.new(nil,gg[0].ring);
4075     res = RReductionSeq.new();
4076     gg = res.booleanClosure(gg);
4077     return ParamIdeal.new(ring,nil,gg);
4078 end
stringSlice() click to toggle source

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

     # File examples/jas.rb
4109 def stringSlice()
4110     s = @pset;
4111     b = PolyUtilApp.productToString(s);
4112     return b;
4113 end
toIntegralCoeff() click to toggle source

Convert rational function coefficients to integral function coefficients.

     # File examples/jas.rb
3929 def toIntegralCoeff()
3930     p = @pset;
3931     l = p.list;
3932     r = p.ring;
3933     q = r.coFac;
3934     c = q.ring;
3935     rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars );
3936     #puts "rc = ", rc;
3937     lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l);
3938     #puts "lp = ", lp;
3939     r = Ring.new("",rc);
3940     return ParamIdeal.new(r,"",lp);
3941 end
toModularCoeff(mf) click to toggle source

Convert integral function coefficients to modular function coefficients.

     # File examples/jas.rb
3946 def toModularCoeff(mf)
3947     p = @pset;
3948     l = p.list;
3949     r = p.ring;
3950     c = r.coFac;
3951     #puts "c = ", c;
3952     if mf.is_a? RingElem
3953         mf = mf.ring;
3954     end
3955     cm = GenPolynomialRing.new( mf, c.nvar, c.tord, c.vars );
3956     #puts "cm = ", cm;
3957     rm = GenPolynomialRing.new( cm, r.nvar, r.tord, r.vars );
3958     #puts "rm = ", rm;
3959     pm = PolyUfdUtil.fromIntegerCoefficients(rm,l);
3960     r = Ring.new("",rm);
3961     return ParamIdeal.new(r,"",pm);
3962 end
toQuotientCoeff() click to toggle source

Convert integral function coefficients to rational function coefficients.

     # File examples/jas.rb
3967 def toQuotientCoeff()
3968     p = @pset;
3969     l = p.list;
3970     r = p.ring;
3971     c = r.coFac;
3972     #puts "c = ", c;
3973     q = QuotientRing.new(c);
3974     #puts "q = ", q;
3975     qm = GenPolynomialRing.new( q, r.nvar, r.tord, r.vars );
3976     #puts "qm = ", qm;
3977     pm = PolyUfdUtil.quotientFromIntegralCoefficients(qm,l);
3978     r = Ring.new("",qm);
3979     return ParamIdeal.new(r,"",pm);
3980 end
to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
3881     def to_s()
3882         if @gbsys == nil
3883             return @pset.toScript();
3884         else
3885             return @pset.toScript() + "\n" + @gbsys.toScript();
3886 #            return @pset.toScript() + "\n" + @gbsys.to_s;
3887         end
3888     end