A C++ Framework for Optimization
Loading...
Searching...
No Matches
SOSCtr.h
1//
2// Created by henri on 13.04.25.
3//
4
5#ifndef IDOL_SOSCTR_H
6#define IDOL_SOSCTR_H
7
8#include <utility>
9
10#include "idol/mixed-integer/modeling/objects/Object.h"
11#include "idol/mixed-integer/modeling/Types.h"
12#include "idol/mixed-integer/modeling/variables/Var.h"
13
14namespace idol {
15 class SOSCtrVersion;
16 class Env;
17
18 template<class T>
19 class Versions;
20
21 namespace impl {
22 class Env;
23 }
24
25 class SOSCtr;
26}
27
28class idol::SOSCtr : public Object<SOSCtrVersion, SOSCtr> {
29 friend class impl::Env;
30public:
31 SOSCtr(Env& t_env, bool t_is_sos1, std::vector<Var> t_vars, std::vector<double> t_weights, std::string t_name = "");
32
33 static SOSCtr SOS1(Env& t_env, std::vector<Var> t_vars, std::vector<double> t_weights, std::string t_name = "") {
34 return SOSCtr(t_env, true, std::move(t_vars), std::move(t_weights), std::move(t_name));
35 }
36
37 static SOSCtr SOS2(Env& t_env, std::vector<Var> t_vars, std::vector<double> t_weights, std::string t_name = "") {
38 return SOSCtr(t_env, false, std::move(t_vars), std::move(t_weights), std::move(t_name));
39 }
40
41 [[nodiscard]] unsigned int index(const Model& t_index) const;
42};
43
44#endif //IDOL_SOSCTR_H