class JAS::WordPolyRing

Represents a JAS non-commutative polynomial ring: GenWordPolynomialRing.

Provides more convenient constructor. Then returns a Ring. Note: watch your step: check that jruby does not reorder multiplication.

Public Class Methods

new(coeff,vars) click to toggle source

Ring constructor.

coeff = factory for coefficients, vars = string with variable names.

     # File examples/jas.rb
6362 def initialize(coeff,vars)
6363     if coeff == nil
6364         raise ArgumentError, "No coefficient given."
6365     end
6366     cf = coeff;
6367     if coeff.is_a? RingElem
6368         cf = coeff.elem.factory();
6369     end
6370     if coeff.is_a? Ring
6371         cf = coeff.ring;
6372     end
6373     if vars == nil
6374         raise ArgumentError, "No variable names given."
6375     end
6376     names = vars;
6377     if vars.is_a? String
6378         names = GenPolynomialTokenizer.variableList(vars);
6379     end
6380     wf = WordFactory.new(names);
6381     @ring = GenWordPolynomialRing.new(cf, wf);
6382 end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
6387 def to_s()
6388     return @ring.toScript();
6389 end