Represents a JAS power series ring: UnivPowerSeriesRing.
Methods for univariate power series arithmetic.
Ring constructor.
# File examples/jas.rb, line 4611 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
Get the cosinus power series.
# File examples/jas.rb, line 4691 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 4748 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 4677 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 4767 def fixPoint(psmap) ps = @ring.fixPoint( psmap ); return RingElem.new( ps ); end
Convert a GenPolynomial to a power series.
# File examples/jas.rb, line 4788 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 4775 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 4647 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 4656 def one() return RingElem.new( @ring.getONE() ); end
Get a random power series.
# File examples/jas.rb, line 4670 def random(n) return RingElem.new( @ring.random(n) ); end
Get the sinus power series.
# File examples/jas.rb, line 4684 def sin() return RingElem.new( @ring.getSIN() ); end
Get the tangens power series.
# File examples/jas.rb, line 4698 def tan() return RingElem.new( @ring.getTAN() ); end
Generated with the Darkfish Rdoc Generator 2.