0
Answered

mp linprog support

Michal Kvasnicka 1 year ago • updated by Mark Stone 4 weeks ago 3

Is there any possibility to use matlab function linprog with mp class?

Answered

After quick evaluation - I think it is impossible at the moment.

The linprog uses a lot of compiled p-code functions, hard-coded to double precision only.

See for example this directory: [matlab root]/toolbox/optim/+optim/+algorithm/ 

It contains all main solvers, and all of them are stored as unmodifiable p-code.


Optimization routines are of high demand and we consider to add more homegrown functionality in this area.

The only issue is that it takes really long time to develop full-featured solver(s), test them and maintain. Basically we must re-write optimization toolbox from scratch without having its source code.

Hi Pavel,

I desperately need any multi-precision linprog matlab code, because my optimization problem has a very specific numerical behavior. Now, I have a simple dual-simplex algorithm based code, which works "well".

Could you help me to modify the attached pure Matlab code LinProg.m to the efficient mp-like code?


LinProg.m

Hi Michal,


From the first glance conversion to mp is trivial for this script. 


Basically you only need to convert standard arrays to mp-type. 

So that just add 'mp' as last argument to every call to 'zeros', 'eye', etc. e.g.:


zeros(...) - > zeros(...,'mp')
eye(...) - > eye(...,'mp')
...

Also, of course, make sure input parameters to LinProg generate mp-values.


Let me know if you encounter any other issues.