104b8f2e7a7eed9a04aa4f5ea32be22995149a25
[libfirm] / ir / lpp / lpp_solvers.c
1 /*
2  * Copyright (C) 2005-2011 University of Karlsruhe.  All right reserved.
3  *
4  * This file is part of libFirm.
5  *
6  * This file may be distributed and/or modified under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation and appearing in the file LICENSE.GPL included in the
9  * packaging of this file.
10  *
11  * Licensees holding valid libFirm Professional Edition licenses may use
12  * this file in accordance with the libFirm Commercial License.
13  * Agreement provided with the Software.
14  *
15  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17  * PURPOSE.
18  */
19
20 /**
21  * @file
22  * @author  Sebastian Hack
23  */
24 #include "config.h"
25
26 #include "lpp_solvers.h"
27 #include "lpp_cplex.h"
28 #include "lpp_gurobi.h"
29
30 lpp_solver_t lpp_solvers[] = {
31 #ifdef WITH_CPLEX
32         { lpp_solve_cplex,   "cplex",   1 },
33 #endif
34 #ifdef WITH_GUROBI
35         { lpp_solve_gurobi,  "gurobi",  1 },
36 #endif
37         { NULL,              NULL,      0 }
38 };
39
40 lpp_solver_func_t *lpp_find_solver(const char *name)
41 {
42         int i;
43
44         for(i = 0; lpp_solvers[i].solver != NULL; i++)
45                 if(strcmp(lpp_solvers[i].name, name) == 0)
46                         return lpp_solvers[i].solver;
47
48         return NULL;
49 }