Drake
Drake C++ Documentation
Loading...
Searching...
No Matches
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

namespace  drake
namespace  drake::math

Enumerations

enum class  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.