class JAS::SimIdeal

Represents a JAS polynomial ideal: PolynomialList and Ideal.

Methods for Groebner bases, ideal sum, intersection and others.

Attributes

list[R]

the Java polynomial list, polynomial ring, and ideal decompositions

primary[R]

the Java polynomial list, polynomial ring, and ideal decompositions

prime[R]

the Java polynomial list, polynomial ring, and ideal decompositions

pset[R]

the Java polynomial list, polynomial ring, and ideal decompositions

ring[R]

the Java polynomial list, polynomial ring, and ideal decompositions

roots[R]

the Java polynomial list, polynomial ring, and ideal decompositions

Public Class Methods

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

SimIdeal constructor.

     # File examples/jas.rb
3085 def initialize(ring,polystr="",list=nil)
3086     @ring = ring;
3087     if list == nil
3088        sr = StringReader.new( polystr );
3089        tok = GenPolynomialTokenizer.new(ring::ring,sr);
3090        @list = tok.nextPolynomialList();
3091     else
3092        @list = rbarray2arraylist(list,rec=1);
3093     end
3094     #@list = PolyUtil.monic(@list);
3095     @pset = OrderedPolynomialList.new(@ring.ring,@list);
3096     #@ideal = Ideal.new(@pset);
3097     @roots = nil;
3098     @croots = nil;
3099     @prime = nil;
3100     @primary = nil;
3101     #super(@ring::ring,@list) # non-sense, JRuby extends application.Ideal
3102 end

Public Instance Methods

<=>(other) click to toggle source

Compare two ideals.

     # File examples/jas.rb
3114 def <=>(other)
3115     s = Ideal.new(@pset);
3116     o = Ideal.new(other.pset);
3117     return s.compareTo(o);
3118 end
==(other) click to toggle source

Test if two ideals are equal.

     # File examples/jas.rb
3123 def ==(other)
3124     if not other.is_a? SimIdeal
3125        return false;
3126     end
3127     return (self <=> other) == 0; 
3128 end
CS() click to toggle source

Compute a Characteristic Set.

     # File examples/jas.rb
3769 def CS()
3770     s = @pset;
3771     cofac = s.ring.coFac;
3772     ff = s.list;
3773     t = System.currentTimeMillis();
3774     if cofac.isField()
3775         gg = CharacteristicSetWu.new().characteristicSet(ff);
3776     else
3777         puts "CS not implemented for coefficients #{cofac.toScriptFactory()}\n"; 
3778         gg = nil;
3779     end
3780     t = System.currentTimeMillis() - t;
3781     puts "sequential char set executed in #{t} ms\n"; 
3782     return SimIdeal.new(@ring,"",gg);
3783 end
GB() click to toggle source

Compute a Groebner base.

     # File examples/jas.rb
3156 def GB()
3157     #if @ideal != nil
3158     #   return SimIdeal.new(@ring,"",nil,@ideal.GB());
3159     #end
3160     cofac = @ring.ring.coFac;
3161     ff = @pset.list;
3162     kind = "";
3163     t = System.currentTimeMillis();
3164     if cofac.isField()
3165         #gg = GroebnerBaseSeq.new().GB(ff);
3166         #gg = GroebnerBaseSeq.new(ReductionSeq.new(),OrderedPairlist.new()).GB(ff);
3167         gg = GroebnerBaseSeq.new(ReductionSeq.new(),OrderedSyzPairlist.new()).GB(ff);
3168         #gg = GroebnerBaseSeqIter.new(ReductionSeq.new(),OrderedSyzPairlist.new()).GB(ff);
3169         kind = "field"
3170     else
3171         if cofac.is_a? GenPolynomialRing and cofac.isCommutative()
3172             gg = GroebnerBasePseudoRecSeq.new(cofac).GB(ff);
3173             kind = "pseudoRec"
3174         else
3175             gg = GroebnerBasePseudoSeq.new(cofac).GB(ff);
3176             kind = "pseudo"
3177         end
3178     end
3179     t = System.currentTimeMillis() - t;
3180     puts "sequential(#{kind}) GB executed in #{t} ms\n"; 
3181     return SimIdeal.new(@ring,"",gg);
3182 end
NF(reducer) click to toggle source

Compute a normal form of this ideal with respect to reducer.

     # File examples/jas.rb
3472 def NF(reducer)
3473     s = @pset;
3474     ff = s.list;
3475     gg = reducer.list;
3476     t = System.currentTimeMillis();
3477     nn = ReductionSeq.new().normalform(gg,ff);
3478     t = System.currentTimeMillis() - t;
3479     puts "sequential NF executed in #{t} ms\n"; 
3480     return SimIdeal.new(@ring,"",nn);
3481 end
complexRoots() click to toggle source

Compute complex roots of 0-dim ideal.

     # File examples/jas.rb
3689 def complexRoots()
3690     ii = Ideal.new(@pset);
3691     @croots = PolyUtilApp.complexAlgebraicRoots(ii);
3692     for r in @croots
3693         r.doDecimalApproximation();
3694     end
3695     return @croots;
3696 end
complexRootsPrint() click to toggle source

Print decimal approximation of complex roots of 0-dim ideal.

     # File examples/jas.rb
3701 def complexRootsPrint()
3702     if @croots == nil
3703         ii = Ideal.new(@pset);
3704         @croots = PolyUtilApp.complexAlgebraicRoots(ii);
3705         for r in @croots
3706             r.doDecimalApproximation();
3707         end
3708     end
3709     for ic in @croots
3710         for dc in ic.decimalApproximation()
3711             puts dc.to_s;
3712         end
3713         puts;
3714     end
3715 end
csReduction(p) click to toggle source

Compute a normal form of polynomial p with respect this characteristic set.

     # File examples/jas.rb
3808 def csReduction(p)
3809     s = @pset;
3810     ff = s.list.clone();
3811     Collections.reverse(ff); # todo
3812     if p.is_a? RingElem
3813         p = p.elem;
3814     end
3815     t = System.currentTimeMillis();
3816     nn = CharacteristicSetWu.new().characteristicSetReduction(ff,p);
3817     t = System.currentTimeMillis() - t;
3818     #puts "sequential char set reduction executed in #{t} ms\n";
3819     return RingElem.new(nn);
3820 end
dGB() click to toggle source

Compute an d-Groebner base.

     # File examples/jas.rb
3281 def dGB()
3282     s = @pset;
3283     cofac = s.ring.coFac;
3284     ff = s.list;
3285     t = System.currentTimeMillis();
3286     if cofac.isField()
3287         gg = GroebnerBaseSeq.new().GB(ff);
3288     else
3289         gg = DGroebnerBaseSeq.new().GB(ff)
3290     end
3291     t = System.currentTimeMillis() - t;
3292     puts "sequential d-GB executed in #{t} ms\n"; 
3293     return SimIdeal.new(@ring,"",gg);
3294 end
decomposition() click to toggle source

Compute irreducible decomposition of this ideal.

     # File examples/jas.rb
3680 def decomposition()
3681     ii = Ideal.new(@pset);
3682     @irrdec = ii.decomposition();
3683     return @irrdec;
3684 end
dimension() click to toggle source

Compute the dimension of the ideal.

     # File examples/jas.rb
3630 def dimension()
3631     ii = Ideal.new(@pset);
3632     d = ii.dimension();
3633     return d;
3634 end
distClient(port=4711) click to toggle source

Client for a distributed computation.

     # File examples/jas.rb
3371 def distClient(port=4711)
3372     s = @pset;
3373     e1 = ExecutableServer.new( port );
3374     e1.init();
3375     e2 = ExecutableServer.new( port+1 );
3376     e2.init();
3377     @exers = [e1,e2];
3378     return nil;
3379 end
distClientStop() click to toggle source

Client for a distributed computation.

     # File examples/jas.rb
3385 def distClientStop()
3386     for es in @exers;
3387         es.terminate();
3388     end
3389     return nil;
3390 end
distGB(th=2,machine="examples/machines.localhost",port=55711) click to toggle source

Compute on a distributed system a Groebner base.

     # File examples/jas.rb
3352 def distGB(th=2,machine="examples/machines.localhost",port=55711)
3353     s = @pset;
3354     ff = s.list;
3355     t = System.currentTimeMillis();
3356     # old: gbd = GBDist.new(th,machine,port);
3357     gbd = GroebnerBaseDistributedEC.new(machine,th,port);
3358     #gbd = GroebnerBaseDistributedHybridEC.new(machine,th,3,port);
3359     t1 = System.currentTimeMillis();
3360     gg = gbd.GB(ff);
3361     t1 = System.currentTimeMillis() - t1;
3362     gbd.terminate(false);
3363     t = System.currentTimeMillis() - t;
3364     puts "distributed #{th} executed in #{t1} ms (#{t-t1} ms start-up)\n"; 
3365     return SimIdeal.new(@ring,"",gg);
3366 end
eExtGB() click to toggle source

Compute an extended e-Groebner base.

     # File examples/jas.rb
3245 def eExtGB()
3246     s = @pset;
3247     cofac = s.ring.coFac;
3248     ff = s.list;
3249     t = System.currentTimeMillis();
3250     if cofac.isField()
3251         gg = GroebnerBaseSeq.new().extGB(ff);
3252     else
3253         gg = EGroebnerBaseSeq.new().extGB(ff)
3254     end
3255     t = System.currentTimeMillis() - t;
3256     puts "sequential extended e-GB executed in #{t} ms\n";
3257     return gg; #SimIdeal.new(@ring,"",gg);
3258 end
eGB() click to toggle source

Compute an e-Groebner base.

     # File examples/jas.rb
3209 def eGB()
3210     s = @pset;
3211     cofac = s.ring.coFac;
3212     ff = s.list;
3213     t = System.currentTimeMillis();
3214     if cofac.isField()
3215         gg = GroebnerBaseSeq.new().GB(ff);
3216     else
3217         gg = EGroebnerBaseSeq.new().GB(ff)
3218     end
3219     t = System.currentTimeMillis() - t;
3220     puts "sequential e-GB executed in #{t} ms\n"; 
3221     return SimIdeal.new(@ring,"",gg);
3222 end
eInverse(p) click to toggle source

Compute the e- inverse polynomial modulo this e-ideal, if it exists.

     # File examples/jas.rb
3592 def eInverse(p)
3593     if p.is_a? RingElem
3594         p = p.elem;
3595     end
3596     i = EGroebnerBaseSeq.new().inverse(p, @list);
3597     return RingElem.new(i);
3598 end
eReduction(p) click to toggle source

Compute a e-normal form of p with respect to this ideal.

     # File examples/jas.rb
3417 def eReduction(p)
3418     s = @pset;
3419     gg = s.list;
3420     if p.is_a? RingElem
3421         p = p.elem;
3422     end
3423     t = System.currentTimeMillis();
3424     n = EReductionSeq.new().normalform(gg,p);
3425     t = System.currentTimeMillis() - t;
3426     puts "sequential eReduction executed in " + str(t) + " ms"; 
3427     return RingElem.new(n);
3428 end
eReductionRec(row, p) click to toggle source

Compute a e-normal form with recording in row of p with respect to this ideal.

     # File examples/jas.rb
3433 def eReductionRec(row, p)
3434     s = @pset;
3435     gg = s.list;
3436     row = rbarray2arraylist(row,nil,rec=1)
3437     if p.is_a? RingElem
3438         p = p.elem;
3439     end
3440     #puts "p   = " + str(p);
3441     #puts "gg  = " + str(gg);
3442     #puts "row_1 = " + str(row);
3443     t = System.currentTimeMillis();
3444     n = EReductionSeq.new().normalform(row,gg,p);
3445     t = System.currentTimeMillis() - t;
3446     #puts "row_2 = " + str(row);
3447     puts "sequential eReduction recording executed in " + str(t) + " ms";
3448     #row = row.map{|a| RingElem.new(a) };
3449     return row, RingElem.new(n);
3450 end
eliminateRing(ring) click to toggle source

Compute the elimination ideal of this and the given polynomial ring.

     # File examples/jas.rb
3538 def eliminateRing(ring)
3539     s = Ideal.new(@pset);
3540     nn = s.eliminate(ring.ring);
3541     r = Ring.new( "", nn.getRing() );
3542     return SimIdeal.new(r,"",nn.getList());
3543 end
interreduced_basis() click to toggle source

Compute a interreduced ideal basis of this.

     # File examples/jas.rb
3510 def interreduced_basis()
3511     ff = @pset.list;
3512     nn = ReductionSeq.new().irreducibleSet(ff);
3513     return nn.map{ |x| RingElem.new(x) };
3514 end
intersect(id2) click to toggle source

Compute the intersection of this and the given ideal.

     # File examples/jas.rb
3528 def intersect(id2)
3529     s1 = Ideal.new(@pset);
3530     s2 = Ideal.new(id2.pset);
3531     nn = s1.intersect(s2);
3532     return SimIdeal.new(@ring,"",nn.getList());
3533 end
intersectRing(ring) click to toggle source

Compute the intersection of this and the given polynomial ring.

     # File examples/jas.rb
3519 def intersectRing(ring)
3520     s = Ideal.new(@pset);
3521     nn = s.intersect(ring.ring);
3522     return SimIdeal.new(ring,"",nn.getList());
3523 end
inverse(p) click to toggle source

Compute the inverse polynomial modulo this ideal, if it exists.

     # File examples/jas.rb
3580 def inverse(p)
3581     if p.is_a? RingElem
3582         p = p.elem;
3583     end
3584     s = Ideal.new(@pset);
3585     i = s.inverse(p);
3586     return RingElem.new(i);
3587 end
isCS() click to toggle source

Test for Characteristic Set.

     # File examples/jas.rb
3788 def isCS()
3789     s = @pset;
3790     cofac = s.ring.coFac;
3791     ff = s.list.clone();
3792     Collections.reverse(ff); # todo
3793     t = System.currentTimeMillis();
3794     if cofac.isField()
3795         b = CharacteristicSetWu.new().isCharacteristicSet(ff);
3796     else
3797         puts "isCS not implemented for coefficients #{cofac.toScriptFactory()}\n"; 
3798         b = false;
3799     end
3800     t = System.currentTimeMillis() - t;
3801     #puts "sequential is char set executed in #{t} ms\n";
3802     return b;
3803 end
isGB() click to toggle source

Test if this is a Groebner base.

     # File examples/jas.rb
3187 def isGB()
3188     s = @pset;
3189     cofac = s.ring.coFac;
3190     ff = s.list;
3191     t = System.currentTimeMillis();
3192     if cofac.isField()
3193         b = GroebnerBaseSeq.new().isGB(ff);
3194     else
3195         if cofac.is_a? GenPolynomialRing and cofac.isCommutative()
3196             b = GroebnerBasePseudoRecSeq.new(cofac).isGB(ff);
3197         else
3198             b = GroebnerBasePseudoSeq.new(cofac).isGB(ff);
3199         end
3200     end
3201     t = System.currentTimeMillis() - t;
3202     puts "isGB = #{b} executed in #{t} ms\n"; 
3203     return b;
3204 end
isONE() click to toggle source

Test if ideal is one.

     # File examples/jas.rb
3133 def isONE()
3134     s = Ideal.new(@pset);
3135     return s.isONE(); 
3136 end
isSyzygy(m) click to toggle source

Test if this is a syzygy of the module in m.

     # File examples/jas.rb
3839 def isSyzygy(m)
3840     p = @pset;
3841     g = p.list;
3842     l = m.list;
3843     #puts "l = #{l}";
3844     #puts "g = #{g}";
3845     t = System.currentTimeMillis();
3846     z = SyzygySeq.new(p.ring.coFac).isZeroRelation( l, g );
3847     t = System.currentTimeMillis() - t;
3848     puts "executed isSyzygy in #{t} ms\n"; 
3849     return z;
3850 end
isZERO() click to toggle source

Test if ideal is zero.

     # File examples/jas.rb
3141 def isZERO()
3142     s = Ideal.new(@pset);
3143     return s.isZERO(); 
3144 end
isdGB() click to toggle source

Test if this is a d-Groebner base.

     # File examples/jas.rb
3299 def isdGB()
3300     s = @pset;
3301     cofac = s.ring.coFac;
3302     ff = s.list;
3303     t = System.currentTimeMillis();
3304     if cofac.isField()
3305         b = GroebnerBaseSeq.new().isGB(ff);
3306     else
3307         b = DGroebnerBaseSeq.new().isGB(ff)
3308     end
3309     t = System.currentTimeMillis() - t;
3310     puts "is d-GB = #{b} executed in #{t} ms\n"; 
3311     return b;
3312 end
iseExtGB(eg) click to toggle source

Test if eg is an extended e-Groebner base.

     # File examples/jas.rb
3263 def iseExtGB(eg)
3264     s = @pset;
3265     cofac = s.ring.coFac;
3266     ff = s.list;
3267     t = System.currentTimeMillis();
3268     if cofac.isField()
3269         b = GroebnerBaseSeq.new().isMinReductionMatrix(eg);
3270     else
3271         b = EGroebnerBaseSeq.new().isMinReductionMatrix(eg)
3272     end
3273     t = System.currentTimeMillis() - t;
3274     #puts "sequential test extended e-GB executed in #{t} ms\n";
3275     return b;
3276 end
iseGB() click to toggle source

Test if this is an e-Groebner base.

     # File examples/jas.rb
3227 def iseGB()
3228     s = @pset;
3229     cofac = s.ring.coFac;
3230     ff = s.list;
3231     t = System.currentTimeMillis();
3232     if cofac.isField()
3233         b = GroebnerBaseSeq.new().isGB(ff);
3234     else
3235         b = EGroebnerBaseSeq.new().isGB(ff)
3236     end
3237     t = System.currentTimeMillis() - t;
3238     puts "is e-GB = #{b} executed in #{t} ms\n"; 
3239     return b;
3240 end
iseInverse(i, p) click to toggle source

Test if i is a e-inverse of p modulo this e-ideal.

     # File examples/jas.rb
3603 def iseInverse(i, p)
3604     if i.is_a? RingElem
3605         i = i.elem;
3606     end
3607     if p.is_a? RingElem
3608         p = p.elem;
3609     end
3610     r = EReductionSeq.new().normalform(@list, i.multiply(p));
3611     #puts "r = " + str(r);
3612     return r.isONE();
3613 end
iseReductionRec(row, p, n) click to toggle source

Test if n is a e-normalform with recording in row of p with respect to this ideal.

     # File examples/jas.rb
3455 def iseReductionRec(row, p, n)
3456     s = @pset;
3457     gg = s.list;
3458     row = rbarray2arraylist(row,nil,rec=1)
3459     if p.is_a? RingElem
3460         p = p.elem;
3461     end
3462     if n.is_a? RingElem
3463         n = n.elem;
3464     end
3465     b = EReductionSeq.new().isReductionNF(row,gg,p,n);
3466     return b;
3467 end
lift(p) click to toggle source

Represent p as element of this ideal.

     # File examples/jas.rb
3486 def lift(p)
3487     gg = @pset.list;
3488     z = @ring.ring.getZERO();
3489     rr = gg.map { |x| z };
3490     if p.is_a? RingElem
3491         p = p.elem;
3492     end
3493     #t = System.currentTimeMillis();
3494     if @ring.ring.coFac.isField()
3495        n = ReductionSeq.new().normalform(rr,gg,p);
3496     else 
3497        n = PseudoReductionSeq.new().normalform(rr,gg,p);
3498     end
3499     if not n.isZERO()
3500        raise StandardError, "p ist not a member of the ideal"
3501     end
3502     #t = System.currentTimeMillis() - t;
3503     #puts "sequential reduction executed in " + str(t) + " ms";
3504     return rr.map { |x| RingElem.new(x) };
3505 end
optimize() click to toggle source

Optimize the term order on the variables.

     # File examples/jas.rb
3619 def optimize()
3620     p = @pset;
3621     o = TermOrderOptimization.optimizeTermOrder(p);
3622     r = Ring.new("",o.ring);
3623     return SimIdeal.new(r,"",o.list);
3624 end
parGB(th) click to toggle source

Compute in parallel a Groebner base.

     # File examples/jas.rb
3332 def parGB(th)
3333     s = @pset;
3334     ff = s.list;
3335     cofac = s.ring.coFac;
3336     if cofac.isField() 
3337        bbpar = GroebnerBaseParallel.new(th);
3338     else 
3339        bbpar = GroebnerBasePseudoParallel.new(th,cofac);
3340     end
3341     t = System.currentTimeMillis();
3342     gg = bbpar.GB(ff);
3343     t = System.currentTimeMillis() - t;
3344     bbpar.terminate();
3345     puts "parallel #{th} executed in #{t} ms\n"; 
3346     return SimIdeal.new(@ring,"",gg);
3347 end
parUnusedGB(th) click to toggle source

Compute in parallel a Groebner base.

     # File examples/jas.rb
3317 def parUnusedGB(th)
3318     s = @pset;
3319     ff = s.list;
3320     bbpar = GroebnerBaseSeqPairParallel.new(th);
3321     t = System.currentTimeMillis();
3322     gg = bbpar.GB(ff);
3323     t = System.currentTimeMillis() - t;
3324     bbpar.terminate();
3325     puts "parallel-old #{th} executed in #{t} ms\n"; 
3326     return SimIdeal.new(@ring,"",gg);
3327 end
paramideal() click to toggle source

Create an ideal in a polynomial ring with parameter coefficients.

     # File examples/jas.rb
3149 def paramideal()
3150     return ParamIdeal.new(@ring,"",@list);
3151 end
primaryDecomp() click to toggle source

Compute primary decomposition of this ideal.

     # File examples/jas.rb
3729     def primaryDecomp()
3730         ii = Ideal.new(@pset);
3731 ##         if @prime == nil:
3732 ##             @prime = I.primeDecomposition();
3733         @primary = ii.primaryDecomposition();
3734         return @primary;
3735     end
primeDecomp() click to toggle source

Compute prime decomposition of this ideal.

     # File examples/jas.rb
3720 def primeDecomp()
3721     ii = Ideal.new(@pset);
3722     @prime = ii.primeDecomposition();
3723     return @prime;
3724 end
radicalDecomp() click to toggle source

Compute radical decomposition of this ideal.

     # File examples/jas.rb
3671 def radicalDecomp()
3672     ii = Ideal.new(@pset);
3673     @radical = ii.radicalDecomposition();
3674     return @radical;
3675 end
realRoots() click to toggle source

Compute real roots of 0-dim ideal.

     # File examples/jas.rb
3640 def realRoots()
3641     ii = Ideal.new(@pset);
3642     @roots = PolyUtilApp.realAlgebraicRoots(ii);
3643     for r in @roots
3644         r.doDecimalApproximation();
3645     end
3646     return @roots;
3647 end
realRootsPrint() click to toggle source

Print decimal approximation of real roots of 0-dim ideal.

     # File examples/jas.rb
3652 def realRootsPrint()
3653     if @roots == nil
3654         ii = Ideal.new(@pset);
3655         @roots = PolyUtilApp.realAlgebraicRoots(ii);
3656         for r in @roots
3657             r.doDecimalApproximation();
3658         end
3659     end
3660     for ir in @roots
3661         for dr in ir.decimalApproximation()
3662             puts dr.to_s;
3663         end
3664         puts;
3665     end
3666 end
reduction(p) click to toggle source

Compute a normal form of p with respect to this ideal.

     # File examples/jas.rb
3395 def reduction(p)
3396     s = @pset;
3397     gg = s.list;
3398     if p.is_a? RingElem
3399         p = p.elem;
3400     end
3401     #t = System.currentTimeMillis();
3402     if @ring.ring.coFac.isField()
3403        n = ReductionSeq.new().normalform(gg,p);
3404     else 
3405        n = PseudoReductionSeq.new().normalform(gg,p);
3406        #ff = PseudoReductionSeq.New().normalformFactor(gg,p);
3407        #print "ff.multiplicator = " + str(ff.multiplicator)
3408     end
3409     #t = System.currentTimeMillis() - t;
3410     #puts "sequential reduction executed in " + str(t) + " ms";
3411     return RingElem.new(n);
3412 end
sat(id2) click to toggle source

Compute the saturation of this and the given ideal.

     # File examples/jas.rb
3548 def sat(id2)
3549     s1 = Ideal.new(@pset);
3550     s2 = Ideal.new(id2.pset);
3551     #nn = s1.infiniteQuotient(s2);
3552     nn = s1.infiniteQuotientRab(s2);
3553     mm = nn.getList(); #PolyUtil.monicRec(nn.getList());
3554     return SimIdeal.new(@ring,"",mm);
3555 end
sum(other) click to toggle source

Compute the sum of this and the ideal.

     # File examples/jas.rb
3560 def sum(other)
3561     s = Ideal.new(@pset);
3562     t = Ideal.new(other.pset);
3563     nn = s.sum( t );
3564     return SimIdeal.new(@ring,"",nn.getList());
3565 end
syzygy() click to toggle source

Syzygy of generating polynomials.

     # File examples/jas.rb
3825 def syzygy()
3826     p = @pset;
3827     l = p.list;
3828     t = System.currentTimeMillis();
3829     s = SyzygySeq.new(p.ring.coFac).zeroRelations( l );
3830     t = System.currentTimeMillis() - t;
3831     puts "executed Syzygy in #{t} ms\n"; 
3832     m = CommutativeModule.new("",p.ring);
3833     return SubModule.new(m,"",s);
3834 end
toInteger() click to toggle source

Convert rational coefficients to integer coefficients.

     # File examples/jas.rb
3740 def toInteger()
3741     p = @pset;
3742     l = p.list;
3743     r = p.ring;
3744     ri = GenPolynomialRing.new( BigInteger.new(), r.nvar, r.tord, r.vars );
3745     pi = PolyUtil.integerFromRationalCoefficients(ri,l);
3746     r = Ring.new("",ri);
3747     return SimIdeal.new(r,"",pi);
3748 end
toModular(mf) click to toggle source

Convert integer coefficients to modular coefficients.

     # File examples/jas.rb
3753 def toModular(mf)
3754     p = @pset;
3755     l = p.list;
3756     r = p.ring;
3757     if mf.is_a? RingElem
3758         mf = mf.ring;
3759     end
3760     rm = GenPolynomialRing.new( mf, r.nvar, r.tord, r.vars );
3761     pm = PolyUtil.fromIntegerCoefficients(rm,l);
3762     r = Ring.new("",rm);
3763     return SimIdeal.new(r,"",pm);
3764 end
to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
3107 def to_s()
3108     return @pset.toScript();
3109 end
univariates() click to toggle source

Compute the univariate polynomials in each variable of this ideal.

     # File examples/jas.rb
3570 def univariates()
3571     s = Ideal.new(@pset);
3572     ll = s.constructUnivariate();
3573     nn = ll.map {|e| RingElem.new(e) };
3574     return nn;
3575 end