philsupertramp/game-math
Loading...
Searching...
No Matches
Namespaces | Functions
Integration.h File Reference
#include "../../Matrix.h"
#include "../../sorting.h"
#include "../utils.h"
#include <functional>

Go to the source code of this file.

Namespaces

namespace  integration
 

Functions

std::pair< double, std::vector< double > > integration::quad_adaptive_rec (const std::function< double(double)> &fun, const double &a, const double &b, const double &tol, const double &hMin, std::vector< double > &nodes, Matrix< double > &values)
 
std::pair< double, std::vector< double > > quadrature (const std::function< double(double)> &fun, const double &lower, const double &upper, const double &tol, const double &hMin)
 

Function Documentation

◆ quadrature()

std::pair< double, std::vector< double > > quadrature ( const std::function< double(double)> &  fun,
const double &  lower,
const double &  upper,
const double &  tol,
const double &  hMin 
)

Calculates the given exact integral

\begin{equation} \int \limits_{l}^{u} f(x) dx \end{equation} where $l$ := lower boundary, and $u$ := upper boundary

Parameters
funFunction to calculate exact integral of
lowerlower boundary of integral
upperupper boundary of integral
toltolerance of result to exact solution
hMinminimal distance between approximation points
Returns
approximated exact integral of fun
Examples
numerics/analysis/TestIntegration.cpp.