pinocchio  3.7.0
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
 
Loading...
Searching...
No Matches
proximal.hpp
1//
2// Copyright (c) 2019-2022 INRIA
3//
4
5#ifndef __pinocchio_algorithm_proximal_hpp__
6#define __pinocchio_algorithm_proximal_hpp__
7
8#include <Eigen/Core>
9#include "pinocchio/multibody/model.hpp"
10#include "pinocchio/multibody/data.hpp"
11
12namespace pinocchio
13{
14
23 template<typename _Scalar>
25 {
26 typedef _Scalar Scalar;
27
30 : absolute_accuracy(Eigen::NumTraits<Scalar>::dummy_precision())
31 , relative_accuracy(Eigen::NumTraits<Scalar>::dummy_precision())
32 , mu(0)
33 , max_iter(1)
36 , iter(0)
37 {
38 }
39
46 , mu(mu)
50 , iter(0)
51 {
52 PINOCCHIO_CHECK_INPUT_ARGUMENT(
53 check_expression_if_real<Scalar>(accuracy >= 0.) && "Accuracy must be positive.");
54 PINOCCHIO_CHECK_INPUT_ARGUMENT(
55 check_expression_if_real<Scalar>(mu >= 0.) && "mu must be positive");
56 assert(max_iter >= 1 && "max_iter must be greater or equal to 1");
57 }
58
65 const Scalar mu,
66 const int max_iter)
69 , mu(mu)
73 , iter(0)
74 {
75 PINOCCHIO_CHECK_INPUT_ARGUMENT(
77 && "Absolute accuracy must be positive.");
78 PINOCCHIO_CHECK_INPUT_ARGUMENT(
80 && "Relative accuracy must be positive.");
81 PINOCCHIO_CHECK_INPUT_ARGUMENT(
82 check_expression_if_real<Scalar>(mu >= 0.) && "mu must be positive");
83 assert(max_iter >= 1 && "max_iter must be greater or equal to 1");
84 }
85
86 // data
87
90
93
96
99
100 // data that can be modified by the algorithm
101
104
107
110 int iter;
111 };
112
113} // namespace pinocchio
114
115#if PINOCCHIO_ENABLE_TEMPLATE_INSTANTIATION
116 #include "pinocchio/algorithm/proximal.txx"
117#endif // PINOCCHIO_ENABLE_TEMPLATE_INSTANTIATION
118
119#endif // ifndef __pinocchio_algorithm_proximal_hpp__
Main pinocchio namespace.
Definition treeview.dox:11
Structure containing all the settings parameters for the proximal algorithms.
Definition proximal.hpp:25
ProximalSettingsTpl()
Default constructor.
Definition proximal.hpp:29
ProximalSettingsTpl(const Scalar accuracy, const Scalar mu, const int max_iter)
Constructor with all the setting parameters.
Definition proximal.hpp:43
int max_iter
Maximal number of iterations.
Definition proximal.hpp:98
Scalar relative_accuracy
Relative proximal accuracy between two iterates.
Definition proximal.hpp:92
Scalar absolute_accuracy
Absolute proximal accuracy.
Definition proximal.hpp:89
Scalar mu
Regularization parameter of the proximal algorithm.
Definition proximal.hpp:95
int iter
Total number of iterations of the algorithm when it has converged or reached the maximal number of al...
Definition proximal.hpp:110
Scalar relative_residual
Relatice residual between two iterates.
Definition proximal.hpp:106
Scalar absolute_residual
Absolute residual.
Definition proximal.hpp:103
ProximalSettingsTpl(const Scalar absolute_accuracy, const Scalar relative_accuracy, const Scalar mu, const int max_iter)
Constructor with all the setting parameters.
Definition proximal.hpp:62