class JAS::SeriesRing
Represents a JAS power series ring: UnivPowerSeriesRing.
Methods for univariate power series arithmetic.
Attributes
the Java polynomial ring
Public Class Methods
Ring constructor.
# File examples/jas.rb, line 4868 def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,name="z") if ring == nil if ringstr.size > 0 sr = StringReader.new( ringstr ); tok = RingFactoryTokenizer.new(sr); pfac = tok.nextPolynomialRing(); #tok = GenPolynomialTokenizer.new(sr); #pset = tok.nextPolynomialSet(); ring = pfac; vname = ring.vars; name = vname[0]; cofac = ring.coFac; end if cofac.is_a? RingElem cofac = cofac.elem; end if truncate == nil @ring = UnivPowerSeriesRing.new(cofac,name); else @ring = UnivPowerSeriesRing.new(cofac,truncate,name); end else @ring = ring; end end
Public Instance Methods
Get the cosinus power series.
# File examples/jas.rb, line 4948 def cos() return RingElem.new( @ring.getCOS() ); end
Create a power series with given generating function.
ifunc(int i) must return a value which is used in RingFactory.fromInteger(). jfunc(int i) must return a value of type ring.coFac. clazz must implement the Coefficients abstract class.
# File examples/jas.rb, line 5005 def create(ifunc,jfunc=nil,clazz=nil) if clazz == nil #puts "ifunc = " + ifunc.to_s + "."; #puts "jfunc = " + jfunc.to_s + "."; #puts "clazz = " + clazz.to_s + "."; cf = Ucoeff.new(ifunc,jfunc,@ring.coFac); #puts "cf = " + cf.to_s + "."; ps = UnivPowerSeries.new( @ring, cf ); else ps = UnivPowerSeries.new( @ring, clazz ); end return RingElem.new( ps ); end
Get the exponential power series.
# File examples/jas.rb, line 4934 def exp() return RingElem.new( @ring.getEXP() ); end
Create a power series as fixed point of the given mapping.
psmap must implement the UnivPowerSeriesMap interface.
# File examples/jas.rb, line 5024 def fixPoint(psmap) ps = @ring.fixPoint( psmap ); return RingElem.new( ps ); end
Convert a GenPolynomial to a power series.
# File examples/jas.rb, line 5045 def fromPoly(a) if a.is_a? RingElem a = a.elem; end return RingElem.new( @ring.fromPolynomial(a) ); end
Compute the greatest common divisor of a and b.
# File examples/jas.rb, line 5032 def gcd(a,b) if a.is_a? RingElem a = a.elem; end if b.is_a? RingElem b = b.elem; end return RingElem.new( a.gcd(b) ); end
Get the generators of the power series ring.
# File examples/jas.rb, line 4904 def gens() ll = @ring.generators(); nn = ll.map { |e| RingElem.new(e) }; return nn; end
Get the one of the power series ring.
# File examples/jas.rb, line 4913 def one() return RingElem.new( @ring.getONE() ); end
Get a random power series.
# File examples/jas.rb, line 4927 def random(n) return RingElem.new( @ring.random(n) ); end
Get the sinus power series.
# File examples/jas.rb, line 4941 def sin() return RingElem.new( @ring.getSIN() ); end
Get the tangens power series.
# File examples/jas.rb, line 4955 def tan() return RingElem.new( @ring.getTAN() ); end
Create a string representation.
# File examples/jas.rb, line 4897 def to_s() return @ring.toScript(); end
Get the zero of the power series ring.
# File examples/jas.rb, line 4920 def zero() return RingElem.new( @ring.getZERO() ); end