Linear Programming library for iOS

2019-04-22 10:01发布

问题:

I am looking for an iOS library that enables solving LP, IP, BIP, MIP for an application I am developing. I've found GLPK but have no idea how to compile it for iOS, and after searching the web for some time, I did not find anything interesting... I'd appreciate if someone can help me how to compile GLPK for iOS or either knows of some open source LP solver for iOS.

回答1:

I used GMP (GNU Multiple Precision Arithmetic Library) for iOS development, what is basically a C based static library for various mathematical purpose. I had to do calculation on a big matrix, so I needed a library that support arbitrary precision. I installed it with MacPorts. MacPorts is a terminal based package management system on Mac, like yum or apt on Debian. After you installed the appropriate static library as I installed GMPL with "sudo port install gmp", after that you can check out in Xcode the static library under "Link Binary With Library" section. Press the "Add Other.." button, go the the /opt/local/lib folder, this is the default installation folder for MacPorts, and check out your static library. Add some header to your code, and voila, you can do your computations.

In the picture below you can see libgsl as well, that is the GNU Scientific Library, I would recommend it too.