robotoc
robotoc - efficient ROBOT Optimal Control solvers
Loading...
Searching...
No Matches
line_search_filter.hpp
Go to the documentation of this file.
1#ifndef ROBOTOC_LINE_SEARCH_FILTER_HPP_
2#define ROBOTOC_LINE_SEARCH_FILTER_HPP_
3
4#include <vector>
5#include <utility>
6
7
8namespace robotoc {
9
15public:
23 LineSearchFilter(const double cost_reduction_rate=0.005,
24 const double constraint_violation_reduction_rate=0.005);
25
29 ~LineSearchFilter() = default;
30
35
40
44 LineSearchFilter(LineSearchFilter&&) noexcept = default;
45
49 LineSearchFilter& operator=(LineSearchFilter&&) noexcept = default;
50
59 bool isAccepted(const double cost, const double constraint_violation) const;
60
66 void augment(const double cost, const double constraint_violation);
67
71 void clear();
72
77 bool isEmpty() const;
78
79private:
80 std::vector<std::pair<double, double>> filter_;
81 double cost_reduction_rate_, constraint_violation_reduction_rate_;
82
83};
84
85} // namespace robotoc
86
87
88#endif // ROBOTOC_LINE_SEARCH_FILTER_HPP_
Filter of the line search.
Definition: line_search_filter.hpp:14
void clear()
Clears the filter.
LineSearchFilter(const double cost_reduction_rate=0.005, const double constraint_violation_reduction_rate=0.005)
Construct a line search filter.
LineSearchFilter & operator=(const LineSearchFilter &)=default
Default copy assign operator.
LineSearchFilter(LineSearchFilter &&) noexcept=default
Default move constructor.
LineSearchFilter(const LineSearchFilter &)=default
Default copy constructor.
~LineSearchFilter()=default
Default destructor.
bool isAccepted(const double cost, const double constraint_violation) const
Check wheather the pair of cost and constraint violation is accepted by the filter or not.
void augment(const double cost, const double constraint_violation)
Augment the pair of cost and constraint violation to the filter.
bool isEmpty() const
Checks wheather the filter is empty or not.
Definition: constraint_component_base.hpp:17