bearch: Disallow passing Projs to get_irn_ops().
[libfirm] / ir / lpp / lpp_cplex.c
index 2bcd7ff..636645e 100644 (file)
@@ -1,20 +1,6 @@
 /*
- * Copyright (C) 2005-2011 University of Karlsruhe.  All right reserved.
- *
  * This file is part of libFirm.
- *
- * This file may be distributed and/or modified under the terms of the
- * GNU General Public License version 2 as published by the Free Software
- * Foundation and appearing in the file LICENSE.GPL included in the
- * packaging of this file.
- *
- * Licensees holding valid libFirm Professional Edition licenses may use
- * this file in accordance with the libFirm Commercial License.
- * Agreement provided with the Software.
- *
- * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE.
+ * Copyright (C) 2012 University of Karlsruhe.
  */
 
 /**
@@ -23,8 +9,10 @@
  */
 #include "config.h"
 
-#ifdef WITH_CPLEX
 #include "lpp_cplex.h"
+#include "error.h"
+
+#ifdef WITH_CPLEX
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -85,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;
@@ -220,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 */
@@ -277,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