gtsam  4.0.0
gtsam
numericalDerivative.h File Reference

Some functions to compute numerical derivatives. More...

Go to the source code of this file.

Classes

struct  gtsam::internal::FixedSizeMatrix< Y, X >
 
class  gtsam::G_x1< X1, X2 >
 Helper class that computes the derivative of f w.r.t. More...
 

Namespaces

 gtsam
 Global functions in a separate testing namespace.
 

Functions

template<class X , int N = traits<X>::dimension>
Eigen::Matrix< double, N, 1 > gtsam::numericalGradient (boost::function< double(const X &)> h, const X &x, double delta=1e-5)
 Numerically compute gradient of scalar function. More...
 
template<class Y , class X , int N = traits<X>::dimension>
internal::FixedSizeMatrix< Y, X >::type gtsam::numericalDerivative11 (boost::function< Y(const X &)> h, const X &x, double delta=1e-5)
 New-style numerical derivatives using manifold_traits. More...
 
template<class Y , class X >
internal::FixedSizeMatrix< Y, X >::type gtsam::numericalDerivative11 (Y(*h)(const X &), const X &x, double delta=1e-5)
 use a raw C++ function pointer
 
template<class Y , class X1 , class X2 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative21 (const boost::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
 Compute numerical derivative in argument 1 of binary function. More...
 
template<class Y , class X1 , class X2 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative21 (Y(*h)(const X1 &, const X2 &), const X1 &x1, const X2 &x2, double delta=1e-5)
 use a raw C++ function pointer
 
template<class Y , class X1 , class X2 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative22 (boost::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
 Compute numerical derivative in argument 2 of binary function. More...
 
template<class Y , class X1 , class X2 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative22 (Y(*h)(const X1 &, const X2 &), const X1 &x1, const X2 &x2, double delta=1e-5)
 use a raw C++ function pointer
 
template<class Y , class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative31 (boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 Compute numerical derivative in argument 1 of ternary function. More...
 
template<class Y , class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative31 (Y(*h)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative32 (boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 Compute numerical derivative in argument 2 of ternary function. More...
 
template<class Y , class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative32 (Y(*h)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< Y, X3 >::type gtsam::numericalDerivative33 (boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 Compute numerical derivative in argument 3 of ternary function. More...
 
template<class Y , class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< Y, X3 >::type gtsam::numericalDerivative33 (Y(*h)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative41 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 Compute numerical derivative in argument 1 of 4-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative41 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative42 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 Compute numerical derivative in argument 2 of 4-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative42 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X3 >::type gtsam::numericalDerivative43 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 Compute numerical derivative in argument 3 of 4-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X3 >::type gtsam::numericalDerivative43 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X4 >::type gtsam::numericalDerivative44 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 Compute numerical derivative in argument 4 of 4-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 >
internal::FixedSizeMatrix< Y, X4 >::type gtsam::numericalDerivative44 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative51 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 Compute numerical derivative in argument 1 of 5-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X1 >::type gtsam::numericalDerivative51 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative52 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 Compute numerical derivative in argument 2 of 5-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X2 >::type gtsam::numericalDerivative51 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X3 >::type gtsam::numericalDerivative53 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 Compute numerical derivative in argument 3 of 5-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X3 >::type gtsam::numericalDerivative53 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X4 >::type gtsam::numericalDerivative54 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 Compute numerical derivative in argument 4 of 5-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X4 >::type gtsam::numericalDerivative53 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X5 >::type gtsam::numericalDerivative55 (boost::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 Compute numerical derivative in argument 5 of 5-argument function. More...
 
template<class Y , class X1 , class X2 , class X3 , class X4 , class X5 >
internal::FixedSizeMatrix< Y, X5 >::type gtsam::numericalDerivative53 (Y(*h)(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &), const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, double delta=1e-5)
 
template<class X >
internal::FixedSizeMatrix< X, X >::type gtsam::numericalHessian (boost::function< double(const X &)> f, const X &x, double delta=1e-5)
 Compute numerical Hessian matrix. More...
 
template<class X >
internal::FixedSizeMatrix< X, X >::type gtsam::numericalHessian (double(*f)(const X &), const X &x, double delta=1e-5)
 
template<class X1 , class X2 >
internal::FixedSizeMatrix< X1, X2 >::type gtsam::numericalHessian212 (boost::function< double(const X1 &, const X2 &)> f, const X1 &x1, const X2 &x2, double delta=1e-5)
 
template<class X1 , class X2 >
internal::FixedSizeMatrix< X1, X2 >::type gtsam::numericalHessian212 (double(*f)(const X1 &, const X2 &), const X1 &x1, const X2 &x2, double delta=1e-5)
 
template<class X1 , class X2 >
internal::FixedSizeMatrix< X1, X1 >::type gtsam::numericalHessian211 (boost::function< double(const X1 &, const X2 &)> f, const X1 &x1, const X2 &x2, double delta=1e-5)
 
template<class X1 , class X2 >
internal::FixedSizeMatrix< X1, X1 >::type gtsam::numericalHessian211 (double(*f)(const X1 &, const X2 &), const X1 &x1, const X2 &x2, double delta=1e-5)
 
template<class X1 , class X2 >
internal::FixedSizeMatrix< X2, X2 >::type gtsam::numericalHessian222 (boost::function< double(const X1 &, const X2 &)> f, const X1 &x1, const X2 &x2, double delta=1e-5)
 
template<class X1 , class X2 >
internal::FixedSizeMatrix< X2, X2 >::type gtsam::numericalHessian222 (double(*f)(const X1 &, const X2 &), const X1 &x1, const X2 &x2, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X1, X1 >::type gtsam::numericalHessian311 (boost::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 Numerical Hessian for tenary functions.
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X1, X1 >::type gtsam::numericalHessian311 (double(*f)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X2, X2 >::type gtsam::numericalHessian322 (boost::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X2, X2 >::type gtsam::numericalHessian322 (double(*f)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X3, X3 >::type gtsam::numericalHessian333 (boost::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X3, X3 >::type gtsam::numericalHessian333 (double(*f)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X1, X2 >::type gtsam::numericalHessian312 (boost::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X1, X3 >::type gtsam::numericalHessian313 (boost::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X2, X3 >::type gtsam::numericalHessian323 (boost::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X1, X2 >::type gtsam::numericalHessian312 (double(*f)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X1, X3 >::type gtsam::numericalHessian313 (double(*f)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 
template<class X1 , class X2 , class X3 >
internal::FixedSizeMatrix< X2, X3 >::type gtsam::numericalHessian323 (double(*f)(const X1 &, const X2 &, const X3 &), const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
 

Detailed Description

Some functions to compute numerical derivatives.

Author
Frank Dellaert