class 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.

Calls superclass method JAS::Ring::new
     # File examples/jas.rb
4128 def initialize(ringstr="",ring=nil)
4129     if ring == nil
4130        sr = StringReader.new( ringstr );
4131        tok = RingFactoryTokenizer.new(sr);
4132        pfac = tok.nextSolvablePolynomialRing();
4133        #tok = GenPolynomialTokenizer.new(sr);
4134        #@pset = tok.nextSolvablePolynomialSet();
4135        @ring = pfac;
4136     else
4137        if ring.is_a? Ring
4138           @ring = ring.ring
4139        else 
4140           @ring = ring;
4141        end
4142     end
4143     if @ring.isAssociative()
4144        puts "ring is associative";
4145     else
4146        puts "warning: ring is not associative";
4147     end
4148     #puts "SolvableRing to super()";
4149     super("",@ring)
4150 end

Public Instance Methods

element(poly) click to toggle source

Create an element from a string or object.

     # File examples/jas.rb
4183 def element(poly)
4184     if not poly.is_a? String 
4185        begin
4186           if @ring == poly.ring 
4187              return RingElem.new(poly);
4188           end
4189        rescue => e
4190           # pass
4191        end
4192        poly = str(poly);
4193     end
4194     ii = SolvIdeal.new(self, "( " + poly + " )");
4195     list = ii.pset.list;
4196     if list.size > 0
4197         return RingElem.new( list[0] );
4198     end
4199 end
ideal(ringstr="",list=nil) click to toggle source

Create a solvable ideal.

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

Get the one of the solvable polynomial ring.

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

Create a string representation.

     # File examples/jas.rb
4155 def to_s()
4156     return @ring.toScript(); #.to_s;
4157 end
zero() click to toggle source

Get the zero of the solvable polynomial ring.

     # File examples/jas.rb
4176 def zero()
4177     return RingElem.new( @ring.getZERO() );
4178 end