valueset: Remove the unused link field.
[libfirm] / ir / lpp / lpp_gurobi.c
index fe0cb3a..6b043e4 100644 (file)
@@ -71,10 +71,10 @@ static gurobi_t *new_gurobi(lpp_t *lpp)
         * The only thing gurobi sanely supports is giving a string with a filename
         * :-( ...so we use /tmp/firm_gurobi.log as a temporary measure...
         */
-#if 0
-       error = GRBsetlogfile(grb->env, lpp->log);
-       check_gurobi_error(grb, error);
-#endif
+       if (lpp->log != stdout && lpp->log != stderr) {
+               error = GRBsetintparam(grb->env, GRB_INT_PAR_OUTPUTFLAG, 0);
+               check_gurobi_error(grb, error);
+       }
 
        return grb;
 }
@@ -92,19 +92,18 @@ static void free_gurobi(gurobi_t *grb)
  */
 static void gurobi_construct(gurobi_t *grb)
 {
-       const matrix_elem_t *elem;
-       int                  i, o;
-       //int                  sv_cnt;
-       //int                 *indices;
-       //double              *startv;
-       int                  numcols, numrows, numentries;
-       int                  objsen, *matbeg, *matcnt, *matind;
-       double               *obj, *rhs, *matval, *lb;
-       char                 *sense, *vartype;
-       char                 **colname, **rowname;
-       struct obstack       obst;
-       lpp_t                *lpp = grb->lpp;
-       int                  error;
+       int            i, o;
+       //int            sv_cnt;
+       //int           *indices;
+       //double        *startv;
+       int            numcols, numrows, numentries;
+       int            objsen, *matbeg, *matcnt, *matind;
+       double        *obj, *rhs, *matval, *lb;
+       char          *sense, *vartype;
+       char         **colname, **rowname;
+       struct obstack obst;
+       lpp_t         *lpp = grb->lpp;
+       int            error;
 
        numcols    = lpp->var_next-1;
        numrows    = lpp->cst_next-1;
@@ -138,14 +137,6 @@ static void gurobi_construct(gurobi_t *grb)
                colname[i] = (char*) curr_var->name;
                vartype[i] = gurobi_var_encoding[curr_var->type.var_type];
 
-#if 0
-               if (curr_var->value_kind == lpp_value_start) {
-                       panic("start values not supported in gurobi yet");
-                       indices[sv_cnt]  = i;
-                       startv[sv_cnt++] = curr_var->value;
-               }
-#endif
-
                matbeg[i] = o;
                matcnt[i] = 0;
                matrix_foreach_in_col(lpp->m, 1 + i, elem) {
@@ -193,23 +184,6 @@ static void gurobi_solve(gurobi_t *grb)
                check_gurobi_error(grb, error);
        }
 
-       /*
-        * If we have enough time, we instruct cplex to imply some
-        * of its higher order magic to pursue the best solution
-        */
-       if(lpp->emphasis) {
-               /* not implemented */
-       }
-
-       /*
-        * If a bound of the objective function is supplied,
-        * set it accordingly, dependign on minimization or maximization.
-        */
-       if(lpp->set_bound) {
-               //panic("bound not implemented yet");
-               fprintf(stderr, "Warning: gurobi bound not implemented yet\n");
-       }
-
        /* solve */
        error = GRBoptimize(grb->model);
        check_gurobi_error(grb, error);