Class cheb_approx_tl (o2scl)¶
-
template<class
fp_t
= double>
classo2scl
::
cheb_approx_tl
¶ Chebyshev approximation (GSL)
Approximate a function on a finite interval using a Chebyshev series:
\[ f(x) = \sum_n c_n T_n(x) \]where \( T_n(x)=\cos(n \arccos x) \)See also the Chebyshev approximation example.
Initialization methods
-
template<class
func_t
>
voidinit
(func_t &func, size_t ord, fp_t a1, fp_t b1)¶ Initialize a Chebyshev approximation of the function
func
over the interval froma1
tob1
.The interval must be specified so that \( a < b \) , so a and b are swapped if this is not the case.
Evaulation methods
Maniupulating coefficients and endpoints
-
fp_t
get_coefficient
(size_t ix) const¶ Get a coefficient.
Legal values of the argument are 0 to
order
(inclusive)
Derivatives and integrals
-
void
deriv
(cheb_approx_tl &gc) const¶ Make
gc
an approximation to the derivative.
-
void
integ
(cheb_approx_tl &gc) const¶ Make
gc
an approximation to the integral.
Public Functions
-
cheb_approx_tl
()¶
-
cheb_approx_tl
(const cheb_approx_tl &gc)¶ Copy constructor.
-
cheb_approx_tl &
operator=
(const cheb_approx_tl &gc)¶ Copy constructor.
-
template<class