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
2404 def initialize(coeff,vars,order=Order::IGRLEX)
2405     if coeff == nil
2406         raise ArgumentError, "No coefficient given."
2407     end
2408     cf = coeff;
2409     if coeff.is_a? RingElem
2410         cf = coeff.elem.factory();
2411     end
2412     if coeff.is_a? Ring
2413         cf = coeff.ring;
2414     end
2415     if vars == nil
2416         raise ArgumentError, "No variable names given."
2417     end
2418     names = vars;
2419     if vars.is_a? String
2420        names = GenPolynomialTokenizer.variableList(vars);
2421     end
2422     nv = names.size;
2423     to = Order::IGRLEX; #self.class.grad;
2424     if order.is_a? TermOrder
2425         to = order;
2426     end
2427     if order.is_a? Array
2428         to = TermOrder.reverseWeight(order);
2429     end
2430     @ring = GenPolynomialRing.new(cf,nv,to,names);
2431     #@ring = tring;
2432     super("",@ring)
2433 end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
2438 def to_s()
2439     return @ring.toScript();
2440 end