src/work/athos/lp/magic_square.cc
changeset 1241 dadc9987c537
parent 1240 88a2ab6bfc4a
child 1243 41caee260bd4
equal deleted inserted replaced
0:a69e96b5de7d 1:d0a5fc6b5500
     1 // -*- c++ -*-
     1 // -*- c++ -*-
     2 #include <iostream>
     2 #include <iostream>
     3 #include <fstream>
     3 #include <fstream>
     4 
     4 
     5 #include <lemon/time_measure.h>
     5 #include <lemon/time_measure.h>
     6 #include <lp_solver_base.h>
     6 #include <lp_solver_glpk.h>
     7 
     7 
     8 using std::cout;
     8 using std::cout;
     9 using std::endl;
     9 using std::endl;
    10 using namespace lemon;
    10 using namespace lemon;
    11 
    11 
    19 int main(int, char **) {
    19 int main(int, char **) {
    20   const int n=4;
    20   const int n=4;
    21   const double row_sum=(1.0+n*n)*n/2;
    21   const double row_sum=(1.0+n*n)*n/2;
    22   Timer ts;
    22   Timer ts;
    23   ts.reset();
    23   ts.reset();
    24   typedef LPGLPK LPSolver;
    24   typedef LpGlpk LPSolver;
    25   typedef LPSolver::Col Col;
    25   typedef LPSolver::Col Col;
    26   LPSolver lp;
    26   LPSolver lp;
    27   typedef std::map<std::pair<int, int>, Col> Coords;
    27   typedef std::map<std::pair<int, int>, Col> Coords;
    28   Coords x;
    28   Coords x;
    29   // we create a new variable for each entry 
    29   // we create a new variable for each entry