In Files

Parent

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, 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

Public Instance Methods

cos(r) click to toggle source

Get the cosinus power series, var r.

# File examples/jas.rb, line 4890
def cos(r)
    return RingElem.new( @ring.getCOS(r) );
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, 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
exp(r) click to toggle source

Get the exponential power series, var r.

# File examples/jas.rb, line 4876
def exp(r)
    return RingElem.new( @ring.getEXP(r) );
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, line 4960
def fixPoint(psmap)
    ps = @ring.fixPoint( psmap );
    return RingElem.new( ps );
end
fromPoly(a) click to toggle source

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
gcd(a,b) click to toggle source

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
gens() click to toggle source

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
one() click to toggle source

Get the one of the power series ring.

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

Get a random power series.

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

Get the sinus power series, var r.

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

Get the tangens power series, var r.

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

Create a string representation.

# File examples/jas.rb, line 4839
def to_s()
    return @ring.toScript();
end
zero() click to toggle source

Get the zero of the power series ring.

# File examples/jas.rb, line 4862
def zero()
    return RingElem.new( @ring.getZERO() );
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.