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... | |
Namespaces | |
namespace | roboptim::finiteDifferenceGradientPolicies |
Contains finite difference gradients policies. | |
Functions | |
template<typename T > | |
std::ostream & | roboptim::operator<< (std::ostream &o, const BadGradient< T > &f) |
Override operator<< to handle exception display. | |
template<typename T > | |
std::ostream & | roboptim::operator<< (std::ostream &o, const BadJacobian< T > &f) |
Override operator<< to handle exception display. | |
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) |
Check if a gradient is valid. | |
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) 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) |
Check if a Jacobian is valid. | |
template<typename T > | |
void | roboptim::checkJacobianAndThrow (const GenericDifferentiableFunction< T > &function, typename GenericDifferentiableFunction< T >::const_argument_ref x, typename GenericDifferentiableFunction< T >::value_type threshold=finiteDifferenceThreshold) throw (BadJacobian<T>) |
Variables | |
static const double | roboptim::finiteDifferenceThreshold = 1e-4 |
Default threshold for checkGradient. | |
static const double | roboptim::finiteDifferenceEpsilon = 1e-8 |
Default epsilon for finite difference class. |
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 |
||
) |
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(), and roboptim::GenericDifferentiableFunction< T >::gradient().
Referenced by roboptim::checkGradientAndThrow().
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 |
||
) | throw (BadGradient<T>) |
bool roboptim::checkJacobian | ( | const GenericDifferentiableFunction< T > & | function, |
typename GenericDifferentiableFunction< T >::const_argument_ref | x, | ||
typename GenericDifferentiableFunction< T >::value_type | threshold = finiteDifferenceThreshold |
||
) |
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(), and roboptim::GenericDifferentiableFunction< T >::jacobian().
Referenced by roboptim::checkJacobianAndThrow().
void roboptim::checkJacobianAndThrow | ( | const GenericDifferentiableFunction< T > & | function, |
typename GenericDifferentiableFunction< T >::const_argument_ref | x, | ||
typename GenericDifferentiableFunction< T >::value_type | threshold = finiteDifferenceThreshold |
||
) | 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 |
const double roboptim::finiteDifferenceEpsilon = 1e-8 [static] |
Default epsilon for finite difference class.
const double roboptim::finiteDifferenceThreshold = 1e-4 [static] |
Default threshold for checkGradient.