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 3976 def initialize(ringstr="",ring=nil) 3977 if ring == nil 3978 sr = StringReader.new( ringstr ); 3979 tok = RingFactoryTokenizer.new(sr); 3980 pfac = tok.nextSolvablePolynomialRing(); 3981 #tok = GenPolynomialTokenizer.new(sr); 3982 #@pset = tok.nextSolvablePolynomialSet(); 3983 @ring = pfac; 3984 else 3985 if ring.is_a? Ring 3986 @ring = ring.ring 3987 else 3988 @ring = ring; 3989 end 3990 end 3991 if @ring.isAssociative() 3992 puts "ring is associative"; 3993 else 3994 puts "warning: ring is not associative"; 3995 end 3996 #puts "SolvableRing to super()"; 3997 super("",@ring) 3998 end
Public Instance Methods
element(poly)
click to toggle source
Create an element from a string or object.
# File examples/jas.rb 4031 def element(poly) 4032 if not poly.is_a? String 4033 begin 4034 if @ring == poly.ring 4035 return RingElem.new(poly); 4036 end 4037 rescue => e 4038 # pass 4039 end 4040 poly = str(poly); 4041 end 4042 ii = SolvIdeal.new(self, "( " + poly + " )"); 4043 list = ii.pset.list; 4044 if list.size > 0 4045 return RingElem.new( list[0] ); 4046 end 4047 end
ideal(ringstr="",list=nil)
click to toggle source
Create a solvable ideal.
# File examples/jas.rb 4010 def ideal(ringstr="",list=nil) 4011 return SolvIdeal.new(self,ringstr,list); 4012 end
one()
click to toggle source
Get the one of the solvable polynomial ring.
# File examples/jas.rb 4017 def one() 4018 return RingElem.new( @ring.getONE() ); 4019 end
to_s()
click to toggle source
Create a string representation.
# File examples/jas.rb 4003 def to_s() 4004 return @ring.toScript(); #.to_s; 4005 end
zero()
click to toggle source
Get the zero of the solvable polynomial ring.
# File examples/jas.rb 4024 def zero() 4025 return RingElem.new( @ring.getZERO() ); 4026 end