-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSolver.h
More file actions
48 lines (40 loc) · 1.21 KB
/
Solver.h
File metadata and controls
48 lines (40 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//
// Created by devt75 on 25/2/25.
//
#ifndef SOLVER_H
#define SOLVER_H
#include <vector>
#include <string>
#include <map>
using std::vector;
using std::string;
using std::map;
namespace SolverLib{ // namespace for solver
class Solver { // main class containing the optimization technique classes
public:
Solver() = default;
void init();
private:
class Simplex{
public:
Simplex() = default;
void solve();
void initialize();
private:
int n,m;
bool solved_ = false;
vector<string> variables;
vector<vector<double>> tableau;
vector<double> solution;
map<int, string> basic_variables, mp, slack;
void printResult();
void printTableau();
int getEnteringIndex();
int getLeavingIndex(int enteringIndex);
void GaussJordanRowOperation(int enteringIndex, int leavingIndex);
};
// Add more in future
Simplex simplex_;
};
}
#endif //SOLVER_H