• Subject: Re: [?? Probable Spam] Lua and Linear Programming
• From: Olivier Hamel <evilpineapple@...>
• Date: Wed, 20 May 2009 09:06:25 -0400

```Geoff Leyland wrote:
```
```Hi List,

```
I've written a binding to three free LP and MILP [1] solvers: CLP [2], CBC [3] and lpsolve [4]. It includes just enough symbolic processing to work out if if an expression is linear, and a first draft of a method for composing models.
```Documentation is included.

Examples:

x, y = rima.R"x, y"
e = x * y
print(rima.E(e * x * y))                                 --> x^2*y^2

x, y = rima.R"x, y"
print(rima.E(x, { x=y^2, y=5 }))                 --> 25

Simple LP:

local x, y = rima.R"x, y"
local f = rima.formulation:new()
f:set_objective(x + y, "maximise")
f:set{ ["x, y"] = rima.positive() }
local r = f:solve("clp")
print(r.variables.x.p, r.variables.y.p)        --> 1 1

```
```

```
Thanks to everyone who helped me come up with a name and Steve Donovan, from whom I've stolen a few good ideas.
```
Cheers,
Geoff

[1] http://en.wikipedia.org/wiki/Linear_programming
[2] https://projects.coin-or.org/Clp
[3] https://projects.coin-or.org/Cbc
[4] http://sourceforge.net/projects/lpsolve

```
Neat! I'll certainly take a look. As for stealing good ideas, there's only so much innovation in anything, the best you can do is improve what others have done before you.
```
```