robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
constraints_data.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_CONSTRAINTS_DATA_HPP_
2#define ROBOTOC_CONSTRAINTS_DATA_HPP_
3
4#include <vector>
5
7
8
9namespace robotoc {
10
17public:
23 ConstraintsData(const int time_stage);
24
29
33 ~ConstraintsData() = default;
34
39
44
48 ConstraintsData(ConstraintsData&&) noexcept = default;
49
53 ConstraintsData& operator=(ConstraintsData&&) noexcept = default;
54
59 void setTimeStage(const int time_stage);
60
65 bool isPositionLevelValid() const {
66 return is_position_level_valid_;
67 }
68
73 bool isVelocityLevelValid() const {
74 return is_velocity_level_valid_;
75 }
76
83 return is_acceleration_level_valid_;
84 }
85
90 bool isImpactLevelValid() const {
91 return is_impact_level_valid_;
92 }
93
99 double KKTError() const;
100
107 double logBarrier() const;
108
116 template <int p=1>
117 double primalFeasibility() const;
118
126 template <int p=1>
127 double dualFeasibility() const;
128
132 std::vector<ConstraintComponentData> position_level_data;
133
137 std::vector<ConstraintComponentData> velocity_level_data;
138
142 std::vector<ConstraintComponentData> acceleration_level_data;
143
147 std::vector<ConstraintComponentData> impact_level_data;
148
149private:
150 bool is_position_level_valid_, is_velocity_level_valid_,
151 is_acceleration_level_valid_, is_impact_level_valid_;
152
153};
154
155} // namespace robotoc
156
158
159#endif // ROBOTOC_CONSTRAINTS_DATA_HPP_
Data for constraints. Composed of ConstraintComponentData corrensponding to the components of Constra...
Definition: constraints_data.hpp:16
bool isPositionLevelValid() const
Checks wheather the position-level constraints are valid or not.
Definition: constraints_data.hpp:65
double primalFeasibility() const
Returns the lp norm of the primal feasibility, i.e., the constraint violation. Default norm is l1-nor...
Definition: constraints_data.hxx:62
std::vector< ConstraintComponentData > acceleration_level_data
The collection of the acceleration-level constraints data.
Definition: constraints_data.hpp:142
bool isVelocityLevelValid() const
Checks wheather the velocity-level constraints are valid or not.
Definition: constraints_data.hpp:73
bool isAccelerationLevelValid() const
Checks wheather the acceleration-level constraints are valid or not.
Definition: constraints_data.hpp:82
ConstraintsData(const int time_stage)
Constructor.
std::vector< ConstraintComponentData > velocity_level_data
The collection of the velocity-level constraints data.
Definition: constraints_data.hpp:137
bool isImpactLevelValid() const
Checks wheather the impact-level constraints are valid or not.
Definition: constraints_data.hpp:90
void setTimeStage(const int time_stage)
Sets the time stage info.
double KKTError() const
Returns the sum of the squared norm of the KKT error (primal residual and complementary slackness) of...
Definition: constraints_data.hxx:9
double dualFeasibility() const
Returns the lp norm of the dual feasibility. Default norm is l1-norm. You can also specify l-infty no...
Definition: constraints_data.hxx:89
ConstraintsData(const ConstraintsData &)=default
Default copy constructor.
~ConstraintsData()=default
Default destructor.
double logBarrier() const
Returns the sum of the log-barrier of the slack variables of all the constraints.
Definition: constraints_data.hxx:35
std::vector< ConstraintComponentData > impact_level_data
The collection of the impact-level constraints data.
Definition: constraints_data.hpp:147
ConstraintsData(ConstraintsData &&) noexcept=default
Default move constructor.
ConstraintsData & operator=(const ConstraintsData &)=default
Default copy operator.
std::vector< ConstraintComponentData > position_level_data
The collection of the position-level constraints data.
Definition: constraints_data.hpp:132
ConstraintsData()
Default constructor.
Definition: constraint_component_base.hpp:17