aboutsummaryrefslogtreecommitdiffstats
path: root/src/test_simplex.cpp
blob: c5e54b9655882355361cf045b3963a9d5c3ca2cd (plain)
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
#include <simplex.h>

#include <iostream>

int main()
{
    BasicRep br{
        {1, 1, 1, 0, 0, 0, 0},
        {0, 2, 1, 1, 0, 0, 11},
        {0, 1, 3, 0, 1, 0, 18},
        {0, 1, 0, 0, 0, 1, 4},
    };

    Simplex s{br};

    s.solve();

    // s.initialize({{1, -20, -9, 0, 0, 10.5, -70.5, 0, 0},
    //               {0, -2, 4, 1, 0, 0.5, -4.5, 0, 0},
    //               {0, -0.5, 0.5, 0, 1, 0.25, -1.25, 0, 0},
    //               {0, 1, 0, 0, 0, 0, 0, 1, 1}});

    // s.solve();

    std::cout << "Result: " << s.getMin() << "\n";
}