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
5500 def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil)
5501     if ring == nil
5502         if ringstr.size > 0
5503             sr = StringReader.new( ringstr );
5504             tok = RingFactoryTokenizer.new(sr);
5505             pfac = tok.nextPolynomialRing();
5506             #tok = GenPolynomialTokenizer.new(sr);
5507             #pset = tok.nextPolynomialSet();
5508             ring = pfac;
5509             names = ring.vars;
5510             cofac = ring.coFac;
5511         end
5512         if cofac.is_a? RingElem
5513             cofac = cofac.elem;
5514         end
5515         if names.is_a? String
5516            names = GenPolynomialTokenizer.variableList(names);
5517         end
5518         if truncate == nil
5519             @ring = MultiVarPowerSeriesRing.new(cofac,names);
5520         else
5521             nv = names.size;
5522             @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names);
5523         end
5524     else
5525        @ring = ring;
5526     end
5527 end

Public Instance Methods

cos(r) click to toggle source

Get the cosinus power series, var r.

     # File examples/jas.rb
5583 def cos(r)
5584     return RingElem.new( @ring.getCOS(r) );
5585 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
5636 def create(ifunc=nil,jfunc=nil,clazz=nil)
5637     #puts "ifunc "
5638     #puts "jfunc "
5639     #puts "clazz " + str(clazz)
5640     if clazz == nil
5641         clazz = Mcoeff.new(@ring,ifunc,jfunc);
5642     end
5643     ps = MultiVarPowerSeries.new( @ring, clazz );
5644     #puts "ps ", ps.toScript();
5645     return RingElem.new( ps );
5646 end
exp(r) click to toggle source

Get the exponential power series, var r.

     # File examples/jas.rb
5569 def exp(r)
5570     return RingElem.new( @ring.getEXP(r) );
5571 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
5653 def fixPoint(psmap)
5654     ps = @ring.fixPoint( psmap );
5655     return RingElem.new( ps );
5656 end
fromPoly(a) click to toggle source

Convert a GenPolynomial to a power series.

     # File examples/jas.rb
5674 def fromPoly(a)
5675     if a.is_a? RingElem
5676         a = a.elem;
5677     end
5678     return RingElem.new( @ring.fromPolynomial(a) );
5679 end
gcd(a,b) click to toggle source

Compute the greatest common divisor of a and b.

     # File examples/jas.rb
5661 def gcd(a,b)
5662     if a.is_a? RingElem
5663         a = a.elem;
5664     end
5665     if b.is_a? RingElem
5666         b = b.elem;
5667     end
5668     return RingElem.new( a.gcd(b) );
5669 end
gens() click to toggle source

Get the generators of the power series ring.

     # File examples/jas.rb
5539 def gens()
5540     ll = @ring.generators();
5541     nn = ll.map { |e| RingElem.new(e) };
5542     return nn;
5543 end
one() click to toggle source

Get the one of the power series ring.

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

Get a random power series.

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

Get the sinus power series, var r.

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

Get the tangens power series, var r.

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

Create a string representation.

     # File examples/jas.rb
5532 def to_s()
5533     return @ring.toScript();
5534 end
zero() click to toggle source

Get the zero of the power series ring.

     # File examples/jas.rb
5555 def zero()
5556     return RingElem.new( @ring.getZERO() );
5557 end