class JAS::SubModule
Represents a JAS sub-module over a polynomial ring.
Methods to compute Groebner bases.
Attributes
the Java module, module list, polynomial list, number of columns and rows, module list
the Java module, module list, polynomial list, number of columns and rows, module list
the Java module, module list, polynomial list, number of columns and rows, module list
the Java module, module list, polynomial list, number of columns and rows, module list
the Java module, module list, polynomial list, number of columns and rows, module list
the Java module, module list, polynomial list, number of columns and rows, module list
Public Class Methods
Constructor for a sub-module.
# File examples/jas.rb 4537 def initialize(modu,modstr="",list=nil) 4538 @modu = modu; 4539 if list == nil 4540 sr = StringReader.new( modstr ); 4541 tok = GenPolynomialTokenizer.new(modu.ring,sr); 4542 @list = tok.nextSubModuleList(); 4543 else 4544 if list.is_a? Array 4545 if list.size != 0 4546 if list[0].is_a? RingElem 4547 list = list.map { |re| re.elem }; 4548 end 4549 end 4550 @list = rbarray2arraylist(list,@modu.ring,rec=2); 4551 else 4552 @list = list; 4553 end 4554 end 4555 #puts "list = ", str(list); 4556 #e = @list[0]; 4557 #puts "e = ", e; 4558 @mset = OrderedModuleList.new(modu.ring,@list); 4559 @cols = @mset.cols; 4560 @rows = @mset.rows; 4561 @pset = @mset.getPolynomialList(); 4562 end
Public Instance Methods
Compute a Groebner base.
# File examples/jas.rb 4574 def GB() 4575 t = System.currentTimeMillis(); 4576 #gg = ModGroebnerBaseSeq.new(@modu.ring.coFac).GB(@mset); 4577 gg = GroebnerBaseSeq.new().GB(@mset); 4578 t = System.currentTimeMillis() - t; 4579 puts "executed module GB in #{t} ms\n"; 4580 return SubModule.new(@modu,"",gg.list); 4581 end
Test if this is a Groebner base.
# File examples/jas.rb 4586 def isGB() 4587 t = System.currentTimeMillis(); 4588 #b = ModGroebnerBaseSeq.new(@modu.ring.coFac).isGB(@mset); 4589 b = GroebnerBaseSeq.new().isGB(@mset); 4590 t = System.currentTimeMillis() - t; 4591 puts "module isGB executed in #{t} ms\n"; 4592 return b; 4593 end
Test if this is a syzygy of the polynomials in g.
# File examples/jas.rb 4598 def isSyzygy(g) 4599 l = @list; 4600 if g.is_a? SimIdeal 4601 s = g.pset.list; # not g.list 4602 else 4603 if g.is_a? SubModule 4604 s = g.mset; 4605 l = @mset; 4606 else 4607 raise "unknown type #{g.getClass().getName()}"; 4608 end 4609 end 4610 #puts "l = #{l}"; 4611 #puts "s = #{s}"; 4612 t = System.currentTimeMillis(); 4613 z = SyzygySeq.new(@modu.ring.coFac).isZeroRelation( l, s ); 4614 t = System.currentTimeMillis() - t; 4615 puts "executed isSyzygy in #{t} ms\n"; 4616 return z; 4617 end
Compute syzygys of this module.
# File examples/jas.rb 4622 def syzygy() 4623 l = @mset; 4624 t = System.currentTimeMillis(); 4625 p = SyzygySeq.new(@modu.ring.coFac).zeroRelations( l ); 4626 t = System.currentTimeMillis() - t; 4627 puts "executed module syzygy in #{t} ms\n"; 4628 m = CommutativeModule.new("",p.ring,p.cols); 4629 return SubModule.new(m,"",p.list); 4630 end
Create a string representation.
# File examples/jas.rb 4567 def to_s() 4568 return @mset.toScript(); # + "\n\n" + str(@pset); 4569 end