23 template<
class T,
unsigned int N>
24 void set_annotation(
const Vector<T, N> &t_vector,
unsigned int t_value) {
25 if constexpr (N == 1) {
26 for (
const auto& x : t_vector) {
27 x.set(m_level, t_value);
30 for (
const auto& x : t_vector) {
31 add_vector<T, N - 1>(x);
37 Description(
Env& t_env,
const std::string& t_name) : m_level(t_env, t_name +
"_lower_level", MasterId) {}
45 : m_level(t_lower_level),
46 m_follower_objective(std::move(t_follower_objective)) {}
50 [[nodiscard]]
const QuadExpr<Var>& lower_level_obj()
const {
return m_follower_objective; }
52 void make_upper_level(
const Var& t_var) { t_var.
set(m_level, MasterId); }
54 void make_upper_level(
const Ctr& t_ctr) { t_ctr.
set(m_level, MasterId); }
56 void make_upper_level(
const QCtr& t_ctr) { t_ctr.
set(m_level, MasterId); }
58 void make_lower_level(
const Var& t_var) { t_var.
set(m_level, 0); }
60 template<
unsigned int N>
void make_lower_level(
const Vector<Var, N>& t_vars) { set_annotation<Var, N>(t_vars, 0); }
62 void make_lower_level(
const Ctr& t_ctr) { t_ctr.
set(m_level, 0); }
64 void make_lower_level(
const QCtr& t_ctr) { t_ctr.
set(m_level, 0); }
66 void set_lower_level_obj(
QuadExpr<Var> t_objective) { m_follower_objective = std::move(t_objective); }
68 [[nodiscard]]
bool is_upper(
const Var& t_var)
const {
return t_var.
get(m_level) == MasterId; }
70 [[nodiscard]]
bool is_upper(
const Ctr& t_ctr)
const {
return t_ctr.
get(m_level) == MasterId; }
72 [[nodiscard]]
bool is_upper(
const QCtr& t_ctr)
const {
return t_ctr.
get(m_level) == MasterId; }
74 [[nodiscard]]
bool is_lower(
const Var& t_var)
const {
return t_var.
get(m_level) != MasterId; }
76 [[nodiscard]]
bool is_lower(
const Ctr& t_ctr)
const {
return t_ctr.
get(m_level) != MasterId; }
78 [[nodiscard]]
bool is_lower(
const QCtr& t_ctr)
const {
return t_ctr.
get(m_level) != MasterId; }