class JAS::MultiSeriesRing

Represents a JAS power series ring: MultiVarPowerSeriesRing.

Methods for multivariate power series arithmetic.

Attributes

ring[R]

the Java polynomial ring

Public Class Methods

new(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil) click to toggle source

Ring constructor.

     # File examples/jas.rb
5121 def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil)
5122     if ring == nil
5123         if ringstr.size > 0
5124             sr = StringReader.new( ringstr );
5125             tok = RingFactoryTokenizer.new(sr);
5126             pfac = tok.nextPolynomialRing();
5127             #tok = GenPolynomialTokenizer.new(sr);
5128             #pset = tok.nextPolynomialSet();
5129             ring = pfac;
5130             names = ring.vars;
5131             cofac = ring.coFac;
5132         end
5133         if cofac.is_a? RingElem
5134             cofac = cofac.elem;
5135         end
5136         if names.is_a? String
5137            names = GenPolynomialTokenizer.variableList(names);
5138         end
5139         if truncate == nil
5140             @ring = MultiVarPowerSeriesRing.new(cofac,names);
5141         else
5142             nv = names.size;
5143             @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names);
5144         end
5145     else
5146        @ring = ring;
5147     end
5148 end

Public Instance Methods

cos(r) click to toggle source

Get the cosinus power series, var r.

     # File examples/jas.rb
5204 def cos(r)
5205     return RingElem.new( @ring.getCOS(r) );
5206 end
create(ifunc=nil,jfunc=nil,clazz=nil) click to toggle source

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
5257 def create(ifunc=nil,jfunc=nil,clazz=nil)
5258     #puts "ifunc "
5259     #puts "jfunc "
5260     #puts "clazz " + str(clazz)
5261     if clazz == nil
5262         clazz = Mcoeff.new(@ring,ifunc,jfunc);
5263     end
5264     ps = MultiVarPowerSeries.new( @ring, clazz );
5265     #puts "ps ", ps.toScript();
5266     return RingElem.new( ps );
5267 end
exp(r) click to toggle source

Get the exponential power series, var r.

     # File examples/jas.rb
5190 def exp(r)
5191     return RingElem.new( @ring.getEXP(r) );
5192 end
fixPoint(psmap) click to toggle source

Create a power series as fixed point of the given mapping.

psmap must implement the MultiVarPowerSeriesMap interface.

     # File examples/jas.rb
5274 def fixPoint(psmap)
5275     ps = @ring.fixPoint( psmap );
5276     return RingElem.new( ps );
5277 end
fromPoly(a) click to toggle source

Convert a GenPolynomial to a power series.

     # File examples/jas.rb
5295 def fromPoly(a)
5296     if a.is_a? RingElem
5297         a = a.elem;
5298     end
5299     return RingElem.new( @ring.fromPolynomial(a) );
5300 end
gcd(a,b) click to toggle source

Compute the greatest common divisor of a and b.

     # File examples/jas.rb
5282 def gcd(a,b)
5283     if a.is_a? RingElem
5284         a = a.elem;
5285     end
5286     if b.is_a? RingElem
5287         b = b.elem;
5288     end
5289     return RingElem.new( a.gcd(b) );
5290 end
gens() click to toggle source

Get the generators of the power series ring.

     # File examples/jas.rb
5160 def gens()
5161     ll = @ring.generators();
5162     nn = ll.map { |e| RingElem.new(e) };
5163     return nn;
5164 end
one() click to toggle source

Get the one of the power series ring.

     # File examples/jas.rb
5169 def one()
5170     return RingElem.new( @ring.getONE() );
5171 end
random(n) click to toggle source

Get a random power series.

     # File examples/jas.rb
5183 def random(n)
5184     return RingElem.new( @ring.random(n) );
5185 end
sin(r) click to toggle source

Get the sinus power series, var r.

     # File examples/jas.rb
5197 def sin(r)
5198     return RingElem.new( @ring.getSIN(r) );
5199 end
tan(r) click to toggle source

Get the tangens power series, var r.

     # File examples/jas.rb
5211 def tan(r)
5212     return RingElem.new( @ring.getTAN(r) );
5213 end
to_s() click to toggle source

Create a string representation.

     # File examples/jas.rb
5153 def to_s()
5154     return @ring.toScript();
5155 end
zero() click to toggle source

Get the zero of the power series ring.

     # File examples/jas.rb
5176 def zero()
5177     return RingElem.new( @ring.getZERO() );
5178 end