robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
split_direction.hxx
Go to the documentation of this file.
1#ifndef ROBOTOC_SPLIT_DIRECTION_HXX_
2#define ROBOTOC_SPLIT_DIRECTION_HXX_
3
5
6#include <cassert>
7
8namespace robotoc {
9
10inline void SplitDirection::setContactDimension(const int dimf) {
11 assert(dimf >= 0);
12 assert(dimf <= dxi_full_.size());
13 dimf_ = dimf;
14}
15
16
18 assert(dims >= 0);
19 assert(dims <= dxi_full_.size());
20 dims_ = dims;
21}
22
23
24inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dq() {
25 assert(isDimensionConsistent());
26 return dx.head(dimv_);
27}
28
29
30inline const Eigen::VectorBlock<const Eigen::VectorXd>
32 assert(isDimensionConsistent());
33 return dx.head(dimv_);
34}
35
36
37inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dv() {
38 assert(isDimensionConsistent());
39 return dx.tail(dimv_);
40}
41
42
43inline const Eigen::VectorBlock<const Eigen::VectorXd>
45 assert(isDimensionConsistent());
46 return dx.tail(dimv_);
47}
48
49
50inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::daf() {
51 return daf_full_.head(dimv_+dimf_);
52}
53
54
55inline const Eigen::VectorBlock<const Eigen::VectorXd>
57 return daf_full_.head(dimv_+dimf_);
58}
59
60
61inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::da() {
62 return daf_full_.head(dimv_);
63}
64
65
66inline const Eigen::VectorBlock<const Eigen::VectorXd>
68 return daf_full_.head(dimv_);
69}
70
71
72inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::ddvf() {
73 return daf();
74}
75
76
77inline const Eigen::VectorBlock<const Eigen::VectorXd>
79 return daf();
80}
81
82
83inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::ddv() {
84 return da();
85}
86
87
88inline const Eigen::VectorBlock<const Eigen::VectorXd>
90 return da();
91}
92
93
94inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::df() {
95 return daf_full_.segment(dimv_, dimf_);
96}
97
98
99inline const Eigen::VectorBlock<const Eigen::VectorXd>
101 return daf_full_.segment(dimv_, dimf_);
102}
103
104
105inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dlmd() {
106 assert(isDimensionConsistent());
107 return dlmdgmm.head(dimv_);
108}
109
110
111inline const Eigen::VectorBlock<const Eigen::VectorXd>
113 assert(isDimensionConsistent());
114 return dlmdgmm.head(dimv_);
115}
116
117
118inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dgmm() {
119 assert(isDimensionConsistent());
120 return dlmdgmm.tail(dimv_);
121}
122
123
124inline const Eigen::VectorBlock<const Eigen::VectorXd>
126 assert(isDimensionConsistent());
127 return dlmdgmm.tail(dimv_);
128}
129
130
131inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dbetamu() {
132 return dbetamu_full_.head(dimv_+dimf_);
133}
134
135
136inline const Eigen::VectorBlock<const Eigen::VectorXd>
138 return dbetamu_full_.head(dimv_+dimf_);
139}
140
141
142inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dbeta() {
143 return dbetamu_full_.head(dimv_);
144}
145
146
147inline const Eigen::VectorBlock<const Eigen::VectorXd>
149 return dbetamu_full_.head(dimv_);
150}
151
152
153inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dmu() {
154 return dbetamu_full_.segment(dimv_, dimf_);
155}
156
157
158inline const Eigen::VectorBlock<const Eigen::VectorXd>
160 return dbetamu_full_.segment(dimv_, dimf_);
161}
162
163
164inline Eigen::VectorBlock<Eigen::VectorXd> SplitDirection::dxi() {
165 return dxi_full_.head(dims_);
166}
167
168
169inline const Eigen::VectorBlock<const Eigen::VectorXd>
171 return dxi_full_.head(dims_);
172}
173
174
176 dx.setZero();
177 du.setZero();
178 daf().setZero();
179 dlmdgmm.setZero();
180 dbetamu().setZero();
181 dnu_passive.setZero();
182 dxi().setZero();
183 dts = 0.0;
184 dts_next = 0.0;
185}
186
187
188inline int SplitDirection::dimf() const {
189 return dimf_;
190}
191
192
193inline int SplitDirection::dims() const {
194 return dims_;
195}
196
197} // namespace robotoc
198
199#endif // ROBOTOC_SPLIT_OCP_DIRECTION_HXX_
Eigen::VectorXd dx
Stack of the Newton directions of SplitSolution::q and SplitSolution::v. Size is 2 * Robot::dimv().
Definition: split_direction.hpp:74
void setContactDimension(const int dimf)
Sets contact status, i.e., set dimension of the contact forces.
Definition: split_direction.hxx:10
Eigen::VectorBlock< Eigen::VectorXd > da()
Newton direction of SplitSolution::a. Size is Robot::dimv().
Definition: split_direction.hxx:61
int dims() const
Returns the dimension of the switching constraint.
Definition: split_direction.hxx:193
double dts
Newton direction of the switching time.
Definition: split_direction.hpp:245
Eigen::VectorBlock< Eigen::VectorXd > dv()
Newton direction of SplitSolution::gmm. Size is Robot::dimv().
Definition: split_direction.hxx:37
Eigen::VectorBlock< Eigen::VectorXd > dbeta()
Newton direction of SplitSolution::beta. Size is Robot::dimv().
Definition: split_direction.hxx:142
Eigen::VectorXd du
Newton direction of SplitSolution::u. Size is Robot::dimu().
Definition: split_direction.hpp:101
Eigen::VectorXd dnu_passive
Newton direction of SplitSolution::nu_passive. Size is Robot::dim_passive().
Definition: split_direction.hpp:228
Eigen::VectorBlock< Eigen::VectorXd > dbetamu()
Stack of the Newton direction of SplitSolution::beta and SplitSolution::mu_stack()....
Definition: split_direction.hxx:131
Eigen::VectorBlock< Eigen::VectorXd > dgmm()
Newton direction of SplitSolution::gmm. Size is Robot::dimv().
Definition: split_direction.hxx:118
double dts_next
Newton direction of the next switching time.
Definition: split_direction.hpp:250
Eigen::VectorBlock< Eigen::VectorXd > ddvf()
Stack of Newton direction of SplitSolution::dv and SplitSolution::f. Size is Robot::dimv() + ContactS...
Definition: split_direction.hxx:72
Eigen::VectorBlock< Eigen::VectorXd > ddv()
Newton direction of SplitSolution::dv. Size is Robot::dimv().
Definition: split_direction.hxx:83
Eigen::VectorBlock< Eigen::VectorXd > dmu()
Newton direction of SplitSolution::mu_stack(). Size is SplitSolution::dimf().
Definition: split_direction.hxx:153
Eigen::VectorBlock< Eigen::VectorXd > dlmd()
Newton direction of SplitSolution::lmd. Size is Robot::dimv().
Definition: split_direction.hxx:105
void setSwitchingConstraintDimension(const int dims)
Sets the dimension of the switching constraint.
Definition: split_direction.hxx:17
Eigen::VectorBlock< Eigen::VectorXd > daf()
Stack of Newton direction of SplitSolution::a and SplitSolution::f. Size is Robot::dimv() + ContactSt...
Definition: split_direction.hxx:50
Eigen::VectorXd dlmdgmm
Stack of the Newton direction of SplitSolution::lmd and SplitSolution::gmm. Size is 2 * Robot::dimv()...
Definition: split_direction.hpp:165
Eigen::VectorBlock< Eigen::VectorXd > df()
Newton direction of SplitSolution::f_stack(). Size is ContactStatus::dimf().
Definition: split_direction.hxx:94
int dimf() const
Returns the dimension of the contact.
Definition: split_direction.hxx:188
Eigen::VectorBlock< Eigen::VectorXd > dxi()
Newton direction of SplitSolution::xi_stack(). Size is SplitSolution::dims().
Definition: split_direction.hxx:164
Eigen::VectorBlock< Eigen::VectorXd > dq()
Newton direction of SplitSolution::q. Size is Robot::dimv().
Definition: split_direction.hxx:24
bool isDimensionConsistent() const
Checks dimensional consistency of each component.
void setZero()
Set the all directions zero.
Definition: split_direction.hxx:175
Definition: constraint_component_base.hpp:17