The numerical gradient of a functor. More...
#include <centered_difference.h>
Public Types | |
typedef Functor | function_type |
The function to differentiate. | |
typedef base_type::argument_type | argument_type |
The argument type. | |
typedef base_type::result_type | result_type |
The result type. | |
Public Member Functions | |
GradientCenteredDifference (const function_type &f, const number_type delta=std::pow(std::numeric_limits< T >::epsilon(), 1.0/3.0)) | |
Construct from the functor. | |
GradientCenteredDifference (const GradientCenteredDifference &x) | |
Copy constructor. | |
void | operator() (const argument_type x, result_type &deriv) const |
Calculate the gradient of f at x. | |
result_type | operator() (const argument_type x) const |
Return the gradient of f at x. | |
number_type | delta () const |
Return the differencing offset. | |
void | set_delta (const number_type delta) |
Set the differencing offset. |
The numerical gradient of a functor.