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 2365 def initialize(coeff,vars,order=Order::IGRLEX) 2366 if coeff == nil 2367 raise ArgumentError, "No coefficient given." 2368 end 2369 cf = coeff; 2370 if coeff.is_a? RingElem 2371 cf = coeff.elem.factory(); 2372 end 2373 if coeff.is_a? Ring 2374 cf = coeff.ring; 2375 end 2376 if vars == nil 2377 raise ArgumentError, "No variable names given." 2378 end 2379 names = vars; 2380 if vars.is_a? String 2381 names = GenPolynomialTokenizer.variableList(vars); 2382 end 2383 nv = names.size; 2384 to = Order::IGRLEX; #self.class.grad; 2385 if order.is_a? TermOrder 2386 to = order; 2387 end 2388 if order.is_a? Array 2389 to = TermOrder.reverseWeight(order); 2390 end 2391 @ring = GenPolynomialRing.new(cf,nv,to,names); 2392 #@ring = tring; 2393 super("",@ring) 2394 end
Public Instance Methods
to_s()
click to toggle source
Create a string representation.
# File examples/jas.rb 2399 def to_s() 2400 return @ring.toScript(); 2401 end