summaryrefslogtreecommitdiffhomepage
path: root/ir/lpp
diff options
context:
space:
mode:
authorManuel Mohr <manuel.mohr@kit.edu>2013-01-30 17:41:27 +0100
committerManuel Mohr <manuel.mohr@kit.edu>2013-01-30 17:48:26 +0100
commit4a4429bf6bcc0dd483bc2e096f1cdd8d4e7d07c1 (patch)
tree4899f9e81545be4f424323ead9a79cc55bb7b8b9 /ir/lpp
parent69d7305cc20b3d4a42b63563d8ec0febb4766389 (diff)
lpp: Delete commented out code, correct some comments.
Diffstat (limited to 'ir/lpp')
-rw-r--r--ir/lpp/lpp_gurobi.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/ir/lpp/lpp_gurobi.c b/ir/lpp/lpp_gurobi.c
index 6e261be..7a01b17 100644
--- a/ir/lpp/lpp_gurobi.c
+++ b/ir/lpp/lpp_gurobi.c
@@ -74,15 +74,12 @@ static void free_gurobi(gurobi_t *grb)
}
/**
- * Build CPLEX data structure from LPP matrix.
+ * Build Gurobi data structure from LPP matrix.
* @note: The LPP matrix is freed after this step, to save memory.
*/
static void gurobi_construct(gurobi_t *grb)
{
int i, o;
- //int sv_cnt;
- //int *indices;
- //double *startv;
int numcols, numrows, numentries;
int objsen, *matbeg, *matcnt, *matind;
double *obj, *rhs, *matval, *lb;
@@ -103,8 +100,6 @@ static void gurobi_construct(gurobi_t *grb)
colname = obstack_alloc(&obst, numcols * sizeof(*colname));
rowname = obstack_alloc(&obst, numrows * sizeof(*rowname));
vartype = obstack_alloc(&obst, numcols * sizeof(*vartype));
- //indices = obstack_alloc(&obst, numcols * sizeof(*indices));
- //startv = obstack_alloc(&obst, numcols * sizeof(*startv));
matbeg = obstack_alloc(&obst, numcols * sizeof(*matbeg));
matcnt = obstack_alloc(&obst, numcols * sizeof(*matcnt));
matind = obstack_alloc(&obst, numentries * sizeof(*matind));
@@ -113,8 +108,7 @@ static void gurobi_construct(gurobi_t *grb)
sense = obstack_alloc(&obst, numrows * sizeof(*sense));
o = 0;
- //sv_cnt = 0;
- /* fill the CPLEX matrix*/
+ /* fill the Gurobi matrix*/
for (i = 0; i < numcols; ++i) {
lpp_name_t *curr_var = lpp->vars[1+i];
@@ -166,7 +160,7 @@ static void gurobi_solve(gurobi_t *grb)
double iterations;
/* Set the time limit appropriately */
- if(lpp->time_limit_secs > 0.0) {
+ if (lpp->time_limit_secs > 0.0) {
error = GRBsetdblparam(grb->modelenv, GRB_DBL_PAR_TIMELIMIT, lpp->time_limit_secs);
check_gurobi_error(grb, error);
}
@@ -206,7 +200,7 @@ static void gurobi_solve(gurobi_t *grb)
error = GRBgetdblattrarray(grb->model, GRB_DBL_ATTR_X, 0, numcols,
values);
check_gurobi_error(grb, error);
- for(i=0; i<numcols; ++i) {
+ for (i=0; i<numcols; ++i) {
lpp->vars[1+i]->value = values[i];
lpp->vars[1+i]->value_kind = lpp_value_solution;
}