idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
QCtrVersion.h
1//
2// Created by henri on 19.11.24.
3//
4
5#ifndef IDOL_QCTRVERSION_H
6#define IDOL_QCTRVERSION_H
7
8#include "idol/mixed-integer/modeling/objects/Version.h"
9#include "idol/mixed-integer/modeling/expressions/QuadExpr.h"
10
11namespace idol {
12 class TempQCtr;
13 class QCtrVersion;
14}
15
16class idol::QCtrVersion : public Version {
17 QuadExpr<Var> m_expr;
18 CtrType m_type;
19public:
20 QCtrVersion(unsigned int t_index, TempQCtr&& t_temp_ctr);
21
22 QCtrVersion(unsigned int t_index, const TempQCtr& t_temp_ctr);
23
24 QCtrVersion(unsigned int t_index, QuadExpr<Var>&& t_expr, CtrType t_type)
25 : Version(t_index),
26 m_expr(std::move(t_expr)),
27 m_type(t_type)
28 {}
29
30 QCtrVersion(unsigned int t_index, CtrType t_type)
31 : Version(t_index),
32 m_type(t_type)
33 {}
34
35 QCtrVersion(const QCtrVersion& t_src) = default;
36
37 [[nodiscard]] CtrType type() const { return m_type; }
38
39 void set_type(CtrType t_type) { m_type = t_type; }
40
41 QuadExpr<Var>& expr() { return m_expr; }
42
43 [[nodiscard]] const QuadExpr<Var>& expr() const { return m_expr; }
44
45 void set_expr(QuadExpr<Var>&& t_expr) { m_expr = std::move(t_expr); }
46};
47
48#endif //IDOL_QCTRVERSION_H