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
6021 def initialize(coeff,vars)
6022     if coeff == nil
6023         raise ArgumentError, "No coefficient given."
6024     end
6025     cf = coeff;
6026     if coeff.is_a? RingElem
6027         cf = coeff.elem.factory();
6028     end
6029     if coeff.is_a? Ring
6030         cf = coeff.ring;
6031     end
6032     if vars == nil
6033         raise ArgumentError, "No variable names given."
6034     end
6035     names = vars;
6036     if vars.is_a? String
6037         names = GenPolynomialTokenizer.variableList(vars);
6038     end
6039     wf = WordFactory.new(names);
6040     @ring = GenWordPolynomialRing.new(cf, wf);
6041 end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
6046 def to_s()
6047     return @ring.toScript();
6048 end