55 template<
class Y,
class X=
double>
69 template <class X, int N = traits<X>::dimension>
71 std::function<
double(
const X&)>
h,
const X&
x,
double delta = 1
e-5) {
72 double factor = 1.0 / (2.0 *
delta);
76 "Template argument X must be a manifold type.");
77 static_assert(
N>0,
"Template argument X must be fixed-size type or N must be specified.");
85 for (
int j = 0;
j <
N;
j++) {
91 g(
j) = (hxplus - hxmin) * factor;
108 template <class Y, class X, int N = traits<X>::dimension>
111 std::function<
Y(
const X&)>
h,
const X&
x,
double delta = 1
e-5) {
115 "Template argument Y must be a manifold type.");
119 "Template argument X must be a manifold type.");
120 static_assert(
N>0,
"Template argument X must be fixed-size type or N must be specified.");
127 const typename TraitsY::TangentVector zeroY = TraitsY::Local(hx, hx);
128 const size_t m = zeroY.size();
135 Matrix
H = Matrix::Zero(m,
N);
136 const double factor = 1.0 / (2.0 *
delta);
137 for (
int j = 0;
j <
N;
j++) {
139 const auto dy1 = TraitsY::Local(hx,
h(TraitsX::Retract(x, dx)));
141 const auto dy2 = TraitsY::Local(hx,
h(TraitsX::Retract(x, dx)));
143 H.col(
j) << (dy1 - dy2) * factor;
149 template<
class Y,
class X>
152 return numericalDerivative11<Y, X>(std::bind(
h, std::placeholders::_1),
x,
165 template<class Y, class X1, class X2, int N = traits<X1>::dimension>
167 const X1&
x1,
const X2&
x2,
double delta = 1
e-5) {
169 "Template argument Y must be a manifold type.");
171 "Template argument X1 must be a manifold type.");
172 return numericalDerivative11<Y, X1, N>(
173 std::bind(
h, std::placeholders::_1, std::cref(x2)),
x1,
delta);
177 template<
class Y,
class X1,
class X2>
179 const X2&
x2,
double delta = 1
e-5) {
180 return numericalDerivative21<Y, X1, X2>(
181 std::bind(
h, std::placeholders::_1, std::placeholders::_2),
x1,
x2,
194 template<class Y, class X1, class X2, int N = traits<X2>::dimension>
196 const X1&
x1,
const X2&
x2,
double delta = 1
e-5) {
200 "Template argument X2 must be a manifold type.");
201 return numericalDerivative11<Y, X2, N>(
202 std::bind(
h, std::cref(x1), std::placeholders::_1),
x2,
delta);
206 template<
class Y,
class X1,
class X2>
208 const X2&
x2,
double delta = 1
e-5) {
209 return numericalDerivative22<Y, X1, X2>(
210 std::bind(
h, std::placeholders::_1, std::placeholders::_2),
x1,
x2,
225 template<class Y, class X1, class X2, class X3, int N = traits<X1>::dimension>
227 std::function<
Y(
const X1&,
const X2&,
const X3&)>
h,
const X1&
x1,
228 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
230 "Template argument Y must be a manifold type.");
232 "Template argument X1 must be a manifold type.");
233 return numericalDerivative11<Y, X1, N>(
234 std::bind(
h, std::placeholders::_1, std::cref(x2), std::cref(x3)),
238 template<
class Y,
class X1,
class X2,
class X3>
240 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
241 return numericalDerivative31<Y, X1, X2, X3>(
242 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
243 std::placeholders::_3),
258 template<class Y, class X1, class X2, class X3, int N = traits<X2>::dimension>
260 std::function<
Y(
const X1&,
const X2&,
const X3&)>
h,
const X1&
x1,
261 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
263 "Template argument Y must be a manifold type.");
265 "Template argument X2 must be a manifold type.");
266 return numericalDerivative11<Y, X2, N>(
267 std::bind(
h, std::cref(x1), std::placeholders::_1, std::cref(x3)),
271 template<
class Y,
class X1,
class X2,
class X3>
273 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
274 return numericalDerivative32<Y, X1, X2, X3>(
275 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
276 std::placeholders::_3),
291 template<class Y, class X1, class X2, class X3, int N = traits<X3>::dimension>
293 std::function<
Y(
const X1&,
const X2&,
const X3&)>
h,
const X1&
x1,
294 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
296 "Template argument Y must be a manifold type.");
298 "Template argument X3 must be a manifold type.");
299 return numericalDerivative11<Y, X3, N>(
300 std::bind(
h, std::cref(x1), std::cref(x2), std::placeholders::_1),
304 template<
class Y,
class X1,
class X2,
class X3>
306 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
307 return numericalDerivative33<Y, X1, X2, X3>(
308 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
309 std::placeholders::_3),
324 template<class Y, class X1, class X2, class X3, class X4, int N = traits<X1>::dimension>
326 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&)>
h,
const X1&
x1,
327 const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
329 "Template argument Y must be a manifold type.");
331 "Template argument X1 must be a manifold type.");
332 return numericalDerivative11<Y, X1, N>(
333 std::bind(
h, std::placeholders::_1, std::cref(x2), std::cref(x3),
338 template<
class Y,
class X1,
class X2,
class X3,
class X4>
340 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
341 return numericalDerivative41<Y, X1, X2, X3, X4>(
342 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
343 std::placeholders::_3, std::placeholders::_4),
358 template<class Y, class X1, class X2, class X3, class X4, int N = traits<X2>::dimension>
360 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&)>
h,
const X1&
x1,
361 const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
363 "Template argument Y must be a manifold type.");
365 "Template argument X2 must be a manifold type.");
366 return numericalDerivative11<Y, X2, N>(
367 std::bind(
h, std::cref(x1), std::placeholders::_1, std::cref(x3),
372 template<
class Y,
class X1,
class X2,
class X3,
class X4>
374 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
375 return numericalDerivative42<Y, X1, X2, X3, X4>(
376 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
377 std::placeholders::_3, std::placeholders::_4),
392 template<class Y, class X1, class X2, class X3, class X4, int N = traits<X3>::dimension>
394 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&)>
h,
const X1&
x1,
395 const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
397 "Template argument Y must be a manifold type.");
399 "Template argument X3 must be a manifold type.");
400 return numericalDerivative11<Y, X3, N>(
401 std::bind(
h, std::cref(x1), std::cref(x2), std::placeholders::_1,
406 template<
class Y,
class X1,
class X2,
class X3,
class X4>
408 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
409 return numericalDerivative43<Y, X1, X2, X3, X4>(
410 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
411 std::placeholders::_3, std::placeholders::_4),
426 template<class Y, class X1, class X2, class X3, class X4, int N = traits<X4>::dimension>
428 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&)>
h,
const X1&
x1,
429 const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
431 "Template argument Y must be a manifold type.");
433 "Template argument X4 must be a manifold type.");
434 return numericalDerivative11<Y, X4, N>(
435 std::bind(
h, std::cref(x1), std::cref(x2), std::cref(x3),
436 std::placeholders::_1),
440 template<
class Y,
class X1,
class X2,
class X3,
class X4>
442 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
double delta = 1
e-5) {
443 return numericalDerivative44<Y, X1, X2, X3, X4>(
444 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
445 std::placeholders::_3, std::placeholders::_4),
461 template<class Y, class X1, class X2, class X3, class X4, class X5, int N = traits<X1>::dimension>
463 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&)>
h,
const X1&
x1,
464 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
466 "Template argument Y must be a manifold type.");
468 "Template argument X1 must be a manifold type.");
469 return numericalDerivative11<Y, X1, N>(
470 std::bind(
h, std::placeholders::_1, std::cref(x2), std::cref(x3),
471 std::cref(x4), std::cref(x5)),
475 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5>
477 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
478 return numericalDerivative51<Y, X1, X2, X3, X4, X5>(
479 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
480 std::placeholders::_3, std::placeholders::_4,
481 std::placeholders::_5),
497 template<class Y, class X1, class X2, class X3, class X4, class X5, int N = traits<X2>::dimension>
499 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&)>
h,
const X1&
x1,
500 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
502 "Template argument Y must be a manifold type.");
504 "Template argument X1 must be a manifold type.");
505 return numericalDerivative11<Y, X2, N>(
506 std::bind(
h, std::cref(x1), std::placeholders::_1, std::cref(x3),
507 std::cref(x4), std::cref(x5)),
511 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5>
513 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
514 return numericalDerivative52<Y, X1, X2, X3, X4, X5>(
515 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
516 std::placeholders::_3, std::placeholders::_4,
517 std::placeholders::_5),
533 template<class Y, class X1, class X2, class X3, class X4, class X5, int N = traits<X3>::dimension>
535 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&)>
h,
const X1&
x1,
536 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
538 "Template argument Y must be a manifold type.");
540 "Template argument X1 must be a manifold type.");
541 return numericalDerivative11<Y, X3, N>(
542 std::bind(
h, std::cref(x1), std::cref(x2), std::placeholders::_1,
543 std::cref(x4), std::cref(x5)),
547 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5>
549 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
550 return numericalDerivative53<Y, X1, X2, X3, X4, X5>(
551 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
552 std::placeholders::_3, std::placeholders::_4,
553 std::placeholders::_5),
569 template<class Y, class X1, class X2, class X3, class X4, class X5, int N = traits<X4>::dimension>
571 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&)>
h,
const X1&
x1,
572 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
574 "Template argument Y must be a manifold type.");
576 "Template argument X1 must be a manifold type.");
577 return numericalDerivative11<Y, X4, N>(
578 std::bind(
h, std::cref(x1), std::cref(x2), std::cref(x3),
579 std::placeholders::_1, std::cref(x5)),
583 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5>
585 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
586 return numericalDerivative54<Y, X1, X2, X3, X4, X5>(
587 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
588 std::placeholders::_3, std::placeholders::_4,
589 std::placeholders::_5),
605 template<class Y, class X1, class X2, class X3, class X4, class X5, int N = traits<X5>::dimension>
607 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&)>
h,
const X1&
x1,
608 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
610 "Template argument Y must be a manifold type.");
612 "Template argument X1 must be a manifold type.");
613 return numericalDerivative11<Y, X5, N>(
614 std::bind(
h, std::cref(x1), std::cref(x2), std::cref(x3),
615 std::cref(x4), std::placeholders::_1),
619 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5>
621 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
double delta = 1
e-5) {
622 return numericalDerivative55<Y, X1, X2, X3, X4, X5>(
623 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
624 std::placeholders::_3, std::placeholders::_4,
625 std::placeholders::_5),
642 template<class Y, class X1, class X2, class X3, class X4, class X5, class X6, int N = traits<X1>::dimension>
644 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&,
const X6&)>
h,
const X1&
x1,
645 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
647 "Template argument Y must be a manifold type.");
649 "Template argument X1 must be a manifold type.");
650 return numericalDerivative11<Y, X1, N>(
651 std::bind(
h, std::placeholders::_1, std::cref(x2), std::cref(x3),
652 std::cref(x4), std::cref(x5), std::cref(x6)),
656 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5,
class X6>
658 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
659 return numericalDerivative61<Y, X1, X2, X3, X4, X5, X6>(
660 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
661 std::placeholders::_3, std::placeholders::_4,
662 std::placeholders::_5, std::placeholders::_6),
679 template<class Y, class X1, class X2, class X3, class X4, class X5, class X6, int N = traits<X2>::dimension>
681 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&,
const X6&)>
h,
const X1&
x1,
682 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
684 "Template argument Y must be a manifold type.");
686 "Template argument X1 must be a manifold type.");
687 return numericalDerivative11<Y, X2, N>(
688 std::bind(
h, std::cref(x1), std::placeholders::_1, std::cref(x3),
689 std::cref(x4), std::cref(x5), std::cref(x6)),
693 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5,
class X6>
695 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
696 return numericalDerivative62<Y, X1, X2, X3, X4, X5, X6>(
697 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
698 std::placeholders::_3, std::placeholders::_4,
699 std::placeholders::_5, std::placeholders::_6),
716 template<class Y, class X1, class X2, class X3, class X4, class X5, class X6, int N = traits<X3>::dimension>
718 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&,
const X6&)>
h,
const X1&
x1,
719 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
721 "Template argument Y must be a manifold type.");
723 "Template argument X1 must be a manifold type.");
724 return numericalDerivative11<Y, X3, N>(
725 std::bind(
h, std::cref(x1), std::cref(x2), std::placeholders::_1,
726 std::cref(x4), std::cref(x5), std::cref(x6)),
730 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5,
class X6>
732 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
733 return numericalDerivative63<Y, X1, X2, X3, X4, X5, X6>(
734 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
735 std::placeholders::_3, std::placeholders::_4,
736 std::placeholders::_5, std::placeholders::_6),
753 template<class Y, class X1, class X2, class X3, class X4, class X5, class X6, int N = traits<X4>::dimension>
755 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&,
const X6&)>
h,
const X1&
x1,
756 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
758 "Template argument Y must be a manifold type.");
760 "Template argument X1 must be a manifold type.");
761 return numericalDerivative11<Y, X4, N>(
762 std::bind(
h, std::cref(x1), std::cref(x2), std::cref(x3),
763 std::placeholders::_1, std::cref(x5), std::cref(x6)),
767 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5,
class X6>
769 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
770 return numericalDerivative64<Y, X1, X2, X3, X4, X5>(
771 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
772 std::placeholders::_3, std::placeholders::_4,
773 std::placeholders::_5, std::placeholders::_6),
790 template<class Y, class X1, class X2, class X3, class X4, class X5, class X6, int N = traits<X5>::dimension>
792 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&,
const X6&)>
h,
const X1&
x1,
793 const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
795 "Template argument Y must be a manifold type.");
797 "Template argument X1 must be a manifold type.");
798 return numericalDerivative11<Y, X5, N>(
799 std::bind(
h, std::cref(x1), std::cref(x2), std::cref(x3),
800 std::cref(x4), std::placeholders::_1, std::cref(x6)),
804 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5,
class X6>
806 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
807 return numericalDerivative65<Y, X1, X2, X3, X4, X5, X6>(
808 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
809 std::placeholders::_3, std::placeholders::_4,
810 std::placeholders::_5, std::placeholders::_6),
827 template<class Y, class X1, class X2, class X3, class X4, class X5, class X6, int N = traits<X6>::dimension>
829 std::function<
Y(
const X1&,
const X2&,
const X3&,
const X4&,
const X5&,
const X6&)>
h,
830 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
833 "Template argument Y must be a manifold type.");
835 "Template argument X1 must be a manifold type.");
836 return numericalDerivative11<Y, X6, N>(
837 std::bind(
h, std::cref(x1), std::cref(x2), std::cref(x3),
838 std::cref(x4), std::cref(x5), std::placeholders::_1),
842 template<
class Y,
class X1,
class X2,
class X3,
class X4,
class X5,
class X6>
844 const X1&
x1,
const X2&
x2,
const X3&
x3,
const X4&
x4,
const X5&
x5,
const X6& x6,
double delta = 1
e-5) {
845 return numericalDerivative66<Y, X1, X2, X3, X4, X5, X6>(
846 std::bind(
h, std::placeholders::_1, std::placeholders::_2,
847 std::placeholders::_3, std::placeholders::_4,
848 std::placeholders::_5, std::placeholders::_6),
864 "Template argument X must be a manifold type.");
866 typedef std::function<double(const X&)>
F;
867 typedef std::function<VectorD(F, const X&, double)>
G;
868 G ng =
static_cast<G
>(numericalGradient<X> );
869 return numericalDerivative11<VectorD, X>(
870 std::bind(ng,
f, std::placeholders::_1,
delta),
x,
delta);
882 template<
class X1,
class X2>
884 const std::function<double(const X1&, const X2&)>&
f_;
890 G_x1(
const std::function<
double(
const X1&,
const X2&)>&
f,
const X1&
x1,
892 f_(
f), x1_(x1), delta_(delta) {
895 return numericalGradient<X1>(
896 std::bind(f_, std::placeholders::_1, std::cref(x2)), x1_, delta_);
900 template<
class X1,
class X2>
902 std::function<
double(
const X1&,
const X2&)>
f,
const X1&
x1,
const X2&
x2,
906 return numericalDerivative11<Vector, X2>(
907 std::function<Vector(const X2&)>(
908 std::bind<Vector>(
std::ref(g_x1), std::placeholders::_1)),
912 template<
class X1,
class X2>
914 const X1&
x1,
const X2&
x2,
double delta = 1
e-5) {
919 template<
class X1,
class X2>
921 std::function<
double(
const X1&,
const X2&)>
f,
const X1&
x1,
const X2&
x2,
926 Vector (*numGrad)(std::function<double(const X1&)>,
const X1&,
927 double) = &numericalGradient<X1>;
928 std::function<double(const X1&)>
f2(
929 std::bind(
f, std::placeholders::_1, std::cref(x2)));
931 return numericalDerivative11<Vector, X1>(
932 std::function<Vector(const X1&)>(
933 std::bind(numGrad, f2, std::placeholders::_1,
delta)),
937 template<
class X1,
class X2>
939 const X1&
x1,
const X2&
x2,
double delta = 1
e-5) {
944 template<
class X1,
class X2>
946 std::function<
double(
const X1&,
const X2&)>
f,
const X1&
x1,
const X2&
x2,
949 Vector (*numGrad)(std::function<double(const X2&)>,
const X2&,
950 double) = &numericalGradient<X2>;
951 std::function<double(const X2&)>
f2(
952 std::bind(
f, std::cref(x1), std::placeholders::_1));
954 return numericalDerivative11<Vector, X2>(
955 std::function<Vector(const X2&)>(
956 std::bind(numGrad, f2, std::placeholders::_1,
delta)),
960 template<
class X1,
class X2>
962 const X1&
x1,
const X2&
x2,
double delta = 1
e-5) {
971 template<
class X1,
class X2,
class X3>
973 std::function<
double(
const X1&,
const X2&,
const X3&)>
f,
const X1&
x1,
974 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
976 Vector (*numGrad)(std::function<double(const X1&)>,
const X1&,
977 double) = &numericalGradient<X1>;
978 std::function<double(const X1&)>
f2(std::bind(
979 f, std::placeholders::_1, std::cref(x2), std::cref(x3)));
981 return numericalDerivative11<Vector, X1>(
982 std::function<Vector(const X1&)>(
983 std::bind(numGrad, f2, std::placeholders::_1,
delta)),
987 template<
class X1,
class X2,
class X3>
989 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
991 std::function<
double(
const X1&,
const X2&,
const X3&)>(
f), x1, x2, x3,
996 template<
class X1,
class X2,
class X3>
998 std::function<
double(
const X1&,
const X2&,
const X3&)>
f,
const X1&
x1,
999 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1001 Vector (*numGrad)(std::function<double(const X2&)>,
const X2&,
1002 double) = &numericalGradient<X2>;
1003 std::function<double(const X2&)>
f2(std::bind(
1004 f, std::cref(x1), std::placeholders::_1, std::cref(x3)));
1006 return numericalDerivative11<Vector, X2>(
1007 std::function<Vector(const X2&)>(
1008 std::bind(numGrad, f2, std::placeholders::_1,
delta)),
1012 template<
class X1,
class X2,
class X3>
1014 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1016 std::function<
double(
const X1&,
const X2&,
const X3&)>(
f), x1, x2, x3,
1021 template<
class X1,
class X2,
class X3>
1023 std::function<
double(
const X1&,
const X2&,
const X3&)>
f,
const X1&
x1,
1024 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1026 Vector (*numGrad)(std::function<double(const X3&)>,
const X3&,
1027 double) = &numericalGradient<X3>;
1028 std::function<double(const X3&)>
f2(std::bind(
1029 f, std::cref(x1), std::cref(x2), std::placeholders::_1));
1031 return numericalDerivative11<Vector, X3>(
1032 std::function<Vector(const X3&)>(
1033 std::bind(numGrad, f2, std::placeholders::_1,
delta)),
1037 template<
class X1,
class X2,
class X3>
1039 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1041 std::function<
double(
const X1&,
const X2&,
const X3&)>(
f), x1, x2, x3,
1046 template<
class X1,
class X2,
class X3>
1048 std::function<
double(
const X1&,
const X2&,
const X3&)>
f,
const X1&
x1,
1049 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1050 return numericalHessian212<X1, X2>(
1051 std::function<double(const X1&, const X2&)>(
1052 std::bind(
f, std::placeholders::_1, std::placeholders::_2,
1057 template<
class X1,
class X2,
class X3>
1059 std::function<
double(
const X1&,
const X2&,
const X3&)>
f,
const X1&
x1,
1060 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1061 return numericalHessian212<X1, X3>(
1062 std::function<double(const X1&, const X3&)>(
1063 std::bind(
f, std::placeholders::_1, std::cref(x2),
1064 std::placeholders::_2)),
1068 template<
class X1,
class X2,
class X3>
1070 std::function<
double(
const X1&,
const X2&,
const X3&)>
f,
const X1&
x1,
1071 const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1072 return numericalHessian212<X2, X3>(
1073 std::function<double(const X2&, const X3&)>(
1074 std::bind(
f, std::cref(x1), std::placeholders::_1,
1075 std::placeholders::_2)),
1080 template<
class X1,
class X2,
class X3>
1082 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1084 std::function<
double(
const X1&,
const X2&,
const X3&)>(
f), x1, x2, x3,
1088 template<
class X1,
class X2,
class X3>
1090 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1092 std::function<
double(
const X1&,
const X2&,
const X3&)>(
f), x1, x2, x3,
1096 template<
class X1,
class X2,
class X3>
1098 const X1&
x1,
const X2&
x2,
const X3&
x3,
double delta = 1
e-5) {
1100 std::function<
double(
const X1&,
const X2&,
const X3&)>(
f), x1, x2, x3,
tag to assert a type is a manifold
internal::FixedSizeMatrix< X3, X3 >::type numericalHessian333(std::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
EIGEN_DEVICE_FUNC Derived & setZero(Index size)
internal::FixedSizeMatrix< Y, X6 >::type numericalDerivative66(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, const X6 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, const X6 &x6, double delta=1e-5)
internal::FixedSizeMatrix< Y, X4 >::type numericalDerivative44(std::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)
A non-templated config holding any types of Manifold-group elements.
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative62(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, const X6 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, const X6 &x6, double delta=1e-5)
JacobiRotation< float > G
internal::FixedSizeMatrix< Y, X4 >::type numericalDerivative64(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, const X6 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, const X6 &x6, double delta=1e-5)
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
internal::FixedSizeMatrix< X1, X3 >::type numericalHessian313(std::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
double f2(const Vector2 &x)
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set set pointsize set encoding default set nopolar set noparametric set set set set surface set nocontour set clabel set mapping cartesian set nohidden3d set cntrparam order set cntrparam linear set cntrparam levels auto set cntrparam points set size set set xzeroaxis lt lw set x2zeroaxis lt lw set yzeroaxis lt lw set y2zeroaxis lt lw set tics in set ticslevel set tics set mxtics default set mytics default set mx2tics default set my2tics default set xtics border mirror norotate autofreq set ytics border mirror norotate autofreq set ztics border nomirror norotate autofreq set nox2tics set noy2tics set timestamp bottom norotate set rrange [*:*] noreverse nowriteback set trange [*:*] noreverse nowriteback set urange [*:*] noreverse nowriteback set vrange [*:*] noreverse nowriteback set xlabel matrix size set x2label set timefmt d m y n H
Eigen::Matrix< double, traits< Y >::dimension, traits< X >::dimension > type
void g(const string &key, int i)
internal::FixedSizeMatrix< Y, X3 >::type numericalDerivative63(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, const X6 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, const X6 &x6, double delta=1e-5)
internal::FixedSizeMatrix< Y, X >::type numericalDerivative11(std::function< Y(const X &)> h, const X &x, double delta=1e-5)
New-style numerical derivatives using manifold_traits.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative21(const std::function< Y(const X1 &, const X2 &)> &h, const X1 &x1, const X2 &x2, double delta=1e-5)
internal::FixedSizeMatrix< X1, X1 >::type numericalHessian311(std::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative51(std::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)
G_x1(const std::function< double(const X1 &, const X2 &)> &f, const X1 &x1, double delta)
const std::function< double(const X1 &, const X2 &)> & f_
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative41(std::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)
internal::FixedSizeMatrix< Y, X3 >::type numericalDerivative33(std::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative52(std::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)
internal::FixedSizeMatrix< Y, X5 >::type numericalDerivative55(std::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)
internal::FixedSizeMatrix< X1, X1 >::type numericalHessian211(std::function< double(const X1 &, const X2 &)> f, const X1 &x1, const X2 &x2, double delta=1e-5)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative32(std::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
internal::FixedSizeMatrix< X1, X2 >::type numericalHessian212(std::function< double(const X1 &, const X2 &)> f, const X1 &x1, const X2 &x2, double delta=1e-5)
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative31(std::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
internal::FixedSizeMatrix< X2, X3 >::type numericalHessian323(std::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
internal::FixedSizeMatrix< X1, X2 >::type numericalHessian312(std::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
internal::FixedSizeMatrix< X1 >::type Vector
internal::FixedSizeMatrix< X, X >::type numericalHessian(std::function< double(const X &)> f, const X &x, double delta=1e-5)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
internal::FixedSizeMatrix< X2, X2 >::type numericalHessian322(std::function< double(const X1 &, const X2 &, const X3 &)> f, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
internal::FixedSizeMatrix< Y, X3 >::type numericalDerivative53(std::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)
Base class and basic functions for Lie types.
Pose3 x3(Rot3::Ypr(M_PI/4.0, 0.0, 0.0), l2)
internal::FixedSizeMatrix< Y, X4 >::type numericalDerivative54(std::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)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative42(std::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)
internal::FixedSizeMatrix< Y, X5 >::type numericalDerivative65(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, const X6 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, const X6 &x6, double delta=1e-5)
Eigen::Matrix< double, N, 1 > numericalGradient(std::function< double(const X &)> h, const X &x, double delta=1e-5)
Numerically compute gradient of scalar function.
internal::FixedSizeMatrix< Y, X3 >::type numericalDerivative43(std::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)
internal::FixedSizeMatrix< X2, X2 >::type numericalHessian222(std::function< double(const X1 &, const X2 &)> f, const X1 &x1, const X2 &x2, double delta=1e-5)
Vector operator()(const X2 &x2)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative22(std::function< Y(const X1 &, const X2 &)> h, const X1 &x1, const X2 &x2, double delta=1e-5)
The matrix class, also used for vectors and row-vectors.
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative61(std::function< Y(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, const X6 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, const X4 &x4, const X5 &x5, const X6 &x6, double delta=1e-5)