idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
Ctr.h
1//
2// Created by henri on 27/01/23.
3//
4
5#ifndef IDOL_CTR_H
6#define IDOL_CTR_H
7
8#include "idol/mixed-integer/modeling/objects/Object.h"
9#include "idol/mixed-integer/modeling/Types.h"
10#include "idol/mixed-integer/modeling/constraints/TempCtr.h"
11
12namespace idol {
13 class CtrVersion;
14 class Env;
15
16 template<class T>
17 class Versions;
18
19 class TempCtr;
20 class Constant;
21
22 namespace impl {
23 class Env;
24 }
25
26 class Ctr;
27}
28
29class idol::Ctr : public Object<CtrVersion, Ctr> {
30 friend class impl::Env;
31public:
42 Ctr(Env& t_env, TempCtr&& t_temp_ctr, std::string t_name = "");
43
54 Ctr(Env& t_env, const TempCtr& t_temp_ctr, std::string t_name = "");
55
67 Ctr(Env& t_env, CtrType t_type, double t_constant, std::string t_name = "");
68
91 template<unsigned int N = 1, unsigned int I = 0>
92 static Vector<Ctr, N - I> make_vector(Env& t_env, const Dim<N>& t_dim, CtrType t_type, double t_constant, const std::string& t_name = "") {
93 return idol::impl::create_many<Ctr, N, I>(t_dim, t_name, [&](const std::string& t_name_i) {
94 return Ctr(t_env, t_type, t_constant, t_name_i);
95 });
96 }
97
98 [[nodiscard]] unsigned int index(const Model& t_index) const;
99};
100
101//IDOL_MAKE_HASHABLE(Ctr)
102
103#endif //IDOL_CTR_H
Ctr(Env &t_env, const TempCtr &t_temp_ctr, std::string t_name="")
Ctr(Env &t_env, TempCtr &&t_temp_ctr, std::string t_name="")
static Vector< Ctr, N - I > make_vector(Env &t_env, const Dim< N > &t_dim, CtrType t_type, double t_constant, const std::string &t_name="")
Definition Ctr.h:92
Ctr(Env &t_env, CtrType t_type, double t_constant, std::string t_name="")