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
3735 def initialize(ringstr="",ring=nil)
3736     if ring == nil
3737        sr = StringReader.new( ringstr );
3738        tok = RingFactoryTokenizer.new(sr);
3739        pfac = tok.nextSolvablePolynomialRing();
3740        #tok = GenPolynomialTokenizer.new(sr);
3741        #@pset = tok.nextSolvablePolynomialSet();
3742        @ring = pfac;
3743     else
3744        if ring.is_a? Ring
3745           @ring = ring.ring
3746        else 
3747           @ring = ring;
3748        end
3749     end
3750     if @ring.isAssociative()
3751        puts "ring is associative";
3752     else
3753        puts "warning: ring is not associative";
3754     end
3755     #puts "SolvableRing to super()";
3756     super("",@ring) 
3757 end

Public Instance Methods

element(poly) click to toggle source

Create an element from a string or object.

     # File examples/jas.rb
3790 def element(poly)
3791     if not poly.is_a? String 
3792        begin
3793           if @ring == poly.ring 
3794              return RingElem.new(poly);
3795           end
3796        rescue => e
3797           # pass
3798        end
3799        poly = str(poly);
3800     end
3801     ii = SolvIdeal.new(self, "( " + poly + " )");
3802     list = ii.pset.list;
3803     if list.size > 0
3804         return RingElem.new( list[0] );
3805     end
3806 end
ideal(ringstr="",list=nil) click to toggle source

Create a solvable ideal.

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

Get the one of the solvable polynomial ring.

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

Create a string representation.

     # File examples/jas.rb
3762 def to_s()
3763     return @ring.toScript(); #.to_s;
3764 end
zero() click to toggle source

Get the zero of the solvable polynomial ring.

     # File examples/jas.rb
3783 def zero()
3784     return RingElem.new( @ring.getZERO() );
3785 end