Class | JAS::WordIdeal |
In: |
examples/jas.rb
|
Parent: | Object |
Represents a JAS non-commutative polynomial ideal.
Methods for two-sided Groebner bases and others. Note: watch your step: check that jruby does not reorder multiplication.
list | [R] | |
ring | [R] |
Constructor for an ideal in a non-commutative polynomial ring.
# File examples/jas.rb, line 4054 4054: def initialize(ring,ringstr="",list=nil) 4055: @ring = ring; 4056: if list == nil 4057: raise "parse of non-commutative polynomials not implemented" 4058: sr = StringReader.new( ringstr ); 4059: tok = GenPolynomialTokenizer.new(ring.ring,sr); 4060: @list = tok.nextWordPolynomialList(); 4061: else 4062: @list = rbarray2arraylist(list,rec=1); 4063: end 4064: #@pset = OrderedPolynomialList.new(ring.ring,@list); 4065: end
Compute a two-sided Groebner base.
# File examples/jas.rb, line 4077 4077: def GB() 4078: return twosidedGB(); 4079: end
Test if this is a two-sided Groebner base.
# File examples/jas.rb, line 4097 4097: def isGB() 4098: return isTwosidedGB(); 4099: end
Test if this is a two-sided Groebner base.
# File examples/jas.rb, line 4104 4104: def isTwosidedGB() 4105: #s = @pset; 4106: ff = @list; 4107: t = System.currentTimeMillis(); 4108: b = WordGroebnerBaseSeq.new().isGB(ff); 4109: t = System.currentTimeMillis() - t; 4110: puts "isTwosidedGB executed in #{t} ms\n"; 4111: return b; 4112: end
Create a string representation.
# File examples/jas.rb, line 4070 4070: def to_s() 4071: return "( " + @list.map{ |e| e.toScript() }.join(", ") + " )"; 4072: end
Compute a two-sided Groebner base.
# File examples/jas.rb, line 4084 4084: def twosidedGB() 4085: #s = @pset; 4086: ff = @list; 4087: t = System.currentTimeMillis(); 4088: gg = WordGroebnerBaseSeq.new().GB(ff); 4089: t = System.currentTimeMillis() - t; 4090: puts "executed twosidedGB in #{t} ms\n"; 4091: return WordIdeal.new(@ring,"",gg); 4092: end