Drake
Drake C++ Documentation
compute_numerical_gradient.h File Reference
#include <algorithm>
#include "drake/common/eigen_types.h"
Include dependency graph for compute_numerical_gradient.h:

Classes

class  NumericalGradientOption
 

Namespaces

 drake
 
 drake::math
 

Enumerations

enum  NumericalGradientMethod { kForward, kBackward, kCentral }
 

Functions

template<typename DerivedX , typename DerivedY , typename DerivedCalcX >
Eigen::Matrix< typename DerivedX::Scalar, DerivedY::RowsAtCompileTime, DerivedX::RowsAtCompileTime > ComputeNumericalGradient (std::function< void(const DerivedCalcX &, DerivedY *y)> calc_func, const DerivedX &x, const NumericalGradientOption &option=NumericalGradientOption{ NumericalGradientMethod::kForward})
 Compute the gradient of a function f(x) through numerical difference. More...