Class | JAS::MultiSeriesRing |
In: |
examples/jas.rb
|
Parent: | Object |
Represents a JAS power series ring: MultiVarPowerSeriesRing.
Methods for multivariate power series arithmetic.
ring | [R] |
Ring constructor.
# File examples/jas.rb, line 3400 3400: def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil) 3401: if ring == nil 3402: if ringstr.size > 0 3403: sr = StringReader.new( ringstr ); 3404: tok = GenPolynomialTokenizer.new(sr); 3405: pset = tok.nextPolynomialSet(); 3406: ring = pset.ring; 3407: names = ring.vars; 3408: cofac = ring.coFac; 3409: end 3410: if cofac.is_a? RingElem 3411: cofac = cofac.elem; 3412: end 3413: if truncate == nil 3414: @ring = MultiVarPowerSeriesRing.new(cofac,names); 3415: else 3416: @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names); 3417: end 3418: else 3419: @ring = ring; 3420: end 3421: end
Get the cosinus power series, var r.
# File examples/jas.rb, line 3477 3477: def cos(r) 3478: return RingElem.new( @ring.getCOS(r) ); 3479: 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 3519 3519: def create(ifunc=nil,jfunc=nil,clazz=nil) 3520: #puts "ifunc " 3521: #puts "jfunc " 3522: #puts "clazz " + str(clazz) 3523: if clazz == nil 3524: clazz = Mcoeff.new(@ring,ifunc,jfunc); 3525: end 3526: ps = MultiVarPowerSeries.new( @ring, clazz ); 3527: #puts "ps ", ps.toScript(); 3528: return RingElem.new( ps ); 3529: end
Get the exponential power series, var r.
# File examples/jas.rb, line 3463 3463: def exp(r) 3464: return RingElem.new( @ring.getEXP(r) ); 3465: end
Create a power series as fixed point of the given mapping.
psmap must implement the MultiVarPowerSeriesMap interface.
# File examples/jas.rb, line 3536 3536: def fixPoint(psmap) 3537: ps = @ring.fixPoint( psmap ); 3538: return RingElem.new( ps ); 3539: end
Convert a GenPolynomial to a power series.
# File examples/jas.rb, line 3557 3557: def fromPoly(a) 3558: if a.is_a? RingElem 3559: a = a.elem; 3560: end 3561: return RingElem.new( @ring.fromPolynomial(a) ); 3562: end
Compute the greatest common divisor of a and b.
# File examples/jas.rb, line 3544 3544: def gcd(a,b) 3545: if a.is_a? RingElem 3546: a = a.elem; 3547: end 3548: if b.is_a? RingElem 3549: b = b.elem; 3550: end 3551: return RingElem.new( a.gcd(b) ); 3552: end
Get the generators of the power series ring.
# File examples/jas.rb, line 3433 3433: def gens() 3434: ll = @ring.generators(); 3435: nn = ll.map { |e| RingElem.new(e) }; 3436: return nn; 3437: end
Get the sinus power series, var r.
# File examples/jas.rb, line 3470 3470: def sin(r) 3471: return RingElem.new( @ring.getSIN(r) ); 3472: end
Get the tangens power series, var r.
# File examples/jas.rb, line 3484 3484: def tan(r) 3485: return RingElem.new( @ring.getTAN(r) ); 3486: end