aboutsummaryrefslogtreecommitdiffstats
path: root/native/src/linprog/cplex.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'native/src/linprog/cplex.cpp')
-rw-r--r--native/src/linprog/cplex.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/native/src/linprog/cplex.cpp b/native/src/linprog/cplex.cpp
index b5565d4..9be1e74 100644
--- a/native/src/linprog/cplex.cpp
+++ b/native/src/linprog/cplex.cpp
@@ -70,6 +70,13 @@ void CPLEXSolution::solve_model(unsigned int max_num_vars,
70{ 70{
71 try 71 try
72 { 72 {
73#if DEBUG_LP_OVERHEADS >= 3
74 static DEFINE_CPU_CLOCK(model_costs);
75 static DEFINE_CPU_CLOCK(solver_costs);
76 static DEFINE_CPU_CLOCK(extract_costs);
77
78 model_costs.start();
79#endif
73 IloNumVarArray cplex_vars = IloNumVarArray(get_env(), max_num_vars, 80 IloNumVarArray cplex_vars = IloNumVarArray(get_env(), max_num_vars,
74 var_lb, var_ub); 81 var_lb, var_ub);
75 82
@@ -84,11 +91,29 @@ void CPLEXSolution::solve_model(unsigned int max_num_vars,
84 91
85 IloCplex cplex = IloCplex(model); 92 IloCplex cplex = IloCplex(model);
86 93
94#if DEBUG_LP_OVERHEADS >= 3
95 model_costs.stop();
96 solver_costs.start();
97#endif
98
87 cplex.solve(); 99 cplex.solve();
88 100
101#if DEBUG_LP_OVERHEADS >= 3
102 solver_costs.stop();
103 extract_costs.start();
104#endif
105
89 cplex.getValues(cplex_vars, cplex_values); 106 cplex.getValues(cplex_vars, cplex_values);
90 solved = true; 107 solved = true;
91 108
109#if DEBUG_LP_OVERHEADS >= 3
110 extract_costs.stop();
111
112 std::cout << model_costs << std::endl
113 << solver_costs << std::endl
114 << extract_costs << std::endl;
115#endif
116
92 } catch (IloException &ex) 117 } catch (IloException &ex)
93 { 118 {
94 // Improve me: we should export some kind of error info. 119 // Improve me: we should export some kind of error info.