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, line 2072
def initialize(coeff,vars,order=Order::IGRLEX)
    if coeff == nil
        raise ArgumentError, "No coefficient given."
    end
    cf = coeff;
    if coeff.is_a? RingElem
        cf = coeff.elem.factory();
    end
    if coeff.is_a? Ring
        cf = coeff.ring;
    end
    if vars == nil
        raise ArgumentError, "No variable names given."
    end
    names = vars;
    if vars.is_a? String
       names = GenPolynomialTokenizer.variableList(vars);
    end
    nv = names.size;
    to = Order::IGRLEX; #self.class.grad;
    if order.is_a? TermOrder
        to = order;
    end
    if order.is_a? Array
        to = TermOrder.reverseWeight(order);
    end
    @ring = GenPolynomialRing.new(cf,nv,to,names);
    #@ring = tring;
    super("",@ring) 
end

Public Instance Methods

to_s() click to toggle source

Create a string representation.

# File examples/jas.rb, line 2106
def to_s()
    return @ring.toScript();
end