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
4590 def initialize(modu,modstr="",list=nil)
4591     @modu = modu;
4592     if list == nil
4593        sr = StringReader.new( modstr );
4594        tok = GenPolynomialTokenizer.new(modu.ring,sr);
4595        @list = tok.nextSubModuleList();
4596     else
4597         if list.is_a? Array
4598             if list.size != 0
4599                 if list[0].is_a? RingElem
4600                     list = list.map { |re| re.elem  };
4601                 end
4602             end
4603             @list = rbarray2arraylist(list,@modu.ring,rec=2);
4604         else
4605             @list = list;
4606         end
4607     end
4608     #puts "list = ", str(list);
4609     #e = @list[0];
4610     #puts "e = ", e;
4611     @mset = OrderedModuleList.new(modu.ring,@list);
4612     @cols = @mset.cols;
4613     @rows = @mset.rows;
4614     @pset = @mset.getPolynomialList();
4615 end

Public Instance Methods

GB() click to toggle source

Compute a Groebner base.

     # File examples/jas.rb
4627 def GB()
4628     t = System.currentTimeMillis();
4629     #gg = ModGroebnerBaseSeq.new(@modu.ring.coFac).GB(@mset);
4630     gg = GroebnerBaseSeq.new().GB(@mset);
4631     t = System.currentTimeMillis() - t;
4632     puts "executed module GB in #{t} ms\n"; 
4633     return SubModule.new(@modu,"",gg.list);
4634 end
isGB() click to toggle source

Test if this is a Groebner base.

     # File examples/jas.rb
4639 def isGB()
4640     t = System.currentTimeMillis();
4641     #b = ModGroebnerBaseSeq.new(@modu.ring.coFac).isGB(@mset);
4642     b = GroebnerBaseSeq.new().isGB(@mset);
4643     t = System.currentTimeMillis() - t;
4644     puts "module isGB executed in #{t} ms\n"; 
4645     return b;
4646 end
isSyzygy(g) click to toggle source

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

     # File examples/jas.rb
4651 def isSyzygy(g)
4652     l = @list;
4653     if g.is_a? SimIdeal
4654        s = g.pset.list; # not g.list
4655     else 
4656        if g.is_a? SubModule
4657           s = g.mset;
4658           l = @mset;
4659        else
4660           raise "unknown type #{g.getClass().getName()}";
4661        end
4662     end
4663     #puts "l = #{l}";
4664     #puts "s = #{s}";
4665     t = System.currentTimeMillis();
4666     z = SyzygySeq.new(@modu.ring.coFac).isZeroRelation( l, s );
4667     t = System.currentTimeMillis() - t;
4668     puts "executed isSyzygy in #{t} ms\n"; 
4669     return z;
4670 end
syzygy() click to toggle source

Compute syzygys of this module.

     # File examples/jas.rb
4675 def syzygy()
4676     l = @mset;
4677     t = System.currentTimeMillis();
4678     p = SyzygySeq.new(@modu.ring.coFac).zeroRelations( l );
4679     t = System.currentTimeMillis() - t;
4680     puts "executed module syzygy in #{t} ms\n"; 
4681     m = CommutativeModule.new("",p.ring,p.cols);
4682     return SubModule.new(m,"",p.list);
4683 end
to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
4620 def to_s()
4621     return @mset.toScript(); # + "\n\n" + str(@pset);
4622 end