Linear_Program.h 1.37 KB
Newer Older
1 2 3 4
#ifndef LINEAR_PROGRAM_H
#define LINEAR_PROGRAM_H

#include <cstddef>
jonasseidel's avatar
jonasseidel committed
5
#include <unordered_map>
6
#include <vector>
Jonas Seidel's avatar
Jonas Seidel committed
7
#include <cmath>
Jonas Seidel's avatar
Jonas Seidel committed
8 9 10 11 12 13
#include <sstream>
#include <fstream>
#include <iostream>
#include <cstdlib>

#include <boost/bimap.hpp>
jonasseidel's avatar
jonasseidel committed
14 15
#include <scip/scip.h>
#include <scip/scipdefplugins.h>
jonasseidel's avatar
jonasseidel committed
16
#include <scip/debug.h>
17 18

#include "Polyeder.h"
Jonas Seidel's avatar
Jonas Seidel committed
19
#include "../Common/integrality.h"
20 21 22

class Linear_Program{
  bool _maximum;
jonasseidel's avatar
jonasseidel committed
23
  std::unordered_map<Variable*, Coefficient> _direction;
24 25
  Polyeder _polyeder;
public:
26 27 28
  Linear_Program(Linear_Program& lp);
  Linear_Program(Linear_Program&& lp);
  Linear_Program(bool maximum);
jonasseidel's avatar
jonasseidel committed
29 30 31
  Linear_Program(bool maximum, std::unordered_map<Variable*, Coefficient> direction, Polyeder polyeder);

  std::string description();
32 33

  bool is_maximum();
jonasseidel's avatar
jonasseidel committed
34
  std::unordered_map<Variable*, Coefficient> direction();
35 36
  void add_direction_coefficient(std::pair<Variable*, Coefficient> summand);
  Coefficient direction_coefficient(Variable* index);
37
  Polyeder& polyeder();
Jonas Seidel's avatar
Jonas Seidel committed
38

39
  std::pair<SCIP*, std::unordered_map<Variable*, SCIP_VAR*> > computational_model();
Jonas Seidel's avatar
Jonas Seidel committed
40

41 42
  void operator=(Linear_Program& lp);
  void operator=(Linear_Program&& lp);
43

Jonas Seidel's avatar
Jonas Seidel committed
44
  Linear_Program relaxation_dual();
45 46
  Linear_Program Danzig_Wolfe_IPM_complete_optimal_inequality_relaxation();
  Linear_Program Benders_Reformulierung_integral_relaxation();
47 48 49 50
};

std::ostream& operator<<(std::ostream& os, Linear_Program& linear_program);
#endif