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

Represents a JAS sub-module over a polynomial ring.

Methods to compute Groebner bases.

Methods

GB   isGB   new   to_s  

Attributes

cols  [R] 
list  [R] 
modu  [R] 
mset  [R] 
pset  [R] 
rows  [R] 

Public Class methods

Constructor for a sub-module.

[Source]

      # File examples/jas.rb, line 2949
2949:     def initialize(modu,modstr="",list=nil)
2950:         @modu = modu;
2951:         if list == nil
2952:            sr = StringReader.new( modstr );
2953:            tok = GenPolynomialTokenizer.new(modu.ring,sr);
2954:            @list = tok.nextSubModuleList();
2955:         else
2956:             if list.is_a? Array
2957:                 if list.size != 0
2958:                     if list[0].is_a? RingElem
2959:                         list = list.map { |re| re.elem  };
2960:                     end
2961:                 end
2962:                 @list = rbarray2arraylist(list,@modu.ring,rec=2);
2963:             else
2964:                 @list = list;
2965:             end
2966:         end
2967:         #puts "list = ", str(list);
2968:         #e = @list[0];
2969:         #puts "e = ", e;
2970:         @mset = OrderedModuleList.new(modu.ring,@list);
2971:         @cols = @mset.cols;
2972:         @rows = @mset.rows;
2973:         @pset = @mset.getPolynomialList();
2974:     end

Public Instance methods

Compute a Groebner base.

[Source]

      # File examples/jas.rb, line 2986
2986:     def GB()
2987:         t = System.currentTimeMillis();
2988:         gg = ModGroebnerBaseAbstract.new().GB(@mset);
2989:         t = System.currentTimeMillis() - t;
2990:         puts "executed module GB in #{t} ms\n"; 
2991:         return SubModule.new(@modu,"",gg.list);
2992:     end

Test if this is a Groebner base.

[Source]

      # File examples/jas.rb, line 2997
2997:     def isGB()
2998:         t = System.currentTimeMillis();
2999:         b = ModGroebnerBaseAbstract.new().isGB(@mset);
3000:         t = System.currentTimeMillis() - t;
3001:         puts "module isGB executed in #{t} ms\n"; 
3002:         return b;
3003:     end

Create a string representation.

[Source]

      # File examples/jas.rb, line 2979
2979:     def to_s()
2980:         return @mset.toScript(); # + "\n\n" + str(@pset);
2981:     end

[Validate]