idol
A C++ Framework for Optimization
Loading...
Searching...
No Matches
MosekCallbackI.h
1//
2// Created by henri on 19.06.24.
3//
4
5#ifndef IDOL_MOSEKCALLBACKI_H
6#define IDOL_MOSEKCALLBACKI_H
7
8#ifdef IDOL_USE_MOSEK
9
10#include <mosek.h>
11#include "idol/mixed-integer/optimizers/callbacks/Callback.h"
12
13namespace idol {
14 namespace Optimizers {
15 class Mosek;
16 }
17 class MosekCallbackI;
18}
19
20class idol::MosekCallbackI : public CallbackI {
21
22 Optimizers::Mosek& m_parent;
23 std::list<std::unique_ptr<Callback>> m_callbacks;
24
25 // Information from Mosek Callback
26 const double *m_double_info = nullptr;
27 const int32_t *m_int32_info = nullptr;
28 const int64_t *m_int64_info = nullptr;
29
30public:
31 explicit MosekCallbackI(Optimizers::Mosek& t_parent);
32
33 void add_callback(Callback* t_callback);
34
35 void callback(MSKcallbackcodee t_caller, const double * t_double_info, const int32_t* t_int32_info, const int64_t* t_int64_info);
36protected:
37 void call(CallbackEvent t_event);
38
39 const Model &original_model() const override;
40
41 void add_user_cut(const TempCtr &t_cut) override;
42
43 void add_lazy_cut(const TempCtr &t_cut) override;
44
45 void submit_heuristic_solution(PrimalPoint t_solution) override;
46
47 PrimalPoint primal_solution() const override;
48
49 const Timer &time() const override;
50
51 double best_obj() const override;
52
53 double best_bound() const override;
54
55 void terminate() override;
56};
57
58#endif
59
60#endif //IDOL_MOSEKCALLBACKI_H