In Files

Parent

JAS::CommutativeModule

Represents a JAS module over a polynomial ring.

Method to create sub-modules.

Attributes

cols[R]

the Java polynomial ring, number of columns, module list

mset[R]

the Java polynomial ring, number of columns, module list

ring[R]

the Java polynomial ring, number of columns, module list

Public Class Methods

new(modstr="",ring=nil,cols=0) click to toggle source

Module constructor.

# File examples/jas.rb, line 4141
def initialize(modstr="",ring=nil,cols=0)
    if ring == nil
       sr = StringReader.new( modstr );
       tok = RingFactoryTokenizer.new(sr);
       pfac = tok.nextPolynomialRing();
       #tok = GenPolynomialTokenizer.new(sr);
       #@mset = tok.nextSubModuleSet();
       #if @mset.cols >= 0
       #    @cols = @mset.cols;
       #else
       #end
       @ring = pfac;
    else
       if ring.is_a? Ring
          @ring = ring.ring
       else 
          @ring = ring;
       end
    end
    @mset = ModuleList.new(@ring,nil);
    if cols < 0 
       cols = 0;
    end
    @cols = cols;
end

Public Instance Methods

element(mods) click to toggle source

Create an element from a string.

# File examples/jas.rb, line 4184
def element(mods)
    if not mods.is_a? String 
       begin
          if @ring == mods.ring 
             return RingElem.new(mods);
          end
       rescue Exception => e
          # pass
       end
       mods = str(mods);
    end
    ii = SubModule.new( "( " + mods + " )");
    list = ii.mset.list;
    if list.size > 0
        return RingElem.new( list[0] );
    end
end
gens() click to toggle source

Get the generators of this module.

# File examples/jas.rb, line 4205
def gens()
    gm = GenVectorModul.new(@ring,@cols);
    ll = gm.generators();
    nn = ll.map { |e| RingElem.new(e) }; # want use val here, but can not
    return nn;
end
submodul(modstr="",list=nil) click to toggle source

Create a sub-module.

# File examples/jas.rb, line 4177
def submodul(modstr="",list=nil)
    return SubModule.new(self,modstr,list);
end
to_s() click to toggle source

Create a string representation.

# File examples/jas.rb, line 4170
def to_s()
    return @mset.toScript();
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.