Represents a JAS power series ring: MultiVarPowerSeriesRing.
Methods for multivariate power series arithmetic.
Ring constructor.
# File examples/jas.rb, line 4811 def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil) 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; names = ring.vars; cofac = ring.coFac; end if cofac.is_a? RingElem cofac = cofac.elem; end if truncate == nil @ring = MultiVarPowerSeriesRing.new(cofac,names); else @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names); end else @ring = ring; end end
Get the cosinus power series, var r.
# File examples/jas.rb, line 4890 def cos(r) return RingElem.new( @ring.getCOS(r) ); end
Create a power series with given generating function.
ifunc(ExpVector i) must return a value which is used in RingFactory.fromInteger(). jfunc(ExpVector i) must return a value of type ring.coFac. clazz must implement the MultiVarCoefficients abstract class.
# File examples/jas.rb, line 4943 def create(ifunc=nil,jfunc=nil,clazz=nil) #puts "ifunc " #puts "jfunc " #puts "clazz " + str(clazz) if clazz == nil clazz = Mcoeff.new(@ring,ifunc,jfunc); end ps = MultiVarPowerSeries.new( @ring, clazz ); #puts "ps ", ps.toScript(); return RingElem.new( ps ); end
Get the exponential power series, var r.
# File examples/jas.rb, line 4876 def exp(r) return RingElem.new( @ring.getEXP(r) ); end
Create a power series as fixed point of the given mapping.
psmap must implement the MultiVarPowerSeriesMap interface.
# File examples/jas.rb, line 4960 def fixPoint(psmap) ps = @ring.fixPoint( psmap ); return RingElem.new( ps ); end
Convert a GenPolynomial to a power series.
# File examples/jas.rb, line 4981 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 4968 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 4846 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 4855 def one() return RingElem.new( @ring.getONE() ); end
Get a random power series.
# File examples/jas.rb, line 4869 def random(n) return RingElem.new( @ring.random(n) ); end
Get the sinus power series, var r.
# File examples/jas.rb, line 4883 def sin(r) return RingElem.new( @ring.getSIN(r) ); end
Get the tangens power series, var r.
# File examples/jas.rb, line 4897 def tan(r) return RingElem.new( @ring.getTAN(r) ); end
Generated with the Darkfish Rdoc Generator 2.