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 4668 def initialize(modstr="",ring=nil,cols=0) 4669 if ring == nil 4670 sr = StringReader.new( modstr ); 4671 tok = RingFactoryTokenizer.new(sr); 4672 pfac = tok.nextPolynomialRing(); 4673 #tok = GenPolynomialTokenizer.new(sr); 4674 #@mset = tok.nextSubModuleSet(); 4675 #if @mset.cols >= 0 4676 # @cols = @mset.cols; 4677 #else 4678 #end 4679 @ring = pfac; 4680 else 4681 if ring.is_a? Ring 4682 @ring = ring.ring 4683 else 4684 @ring = ring; 4685 end 4686 end 4687 @mset = ModuleList.new(@ring,nil); 4688 if cols < 0 4689 cols = 0; 4690 end 4691 @cols = cols; 4692 end
Public Instance Methods
element(mods)
click to toggle source
Create an element from a string.
# File examples/jas.rb 4711 def element(mods) 4712 if not mods.is_a? String 4713 begin 4714 if @ring == mods.ring 4715 return RingElem.new(mods); 4716 end 4717 rescue => e 4718 # pass 4719 end 4720 mods = str(mods); 4721 end 4722 ii = SubModule.new( "( " + mods + " )"); 4723 list = ii.mset.list; 4724 if list.size > 0 4725 return RingElem.new( list[0] ); 4726 end 4727 end
gens()
click to toggle source
Get the generators of this module.
# File examples/jas.rb 4732 def gens() 4733 gm = GenVectorModul.new(@ring,@cols); 4734 ll = gm.generators(); 4735 nn = ll.map { |e| RingElem.new(e) }; # want use val here, but can not 4736 return nn; 4737 end
submodul(modstr="",list=nil)
click to toggle source
Create a sub-module.
# File examples/jas.rb 4704 def submodul(modstr="",list=nil) 4705 return SubModule.new(self,modstr,list); 4706 end
to_s()
click to toggle source
Create a string representation.
# File examples/jas.rb 4697 def to_s() 4698 return @mset.toScript(); 4699 end