Class | JAS::SeriesRing |
In: |
examples/jas.rb
|
Parent: | Object |
Represents a JAS power series ring: UnivPowerSeriesRing.
Methods for univariate power series arithmetic.
ring | [R] |
Ring constructor.
# File examples/jas.rb, line 3214 3214: def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,name="z") 3215: if ring == nil 3216: if ringstr.size > 0 3217: sr = StringReader.new( ringstr ); 3218: tok = GenPolynomialTokenizer.new(sr); 3219: pset = tok.nextPolynomialSet(); 3220: ring = pset.ring; 3221: vname = ring.vars; 3222: name = vname[0]; 3223: cofac = ring.coFac; 3224: end 3225: if cofac.is_a? RingElem 3226: cofac = cofac.elem; 3227: end 3228: if truncate == nil 3229: @ring = UnivPowerSeriesRing.new(cofac,name); 3230: else 3231: @ring = UnivPowerSeriesRing.new(cofac,truncate,name); 3232: end 3233: else 3234: @ring = ring; 3235: end 3236: end
Get the cosinus power series.
# File examples/jas.rb, line 3292 3292: def cos() 3293: return RingElem.new( @ring.getCOS() ); 3294: 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 3338 3338: def create(ifunc,jfunc=nil,clazz=nil) 3339: if clazz == nil 3340: #puts "ifunc = " + ifunc.to_s + "."; 3341: #puts "jfunc = " + jfunc.to_s + "."; 3342: #puts "clazz = " + clazz.to_s + "."; 3343: cf = Ucoeff.new(ifunc,jfunc,@ring.coFac); 3344: #puts "cf = " + cf.to_s + "."; 3345: ps = UnivPowerSeries.new( @ring, cf ); 3346: else 3347: ps = UnivPowerSeries.new( @ring, clazz ); 3348: end 3349: return RingElem.new( ps ); 3350: end
Get the exponential power series.
# File examples/jas.rb, line 3278 3278: def exp() 3279: return RingElem.new( @ring.getEXP() ); 3280: end
Create a power series as fixed point of the given mapping.
psmap must implement the UnivPowerSeriesMap interface.
# File examples/jas.rb, line 3357 3357: def fixPoint(psmap) 3358: ps = @ring.fixPoint( psmap ); 3359: return RingElem.new( ps ); 3360: end
Convert a GenPolynomial to a power series.
# File examples/jas.rb, line 3378 3378: def fromPoly(a) 3379: if a.is_a? RingElem 3380: a = a.elem; 3381: end 3382: return RingElem.new( @ring.fromPolynomial(a) ); 3383: end
Compute the greatest common divisor of a and b.
# File examples/jas.rb, line 3365 3365: def gcd(a,b) 3366: if a.is_a? RingElem 3367: a = a.elem; 3368: end 3369: if b.is_a? RingElem 3370: b = b.elem; 3371: end 3372: return RingElem.new( a.gcd(b) ); 3373: end
Get the generators of the power series ring.
# File examples/jas.rb, line 3248 3248: def gens() 3249: ll = @ring.generators(); 3250: nn = ll.map { |e| RingElem.new(e) }; 3251: return nn; 3252: end
Get the sinus power series.
# File examples/jas.rb, line 3285 3285: def sin() 3286: return RingElem.new( @ring.getSIN() ); 3287: end
Get the tangens power series.
# File examples/jas.rb, line 3299 3299: def tan() 3300: return RingElem.new( @ring.getTAN() ); 3301: end