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
3788 def initialize(ringstr="",ring=nil)
3789     if ring == nil
3790        sr = StringReader.new( ringstr );
3791        tok = RingFactoryTokenizer.new(sr);
3792        pfac = tok.nextSolvablePolynomialRing();
3793        #tok = GenPolynomialTokenizer.new(sr);
3794        #@pset = tok.nextSolvablePolynomialSet();
3795        @ring = pfac;
3796     else
3797        if ring.is_a? Ring
3798           @ring = ring.ring
3799        else 
3800           @ring = ring;
3801        end
3802     end
3803     if @ring.isAssociative()
3804        puts "ring is associative";
3805     else
3806        puts "warning: ring is not associative";
3807     end
3808     #puts "SolvableRing to super()";
3809     super("",@ring) 
3810 end

Public Instance Methods

element(poly) click to toggle source

Create an element from a string or object.

     # File examples/jas.rb
3843 def element(poly)
3844     if not poly.is_a? String 
3845        begin
3846           if @ring == poly.ring 
3847              return RingElem.new(poly);
3848           end
3849        rescue => e
3850           # pass
3851        end
3852        poly = str(poly);
3853     end
3854     ii = SolvIdeal.new(self, "( " + poly + " )");
3855     list = ii.pset.list;
3856     if list.size > 0
3857         return RingElem.new( list[0] );
3858     end
3859 end
ideal(ringstr="",list=nil) click to toggle source

Create a solvable ideal.

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

Get the one of the solvable polynomial ring.

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

Create a string representation.

     # File examples/jas.rb
3815 def to_s()
3816     return @ring.toScript(); #.to_s;
3817 end
zero() click to toggle source

Get the zero of the solvable polynomial ring.

     # File examples/jas.rb
3836 def zero()
3837     return RingElem.new( @ring.getZERO() );
3838 end