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
4692 def initialize(modstr="",ring=nil,cols=0)
4693     if ring == nil
4694        sr = StringReader.new( modstr );
4695        tok = RingFactoryTokenizer.new(sr);
4696        pfac = tok.nextPolynomialRing();
4697        #tok = GenPolynomialTokenizer.new(sr);
4698        #@mset = tok.nextSubModuleSet();
4699        #if @mset.cols >= 0
4700        #    @cols = @mset.cols;
4701        #else
4702        #end
4703        @ring = pfac;
4704     else
4705        if ring.is_a? Ring
4706           @ring = ring.ring
4707        else 
4708           @ring = ring;
4709        end
4710     end
4711     @mset = ModuleList.new(@ring,nil);
4712     if cols < 0 
4713        cols = 0;
4714     end
4715     @cols = cols;
4716 end

Public Instance Methods

element(mods) click to toggle source

Create an element from a string.

     # File examples/jas.rb
4735 def element(mods)
4736     if not mods.is_a? String 
4737        begin
4738           if @ring == mods.ring 
4739              return RingElem.new(mods);
4740           end
4741        rescue => e
4742           # pass
4743        end
4744        mods = str(mods);
4745     end
4746     ii = SubModule.new( "( " + mods + " )");
4747     list = ii.mset.list;
4748     if list.size > 0
4749         return RingElem.new( list[0] );
4750     end
4751 end
gens() click to toggle source

Get the generators of this module.

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

Create a sub-module.

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

Create a string representation.

     # File examples/jas.rb
4721 def to_s()
4722     return @mset.toScript();
4723 end