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 5362 def initialize(ringstr="",truncate=nil,ring=nil,cofac=nil,names=nil) 5363 if ring == nil 5364 if ringstr.size > 0 5365 sr = StringReader.new( ringstr ); 5366 tok = RingFactoryTokenizer.new(sr); 5367 pfac = tok.nextPolynomialRing(); 5368 #tok = GenPolynomialTokenizer.new(sr); 5369 #pset = tok.nextPolynomialSet(); 5370 ring = pfac; 5371 names = ring.vars; 5372 cofac = ring.coFac; 5373 end 5374 if cofac.is_a? RingElem 5375 cofac = cofac.elem; 5376 end 5377 if names.is_a? String 5378 names = GenPolynomialTokenizer.variableList(names); 5379 end 5380 if truncate == nil 5381 @ring = MultiVarPowerSeriesRing.new(cofac,names); 5382 else 5383 nv = names.size; 5384 @ring = MultiVarPowerSeriesRing.new(cofac,names.size,truncate,names); 5385 end 5386 else 5387 @ring = ring; 5388 end 5389 end
Public Instance Methods
Get the cosinus power series, var r.
# File examples/jas.rb 5445 def cos(r) 5446 return RingElem.new( @ring.getCOS(r) ); 5447 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 5498 def create(ifunc=nil,jfunc=nil,clazz=nil) 5499 #puts "ifunc " 5500 #puts "jfunc " 5501 #puts "clazz " + str(clazz) 5502 if clazz == nil 5503 clazz = Mcoeff.new(@ring,ifunc,jfunc); 5504 end 5505 ps = MultiVarPowerSeries.new( @ring, clazz ); 5506 #puts "ps ", ps.toScript(); 5507 return RingElem.new( ps ); 5508 end
Get the exponential power series, var r.
# File examples/jas.rb 5431 def exp(r) 5432 return RingElem.new( @ring.getEXP(r) ); 5433 end
Create a power series as fixed point of the given mapping.
psmap must implement the MultiVarPowerSeriesMap interface.
# File examples/jas.rb 5515 def fixPoint(psmap) 5516 ps = @ring.fixPoint( psmap ); 5517 return RingElem.new( ps ); 5518 end
Convert a GenPolynomial to a power series.
# File examples/jas.rb 5536 def fromPoly(a) 5537 if a.is_a? RingElem 5538 a = a.elem; 5539 end 5540 return RingElem.new( @ring.fromPolynomial(a) ); 5541 end
Compute the greatest common divisor of a and b.
# File examples/jas.rb 5523 def gcd(a,b) 5524 if a.is_a? RingElem 5525 a = a.elem; 5526 end 5527 if b.is_a? RingElem 5528 b = b.elem; 5529 end 5530 return RingElem.new( a.gcd(b) ); 5531 end
Get the generators of the power series ring.
# File examples/jas.rb 5401 def gens() 5402 ll = @ring.generators(); 5403 nn = ll.map { |e| RingElem.new(e) }; 5404 return nn; 5405 end
Get the one of the power series ring.
# File examples/jas.rb 5410 def one() 5411 return RingElem.new( @ring.getONE() ); 5412 end
Get a random power series.
# File examples/jas.rb 5424 def random(n) 5425 return RingElem.new( @ring.random(n) ); 5426 end
Get the sinus power series, var r.
# File examples/jas.rb 5438 def sin(r) 5439 return RingElem.new( @ring.getSIN(r) ); 5440 end
Get the tangens power series, var r.
# File examples/jas.rb 5452 def tan(r) 5453 return RingElem.new( @ring.getTAN(r) ); 5454 end
Create a string representation.
# File examples/jas.rb 5394 def to_s() 5395 return @ring.toScript(); 5396 end
Get the zero of the power series ring.
# File examples/jas.rb 5417 def zero() 5418 return RingElem.new( @ring.getZERO() ); 5419 end