Fix the incorrect output error.

Implement epsilon (but doesn't work correctly for now).
Start making the correct implementation of I/O.
This commit is contained in:
emil
2024-10-03 04:49:09 +03:00
parent 0ed96c9238
commit 153bcfd017
5 changed files with 118 additions and 24 deletions
+22 -3
View File
@@ -3,10 +3,27 @@
#include "tools/math.h"
#include "simplex.h"
void manualInput() {
int ZLength;
std::cout << "Write how many x's the objective function has:" << std::endl;
std::cin >> ZLength;
Vector Z = {};
}
void printInitialInputs(Vector C, Matrix A, Vector b) {
}
int main() {
// TODO: Initially should be positive
std::string doManual = "";
std::cout << "Enable manual input? (y/n)" << std::endl;
std::cin >> doManual ;
if (doManual == "y" or doManual == "Y") {
manualInput();
} else if (doManual == "n"){
Vector C = {-5, -4, 0, 0, 0, 0};
}
Vector C = {5, 4, 0, 0, 0, 0};
Matrix A = {
{6, 4, 1, 0, 0, 0},
@@ -22,7 +39,7 @@ int main() {
//showMatrix(test);
Result result = Simplex(C, A, b);
Result result = Simplex(C, A, b, 0.1, true);
if(result.state == bounded) {
if(result.solution == nullptr) {
@@ -36,4 +53,6 @@ int main() {
//std::cout << "asdasd" << std::endl;
return 0;
}
}