class JAS::Coeff

(Was interior) class which extends edu.jas.ps.Coefficients

Public Class Methods

new(cof,&f) click to toggle source

Constructor.

cof RingFactory for coefficients. f(int i) must return a value of type cof.

Calls superclass method
     # File examples/jas.rb
5761 def initialize(cof,&f)
5762     super() # this is important in jruby 1.5.6!
5763     #puts "cof type(#{cof}) = #{cof.class}\n";
5764     @coFac = cof;
5765     #puts "f type(#{f}) = #{f.class}\n";
5766     @func = f
5767 end

Public Instance Methods

generate(i) click to toggle source

Generator for a coefficient.

long i parameter. returns a value of type cof.

     # File examples/jas.rb
5775 def generate(i)
5776     #puts "f_3  type(#{@func}) = #{@func.class}\n";
5777     #puts "f_3  type(#{i}) = #{i.class}\n";
5778     #return @coFac.getZERO()
5779     c = @func.call(i)
5780     #puts "f_3  type(#{c}) = #{c.class}\n";
5781     if c.is_a? RingElem
5782         c = c.elem
5783     end
5784     return c
5785 end