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 5174 def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil) 5175 if ring == nil 5176 if ringstr.size > 0 5177 sr = StringReader.new( ringstr ); 5178 tok = RingFactoryTokenizer.new(sr); 5179 pfac = tok.nextPolynomialRing(); 5180 #tok = GenPolynomialTokenizer.new(sr); 5181 #pset = tok.nextPolynomialSet(); 5182 ring = pfac; 5183 names = ring.vars; 5184 cofac = ring.coFac; 5185 end 5186 if cofac.is_a? RingElem 5187 cofac = cofac.elem; 5188 end 5189 if names.is_a? String 5190 names = GenPolynomialTokenizer.variableList(names); 5191 end 5192 if truncate == nil 5193 @ring = MultiVarPowerSeriesRing.new(cofac,names); 5194 else 5195 nv = names.size; 5196 @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names); 5197 end 5198 else 5199 @ring = ring; 5200 end 5201 end
Public Instance Methods
Get the cosinus power series, var r.
# File examples/jas.rb 5257 def cos(r) 5258 return RingElem.new( @ring.getCOS(r) ); 5259 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 5310 def create(ifunc=nil,jfunc=nil,clazz=nil) 5311 #puts "ifunc " 5312 #puts "jfunc " 5313 #puts "clazz " + str(clazz) 5314 if clazz == nil 5315 clazz = Mcoeff.new(@ring,ifunc,jfunc); 5316 end 5317 ps = MultiVarPowerSeries.new( @ring, clazz ); 5318 #puts "ps ", ps.toScript(); 5319 return RingElem.new( ps ); 5320 end
Get the exponential power series, var r.
# File examples/jas.rb 5243 def exp(r) 5244 return RingElem.new( @ring.getEXP(r) ); 5245 end
Create a power series as fixed point of the given mapping.
psmap must implement the MultiVarPowerSeriesMap interface.
# File examples/jas.rb 5327 def fixPoint(psmap) 5328 ps = @ring.fixPoint( psmap ); 5329 return RingElem.new( ps ); 5330 end
Convert a GenPolynomial to a power series.
# File examples/jas.rb 5348 def fromPoly(a) 5349 if a.is_a? RingElem 5350 a = a.elem; 5351 end 5352 return RingElem.new( @ring.fromPolynomial(a) ); 5353 end
Compute the greatest common divisor of a and b.
# File examples/jas.rb 5335 def gcd(a,b) 5336 if a.is_a? RingElem 5337 a = a.elem; 5338 end 5339 if b.is_a? RingElem 5340 b = b.elem; 5341 end 5342 return RingElem.new( a.gcd(b) ); 5343 end
Get the generators of the power series ring.
# File examples/jas.rb 5213 def gens() 5214 ll = @ring.generators(); 5215 nn = ll.map { |e| RingElem.new(e) }; 5216 return nn; 5217 end
Get the one of the power series ring.
# File examples/jas.rb 5222 def one() 5223 return RingElem.new( @ring.getONE() ); 5224 end
Get a random power series.
# File examples/jas.rb 5236 def random(n) 5237 return RingElem.new( @ring.random(n) ); 5238 end
Get the sinus power series, var r.
# File examples/jas.rb 5250 def sin(r) 5251 return RingElem.new( @ring.getSIN(r) ); 5252 end
Get the tangens power series, var r.
# File examples/jas.rb 5264 def tan(r) 5265 return RingElem.new( @ring.getTAN(r) ); 5266 end
Create a string representation.
# File examples/jas.rb 5206 def to_s() 5207 return @ring.toScript(); 5208 end
Get the zero of the power series ring.
# File examples/jas.rb 5229 def zero() 5230 return RingElem.new( @ring.getZERO() ); 5231 end