/usr/share/doc/ruby-gsl/examples/cheb.rb is in ruby-gsl 2.1.0.3+dfsg1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #!/usr/bin/env ruby
require("gsl")
f = GSL::Function.alloc { |x|
if x < 0.5
0.25
else
0.75
end
}
n = 1000
order = 40
cs = GSL::Cheb.alloc(order)
x = GSL::Vector.linspace(0, 1, n)
ff = f.eval(x)
cs.init(f, 0, 1)
r10 = cs.eval_n(10, x)
r40 = cs.eval(x)
GSL::graph(x, ff, r10, r40)
|