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 5338 def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil) 5339 if ring == nil 5340 if ringstr.size > 0 5341 sr = StringReader.new( ringstr ); 5342 tok = RingFactoryTokenizer.new(sr); 5343 pfac = tok.nextPolynomialRing(); 5344 #tok = GenPolynomialTokenizer.new(sr); 5345 #pset = tok.nextPolynomialSet(); 5346 ring = pfac; 5347 names = ring.vars; 5348 cofac = ring.coFac; 5349 end 5350 if cofac.is_a? RingElem 5351 cofac = cofac.elem; 5352 end 5353 if names.is_a? String 5354 names = GenPolynomialTokenizer.variableList(names); 5355 end 5356 if truncate == nil 5357 @ring = MultiVarPowerSeriesRing.new(cofac,names); 5358 else 5359 nv = names.size; 5360 @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names); 5361 end 5362 else 5363 @ring = ring; 5364 end 5365 end
Public Instance Methods
Get the cosinus power series, var r.
# File examples/jas.rb 5421 def cos(r) 5422 return RingElem.new( @ring.getCOS(r) ); 5423 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 5474 def create(ifunc=nil,jfunc=nil,clazz=nil) 5475 #puts "ifunc " 5476 #puts "jfunc " 5477 #puts "clazz " + str(clazz) 5478 if clazz == nil 5479 clazz = Mcoeff.new(@ring,ifunc,jfunc); 5480 end 5481 ps = MultiVarPowerSeries.new( @ring, clazz ); 5482 #puts "ps ", ps.toScript(); 5483 return RingElem.new( ps ); 5484 end
Get the exponential power series, var r.
# File examples/jas.rb 5407 def exp(r) 5408 return RingElem.new( @ring.getEXP(r) ); 5409 end
Create a power series as fixed point of the given mapping.
psmap must implement the MultiVarPowerSeriesMap interface.
# File examples/jas.rb 5491 def fixPoint(psmap) 5492 ps = @ring.fixPoint( psmap ); 5493 return RingElem.new( ps ); 5494 end
Convert a GenPolynomial to a power series.
# File examples/jas.rb 5512 def fromPoly(a) 5513 if a.is_a? RingElem 5514 a = a.elem; 5515 end 5516 return RingElem.new( @ring.fromPolynomial(a) ); 5517 end
Compute the greatest common divisor of a and b.
# File examples/jas.rb 5499 def gcd(a,b) 5500 if a.is_a? RingElem 5501 a = a.elem; 5502 end 5503 if b.is_a? RingElem 5504 b = b.elem; 5505 end 5506 return RingElem.new( a.gcd(b) ); 5507 end
Get the generators of the power series ring.
# File examples/jas.rb 5377 def gens() 5378 ll = @ring.generators(); 5379 nn = ll.map { |e| RingElem.new(e) }; 5380 return nn; 5381 end
Get the one of the power series ring.
# File examples/jas.rb 5386 def one() 5387 return RingElem.new( @ring.getONE() ); 5388 end
Get a random power series.
# File examples/jas.rb 5400 def random(n) 5401 return RingElem.new( @ring.random(n) ); 5402 end
Get the sinus power series, var r.
# File examples/jas.rb 5414 def sin(r) 5415 return RingElem.new( @ring.getSIN(r) ); 5416 end
Get the tangens power series, var r.
# File examples/jas.rb 5428 def tan(r) 5429 return RingElem.new( @ring.getTAN(r) ); 5430 end
Create a string representation.
# File examples/jas.rb 5370 def to_s() 5371 return @ring.toScript(); 5372 end
Get the zero of the power series ring.
# File examples/jas.rb 5393 def zero() 5394 return RingElem.new( @ring.getZERO() ); 5395 end