class JAS::MultiSeriesRing
Represents a JAS power series ring: MultiVarPowerSeriesRing.
Methods for multivariate power series arithmetic.
Attributes
the Java polynomial ring
Public Class Methods
Ring constructor.
# File examples/jas.rb, line 5068 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 names.is_a? String names = GenPolynomialTokenizer.variableList(names); end if truncate == nil @ring = MultiVarPowerSeriesRing.new(cofac,names); else nv = names.size; @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names); end else @ring = ring; end end
Public Instance Methods
Get the cosinus power series, var r.
# File examples/jas.rb, line 5151 def cos(r) return RingElem.new( @ring.getCOS(r) ); 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 5204 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
Get the exponential power series, var r.
# File examples/jas.rb, line 5137 def exp(r) return RingElem.new( @ring.getEXP(r) ); end
Create a power series as fixed point of the given mapping.
psmap must implement the MultiVarPowerSeriesMap interface.
# File examples/jas.rb, line 5221 def fixPoint(psmap) ps = @ring.fixPoint( psmap ); return RingElem.new( ps ); end
Convert a GenPolynomial to a power series.
# File examples/jas.rb, line 5242 def fromPoly(a) if a.is_a? RingElem a = a.elem; end return RingElem.new( @ring.fromPolynomial(a) ); end
Compute the greatest common divisor of a and b.
# File examples/jas.rb, line 5229 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
Get the generators of the power series ring.
# File examples/jas.rb, line 5107 def gens() ll = @ring.generators(); nn = ll.map { |e| RingElem.new(e) }; return nn; end
Get the one of the power series ring.
# File examples/jas.rb, line 5116 def one() return RingElem.new( @ring.getONE() ); end
Get a random power series.
# File examples/jas.rb, line 5130 def random(n) return RingElem.new( @ring.random(n) ); end
Get the sinus power series, var r.
# File examples/jas.rb, line 5144 def sin(r) return RingElem.new( @ring.getSIN(r) ); end
Get the tangens power series, var r.
# File examples/jas.rb, line 5158 def tan(r) return RingElem.new( @ring.getTAN(r) ); end
Create a string representation.
# File examples/jas.rb, line 5100 def to_s() return @ring.toScript(); end
Get the zero of the power series ring.
# File examples/jas.rb, line 5123 def zero() return RingElem.new( @ring.getZERO() ); end