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
2125 def initialize(coeff,vars,order=Order::IGRLEX)
2126     if coeff == nil
2127         raise ArgumentError, "No coefficient given."
2128     end
2129     cf = coeff;
2130     if coeff.is_a? RingElem
2131         cf = coeff.elem.factory();
2132     end
2133     if coeff.is_a? Ring
2134         cf = coeff.ring;
2135     end
2136     if vars == nil
2137         raise ArgumentError, "No variable names given."
2138     end
2139     names = vars;
2140     if vars.is_a? String
2141        names = GenPolynomialTokenizer.variableList(vars);
2142     end
2143     nv = names.size;
2144     to = Order::IGRLEX; #self.class.grad;
2145     if order.is_a? TermOrder
2146         to = order;
2147     end
2148     if order.is_a? Array
2149         to = TermOrder.reverseWeight(order);
2150     end
2151     @ring = GenPolynomialRing.new(cf,nv,to,names);
2152     #@ring = tring;
2153     super("",@ring) 
2154 end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
2159 def to_s()
2160     return @ring.toScript();
2161 end