In Files

Parent

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, line 3163
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

CGB() click to toggle source

Compute a comprehensive Groebner base.

# File examples/jas.rb, line 3300
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
CGBsystem() click to toggle source

Compute a comprehensive Groebner system.

# File examples/jas.rb, line 3316
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
GB() click to toggle source

Compute a Groebner base.

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

Test if this is a comprehensive Groebner base.

# File examples/jas.rb, line 3329
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
isCGBsystem() click to toggle source

Test if this is a comprehensive Groebner system.

# File examples/jas.rb, line 3342
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
isGB() click to toggle source

Test if this is a Groebner base.

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

Test if this is Groebner base over a regular ring.

# File examples/jas.rb, line 3394
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
optimizeCoeff() click to toggle source

Optimize the term order on the variables of the coefficients.

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

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

# File examples/jas.rb, line 3201
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
regularGB() click to toggle source

Compute a Groebner base over a regular ring.

# File examples/jas.rb, line 3381
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
regularRepresentation() click to toggle source

Convert Groebner system to a representation with regular ring coefficents.

# File examples/jas.rb, line 3355
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
regularRepresentationBC() click to toggle source

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

# File examples/jas.rb, line 3367
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
stringSlice() click to toggle source

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

# File examples/jas.rb, line 3407
def stringSlice()
    s = @pset;
    b = PolyUtilApp.productToString(s);
    return b;
end
toIntegralCoeff() click to toggle source

Convert rational function coefficients to integral function coefficients.

# File examples/jas.rb, line 3227
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
toModularCoeff(mf) click to toggle source

Convert integral function coefficients to modular function coefficients.

# File examples/jas.rb, line 3244
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
toQuotientCoeff() click to toggle source

Convert integral function coefficients to rational function coefficients.

# File examples/jas.rb, line 3265
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
to_s() click to toggle source

Create a string representation.

# File examples/jas.rb, line 3179
    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

[Validate]

Generated with the Darkfish Rdoc Generator 2.