class 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
4830 def initialize(modstr="",ring=nil,cols=0)
4831     if ring == nil
4832        sr = StringReader.new( modstr );
4833        tok = RingFactoryTokenizer.new(sr);
4834        pfac = tok.nextPolynomialRing();
4835        #tok = GenPolynomialTokenizer.new(sr);
4836        #@mset = tok.nextSubModuleSet();
4837        #if @mset.cols >= 0
4838        #    @cols = @mset.cols;
4839        #else
4840        #end
4841        @ring = pfac;
4842     else
4843        if ring.is_a? Ring
4844           @ring = ring.ring
4845        else 
4846           @ring = ring;
4847        end
4848     end
4849     @mset = ModuleList.new(@ring,nil);
4850     if cols < 0 
4851        cols = 0;
4852     end
4853     @cols = cols;
4854 end

Public Instance Methods

element(mods) click to toggle source

Create an element from a string.

     # File examples/jas.rb
4873 def element(mods)
4874     if not mods.is_a? String 
4875        begin
4876           if @ring == mods.ring 
4877              return RingElem.new(mods);
4878           end
4879        rescue => e
4880           # pass
4881        end
4882        mods = str(mods);
4883     end
4884     ii = SubModule.new( "( " + mods + " )");
4885     list = ii.mset.list;
4886     if list.size > 0
4887         return RingElem.new( list[0] );
4888     end
4889 end
gens() click to toggle source

Get the generators of this module.

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

Create a sub-module.

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

Create a string representation.

     # File examples/jas.rb
4859 def to_s()
4860     return @mset.toScript();
4861 end