class JAS::SolvableSubModule

Represents a JAS sub-module over a solvable polynomial ring.

Methods to compute left, right and two-sided Groebner bases.

Attributes

cols[R]

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

list[R]

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

modu[R]

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

mset[R]

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

rows[R]

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

Public Class Methods

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

Constructor for sub-module over a solvable polynomial ring.

     # File examples/jas.rb
5101 def initialize(modu,modstr="",list=nil)
5102     @modu = modu;
5103     if list == nil
5104        sr = StringReader.new( modstr );
5105        tok = GenPolynomialTokenizer.new(modu.ring,sr);
5106        @list = tok.nextSolvableSubModuleList();
5107     else
5108         if list.is_a? Array
5109             @list = rbarray2arraylist(list,@modu.ring,rec=2);
5110         else
5111             @list = list;
5112         end
5113     end
5114     @mset = OrderedModuleList.new(modu.ring,@list);
5115     @cols = @mset.cols;
5116     @rows = @mset.rows;
5117 end

Public Instance Methods

isLeftGB() click to toggle source

Test if this is a left Groebner base.

     # File examples/jas.rb
5141 def isLeftGB()
5142     t = System.currentTimeMillis();
5143     #b = SolvableGroebnerBaseSeq.new(@modu.ring.coFac).isLeftGB(@mset);
5144     b = SolvableGroebnerBaseSeq.new().isLeftGB(@mset);
5145     t = System.currentTimeMillis() - t;
5146     puts "module isLeftGB executed in #{t} ms\n"; 
5147     return b;
5148 end
isLeftSyzygy(g) click to toggle source

Test if this is a left syzygy of the vectors in g.

     # File examples/jas.rb
5201 def isLeftSyzygy(g)
5202     l = @list;
5203     if g.is_a? SolvIdeal
5204        s = g.pset.list; # not g.list
5205     else 
5206        if g.is_a? SolvableSubModule
5207           s = g.mset;
5208           l = @mset;
5209        else
5210           raise "unknown type #{g.getClass().getName()}";
5211        end
5212     end
5213     #puts "l = #{l}";
5214     #puts "s = #{s}";
5215     t = System.currentTimeMillis();
5216     z = SolvableSyzygySeq.new(@modu.ring.coFac).isLeftZeroRelation( l, s );
5217     t = System.currentTimeMillis() - t;
5218     puts "executed isLeftSyzygy in #{t} ms\n"; 
5219     return z;
5220 end
isRightGB() click to toggle source

Test if this is a right Groebner base.

     # File examples/jas.rb
5189 def isRightGB()
5190     t = System.currentTimeMillis();
5191     #b = SolvableGroebnerBaseSeq.new(@modu.ring.coFac).isRightGB(@mset);
5192     b = SolvableGroebnerBaseSeq.new().isRightGB(@mset);
5193     t = System.currentTimeMillis() - t;
5194     puts "module isRightGB executed in #{t} ms\n"; 
5195     return b;
5196 end
isRightSyzygy(g) click to toggle source

Test if this is a right syzygy of the vectors in g.

     # File examples/jas.rb
5238 def isRightSyzygy(g)
5239     l = @list;
5240     if g.is_a? SolvIdeal
5241        s = g.pset.list; # not g.list
5242     else 
5243        if g.is_a? SolvableSubModule
5244           s = g.mset;
5245           l = @mset;
5246        else
5247           raise "unknown type #{g.getClass().getName()}";
5248        end
5249     end
5250     #puts "l = #{l}";
5251     #puts "s = #{s}";
5252     t = System.currentTimeMillis();
5253     z = SolvableSyzygySeq.new(@modu.ring.coFac).isRightZeroRelation( l, s );
5254     t = System.currentTimeMillis() - t;
5255     puts "executed isRightSyzygy in #{t} ms\n"; 
5256     return z;
5257 end
isTwosidedGB() click to toggle source

Test if this is a two-sided Groebner base.

     # File examples/jas.rb
5165 def isTwosidedGB()
5166     t = System.currentTimeMillis();
5167     #b = SolvableGroebnerBaseSeq.new(@modu.ring.coFac).isTwosidedGB(@mset);
5168     b = SolvableGroebnerBaseSeq.new().isTwosidedGB(@mset);
5169     t = System.currentTimeMillis() - t;
5170     puts "module isTwosidedGB executed in #{t} ms\n"; 
5171     return b;
5172 end
leftGB() click to toggle source

Compute a left Groebner base.

     # File examples/jas.rb
5129 def leftGB()
5130     t = System.currentTimeMillis();
5131     #gg = SolvableGroebnerBaseSeq.new(@modu.ring.coFac).leftGB(@mset);
5132     gg = SolvableGroebnerBaseSeq.new().leftGB(@mset);
5133     t = System.currentTimeMillis() - t;
5134     puts "executed left module GB in #{t} ms\n"; 
5135     return SolvableSubModule.new(@modu,"",gg.list);
5136 end
leftSyzygy() click to toggle source

Compute left syzygys of this module.

     # File examples/jas.rb
5225 def leftSyzygy()
5226     l = @mset;
5227     t = System.currentTimeMillis();
5228     p = SolvableSyzygySeq.new(@modu.ring.coFac).leftZeroRelationsArbitrary( l );
5229     t = System.currentTimeMillis() - t;
5230     puts "executed left module syzygy in #{t} ms\n"; 
5231     m = SolvableModule.new("",p.ring,p.cols);
5232     return SolvableSubModule.new(m,"",p.list);
5233 end
rightGB() click to toggle source

Compute a right Groebner base.

     # File examples/jas.rb
5177 def rightGB()
5178     t = System.currentTimeMillis();
5179     #gg = SolvableGroebnerBaseSeq.new(@modu.ring.coFac).rightGB(@mset);
5180     gg = SolvableGroebnerBaseSeq.new().rightGB(@mset);
5181     t = System.currentTimeMillis() - t;
5182     puts "executed right module GB in #{t} ms\n"; 
5183     return SolvableSubModule.new(@modu,"",gg.list);
5184 end
rightSyzygy() click to toggle source

Compute right syzygys of this module.

     # File examples/jas.rb
5262 def rightSyzygy()
5263     l = @mset;
5264     t = System.currentTimeMillis();
5265     #no: p = SolvableSyzygySeq.new(@modu.ring.coFac).rightZeroRelations( l );
5266     p = SolvableSyzygySeq.new(@modu.ring.coFac).rightZeroRelationsArbitrary( l );
5267     t = System.currentTimeMillis() - t;
5268     puts "executed right module syzygy in #{t} ms\n"; 
5269     m = SolvableModule.new("",p.ring,p.cols);
5270     return SolvableSubModule.new(m,"",p.list);
5271 end
to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
5122 def to_s()
5123     return @mset.toScript(); # + "\n\n" + str(@pset);
5124 end
twosidedGB() click to toggle source

Compute a two-sided Groebner base.

     # File examples/jas.rb
5153 def twosidedGB()
5154     t = System.currentTimeMillis();
5155     #gg = SolvableGroebnerBaseSeq.new(@modu.ring.coFac).twosidedGB(@mset);
5156     gg = SolvableGroebnerBaseSeq.new().twosidedGB(@mset);
5157     t = System.currentTimeMillis() - t;
5158     puts "executed twosided module GB in #{t} ms\n"; 
5159     return SolvableSubModule.new(@modu,"",gg.list);
5160 end