This is the back end solver for Obelisk, which is socialist economic planning software. It takes the data generated by the front end and uses it to find a plan (set of activities) that is anticipated to be the best while still being totally sustainable.
Algorithmically, it uses an active set algorithm for quadratic programming. Each iteration solves the corresponding KKT matrix using an "inverse" (in quotes because of the possibility of a singular matrix). To do that, I had to implement gaussian elimination directly from BLAS because LU decomp doesn't handle singular matricies. The initial solution is found using coin-or CLP.
To compile this, you will need to have BLAS, coin-or CLP, pqxx and obelisk-frontend set up. The command, assuming you picked OpenBLAS and are using g++, is:
g++ obelisk-backend.cpp obelisk-quadratic-solve.cpp -O3 -lClp -lCoinUtils -lClpSolver -lpqxx -lopenblas -o obelisk-backend
Then run it with:
./obelisk-backend [database name] [database password]
Tested on Debian.
It will be able to handle many thousands of recipes and resources using a reasonable amount of RAM, and for larger problems everything intensive except the CLP solve is a good candidate for distributed computing. A large problem using gigabytes of RAM should only take a couple hours or so.