Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
9360f8e6
Commit
9360f8e6
authored
Dec 08, 2015
by
Christoph Mallon
Browse files
lpp: Cleanup.
parent
621b7436
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/lpp/lpp_solvers.c
View file @
9360f8e6
...
...
@@ -12,7 +12,13 @@
#include "lpp_gurobi.h"
#include "util.h"
lpp_solver_t
lpp_solvers
[]
=
{
typedef
struct
lpp_solver_t
{
lpp_solver_func_t
*
solver
;
char
const
*
name
;
int
n_instances
;
}
lpp_solver_t
;
static
lpp_solver_t
const
lpp_solvers
[]
=
{
#ifdef WITH_CPLEX
{
lpp_solve_cplex
,
"cplex"
,
1
},
#endif
...
...
@@ -22,16 +28,15 @@ lpp_solver_t lpp_solvers[] = {
{
NULL
,
NULL
,
0
}
};
lpp_solver_func_t
*
lpp_find_solver
(
c
onst
char
*
name
)
lpp_solver_func_t
*
lpp_find_solver
(
c
har
const
*
const
name
)
{
int
i
;
if
(
name
[
0
]
==
'\0'
)
return
lpp_solvers
[
0
].
solver
;
for
(
i
=
0
;
lpp_solvers
[
i
].
solver
!=
NULL
;
i
++
)
if
(
streq
(
lpp_solvers
[
i
].
name
,
name
))
return
lpp_solvers
[
i
].
solver
;
for
(
lpp_solver_t
const
*
i
=
lpp_solvers
;
i
->
solver
;
++
i
)
{
if
(
streq
(
i
->
name
,
name
))
return
i
->
solver
;
}
return
NULL
;
}
ir/lpp/lpp_solvers.h
View file @
9360f8e6
...
...
@@ -7,24 +7,16 @@
* @file
* @author Sebastian Hack
*/
#ifndef LPP_LPP_SOLVER_H
#define LPP_LPP_SOLVER_H
#ifndef LPP_LPP_SOLVER
S
_H
#define LPP_LPP_SOLVER
S
_H
#include "lpp.h"
typedef
void
(
lpp_solver_func_t
)(
lpp_t
*
lpp
);
typedef
struct
{
lpp_solver_func_t
*
solver
;
const
char
*
name
;
int
n_instances
;
}
lpp_solver_t
;
extern
lpp_solver_t
lpp_solvers
[];
typedef
void
lpp_solver_func_t
(
lpp_t
*
lpp
);
/**
* Find a solver for a given name.
*/
lpp_solver_func_t
*
lpp_find_solver
(
c
onst
char
*
name
);
lpp_solver_func_t
*
lpp_find_solver
(
c
har
const
*
name
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment