class JAS::PolyRing

Represents a JAS polynomial ring: GenPolynomialRing.

Provides more convenient constructor. Then returns a Ring.

Attributes

grad[R]

the Java term orderings

lex[R]

the Java term orderings

Public Class Methods

new(coeff,vars,order=Order::IGRLEX) click to toggle source

Ring constructor.

coeff = factory for coefficients, vars = string with variable names, order = term order or weight matrix.

Calls superclass method JAS::Ring::new
     # File examples/jas.rb
2178 def initialize(coeff,vars,order=Order::IGRLEX)
2179     if coeff == nil
2180         raise ArgumentError, "No coefficient given."
2181     end
2182     cf = coeff;
2183     if coeff.is_a? RingElem
2184         cf = coeff.elem.factory();
2185     end
2186     if coeff.is_a? Ring
2187         cf = coeff.ring;
2188     end
2189     if vars == nil
2190         raise ArgumentError, "No variable names given."
2191     end
2192     names = vars;
2193     if vars.is_a? String
2194        names = GenPolynomialTokenizer.variableList(vars);
2195     end
2196     nv = names.size;
2197     to = Order::IGRLEX; #self.class.grad;
2198     if order.is_a? TermOrder
2199         to = order;
2200     end
2201     if order.is_a? Array
2202         to = TermOrder.reverseWeight(order);
2203     end
2204     @ring = GenPolynomialRing.new(cf,nv,to,names);
2205     #@ring = tring;
2206     super("",@ring) 
2207 end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
2212 def to_s()
2213     return @ring.toScript();
2214 end