aboutsummaryrefslogtreecommitdiffstats
path: root/include/simplex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/simplex.h')
-rw-r--r--include/simplex.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/simplex.h b/include/simplex.h
index e69de29..22bf1e3 100644
--- a/include/simplex.h
+++ b/include/simplex.h
@@ -0,0 +1,28 @@
+#ifndef SIMPLEX_H
+#define SIMPLEX_H
+
+#include <vector>
+
+typedef std::vector<std::vector<double>> BasicRep;
+
+class Simplex
+{
+public:
+ Simplex(int m, int n);
+ Simplex(BasicRep basic_rep);
+
+ void initialize(BasicRep basic_rep);
+ void solve();
+ double getMin() const;
+private:
+ BasicRep basic_rep_;
+
+ bool isDone() const;
+ int inputBasicVar() const;
+ int outputBasicVar(int column) const;
+ void rotate(int input, int output);
+};
+
+extern void printBR(const BasicRep &basic_rep);
+
+#endif