In Files

Parent

JAS::SolvableRing

Represents a JAS solvable polynomial ring: GenSolvablePolynomialRing.

Has a method to create solvable ideals.

Public Class Methods

new(ringstr="",ring=nil) click to toggle source

Solvable polynomial ring constructor.

# File examples/jas.rb, line 3426
def initialize(ringstr="",ring=nil)
    if ring == nil
       sr = StringReader.new( ringstr );
       tok = RingFactoryTokenizer.new(sr);
       pfac = tok.nextSolvablePolynomialRing();
       #tok = GenPolynomialTokenizer.new(sr);
       #@pset = tok.nextSolvablePolynomialSet();
       @ring = pfac;
    else
       if ring.is_a? Ring
          @ring = ring.ring
       else 
          @ring = ring;
       end
    end
    if @ring.isAssociative()
       puts "ring is associative";
    else
       puts "warning: ring is not associative";
    end
    #puts "SolvableRing to super()";
    super("",@ring) 
end

Public Instance Methods

element(poly) click to toggle source

Create an element from a string or object.

# File examples/jas.rb, line 3481
def element(poly)
    if not poly.is_a? String 
       begin
          if @ring == poly.ring 
             return RingElem.new(poly);
          end
       rescue Exception => e
          # pass
       end
       poly = str(poly);
    end
    ii = SolvIdeal.new(self, "( " + poly + " )");
    list = ii.pset.list;
    if list.size > 0
        return RingElem.new( list[0] );
    end
end
ideal(ringstr="",list=nil) click to toggle source

Create a solvable ideal.

# File examples/jas.rb, line 3460
def ideal(ringstr="",list=nil)
    return SolvIdeal.new(self,ringstr,list);
end
one() click to toggle source

Get the one of the solvable polynomial ring.

# File examples/jas.rb, line 3467
def one()
    return RingElem.new( @ring.getONE() );
end
to_s() click to toggle source

Create a string representation.

# File examples/jas.rb, line 3453
def to_s()
    return @ring.toScript(); #.to_s;
end
zero() click to toggle source

Get the zero of the solvable polynomial ring.

# File examples/jas.rb, line 3474
def zero()
    return RingElem.new( @ring.getZERO() );
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.