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 3525 def initialize(ring,polystr="",list=nil,gbsys=nil) 3526 @ring = ring; 3527 if list == nil and polystr != nil 3528 sr = StringReader.new( polystr ); 3529 tok = GenPolynomialTokenizer.new(ring.ring,sr); 3530 @list = tok.nextPolynomialList(); 3531 else 3532 @list = rbarray2arraylist(list,rec=1); 3533 end 3534 @gbsys = gbsys; 3535 @pset = OrderedPolynomialList.new(ring.ring,@list); 3536 end
Public Instance Methods
Compute a comprehensive Groebner base.
# File examples/jas.rb 3662 def CGB() 3663 s = @pset; 3664 ff = s.list; 3665 t = System.currentTimeMillis(); 3666 if @gbsys == nil 3667 @gbsys = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff); 3668 end 3669 gg = @gbsys.getCGB(); 3670 t = System.currentTimeMillis() - t; 3671 puts "sequential comprehensive executed in #{t} ms\n"; 3672 return ParamIdeal.new(@ring,"",gg,@gbsys); 3673 end
Compute a comprehensive Groebner system.
# File examples/jas.rb 3678 def CGBsystem() 3679 s = @pset; 3680 ff = s.list; 3681 t = System.currentTimeMillis(); 3682 ss = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff); 3683 t = System.currentTimeMillis() - t; 3684 puts "sequential comprehensive system executed in #{t} ms\n"; 3685 return ParamIdeal.new(@ring,nil,ff,ss); 3686 end
Compute a Groebner base.
# File examples/jas.rb 3645 def GB() 3646 ii = SimIdeal.new(@ring,"",@pset.list); 3647 g = ii.GB(); 3648 return ParamIdeal.new(g.ring,"",g.pset.list); 3649 end
Test if this is a comprehensive Groebner base.
# File examples/jas.rb 3691 def isCGB() 3692 s = @pset; 3693 ff = s.list; 3694 t = System.currentTimeMillis(); 3695 b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGB(ff); 3696 t = System.currentTimeMillis() - t; 3697 puts "isCGB = #{b} executed in #{t} ms\n"; 3698 return b; 3699 end
Test if this is a comprehensive Groebner system.
# File examples/jas.rb 3704 def isCGBsystem() 3705 s = @pset; 3706 ss = @gbsys; 3707 t = System.currentTimeMillis(); 3708 b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGBsys(ss); 3709 t = System.currentTimeMillis() - t; 3710 puts "isCGBsystem = #{b} executed in #{t} ms\n"; 3711 return b; 3712 end
Test if this is a Groebner base.
# File examples/jas.rb 3654 def isGB() 3655 ii = SimIdeal.new(@ring,"",@pset.list); 3656 return ii.isGB(); 3657 end
Test if this is Groebner base over a regular ring.
# File examples/jas.rb 3756 def isRegularGB() 3757 s = @pset; 3758 ff = s.list; 3759 t = System.currentTimeMillis(); 3760 b = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).isGB(ff); 3761 t = System.currentTimeMillis() - t; 3762 puts "isRegularGB = #{b} executed in #{t} ms\n"; 3763 return b; 3764 end
Optimize the term order on the variables of the coefficients.
# File examples/jas.rb 3553 def optimizeCoeff() 3554 p = @pset; 3555 o = TermOrderOptimization.optimizeTermOrderOnCoefficients(p); 3556 r = Ring.new("",o.ring); 3557 return ParamIdeal.new(r,"",o.list); 3558 end
Optimize the term order on the variables of the quotient coefficients.
# File examples/jas.rb 3563 def optimizeCoeffQuot() 3564 p = @pset; 3565 l = p.list; 3566 r = p.ring; 3567 q = r.coFac; 3568 c = q.ring; 3569 rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars ); 3570 #puts "rc = ", rc; 3571 lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); 3572 #puts "lp = ", lp; 3573 pp = PolynomialList.new(rc,lp); 3574 #puts "pp = ", pp; 3575 oq = TermOrderOptimization.optimizeTermOrderOnCoefficients(pp); 3576 oor = oq.ring; 3577 qo = oor.coFac; 3578 cq = QuotientRing.new( qo ); 3579 rq = GenPolynomialRing.new( cq, r.nvar, r.tord, r.vars ); 3580 #puts "rq = ", rq; 3581 o = PolyUfdUtil.quotientFromIntegralCoefficients(rq,oq.list); 3582 r = Ring.new("",rq); 3583 return ParamIdeal.new(r,"",o); 3584 end
Compute a Groebner base over a regular ring.
# File examples/jas.rb 3743 def regularGB() 3744 s = @pset; 3745 ff = s.list; 3746 t = System.currentTimeMillis(); 3747 gg = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).GB(ff); 3748 t = System.currentTimeMillis() - t; 3749 puts "sequential regular GB executed in #{t} ms\n"; 3750 return ParamIdeal.new(@ring,nil,gg); 3751 end
Convert Groebner system to a representation with regular ring coefficents.
# File examples/jas.rb 3717 def regularRepresentation() 3718 if @gbsys == nil 3719 return nil; 3720 end 3721 gg = PolyUtilApp.toProductRes(@gbsys.list); 3722 ring = Ring.new(nil,gg[0].ring); 3723 return ParamIdeal.new(ring,nil,gg); 3724 end
Convert Groebner system to a boolean closed representation with regular ring coefficents.
# File examples/jas.rb 3729 def regularRepresentationBC() 3730 if @gbsys == nil 3731 return nil; 3732 end 3733 gg = PolyUtilApp.toProductRes(@gbsys.list); 3734 ring = Ring.new(nil,gg[0].ring); 3735 res = RReductionSeq.new(); 3736 gg = res.booleanClosure(gg); 3737 return ParamIdeal.new(ring,nil,gg); 3738 end
Get each component (slice) of regular ring coefficients separate.
# File examples/jas.rb 3769 def stringSlice() 3770 s = @pset; 3771 b = PolyUtilApp.productToString(s); 3772 return b; 3773 end
Convert rational function coefficients to integral function coefficients.
# File examples/jas.rb 3589 def toIntegralCoeff() 3590 p = @pset; 3591 l = p.list; 3592 r = p.ring; 3593 q = r.coFac; 3594 c = q.ring; 3595 rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars ); 3596 #puts "rc = ", rc; 3597 lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); 3598 #puts "lp = ", lp; 3599 r = Ring.new("",rc); 3600 return ParamIdeal.new(r,"",lp); 3601 end
Convert integral function coefficients to modular function coefficients.
# File examples/jas.rb 3606 def toModularCoeff(mf) 3607 p = @pset; 3608 l = p.list; 3609 r = p.ring; 3610 c = r.coFac; 3611 #puts "c = ", c; 3612 if mf.is_a? RingElem 3613 mf = mf.ring; 3614 end 3615 cm = GenPolynomialRing.new( mf, c.nvar, c.tord, c.vars ); 3616 #puts "cm = ", cm; 3617 rm = GenPolynomialRing.new( cm, r.nvar, r.tord, r.vars ); 3618 #puts "rm = ", rm; 3619 pm = PolyUfdUtil.fromIntegerCoefficients(rm,l); 3620 r = Ring.new("",rm); 3621 return ParamIdeal.new(r,"",pm); 3622 end
Convert integral function coefficients to rational function coefficients.
# File examples/jas.rb 3627 def toQuotientCoeff() 3628 p = @pset; 3629 l = p.list; 3630 r = p.ring; 3631 c = r.coFac; 3632 #puts "c = ", c; 3633 q = QuotientRing.new(c); 3634 #puts "q = ", q; 3635 qm = GenPolynomialRing.new( q, r.nvar, r.tord, r.vars ); 3636 #puts "qm = ", qm; 3637 pm = PolyUfdUtil.quotientFromIntegralCoefficients(qm,l); 3638 r = Ring.new("",qm); 3639 return ParamIdeal.new(r,"",pm); 3640 end
Create a string representation.
# File examples/jas.rb 3541 def to_s() 3542 if @gbsys == nil 3543 return @pset.toScript(); 3544 else 3545 return @pset.toScript() + "\n" + @gbsys.toScript(); 3546 # return @pset.toScript() + "\n" + @gbsys.to_s; 3547 end 3548 end