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 4504 def initialize(modstr="",ring=nil,cols=0) 4505 if ring == nil 4506 sr = StringReader.new( modstr ); 4507 tok = RingFactoryTokenizer.new(sr); 4508 pfac = tok.nextPolynomialRing(); 4509 #tok = GenPolynomialTokenizer.new(sr); 4510 #@mset = tok.nextSubModuleSet(); 4511 #if @mset.cols >= 0 4512 # @cols = @mset.cols; 4513 #else 4514 #end 4515 @ring = pfac; 4516 else 4517 if ring.is_a? Ring 4518 @ring = ring.ring 4519 else 4520 @ring = ring; 4521 end 4522 end 4523 @mset = ModuleList.new(@ring,nil); 4524 if cols < 0 4525 cols = 0; 4526 end 4527 @cols = cols; 4528 end
Public Instance Methods
element(mods)
click to toggle source
Create an element from a string.
# File examples/jas.rb 4547 def element(mods) 4548 if not mods.is_a? String 4549 begin 4550 if @ring == mods.ring 4551 return RingElem.new(mods); 4552 end 4553 rescue => e 4554 # pass 4555 end 4556 mods = str(mods); 4557 end 4558 ii = SubModule.new( "( " + mods + " )"); 4559 list = ii.mset.list; 4560 if list.size > 0 4561 return RingElem.new( list[0] ); 4562 end 4563 end
gens()
click to toggle source
Get the generators of this module.
# File examples/jas.rb 4568 def gens() 4569 gm = GenVectorModul.new(@ring,@cols); 4570 ll = gm.generators(); 4571 nn = ll.map { |e| RingElem.new(e) }; # want use val here, but can not 4572 return nn; 4573 end
submodul(modstr="",list=nil)
click to toggle source
Create a sub-module.
# File examples/jas.rb 4540 def submodul(modstr="",list=nil) 4541 return SubModule.new(self,modstr,list); 4542 end
to_s()
click to toggle source
Create a string representation.
# File examples/jas.rb 4533 def to_s() 4534 return @mset.toScript(); 4535 end