class JAS::ParamIdeal
Represents a JAS polynomial ideal with polynomial coefficients.
Methods to compute comprehensive Groebner bases.
Public Class Methods
Parametric ideal constructor.
# File examples/jas.rb, line 3419 def initialize(ring,polystr="",list=nil,gbsys=nil) @ring = ring; if list == nil and polystr != nil sr = StringReader.new( polystr ); tok = GenPolynomialTokenizer.new(ring.ring,sr); @list = tok.nextPolynomialList(); else @list = rbarray2arraylist(list,rec=1); end @gbsys = gbsys; @pset = OrderedPolynomialList.new(ring.ring,@list); end
Public Instance Methods
Compute a comprehensive Groebner base.
# File examples/jas.rb, line 3556 def CGB() s = @pset; ff = s.list; t = System.currentTimeMillis(); if @gbsys == nil @gbsys = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff); end gg = @gbsys.getCGB(); t = System.currentTimeMillis() - t; puts "sequential comprehensive executed in #{t} ms\n"; return ParamIdeal.new(@ring,"",gg,@gbsys); end
Compute a comprehensive Groebner system.
# File examples/jas.rb, line 3572 def CGBsystem() s = @pset; ff = s.list; t = System.currentTimeMillis(); ss = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff); t = System.currentTimeMillis() - t; puts "sequential comprehensive system executed in #{t} ms\n"; return ParamIdeal.new(@ring,nil,ff,ss); end
Compute a Groebner base.
# File examples/jas.rb, line 3539 def GB() ii = SimIdeal.new(@ring,"",@pset.list); g = ii.GB(); return ParamIdeal.new(g.ring,"",g.pset.list); end
Test if this is a comprehensive Groebner base.
# File examples/jas.rb, line 3585 def isCGB() s = @pset; ff = s.list; t = System.currentTimeMillis(); b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGB(ff); t = System.currentTimeMillis() - t; puts "isCGB = #{b} executed in #{t} ms\n"; return b; end
Test if this is a comprehensive Groebner system.
# File examples/jas.rb, line 3598 def isCGBsystem() s = @pset; ss = @gbsys; t = System.currentTimeMillis(); b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGBsys(ss); t = System.currentTimeMillis() - t; puts "isCGBsystem = #{b} executed in #{t} ms\n"; return b; end
Test if this is a Groebner base.
# File examples/jas.rb, line 3548 def isGB() ii = SimIdeal.new(@ring,"",@pset.list); return ii.isGB(); end
Test if this is Groebner base over a regular ring.
# File examples/jas.rb, line 3650 def isRegularGB() s = @pset; ff = s.list; t = System.currentTimeMillis(); b = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).isGB(ff); t = System.currentTimeMillis() - t; puts "isRegularGB = #{b} executed in #{t} ms\n"; return b; end
Optimize the term order on the variables of the coefficients.
# File examples/jas.rb, line 3447 def optimizeCoeff() p = @pset; o = TermOrderOptimization.optimizeTermOrderOnCoefficients(p); r = Ring.new("",o.ring); return ParamIdeal.new(r,"",o.list); end
Optimize the term order on the variables of the quotient coefficients.
# File examples/jas.rb, line 3457 def optimizeCoeffQuot() p = @pset; l = p.list; r = p.ring; q = r.coFac; c = q.ring; rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars ); #puts "rc = ", rc; lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); #puts "lp = ", lp; pp = PolynomialList.new(rc,lp); #puts "pp = ", pp; oq = TermOrderOptimization.optimizeTermOrderOnCoefficients(pp); oor = oq.ring; qo = oor.coFac; cq = QuotientRing.new( qo ); rq = GenPolynomialRing.new( cq, r.nvar, r.tord, r.vars ); #puts "rq = ", rq; o = PolyUfdUtil.quotientFromIntegralCoefficients(rq,oq.list); r = Ring.new("",rq); return ParamIdeal.new(r,"",o); end
Compute a Groebner base over a regular ring.
# File examples/jas.rb, line 3637 def regularGB() s = @pset; ff = s.list; t = System.currentTimeMillis(); gg = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).GB(ff); t = System.currentTimeMillis() - t; puts "sequential regular GB executed in #{t} ms\n"; return ParamIdeal.new(@ring,nil,gg); end
Convert Groebner system to a representation with regular ring coefficents.
# File examples/jas.rb, line 3611 def regularRepresentation() if @gbsys == nil return nil; end gg = PolyUtilApp.toProductRes(@gbsys.list); ring = Ring.new(nil,gg[0].ring); return ParamIdeal.new(ring,nil,gg); end
Convert Groebner system to a boolean closed representation with regular ring coefficents.
# File examples/jas.rb, line 3623 def regularRepresentationBC() if @gbsys == nil return nil; end gg = PolyUtilApp.toProductRes(@gbsys.list); ring = Ring.new(nil,gg[0].ring); res = RReductionSeq.new(); gg = res.booleanClosure(gg); return ParamIdeal.new(ring,nil,gg); end
Get each component (slice) of regular ring coefficients separate.
# File examples/jas.rb, line 3663 def stringSlice() s = @pset; b = PolyUtilApp.productToString(s); return b; end
Convert rational function coefficients to integral function coefficients.
# File examples/jas.rb, line 3483 def toIntegralCoeff() p = @pset; l = p.list; r = p.ring; q = r.coFac; c = q.ring; rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars ); #puts "rc = ", rc; lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); #puts "lp = ", lp; r = Ring.new("",rc); return ParamIdeal.new(r,"",lp); end
Convert integral function coefficients to modular function coefficients.
# File examples/jas.rb, line 3500 def toModularCoeff(mf) p = @pset; l = p.list; r = p.ring; c = r.coFac; #puts "c = ", c; if mf.is_a? RingElem mf = mf.ring; end cm = GenPolynomialRing.new( mf, c.nvar, c.tord, c.vars ); #puts "cm = ", cm; rm = GenPolynomialRing.new( cm, r.nvar, r.tord, r.vars ); #puts "rm = ", rm; pm = PolyUfdUtil.fromIntegerCoefficients(rm,l); r = Ring.new("",rm); return ParamIdeal.new(r,"",pm); end
Convert integral function coefficients to rational function coefficients.
# File examples/jas.rb, line 3521 def toQuotientCoeff() p = @pset; l = p.list; r = p.ring; c = r.coFac; #puts "c = ", c; q = QuotientRing.new(c); #puts "q = ", q; qm = GenPolynomialRing.new( q, r.nvar, r.tord, r.vars ); #puts "qm = ", qm; pm = PolyUfdUtil.quotientFromIntegralCoefficients(qm,l); r = Ring.new("",qm); return ParamIdeal.new(r,"",pm); end
Create a string representation.
# File examples/jas.rb, line 3435 def to_s() if @gbsys == nil return @pset.toScript(); else return @pset.toScript() + "\n" + @gbsys.toScript(); # return @pset.toScript() + "\n" + @gbsys.to_s; end end