Move general matrix to simplex and fix bugs
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
#include "simplex.h"
|
||||
|
||||
int main() {
|
||||
Vector C = {5, 4, 0, 0};
|
||||
// TODO: Initially should be positive
|
||||
Vector C = {-5, -4, 0, 0, 0, 0};
|
||||
Matrix A = {{6, 4, 1, 0, 0, 0}, {1, 2, 0, 1, 0, 0}, {-1, 1, 0, 0, 1, 0}, {0, 1, 0, 0, 0, 1}};
|
||||
Vector b = {24, 6, 1, 2};
|
||||
|
||||
@@ -12,11 +13,12 @@ int main() {
|
||||
if(result.state == bounded) {
|
||||
|
||||
if(result.solution == nullptr) {
|
||||
std::cout << "HUYN: Khong tim duoc nghiem" << std::endl;
|
||||
// TODO: error
|
||||
}
|
||||
std::cout << *result.solution << std::endl;
|
||||
std::cout << result.objective_fucntion_value << std::endl;
|
||||
|
||||
delete result.solution;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user