aboutsummaryrefslogtreecommitdiffstats
path: root/native/include/linprog
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2012-08-07 07:09:21 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-02-12 06:49:40 -0500
commitf79777a2c66301c6b8f7ec757f02b4b13e640d94 (patch)
tree9e37d92fd2ba0e94241ac133352f1f469454580d /native/include/linprog
parentc2c3126de5fc548db5821081af265bb8cf69cebd (diff)
Add GLPK Integration
Add a bridge to the GLPK library. Availability is auto-discovered by the build system. Most of the code is solver-agnostic.
Diffstat (limited to 'native/include/linprog')
-rw-r--r--native/include/linprog/glpk.h8
-rw-r--r--native/include/linprog/solver.h15
2 files changed, 23 insertions, 0 deletions
diff --git a/native/include/linprog/glpk.h b/native/include/linprog/glpk.h
new file mode 100644
index 0000000..fa2aec9
--- /dev/null
+++ b/native/include/linprog/glpk.h
@@ -0,0 +1,8 @@
1#ifndef LINPROG_GLPK_H
2#define LINPROG_GLPK_H
3
4#include "linprog/solver.h"
5
6Solution *glpk_solve(const LinearProgram& lp, unsigned int max_num_vars);
7
8#endif
diff --git a/native/include/linprog/solver.h b/native/include/linprog/solver.h
index 15e37e6..0129903 100644
--- a/native/include/linprog/solver.h
+++ b/native/include/linprog/solver.h
@@ -24,6 +24,21 @@ public:
24 } 24 }
25}; 25};
26 26
27#if defined(CONFIG_HAVE_GLPK)
27 28
29#include "linprog/glpk.h"
30#define linprog_solve(lp, vars) glpk_solve((lp), (vars))
31
32#elif defined(CONFIG_HAVE_CPLEX)
33
34#include "linprog/cplex.h"
35#define linprog_solve(lp, vars) cplex_solve((lp), (vars))
36
37#else
38
39#warning No LP solver available.
40#define linprog_solve(lp, vars) assert(0)
41
42#endif
28 43
29#endif 44#endif