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 3713 def initialize(ring,polystr="",list=nil,gbsys=nil) 3714 @ring = ring; 3715 if list == nil and polystr != nil 3716 sr = StringReader.new( polystr ); 3717 tok = GenPolynomialTokenizer.new(ring.ring,sr); 3718 @list = tok.nextPolynomialList(); 3719 else 3720 @list = rbarray2arraylist(list,rec=1); 3721 end 3722 @gbsys = gbsys; 3723 @pset = OrderedPolynomialList.new(ring.ring,@list); 3724 end
Public Instance Methods
Compute a comprehensive Groebner base.
# File examples/jas.rb 3850 def CGB() 3851 s = @pset; 3852 ff = s.list; 3853 t = System.currentTimeMillis(); 3854 if @gbsys == nil 3855 @gbsys = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff); 3856 end 3857 gg = @gbsys.getCGB(); 3858 t = System.currentTimeMillis() - t; 3859 puts "sequential comprehensive executed in #{t} ms\n"; 3860 return ParamIdeal.new(@ring,"",gg,@gbsys); 3861 end
Compute a comprehensive Groebner system.
# File examples/jas.rb 3866 def CGBsystem() 3867 s = @pset; 3868 ff = s.list; 3869 t = System.currentTimeMillis(); 3870 ss = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff); 3871 t = System.currentTimeMillis() - t; 3872 puts "sequential comprehensive system executed in #{t} ms\n"; 3873 return ParamIdeal.new(@ring,nil,ff,ss); 3874 end
Compute a Groebner base.
# File examples/jas.rb 3833 def GB() 3834 ii = SimIdeal.new(@ring,"",@pset.list); 3835 g = ii.GB(); 3836 return ParamIdeal.new(g.ring,"",g.pset.list); 3837 end
Test if this is a comprehensive Groebner base.
# File examples/jas.rb 3879 def isCGB() 3880 s = @pset; 3881 ff = s.list; 3882 t = System.currentTimeMillis(); 3883 b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGB(ff); 3884 t = System.currentTimeMillis() - t; 3885 puts "isCGB = #{b} executed in #{t} ms\n"; 3886 return b; 3887 end
Test if this is a comprehensive Groebner system.
# File examples/jas.rb 3892 def isCGBsystem() 3893 s = @pset; 3894 ss = @gbsys; 3895 t = System.currentTimeMillis(); 3896 b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGBsys(ss); 3897 t = System.currentTimeMillis() - t; 3898 puts "isCGBsystem = #{b} executed in #{t} ms\n"; 3899 return b; 3900 end
Test if this is a Groebner base.
# File examples/jas.rb 3842 def isGB() 3843 ii = SimIdeal.new(@ring,"",@pset.list); 3844 return ii.isGB(); 3845 end
Test if this is Groebner base over a regular ring.
# File examples/jas.rb 3944 def isRegularGB() 3945 s = @pset; 3946 ff = s.list; 3947 t = System.currentTimeMillis(); 3948 b = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).isGB(ff); 3949 t = System.currentTimeMillis() - t; 3950 puts "isRegularGB = #{b} executed in #{t} ms\n"; 3951 return b; 3952 end
Optimize the term order on the variables of the coefficients.
# File examples/jas.rb 3741 def optimizeCoeff() 3742 p = @pset; 3743 o = TermOrderOptimization.optimizeTermOrderOnCoefficients(p); 3744 r = Ring.new("",o.ring); 3745 return ParamIdeal.new(r,"",o.list); 3746 end
Optimize the term order on the variables of the quotient coefficients.
# File examples/jas.rb 3751 def optimizeCoeffQuot() 3752 p = @pset; 3753 l = p.list; 3754 r = p.ring; 3755 q = r.coFac; 3756 c = q.ring; 3757 rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars ); 3758 #puts "rc = ", rc; 3759 lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); 3760 #puts "lp = ", lp; 3761 pp = PolynomialList.new(rc,lp); 3762 #puts "pp = ", pp; 3763 oq = TermOrderOptimization.optimizeTermOrderOnCoefficients(pp); 3764 oor = oq.ring; 3765 qo = oor.coFac; 3766 cq = QuotientRing.new( qo ); 3767 rq = GenPolynomialRing.new( cq, r.nvar, r.tord, r.vars ); 3768 #puts "rq = ", rq; 3769 o = PolyUfdUtil.quotientFromIntegralCoefficients(rq,oq.list); 3770 r = Ring.new("",rq); 3771 return ParamIdeal.new(r,"",o); 3772 end
Compute a Groebner base over a regular ring.
# File examples/jas.rb 3931 def regularGB() 3932 s = @pset; 3933 ff = s.list; 3934 t = System.currentTimeMillis(); 3935 gg = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).GB(ff); 3936 t = System.currentTimeMillis() - t; 3937 puts "sequential regular GB executed in #{t} ms\n"; 3938 return ParamIdeal.new(@ring,nil,gg); 3939 end
Convert Groebner system to a representation with regular ring coefficents.
# File examples/jas.rb 3905 def regularRepresentation() 3906 if @gbsys == nil 3907 return nil; 3908 end 3909 gg = PolyUtilApp.toProductRes(@gbsys.list); 3910 ring = Ring.new(nil,gg[0].ring); 3911 return ParamIdeal.new(ring,nil,gg); 3912 end
Convert Groebner system to a boolean closed representation with regular ring coefficents.
# File examples/jas.rb 3917 def regularRepresentationBC() 3918 if @gbsys == nil 3919 return nil; 3920 end 3921 gg = PolyUtilApp.toProductRes(@gbsys.list); 3922 ring = Ring.new(nil,gg[0].ring); 3923 res = RReductionSeq.new(); 3924 gg = res.booleanClosure(gg); 3925 return ParamIdeal.new(ring,nil,gg); 3926 end
Get each component (slice) of regular ring coefficients separate.
# File examples/jas.rb 3957 def stringSlice() 3958 s = @pset; 3959 b = PolyUtilApp.productToString(s); 3960 return b; 3961 end
Convert rational function coefficients to integral function coefficients.
# File examples/jas.rb 3777 def toIntegralCoeff() 3778 p = @pset; 3779 l = p.list; 3780 r = p.ring; 3781 q = r.coFac; 3782 c = q.ring; 3783 rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars ); 3784 #puts "rc = ", rc; 3785 lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l); 3786 #puts "lp = ", lp; 3787 r = Ring.new("",rc); 3788 return ParamIdeal.new(r,"",lp); 3789 end
Convert integral function coefficients to modular function coefficients.
# File examples/jas.rb 3794 def toModularCoeff(mf) 3795 p = @pset; 3796 l = p.list; 3797 r = p.ring; 3798 c = r.coFac; 3799 #puts "c = ", c; 3800 if mf.is_a? RingElem 3801 mf = mf.ring; 3802 end 3803 cm = GenPolynomialRing.new( mf, c.nvar, c.tord, c.vars ); 3804 #puts "cm = ", cm; 3805 rm = GenPolynomialRing.new( cm, r.nvar, r.tord, r.vars ); 3806 #puts "rm = ", rm; 3807 pm = PolyUfdUtil.fromIntegerCoefficients(rm,l); 3808 r = Ring.new("",rm); 3809 return ParamIdeal.new(r,"",pm); 3810 end
Convert integral function coefficients to rational function coefficients.
# File examples/jas.rb 3815 def toQuotientCoeff() 3816 p = @pset; 3817 l = p.list; 3818 r = p.ring; 3819 c = r.coFac; 3820 #puts "c = ", c; 3821 q = QuotientRing.new(c); 3822 #puts "q = ", q; 3823 qm = GenPolynomialRing.new( q, r.nvar, r.tord, r.vars ); 3824 #puts "qm = ", qm; 3825 pm = PolyUfdUtil.quotientFromIntegralCoefficients(qm,l); 3826 r = Ring.new("",qm); 3827 return ParamIdeal.new(r,"",pm); 3828 end
Create a string representation.
# File examples/jas.rb 3729 def to_s() 3730 if @gbsys == nil 3731 return @pset.toScript(); 3732 else 3733 return @pset.toScript() + "\n" + @gbsys.toScript(); 3734 # return @pset.toScript() + "\n" + @gbsys.to_s; 3735 end 3736 end