A Chebyshev series is stored using the GSL::Cheb class.
GSL::Cheb.new(n)GSL::Cheb.alloc(n)GSL::Cheb#init(f, a, b)ex: Approximate a step function defined in (0, 1) by a Chebyshev series of order 40.
f = GSL::Function.new { |x|
if x < 0.5
0.25
else
0.75
end
}
cs = GSL::Cheb.new(40)
cs.init(f, 0, 1)GSL::Cheb#eval(x)GSL::Cheb#eval_n(n, x)GSL::Cheb#calc_deriv()GSL::Cheb#deriv()GSL::Cheb#calc_integ()GSL::Cheb#integ()See also the example script, samples/cheb.rb.