bearch: Disallow passing Projs to get_irn_ops().
[libfirm] / ir / lpp / lpp_cplex.c
index 544e5f8..636645e 100644 (file)
@@ -1,14 +1,18 @@
+/*
+ * This file is part of libFirm.
+ * Copyright (C) 2012 University of Karlsruhe.
+ */
+
 /**
- * Author:      Daniel Grund
- * Date:        02.06.2005
- * Copyright:   (c) Universitaet Karlsruhe
- * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ * @file
+ * @author  Daniel Grund
  */
 #include "config.h"
 
-#ifdef WITH_CPLEX
-
 #include "lpp_cplex.h"
+#include "error.h"
+
+#ifdef WITH_CPLEX
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -69,15 +73,14 @@ static void free_cpx(cpx_t *cpx)
  */
 static void cpx_construct(cpx_t *cpx)
 {
-       const matrix_elem_t *elem;
-       int                  i, o, sv_cnt;
-       int                  numcols, numrows, numentries;
-       int                  objsen, *matbeg, *matcnt, *matind, *indices;
-       double               *obj, *rhs, *matval, *lb, *ub, *startv;
-       char                 *sense, *vartype;
-       char                 **colname, **rowname;
-       struct obstack       obst;
-       lpp_t                *lpp = cpx->lpp;
+       int            i, o, sv_cnt;
+       int            numcols, numrows, numentries;
+       int            objsen, *matbeg, *matcnt, *matind, *indices;
+       double        *obj, *rhs, *matval, *lb, *ub, *startv;
+       char          *sense, *vartype;
+       char         **colname, **rowname;
+       struct obstack obst;
+       lpp_t         *lpp = cpx->lpp;
 
        numcols    = lpp->var_next-1;
        numrows    = lpp->cst_next-1;
@@ -153,7 +156,7 @@ static void cpx_construct(cpx_t *cpx)
        chk_cpx_err(cpx);
 
        obstack_free(&obst, NULL);
-       free_lpp_matrix(lpp);
+       lpp_free_matrix(lpp);
 }
 
 static void cpx_solve(cpx_t *cpx)
@@ -204,9 +207,9 @@ static void cpx_solve(cpx_t *cpx)
        // CPXsetintparam (cpx->env, CPX_PARAM_SCRIND, CPX_ON);
 
        /* solve */
-       timing_ticks(&tvb);
+       timing_ticks(tvb);
        cpx->status = CPXmipopt(cpx->env, cpx->prob);
-       timing_ticks(&tva);
+       timing_ticks(tva);
        chk_cpx_err(cpx);
 
        /* get solution status */
@@ -261,4 +264,12 @@ void lpp_solve_cplex(lpp_t *lpp)
        free_cpx(cpx);
 }
 
+#else
+
+void lpp_solve_cplex(lpp_t *lpp)
+{
+       (void)lpp;
+       panic("libfirm compiled without cplex support");
+}
+
 #endif