Class JAS::SolvableRing
In: examples/jas.rb
Parent: Ring

Represents a JAS solvable polynomial ring: GenSolvablePolynomialRing.

Has a method to create solvable ideals.

Methods

element   ideal   new   one   to_s   zero  

Public Class methods

Solvable polynomial ring constructor.

[Source]

      # File examples/jas.rb, line 2563
2563:     def initialize(ringstr="",ring=nil)
2564:         if ring == nil
2565:            sr = StringReader.new( ringstr );
2566:            tok = GenPolynomialTokenizer.new(sr);
2567:            @pset = tok.nextSolvablePolynomialSet();
2568:            @ring = @pset.ring;
2569:         else
2570:            @ring = ring;
2571:         end
2572:         if not @ring.isAssociative()
2573:            puts "warning: ring is not associative";
2574:         end
2575:         #puts "SolvableRing to super()";
2576:         #super("",@ring) 
2577:     end

Public Instance methods

Create an element from a string or object.

[Source]

      # File examples/jas.rb, line 2610
2610:     def element(poly)
2611:         if not poly.is_a? String 
2612:            begin
2613:               if @ring == poly.ring 
2614:                  return RingElem.new(poly);
2615:               end
2616:            rescue Exception => e
2617:               # pass
2618:            end
2619:            poly = str(poly);
2620:         end
2621:         ii = SolvableIdeal.new(self, "( " + poly + " )");
2622:         list = ii.pset.list;
2623:         if list.size > 0
2624:             return RingElem.new( list[0] );
2625:         end
2626:     end

Create a solvable ideal.

[Source]

      # File examples/jas.rb, line 2589
2589:     def ideal(ringstr="",list=nil)
2590:         return SolvableIdeal.new(self,ringstr,list);
2591:     end

Get the one of the solvable polynomial ring.

[Source]

      # File examples/jas.rb, line 2596
2596:     def one()
2597:         return RingElem.new( @ring.getONE() );
2598:     end

Create a string representation.

[Source]

      # File examples/jas.rb, line 2582
2582:     def to_s()
2583:         return @ring.toScript(); #.to_s;
2584:     end

Get the zero of the solvable polynomial ring.

[Source]

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

[Validate]