MARLEY (Model of Argon Reaction Low Energy Yields)  v1.0.0
A Monte Carlo event generator for tens-of-MeV neutrino-nucleus interactions in liquid argon
 All Classes Functions Variables Enumerations Pages
Public Member Functions | List of all members
marley::Integrator Class Reference

Numerical integrator that uses Clenshaw-Curtis quadrature More...

#include <Integrator.hh>

Public Member Functions

 Integrator (size_t num=N_DEFAULT_)
 Create a Clenshaw-Curtis quadrature integrator that uses 2*num sampling points. More...
 
double num_integrate (const std::function< double(double)> &f, double a, double b) const
 Numerically integrate an arbitrary 1D function. More...
 

Detailed Description

Numerical integrator that uses Clenshaw-Curtis quadrature

Constructor & Destructor Documentation

marley::Integrator::Integrator ( size_t  num = N_DEFAULT_)

Create a Clenshaw-Curtis quadrature integrator that uses 2*num sampling points.

Parameters
numhalf the number of sampling points to use
Todo:
add error check for when num == 0 or too small
Todo:
add error check for when num is ridiculously large

Member Function Documentation

double marley::Integrator::num_integrate ( const std::function< double(double)> &  f,
double  a,
double  b 
) const

Numerically integrate an arbitrary 1D function.

Numerically integrate a std::function<double(double)> over the interval [a,b] using Clenshaw-Curtis quadrature at 2N_ sampling points.


The documentation for this class was generated from the following files: