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
5788 def initialize(coeff,vars)
5789     if coeff == nil
5790         raise ArgumentError, "No coefficient given."
5791     end
5792     cf = coeff;
5793     if coeff.is_a? RingElem
5794         cf = coeff.elem.factory();
5795     end
5796     if coeff.is_a? Ring
5797         cf = coeff.ring;
5798     end
5799     if vars == nil
5800         raise ArgumentError, "No variable names given."
5801     end
5802     names = vars;
5803     if vars.is_a? String
5804         names = GenPolynomialTokenizer.variableList(vars);
5805     end
5806     wf = WordFactory.new(names);
5807     @ring = GenWordPolynomialRing.new(cf, wf);
5808 end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
5813 def to_s()
5814     return @ring.toScript();
5815 end