Class JAS::CommutativeModule
In: examples/jas.rb
Parent: Object

Represents a JAS module over a polynomial ring.

Method to create sub-modules.

Methods

element   gens   new   submodul   to_s  

Attributes

cols  [R] 
mset  [R] 
ring  [R] 

Public Class methods

Module constructor.

[Source]

      # File examples/jas.rb, line 2873
2873:     def initialize(modstr="",ring=nil,cols=0)
2874:         if ring == nil
2875:            sr = StringReader.new( modstr );
2876:            tok = GenPolynomialTokenizer.new(sr);
2877:            @mset = tok.nextSubModuleSet();
2878:            if @mset.cols >= 0
2879:                @cols = @mset.cols;
2880:            else
2881:                @cols = cols;
2882:            end
2883:         else
2884:            @mset = ModuleList.new(ring.ring,nil);
2885:            @cols = cols;
2886:         end
2887:         @ring = @mset.ring;
2888:     end

Public Instance methods

Create an element from a string.

[Source]

      # File examples/jas.rb, line 2907
2907:     def element(mods)
2908:         if not mods.is_a? String 
2909:            begin
2910:               if @ring == mods.ring 
2911:                  return RingElem.new(mods);
2912:               end
2913:            rescue Exception => e
2914:               # pass
2915:            end
2916:            mods = str(mods);
2917:         end
2918:         ii = SubModule.new( "( " + mods + " )");
2919:         list = ii.mset.list;
2920:         if list.size > 0
2921:             return RingElem.new( list[0] );
2922:         end
2923:     end

Get the generators of this module.

[Source]

      # File examples/jas.rb, line 2928
2928:     def gens()
2929:         gm = GenVectorModul.new(@ring,@cols);
2930:         ll = gm.generators();
2931:         nn = ll.map { |e| RingElem.new(e) }; # want use val here, but can not
2932:         return nn;
2933:     end

Create a sub-module.

[Source]

      # File examples/jas.rb, line 2900
2900:     def submodul(modstr="",list=nil)
2901:         return SubModule.new(self,modstr,list);
2902:     end

Create a string representation.

[Source]

      # File examples/jas.rb, line 2893
2893:     def to_s()
2894:         return @mset.toScript();
2895:     end

[Validate]