Clingo
|
A interval of integers. More...
#include <iesolver.hh>
Public Types | |
enum | Type : uint8_t { Lower , Upper } |
Enum to indicate the lower and upper bound of the interval. | |
Public Member Functions | |
IEInterval ()=default | |
Create an unbounded interval. | |
IEInterval (std::optional< Number > lower, std::optional< Number > upper) | |
Create an interval with the given bounds. | |
auto | has_value (Type type) const -> bool |
Whether the given bound has a value. | |
auto | value (Type type) const -> Number const & |
Get the value of the given bound. | |
void | set_value (Type type, Number bound) |
Set the value of the given bound. | |
auto | refine (Type type, Number const &bound) -> bool |
Refine the value of the given bound. | |
auto | refine (IEInterval const &bound) -> bool |
Refine the interval with the given one. | |
Friends | |
auto | operator<< (std::ostream &out, IEInterval const &bound) -> std::ostream & |
Operator to print intervals. | |
auto | operator== (IEInterval const &a, IEInterval const &b) -> bool=default |
Equality compare two terms. | |
auto | operator!= (IEInterval const &a, IEInterval const &b) -> bool=default |
Inequality compare two terms. | |
A interval of integers.
auto CppClingo::Input::IEInterval::refine | ( | IEInterval const & | bound | ) | -> bool |
Refine the interval with the given one.
The refinement corresponds to the intersection of the two intervals. Return true if the interval changed.
Refine the value of the given bound.
The interval can only value smaller. Return true if the interval changed.