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 5841 def initialize(coeff,vars) 5842 if coeff == nil 5843 raise ArgumentError, "No coefficient given." 5844 end 5845 cf = coeff; 5846 if coeff.is_a? RingElem 5847 cf = coeff.elem.factory(); 5848 end 5849 if coeff.is_a? Ring 5850 cf = coeff.ring; 5851 end 5852 if vars == nil 5853 raise ArgumentError, "No variable names given." 5854 end 5855 names = vars; 5856 if vars.is_a? String 5857 names = GenPolynomialTokenizer.variableList(vars); 5858 end 5859 wf = WordFactory.new(names); 5860 @ring = GenWordPolynomialRing.new(cf, wf); 5861 end
Public Instance Methods
to_s()
click to toggle source
Create a string representation.
# File examples/jas.rb 5866 def to_s() 5867 return @ring.toScript(); 5868 end