idol
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
13namespace idol {
14 class SOSCtrVersion;
15 class Env;
16
17 template<class T>
18 class Versions;
19
20 namespace impl {
21 class Env;
22 }
23
24 class SOSCtr;
25}
26
27class idol::SOSCtr : public Object<SOSCtrVersion, SOSCtr> {
28 friend class impl::Env;
29public:
30 SOSCtr(Env& t_env, bool t_is_sos1, std::vector<Var> t_vars, std::vector<double> t_weights, std::string t_name = "");
31
32 static SOSCtr SOS1(Env& t_env, std::vector<Var> t_vars, std::vector<double> t_weights, std::string t_name = "") {
33 return SOSCtr(t_env, true, std::move(t_vars), std::move(t_weights), std::move(t_name));
34 }
35
36 static SOSCtr SOS2(Env& t_env, std::vector<Var> t_vars, std::vector<double> t_weights, std::string t_name = "") {
37 return SOSCtr(t_env, false, std::move(t_vars), std::move(t_weights), std::move(t_name));
38 }
39
40 [[nodiscard]] unsigned int index(const Model& t_index) const;
41};
42
43#endif //IDOL_SOSCTR_H