In Files

Parent

JAS::SubModule

Represents a JAS sub-module over a polynomial ring.

Methods to compute Groebner bases.

Attributes

cols[R]

the Java module, module list, polynomial list, number of columns and rows, module list

list[R]

the Java module, module list, polynomial list, number of columns and rows, module list

modu[R]

the Java module, module list, polynomial list, number of columns and rows, module list

mset[R]

the Java module, module list, polynomial list, number of columns and rows, module list

pset[R]

the Java module, module list, polynomial list, number of columns and rows, module list

rows[R]

the Java module, module list, polynomial list, number of columns and rows, module list

Public Class Methods

new(modu,modstr="",list=nil) click to toggle source

Constructor for a sub-module.

# File examples/jas.rb, line 4227
def initialize(modu,modstr="",list=nil)
    @modu = modu;
    if list == nil
       sr = StringReader.new( modstr );
       tok = GenPolynomialTokenizer.new(modu.ring,sr);
       @list = tok.nextSubModuleList();
    else
        if list.is_a? Array
            if list.size != 0
                if list[0].is_a? RingElem
                    list = list.map { |re| re.elem  };
                end
            end
            @list = rbarray2arraylist(list,@modu.ring,rec=2);
        else
            @list = list;
        end
    end
    #puts "list = ", str(list);
    #e = @list[0];
    #puts "e = ", e;
    @mset = OrderedModuleList.new(modu.ring,@list);
    @cols = @mset.cols;
    @rows = @mset.rows;
    @pset = @mset.getPolynomialList();
end

Public Instance Methods

GB() click to toggle source

Compute a Groebner base.

# File examples/jas.rb, line 4264
def GB()
    t = System.currentTimeMillis();
    #gg = ModGroebnerBaseSeq.new(@modu.ring.coFac).GB(@mset);
    gg = GroebnerBaseSeq.new().GB(@mset);
    t = System.currentTimeMillis() - t;
    puts "executed module GB in #{t} ms\n"; 
    return SubModule.new(@modu,"",gg.list);
end
isGB() click to toggle source

Test if this is a Groebner base.

# File examples/jas.rb, line 4276
def isGB()
    t = System.currentTimeMillis();
    #b = ModGroebnerBaseSeq.new(@modu.ring.coFac).isGB(@mset);
    b = GroebnerBaseSeq.new().isGB(@mset);
    t = System.currentTimeMillis() - t;
    puts "module isGB executed in #{t} ms\n"; 
    return b;
end
isSyzygy(g) click to toggle source

Test if this is a syzygy of the polynomials in g.

# File examples/jas.rb, line 4288
def isSyzygy(g)
    l = @list;
    if g.is_a? SimIdeal
       s = g.pset.list; # not g.list
    else 
       if g.is_a? SubModule
          s = g.mset;
          l = @mset;
       else
          raise "unknown type %s" % g.getClass().getName();
       end
    end
    #puts "l = #{l}"; 
    #puts "s = #{s}"; 
    t = System.currentTimeMillis();
    z = SyzygySeq.new(@modu.ring.coFac).isZeroRelation( l, s );
    t = System.currentTimeMillis() - t;
    puts "executed isSyzygy in #{t} ms\n"; 
    return z;
end
syzygy() click to toggle source

Compute syzygys of this module.

# File examples/jas.rb, line 4312
def syzygy()
    l = @mset;
    t = System.currentTimeMillis();
    p = SyzygySeq.new(@modu.ring.coFac).zeroRelations( l );
    t = System.currentTimeMillis() - t;
    puts "executed module syzygy in #{t} ms\n"; 
    m = CommutativeModule.new("",p.ring,p.cols);
    return SubModule.new(m,"",p.list);
end
to_s() click to toggle source

Create a string representation.

# File examples/jas.rb, line 4257
def to_s()
    return @mset.toScript(); # + "\n\n" + str(@pset);
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.