Class | JAS::WordRing |
In: |
examples/jas.rb
|
Parent: | Ring |
Represents a JAS non-commutative polynomial ring: GenWordPolynomialRing.
Has a method to create non-commutative ideals. Note: watch your step: check that jruby does not reorder multiplication.
Word polynomial ring constructor.
# File examples/jas.rb, line 3905 3905: def initialize(ringstr="",ring=nil) 3906: if ring == nil 3907: raise "parse of word polynomial rings not implemented" 3908: sr = StringReader.new( ringstr ); 3909: tok = GenPolynomialTokenizer.new(sr); 3910: @pset = tok.nextWordPolynomialSet(); 3911: @ring = @pset.ring; 3912: else 3913: @ring = ring; 3914: end 3915: if not @ring.isAssociative() 3916: puts "warning: ring is not associative"; 3917: end 3918: end
Create an element from a string or object.
# File examples/jas.rb, line 3973 3973: def element(poly) 3974: if not poly.is_a? String 3975: begin 3976: if @ring == poly.ring 3977: return RingElem.new(poly); 3978: end 3979: rescue Exception => e 3980: # pass 3981: end 3982: poly = str(poly); 3983: end 3984: ii = WordIdeal.new(self, "( " + poly + " )"); 3985: list = ii.pset.list; 3986: if list.size > 0 3987: return RingElem.new( list[0] ); 3988: end 3989: end