#include <numerical_integration.h>
|
| NumericalIntegration (void) |
|
virtual | ~NumericalIntegration (void) |
|
const NumericalIntegrationMethod & | get_numerical_integration_method (void) const |
|
std::string | write_numerical_integration_method (void) const |
|
const bool & | get_display (void) const |
|
void | set (const NumericalIntegration &) |
|
void | set_numerical_integration_method (const NumericalIntegrationMethod &) |
|
void | set_numerical_integration_method (const std::string &) |
|
void | set_display (const bool &) |
|
void | set_default (void) |
|
double | calculate_trapezoid_integral (const Vector< double > &, const Vector< double > &) const |
|
double | calculate_Simpson_integral (const Vector< double > &, const Vector< double > &) const |
|
double | calculate_integral (const Vector< double > &, const Vector< double > &) const |
|
tinyxml2::XMLDocument * | to_XML (void) const |
|
void | from_XML (const tinyxml2::XMLDocument &) |
|
template<class T > |
double | calculate_integral (const T &t, double(T::*)(const double &) const , const double &a, const double &b, const size_t &n) const |
|
template<class T > |
Vector< double > | calculate_integral (const T &t, Vector< double >(T::*)(const double &) const , const double &a, const double &b, const size_t &n) const |
|
|
template<class T > |
static double | calculate_trapezoid_integral (const T &t, double(T::*f)(const double &) const , const double &a, const double &b, const size_t &n) |
|
template<class T > |
static Vector< double > | calculate_trapezoid_integral (const T &t, Vector< double >(T::*f)(const double &) const , const double &a, const double &b, const size_t &n) |
|
template<class T > |
static double | calculate_Simpson_integral (const T &t, double(T::*f)(const double &) const , const double &a, const double &b, const size_t &n) |
|
template<class T > |
static Vector< double > | calculate_Simpson_integral (const T &t, Vector< double >(T::*f)(const double &) const , const double &a, const double &b, const size_t &n) |
|
This class contains methods for numerical integration of functions. In particular it implements the trapezoid method and the Simpson's method.
Definition at line 36 of file numerical_integration.h.
double OpenNN::NumericalIntegration::calculate_integral |
( |
const Vector< double > & |
x, |
|
|
const Vector< double > & |
y |
|
) |
| const |
This method evaluates the integral of a function given as a set of n pairs of data (x,y).
- Parameters
-
Definition at line 298 of file numerical_integration.cpp.
template<class T >
double OpenNN::NumericalIntegration::calculate_integral |
( |
const T & |
t, |
|
|
double(T::*)(const double &) |
const, |
|
|
const double & |
a, |
|
|
const double & |
b, |
|
|
const size_t & |
n |
|
) |
| const |
|
inline |
This method evaluates the integral of a function given as a class member method.
- Parameters
-
t | : Object constructor containing the member method to integrate. |
f | Pointer to the member method. |
a | Lower integration limit. |
b | Upper integration limit. |
n | Number of intervals. |
Definition at line 239 of file numerical_integration.h.
template<class T >
Vector<double> OpenNN::NumericalIntegration::calculate_integral |
( |
const T & |
t, |
|
|
Vector< double >(T::*)(const double &) |
const, |
|
|
const double & |
a, |
|
|
const double & |
b, |
|
|
const size_t & |
n |
|
) |
| const |
|
inline |
This method evaluates the integral of a vector function given as a class member method with n intervals.
- Parameters
-
t | : Object constructor containing the member method to integrate. |
f | Pointer to the member method. |
a | Lower integration limit. |
b | Upper integration limit. |
n | Number of intervals. |
Definition at line 281 of file numerical_integration.h.
double OpenNN::NumericalIntegration::calculate_Simpson_integral |
( |
const Vector< double > & |
x, |
|
|
const Vector< double > & |
y |
|
) |
| const |
This method evaluates the integral of a function given as a set of n pairs of data (x,y) using the composite Simpson's rule.
- Parameters
-
Definition at line 214 of file numerical_integration.cpp.
template<class T >
static double OpenNN::NumericalIntegration::calculate_Simpson_integral |
( |
const T & |
t, |
|
|
double(T::*)(const double &) const |
f, |
|
|
const double & |
a, |
|
|
const double & |
b, |
|
|
const size_t & |
n |
|
) |
| |
|
inlinestatic |
This method evaluates the integral of a function given as a class member method using the composite Simpsons rule with n intervals.
- Parameters
-
t | : Object constructor containing the member method to integrate. |
f | Pointer to the member method. |
a | Lower integration limit. |
b | Upper integration limit. |
n | Number of intervals. |
Definition at line 166 of file numerical_integration.h.
template<class T >
static Vector<double> OpenNN::NumericalIntegration::calculate_Simpson_integral |
( |
const T & |
t, |
|
|
Vector< double >(T::*)(const double &) const |
f, |
|
|
const double & |
a, |
|
|
const double & |
b, |
|
|
const size_t & |
n |
|
) |
| |
|
inlinestatic |
This method evaluates the integral of a vector function given as a class member method using the composite Simpsons rule with n intervals.
- Parameters
-
t | : Object constructor containing the member method to integrate. |
f | Pointer to the member method. |
a | Lower integration limit. |
b | Upper integration limit. |
n | Number of intervals. |
Definition at line 202 of file numerical_integration.h.
double OpenNN::NumericalIntegration::calculate_trapezoid_integral |
( |
const Vector< double > & |
x, |
|
|
const Vector< double > & |
y |
|
) |
| const |
This method evaluates the integral of a function given as a set of n pairs of data (x,y) using the composite trapezoid rule.
- Parameters
-
Definition at line 186 of file numerical_integration.cpp.
template<class T >
static double OpenNN::NumericalIntegration::calculate_trapezoid_integral |
( |
const T & |
t, |
|
|
double(T::*)(const double &) const |
f, |
|
|
const double & |
a, |
|
|
const double & |
b, |
|
|
const size_t & |
n |
|
) |
| |
|
inlinestatic |
This method evaluates the integral of a function given as a class member method using the composite trapezoid rule with n intervals.
- Parameters
-
t | : Object constructor containing the member method to integrate. |
f | Pointer to the member method. |
a | Lower integration limit. |
b | Upper integration limit. |
n | Number of intervals. |
Definition at line 95 of file numerical_integration.h.
template<class T >
static Vector<double> OpenNN::NumericalIntegration::calculate_trapezoid_integral |
( |
const T & |
t, |
|
|
Vector< double >(T::*)(const double &) const |
f, |
|
|
const double & |
a, |
|
|
const double & |
b, |
|
|
const size_t & |
n |
|
) |
| |
|
inlinestatic |
This method evaluates the integral of a vector function given as a class member method using the composite trapezoid rule with n intervals.
- Parameters
-
t | : Object constructor containing the member method to integrate. |
f | Pointer to the member method. |
a | Lower integration limit. |
b | Upper integration limit. |
n | Number of intervals. |
Definition at line 131 of file numerical_integration.h.
void OpenNN::NumericalIntegration::from_XML |
( |
const tinyxml2::XMLDocument & |
document | ) |
|
Deserializes the object from a XML document.
- Parameters
-
document | TinyXML document with the member data. |
Definition at line 376 of file numerical_integration.cpp.
Sets the members of this object to be equal to those of another object.
- Parameters
-
other_numerical_integration | Numerical integration object to be copied. |
Definition at line 103 of file numerical_integration.cpp.
void OpenNN::NumericalIntegration::set_default |
( |
void |
| ) |
|
Sets the default values to the numerical integration object:
-
Numerical integration method: Simpson method.
-
Display: true
Definition at line 171 of file numerical_integration.cpp.
void OpenNN::NumericalIntegration::set_display |
( |
const bool & |
new_display | ) |
|
void OpenNN::NumericalIntegration::set_numerical_integration_method |
( |
const NumericalIntegrationMethod & |
new_numerical_integration_method | ) |
|
Sets the method to be used for numerical integration (trapezoid method or Simpson's method).
- Parameters
-
new_numerical_integration_method | New numerical integration method. |
Definition at line 117 of file numerical_integration.cpp.
void OpenNN::NumericalIntegration::set_numerical_integration_method |
( |
const std::string & |
new_numerical_integration_method | ) |
|
Sets the method to be used for the numerical integration. The argument is a string with the name of the numerical integration method.
- Parameters
-
new_numerical_integration_method | Numerical integration method name string. |
Definition at line 129 of file numerical_integration.cpp.
The documentation for this class was generated from the following files: