In Files

Parent

Namespace

JAS::SeriesRing

Represents a JAS power series ring: UnivPowerSeriesRing.

Methods for univariate power series arithmetic.

Attributes

ring[R]

the Java polynomial ring

Public Class Methods

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

Ring constructor.

# File examples/jas.rb, line 4611
def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,name="z")
    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;
            vname = ring.vars;
            name = vname[0];
            cofac = ring.coFac;
        end
        if cofac.is_a? RingElem
            cofac = cofac.elem;
        end
        if truncate == nil
            @ring = UnivPowerSeriesRing.new(cofac,name);
        else
            @ring = UnivPowerSeriesRing.new(cofac,truncate,name);
        end
    else
       @ring = ring;
    end
end

Public Instance Methods

cos() click to toggle source

Get the cosinus power series.

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

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 4748
def create(ifunc,jfunc=nil,clazz=nil)
    if clazz == nil
        #puts "ifunc = " + ifunc.to_s + ".";
        #puts "jfunc = " + jfunc.to_s + ".";
        #puts "clazz = " + clazz.to_s + ".";
        cf = Ucoeff.new(ifunc,jfunc,@ring.coFac);
        #puts "cf    = " + cf.to_s + ".";
        ps = UnivPowerSeries.new( @ring, cf );
    else
        ps = UnivPowerSeries.new( @ring, clazz );
    end
    return RingElem.new( ps );
end
exp() click to toggle source

Get the exponential power series.

# File examples/jas.rb, line 4677
def exp()
    return RingElem.new( @ring.getEXP() );
end
fixPoint(psmap) click to toggle source

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

psmap must implement the UnivPowerSeriesMap interface.

# File examples/jas.rb, line 4767
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 4788
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 4775
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 4647
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 4656
def one()
    return RingElem.new( @ring.getONE() );
end
random(n) click to toggle source

Get a random power series.

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

Get the sinus power series.

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

Get the tangens power series.

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

Create a string representation.

# File examples/jas.rb, line 4640
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 4663
def zero()
    return RingElem.new( @ring.getZERO() );
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.