Dear all,

I would like to try a specialized algorithm for my (MI)LP problem but the library that implements it requires to specify the model in a structured row-wise or column-wise matrix form, where diagonal blocks and linking constraints are marked explicitly, and the task of creating such a matrix getting indexes right seems daunting.

I already have a cplex/concert c++ implementation for the same problem that I find easy to follow. I wonder what is the easiest way to generate a matrix representation from that. For one, the C++ Concert library does not seem to have a IloLPMatrix class as in Java and .Net's versions.

More generally, if I were to write a model in matrix format, structured or otherwise, from scratch I'd be using a few containers to represent constraints and variables and interpret the indexes of the LP matrix, in a way similar to concert's. Something like

Var x = new VarArray(N,T); // NxT matrix of variables x_{nt}
Var y = new VarArray(M,T); // MxT matrix of variables y_{mt}
Model foo;
// if I need the index of y_{mt} in a matrix representation I do y[n][t].getIndex() or something like that

I have a home-brew old C library that does that but it's kind of hackish, and uses C99 features so it's likely I cannot mix it freely with the rest of c++ code if needed. I realize this could be done with vectors and arrays as well, and possibly some classes to add syntactic sugar, but I wonder if there's something already done which provides better abstraction and is possibly more efficient at mapping indexes.

Do you know of any free C/C++ modelling library that allows to create a model via object instantiation and map it to a matrix representation?


asked 11 Jul '15, 12:25

Andrea%20T's gravatar image

Andrea T
accept rate: 0%

COIN-OR has FlopC++ (no longer maintained, AFAIK) and Rehearse (a new project).


answered 16 Jul '15, 00:07

Matthew%20Saltzman's gravatar image

Matthew Salt... ♦
accept rate: 17%

You may want to look at existing modeling extensions which expose block structure like StochJuMP, SML, or Pyomo.


answered 18 Jul '15, 02:08

Miles's gravatar image

accept rate: 0%

I knew about SML, but Pyomo is a very welcomed news!

(21 Jul '15, 03:01) Andrea T
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 11 Jul '15, 12:25

Seen: 1,210 times

Last updated: 21 Jul '15, 03:01

OR-Exchange! Your site for questions, answers, and announcements about operations research.