I am trying to play with some linear programming examples of Mathematica as ExampleData[{"LinearProgramming", "blend"}, "Equations"]. It gives me the MPS format of the samples. How can I change them?


One thing you can do is to import in the ConstraintMatrix form.

 Import["ExampleData/afiro.mps", "ConstraintMatrix"]

This gives a SparseArray object, which can be turned back into a regular matrix format using Normal. Some other possible manipulations of the MPS data are discussed here.

  • $\begingroup$ Could you please show me how I can use the Normal and after changing it how having new SparseArray again? $\endgroup$ – Alex May 6 '13 at 17:52
  • 1
    $\begingroup$ After applying Normal it is a matrix of values and you can do anything with it you desire. If you name it (say m) then you can get back to sparse form by SparseArray[m]. $\endgroup$ – bill s May 6 '13 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.