Namespaces | |
namespace | roboptim::finiteDifferenceGradientPolicies |
Contains finite difference gradients policies. | |
Classes | |
class | roboptim::CachedFunction< T > |
Store previous function computation. More... | |
class | roboptim::BadGradient< T > |
Exception thrown when a gradient check fails. More... | |
class | roboptim::BadJacobian< T > |
Exception thrown when a Jacobian check fails. More... | |
class | roboptim::GenericFiniteDifferenceGradient< T, FdgPolicy > |
Compute automatically a gradient with finite differences. More... | |
Functions | |
template<typename T > | |
std::ostream & | roboptim::operator<< (std::ostream &o, const BadGradient< T > &f) |
Override operator<< to handle exception display. More... | |
template<typename T > | |
std::ostream & | roboptim::operator<< (std::ostream &o, const BadJacobian< T > &f) |
Override operator<< to handle exception display. More... | |
template<typename T > | |
bool | roboptim::checkGradient (const GenericDifferentiableFunction< T > &function, typename GenericDifferentiableFunction< T >::size_type functionId, typename GenericDifferentiableFunction< T >::const_argument_ref x, typename GenericDifferentiableFunction< T >::value_type threshold=finiteDifferenceThreshold, typename GenericDifferentiableFunction< T >::value_type fd_eps=finiteDifferenceEpsilon) |
Check if a gradient is valid. More... | |
template<typename T > | |
void | roboptim::checkGradientAndThrow (const GenericDifferentiableFunction< T > &function, typename GenericDifferentiableFunction< T >::size_type functionId, typename GenericDifferentiableFunction< T >::const_argument_ref x, typename GenericDifferentiableFunction< T >::value_type threshold=finiteDifferenceThreshold, typename GenericDifferentiableFunction< T >::value_type fd_eps=finiteDifferenceEpsilon) throw (BadGradient<T>) |
template<typename T > | |
bool | roboptim::checkJacobian (const GenericDifferentiableFunction< T > &function, typename GenericDifferentiableFunction< T >::const_argument_ref x, typename GenericDifferentiableFunction< T >::value_type threshold=finiteDifferenceThreshold, typename GenericDifferentiableFunction< T >::value_type fd_eps=finiteDifferenceEpsilon) |
Check if a Jacobian is valid. More... | |
template<typename T > | |
void | roboptim::checkJacobianAndThrow (const GenericDifferentiableFunction< T > &function, typename GenericDifferentiableFunction< T >::const_argument_ref x, typename GenericDifferentiableFunction< T >::value_type threshold=finiteDifferenceThreshold, typename GenericDifferentiableFunction< T >::value_type fd_eps=finiteDifferenceEpsilon) throw (BadJacobian<T>) |
Variables | |
static const double | roboptim::finiteDifferenceThreshold = 1e-4 |
Default threshold for checkGradient. More... | |
static const double | roboptim::finiteDifferenceEpsilon = 1e-8 |
Default epsilon for finite difference class. More... | |
bool roboptim::checkGradient | ( | const GenericDifferentiableFunction< T > & | function, |
typename GenericDifferentiableFunction< T >::size_type | functionId, | ||
typename GenericDifferentiableFunction< T >::const_argument_ref | x, | ||
typename GenericDifferentiableFunction< T >::value_type | threshold = finiteDifferenceThreshold , |
||
typename GenericDifferentiableFunction< T >::value_type | fd_eps = finiteDifferenceEpsilon |
||
) |
Check if a gradient is valid.
Check if a gradient is valid by comparing the distance between its gradient and an automatically computed finite differences gradient.
function | function that will be checked |
functionId | function id in split representation |
x | point where the gradient will be evaluated |
threshold | maximum tolerated error |
References roboptim::allclose(), roboptim::GenericDifferentiableFunction< T >::gradient(), ROBOPTIM_ALLOW_DEPRECATED_OFF, and ROBOPTIM_ALLOW_DEPRECATED_ON.
void roboptim::checkGradientAndThrow | ( | const GenericDifferentiableFunction< T > & | function, |
typename GenericDifferentiableFunction< T >::size_type | functionId, | ||
typename GenericDifferentiableFunction< T >::const_argument_ref | x, | ||
typename GenericDifferentiableFunction< T >::value_type | threshold = finiteDifferenceThreshold , |
||
typename GenericDifferentiableFunction< T >::value_type | fd_eps = finiteDifferenceEpsilon |
||
) | throw (BadGradient<T>) |
bool roboptim::checkJacobian | ( | const GenericDifferentiableFunction< T > & | function, |
typename GenericDifferentiableFunction< T >::const_argument_ref | x, | ||
typename GenericDifferentiableFunction< T >::value_type | threshold = finiteDifferenceThreshold , |
||
typename GenericDifferentiableFunction< T >::value_type | fd_eps = finiteDifferenceEpsilon |
||
) |
Check if a Jacobian is valid.
Check if a Jacobian is valid by comparing the distance between the matrix and an automatically computed finite differences Jacobian.
function | function that will be checked |
x | point where the Jacobian will be evaluated |
threshold | maximum tolerated error |
References roboptim::allclose(), roboptim::GenericDifferentiableFunction< T >::jacobian(), ROBOPTIM_ALLOW_DEPRECATED_OFF, and ROBOPTIM_ALLOW_DEPRECATED_ON.
void roboptim::checkJacobianAndThrow | ( | const GenericDifferentiableFunction< T > & | function, |
typename GenericDifferentiableFunction< T >::const_argument_ref | x, | ||
typename GenericDifferentiableFunction< T >::value_type | threshold = finiteDifferenceThreshold , |
||
typename GenericDifferentiableFunction< T >::value_type | fd_eps = finiteDifferenceEpsilon |
||
) | throw (BadJacobian<T>) |
std::ostream & roboptim::operator<< | ( | std::ostream & | o, |
const BadGradient< T > & | f | ||
) |
Override operator<< to handle exception display.
o | output stream used for display |
f | function to be displayed |
std::ostream & roboptim::operator<< | ( | std::ostream & | o, |
const BadJacobian< T > & | f | ||
) |
Override operator<< to handle exception display.
o | output stream used for display |
f | function to be displayed |
|
static |
Default epsilon for finite difference class.
|
static |
Default threshold for checkGradient.