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
4451 def initialize(modstr="",ring=nil,cols=0)
4452     if ring == nil
4453        sr = StringReader.new( modstr );
4454        tok = RingFactoryTokenizer.new(sr);
4455        pfac = tok.nextPolynomialRing();
4456        #tok = GenPolynomialTokenizer.new(sr);
4457        #@mset = tok.nextSubModuleSet();
4458        #if @mset.cols >= 0
4459        #    @cols = @mset.cols;
4460        #else
4461        #end
4462        @ring = pfac;
4463     else
4464        if ring.is_a? Ring
4465           @ring = ring.ring
4466        else 
4467           @ring = ring;
4468        end
4469     end
4470     @mset = ModuleList.new(@ring,nil);
4471     if cols < 0 
4472        cols = 0;
4473     end
4474     @cols = cols;
4475 end

Public Instance Methods

element(mods) click to toggle source

Create an element from a string.

     # File examples/jas.rb
4494 def element(mods)
4495     if not mods.is_a? String 
4496        begin
4497           if @ring == mods.ring 
4498              return RingElem.new(mods);
4499           end
4500        rescue => e
4501           # pass
4502        end
4503        mods = str(mods);
4504     end
4505     ii = SubModule.new( "( " + mods + " )");
4506     list = ii.mset.list;
4507     if list.size > 0
4508         return RingElem.new( list[0] );
4509     end
4510 end
gens() click to toggle source

Get the generators of this module.

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

Create a sub-module.

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

Create a string representation.

     # File examples/jas.rb
4480 def to_s()
4481     return @mset.toScript();
4482 end