class JAS::SubModule

Represents a JAS sub-module over a polynomial ring.

Methods to compute Groebner bases.

Attributes

cols[R]

the Java module, module list, polynomial list, number of columns and rows, module list

list[R]

the Java module, module list, polynomial list, number of columns and rows, module list

modu[R]

the Java module, module list, polynomial list, number of columns and rows, module list

mset[R]

the Java module, module list, polynomial list, number of columns and rows, module list

pset[R]

the Java module, module list, polynomial list, number of columns and rows, module list

rows[R]

the Java module, module list, polynomial list, number of columns and rows, module list

Public Class Methods

new(modu,modstr="",list=nil) click to toggle source

Constructor for a sub-module.

     # File examples/jas.rb
4754 def initialize(modu,modstr="",list=nil)
4755     @modu = modu;
4756     if list == nil
4757        sr = StringReader.new( modstr );
4758        tok = GenPolynomialTokenizer.new(modu.ring,sr);
4759        @list = tok.nextSubModuleList();
4760     else
4761         if list.is_a? Array
4762             if list.size != 0
4763                 if list[0].is_a? RingElem
4764                     list = list.map { |re| re.elem  };
4765                 end
4766             end
4767             @list = rbarray2arraylist(list,@modu.ring,rec=2);
4768         else
4769             @list = list;
4770         end
4771     end
4772     #puts "list = ", str(list);
4773     #e = @list[0];
4774     #puts "e = ", e;
4775     @mset = OrderedModuleList.new(modu.ring,@list);
4776     @cols = @mset.cols;
4777     @rows = @mset.rows;
4778     @pset = @mset.getPolynomialList();
4779 end

Public Instance Methods

GB() click to toggle source

Compute a Groebner base.

     # File examples/jas.rb
4791 def GB()
4792     t = System.currentTimeMillis();
4793     #gg = ModGroebnerBaseSeq.new(@modu.ring.coFac).GB(@mset);
4794     gg = GroebnerBaseSeq.new().GB(@mset);
4795     t = System.currentTimeMillis() - t;
4796     puts "executed module GB in #{t} ms\n"; 
4797     return SubModule.new(@modu,"",gg.list);
4798 end
isGB() click to toggle source

Test if this is a Groebner base.

     # File examples/jas.rb
4803 def isGB()
4804     t = System.currentTimeMillis();
4805     #b = ModGroebnerBaseSeq.new(@modu.ring.coFac).isGB(@mset);
4806     b = GroebnerBaseSeq.new().isGB(@mset);
4807     t = System.currentTimeMillis() - t;
4808     puts "module isGB executed in #{t} ms\n"; 
4809     return b;
4810 end
isSyzygy(g) click to toggle source

Test if this is a syzygy of the polynomials in g.

     # File examples/jas.rb
4815 def isSyzygy(g)
4816     l = @list;
4817     if g.is_a? SimIdeal
4818        s = g.pset.list; # not g.list
4819     else 
4820        if g.is_a? SubModule
4821           s = g.mset;
4822           l = @mset;
4823        else
4824           raise "unknown type #{g.getClass().getName()}";
4825        end
4826     end
4827     #puts "l = #{l}";
4828     #puts "s = #{s}";
4829     t = System.currentTimeMillis();
4830     z = SyzygySeq.new(@modu.ring.coFac).isZeroRelation( l, s );
4831     t = System.currentTimeMillis() - t;
4832     puts "executed isSyzygy in #{t} ms\n"; 
4833     return z;
4834 end
syzygy() click to toggle source

Compute syzygys of this module.

     # File examples/jas.rb
4839 def syzygy()
4840     l = @mset;
4841     t = System.currentTimeMillis();
4842     p = SyzygySeq.new(@modu.ring.coFac).zeroRelations( l );
4843     t = System.currentTimeMillis() - t;
4844     puts "executed module syzygy in #{t} ms\n"; 
4845     m = CommutativeModule.new("",p.ring,p.cols);
4846     return SubModule.new(m,"",p.list);
4847 end
to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
4784 def to_s()
4785     return @mset.toScript(); # + "\n\n" + str(@pset);
4786 end