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 4778 def initialize(modu,modstr="",list=nil) 4779 @modu = modu; 4780 if list == nil 4781 sr = StringReader.new( modstr ); 4782 tok = GenPolynomialTokenizer.new(modu.ring,sr); 4783 @list = tok.nextSubModuleList(); 4784 else 4785 if list.is_a? Array 4786 if list.size != 0 4787 if list[0].is_a? RingElem 4788 list = list.map { |re| re.elem }; 4789 end 4790 end 4791 @list = rbarray2arraylist(list,@modu.ring,rec=2); 4792 else 4793 @list = list; 4794 end 4795 end 4796 #puts "list = ", str(list); 4797 #e = @list[0]; 4798 #puts "e = ", e; 4799 @mset = OrderedModuleList.new(modu.ring,@list); 4800 @cols = @mset.cols; 4801 @rows = @mset.rows; 4802 @pset = @mset.getPolynomialList(); 4803 end
Public Instance Methods
Compute a Groebner base.
# File examples/jas.rb 4815 def GB() 4816 t = System.currentTimeMillis(); 4817 #gg = ModGroebnerBaseSeq.new(@modu.ring.coFac).GB(@mset); 4818 gg = GroebnerBaseSeq.new().GB(@mset); 4819 t = System.currentTimeMillis() - t; 4820 puts "executed module GB in #{t} ms\n"; 4821 return SubModule.new(@modu,"",gg.list); 4822 end
Test if this is a Groebner base.
# File examples/jas.rb 4827 def isGB() 4828 t = System.currentTimeMillis(); 4829 #b = ModGroebnerBaseSeq.new(@modu.ring.coFac).isGB(@mset); 4830 b = GroebnerBaseSeq.new().isGB(@mset); 4831 t = System.currentTimeMillis() - t; 4832 puts "module isGB executed in #{t} ms\n"; 4833 return b; 4834 end
Test if this is a syzygy of the polynomials in g.
# File examples/jas.rb 4839 def isSyzygy(g) 4840 l = @list; 4841 if g.is_a? SimIdeal 4842 s = g.pset.list; # not g.list 4843 else 4844 if g.is_a? SubModule 4845 s = g.mset; 4846 l = @mset; 4847 else 4848 raise "unknown type #{g.getClass().getName()}"; 4849 end 4850 end 4851 #puts "l = #{l}"; 4852 #puts "s = #{s}"; 4853 t = System.currentTimeMillis(); 4854 z = SyzygySeq.new(@modu.ring.coFac).isZeroRelation( l, s ); 4855 t = System.currentTimeMillis() - t; 4856 puts "executed isSyzygy in #{t} ms\n"; 4857 return z; 4858 end
Compute syzygys of this module.
# File examples/jas.rb 4863 def syzygy() 4864 l = @mset; 4865 t = System.currentTimeMillis(); 4866 p = SyzygySeq.new(@modu.ring.coFac).zeroRelations( l ); 4867 t = System.currentTimeMillis() - t; 4868 puts "executed module syzygy in #{t} ms\n"; 4869 m = CommutativeModule.new("",p.ring,p.cols); 4870 return SubModule.new(m,"",p.list); 4871 end
Create a string representation.
# File examples/jas.rb 4808 def to_s() 4809 return @mset.toScript(); # + "\n\n" + str(@pset); 4810 end