46 std::vector<humoto::ConstraintActivationType::Type>
data_;
59 "Active set index is out of bounds.");
60 return (data_[constraint_index]);
74 "Active set index is out of bounds.");
75 return (data_[constraint_index]);
120 HUMOTO_ASSERT(location.checkLength( size() ),
"Incorrect location in an active set.");
121 std::fill( data_.begin() + location.front(),
122 data_.begin() + location.end(),
138 std::copy( other_active_set.
data_.begin(),
139 other_active_set.
data_.end(),
140 data_.begin() + location.
front());
156 std::copy( other_active_set.
data_.begin() + location.
front(),
157 other_active_set.
data_.begin() + location.
end(),
170 data_.resize(number_of_constraints);
185 if (size() != location.
length_)
188 data_.resize(location.
length_);
191 copyFrom(other_active_set, location);
205 data_.resize(number_of_constraints, type);
217 void shift(
const std::size_t shift_size,
221 "Shift size exceeded size of the active set.");
223 std::rotate(data_.begin(),
224 data_.begin() + shift_size,
227 std::fill( data_.begin() + (size() - shift_size),
240 std::size_t num_activated_inequalities = 0;
242 for (std::size_t i = 0; i < data_.size(); ++i)
248 ++num_activated_inequalities;
255 return(num_activated_inequalities);
268 const std::string & name =
"")
const 281 std::vector< ActiveSetConstraints >
data_;
295 return (data_[level_index]);
309 return (data_[level_index]);
319 void set(
const std::size_t level_index,
323 data_[level_index].set(type);
334 return(data_.size());
354 const std::vector< std::size_t > &number_of_constraints)
357 data_.resize(number_of_levels);
359 for (std::size_t i = 0; i < number_of_levels; ++i)
361 data_[i].initialize(number_of_constraints[i]);
375 const std::string & name =
"active_set")
const 379 for (std::size_t i = 0; i < data_.size(); ++i)
Lower bound is activated.
bool checkLength(const std::size_t max_length) const
Check length of location.
std::size_t front() const
Offset of the first element.
Constraint is an equality (always active)
void initialize(const ActiveSetConstraints &other_active_set, const Location &location)
Initialize active set.
void initialize(const std::size_t number_of_constraints, const ConstraintActivationType::Type type)
Initialize active set.
#define HUMOTO_GLOBAL_LOGGER_IF_DEFINED
#define HUMOTO_ASSERT(condition, message)
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="") const
Log an active set.
std::size_t size() const
Size of the active set.
Active set corresponding to Constraints class.
void copyFrom(const ActiveSetConstraints &other_active_set, const Location &location)
Set type of a set of constraints.
Represents log entry name.
Active set corresponding to a hierarchy of Constraints.
void initialize(const std::size_t number_of_levels, const std::vector< std::size_t > &number_of_constraints)
Initialize active set.
void reset()
Reset active set.
void initialize(const std::size_t number_of_constraints)
Initialize active set.
Threaded logger: any data sent to this logger is wrapped in a message and pushed to a queue...
std::vector< ActiveSetConstraints > data_
std::vector< humoto::ConstraintActivationType::Type > data_
The root namespace of HuMoTo.
Type of constraint activation.
void copyTo(const Location &location, const ActiveSetConstraints &other_active_set)
Set type of a set of constraints.
std::size_t size() const
Size of the active set.
std::size_t countActiveInequalities() const
Returns number of active inequality constraints.
std::size_t end() const
Offset of the element following the last element.
LogEntryName & add(const char *name)
extends entry name with a subname
void log(humoto::Logger &logger, const LogEntryName &parent=LogEntryName(), const std::string &name="active_set") const
Log an active set.
Location of a data chunk (offset + length).
void reset()
Reset active set.
Upper bound is activated.
void shift(const std::size_t shift_size, const ConstraintActivationType::Type type)
Shift active set forward while preserving the length, the trailing elements are initialized with the ...