dlinear  0.0.1
Delta-complete SMT solver for linear programming
Loading...
Searching...
No Matches
Bound.cpp
1
6#include "Bound.h"
7
8namespace dlinear {
9
10std::strong_ordering Bound::operator<=>(const Bound& other) const {
11 const auto& [value_l, type_l, lit_l, expl_l] = *this;
12 const auto& [value_r, type_r, lit_r, expl_r] = other;
13 if (*value_l < *value_r) return std::strong_ordering::less;
14 if (*value_l > *value_r) return std::strong_ordering::greater;
15 if (type_l < type_r) return std::strong_ordering::less;
16 if (type_l > type_r) return std::strong_ordering::greater;
17 return std::strong_ordering::equal;
18}
19bool Bound::operator==(const Bound& other) const {
20 const auto& [value_l, type_l, lit_l, expl_l] = *this;
21 const auto& [value_r, type_r, lit_r, expl_r] = other;
22 return *value_l == *value_r && type_l == type_r && lit_l == lit_r && expl_l == expl_r;
23}
24
25std::ostream& operator<<(std::ostream& os, const Bound& bound) {
26 const auto& [value, type, lit, expl] = bound;
27 return os << "Bound{ " << *value << ", " << type << ", " << lit << ", " << expl << " }";
28}
29
30} // namespace dlinear
Global namespace for the dlinear library.