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, line 3682 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 3737 def element(poly) if not poly.is_a? String begin if @ring == poly.ring return RingElem.new(poly); end rescue => 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 3716 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 3723 def one() return RingElem.new( @ring.getONE() ); end
to_s()
click to toggle source
Create a string representation.
# File examples/jas.rb, line 3709 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 3730 def zero() return RingElem.new( @ring.getZERO() ); end