|
MARLEY (Model of Argon Reaction Low Energy Yields) v2.0.0
A Monte Carlo event generator for tens-of-MeV neutrino interactions
|
Approximates a 1D function using Chebyshev points. More...
#include <ChebyshevInterpolatingFunction.hh>
Public Member Functions | |
| ChebyshevInterpolatingFunction (const std::function< double(double)> &func, double x_min, double x_max, size_t N=0) | |
| ChebyshevInterpolatingFunction | cdf () const |
| const std::vector< double > & | chebyshev_coeffs () const |
| double | evaluate (double x) const override |
| Approximates the represented function using the barycentric formula. | |
| const std::vector< double > & | Fs () const |
| double | integral () const |
| int | N () const |
| double | x_max () const |
| double | x_min () const |
| const std::vector< double > & | Xs () const |
Public Member Functions inherited from marley::InterpolatingFunction | |
| InterpolatingFunction (double x_min, double x_max) | |
Protected Member Functions | |
| ChebyshevInterpolatingFunction () | |
| Default constructor used by cdf() | |
| double | chebyshev_point (size_t j) const |
| For a given N, returns the x position of the jth Chebyshev point (of the second kind) | |
| void | compute_integral () |
Protected Member Functions inherited from marley::InterpolatingFunction | |
| InterpolatingFunction () | |
| Allows construction by derived classes without immediately defining the bounds of the interpolation range. | |
Protected Attributes | |
| std::vector< double > | chebyshev_coeffs_ |
| Coefficients of the Chebyshev expansion of this function. | |
| std::vector< double > | Fs_ |
| Function values at the grid points. | |
| std::vector< int > | ifac_ |
| double | integral_ |
| Approximate integral of the function on [x_min_, x_max_]. | |
| size_t | N_ |
| Grid size parameter (N + 1 total points) | |
| std::vector< double > | wsave_ |
| std::vector< double > | Xs_ |
| Chebyshev points at which the function was evaluated. | |
Protected Attributes inherited from marley::InterpolatingFunction | |
| double | x_max_ |
| Upper bound of the interpolation range. | |
| double | x_min_ |
| Lower bound of the interpolation range. | |
Static Protected Attributes | |
| static constexpr size_t | N_MAX_ = 65536u |
| Maximum allowed value of the grid size parameter. | |
Approximates a 1D function using Chebyshev points.
Definition at line 29 of file ChebyshevInterpolatingFunction.hh.
| marley::ChebyshevInterpolatingFunction::ChebyshevInterpolatingFunction | ( | const std::function< double(double)> & | func, |
| double | x_min, | ||
| double | x_max, | ||
| size_t | N = 0 ) |
Definition at line 34 of file ChebyshevInterpolatingFunction.cc.
References chebyshev_coeffs_, chebyshev_point(), Fs_, N_, N_MAX_, and Xs_.
|
inlineprotected |
Default constructor used by cdf()
Definition at line 85 of file ChebyshevInterpolatingFunction.hh.
| marley::ChebyshevInterpolatingFunction marley::ChebyshevInterpolatingFunction::cdf | ( | ) | const |
Definition at line 122 of file ChebyshevInterpolatingFunction.cc.
|
inline |
Definition at line 66 of file ChebyshevInterpolatingFunction.hh.
|
inlineprotected |
For a given N, returns the x position of the jth Chebyshev point (of the second kind)
Definition at line 113 of file ChebyshevInterpolatingFunction.hh.
References N_, marley::InterpolatingFunction::x_max_, and marley::InterpolatingFunction::x_min_.
Referenced by ChebyshevInterpolatingFunction().
|
protected |
Definition at line 104 of file ChebyshevInterpolatingFunction.cc.
|
inlineoverridevirtual |
Approximates the represented function using the barycentric formula.
Implements marley::InterpolatingFunction.
Definition at line 39 of file ChebyshevInterpolatingFunction.hh.
|
inline |
Definition at line 69 of file ChebyshevInterpolatingFunction.hh.
|
inline |
Definition at line 64 of file ChebyshevInterpolatingFunction.hh.
|
inline |
Definition at line 75 of file ChebyshevInterpolatingFunction.hh.
|
inline |
Definition at line 80 of file ChebyshevInterpolatingFunction.hh.
|
inline |
Definition at line 79 of file ChebyshevInterpolatingFunction.hh.
|
inline |
Definition at line 72 of file ChebyshevInterpolatingFunction.hh.
|
protected |
Coefficients of the Chebyshev expansion of this function.
Definition at line 103 of file ChebyshevInterpolatingFunction.hh.
Referenced by ChebyshevInterpolatingFunction().
|
protected |
Function values at the grid points.
Definition at line 100 of file ChebyshevInterpolatingFunction.hh.
Referenced by ChebyshevInterpolatingFunction(), and evaluate().
|
protected |
Definition at line 107 of file ChebyshevInterpolatingFunction.hh.
|
protected |
Approximate integral of the function on [x_min_, x_max_].
Definition at line 94 of file ChebyshevInterpolatingFunction.hh.
|
protected |
Grid size parameter (N + 1 total points)
Definition at line 91 of file ChebyshevInterpolatingFunction.hh.
Referenced by ChebyshevInterpolatingFunction(), chebyshev_point(), and evaluate().
|
staticconstexprprotected |
Maximum allowed value of the grid size parameter.
Definition at line 88 of file ChebyshevInterpolatingFunction.hh.
Referenced by ChebyshevInterpolatingFunction().
|
protected |
Definition at line 106 of file ChebyshevInterpolatingFunction.hh.
|
protected |
Chebyshev points at which the function was evaluated.
Definition at line 97 of file ChebyshevInterpolatingFunction.hh.
Referenced by ChebyshevInterpolatingFunction(), and evaluate().