update test cases and format code

This commit is contained in:
Ilya Grigorev
2024-10-09 14:09:48 +05:00
parent a41c15f3ee
commit 60bd99e570
8 changed files with 485 additions and 363 deletions
+7 -5
View File
@@ -4,21 +4,23 @@
#include <vector>
#include "tools/matrix.h"
enum solver_state {
enum solver_state
{
unbounded,
bounded,
unsolvable
};
struct Result {
struct Result
{
solver_state state;
Vector solution;
double objective_function_value;
bool maximize;
};
void _printInitialInputs(Vector& C, Matrix& A, Vector& b);
void _stopIterating(Matrix& generalMatrix, std::vector<int>& basicVars, Result& result);
Result simplex(Vector& C, Matrix& A, Vector& b, double eps = 0.01, bool maximize = true);
void _printInitialInputs(Vector &C, Matrix &A, Vector &b);
void _stopIterating(Matrix &generalMatrix, std::vector<int> &basicVars, Result &result);
Result simplex(Vector &C, Matrix &A, Vector &b, double eps = 0.01, bool maximize = true);
#endif // SIMPLEX_H