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
6045 def initialize(coeff,vars)
6046     if coeff == nil
6047         raise ArgumentError, "No coefficient given."
6048     end
6049     cf = coeff;
6050     if coeff.is_a? RingElem
6051         cf = coeff.elem.factory();
6052     end
6053     if coeff.is_a? Ring
6054         cf = coeff.ring;
6055     end
6056     if vars == nil
6057         raise ArgumentError, "No variable names given."
6058     end
6059     names = vars;
6060     if vars.is_a? String
6061         names = GenPolynomialTokenizer.variableList(vars);
6062     end
6063     wf = WordFactory.new(names);
6064     @ring = GenWordPolynomialRing.new(cf, wf);
6065 end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
6070 def to_s()
6071     return @ring.toScript();
6072 end