# Generic modelling C/C++ library a la concert

 1 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; foo.add(x); foo.add(y). // 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? TIA asked 11 Jul '15, 12:25 Andrea T 384●4●18 accept rate: 0%

 1 COIN-OR has FlopC++ (no longer maintained, AFAIK) and Rehearse (a new project). answered 16 Jul '15, 00:07 Matthew Salt... ♦ 4.7k●3●10 accept rate: 17%
 1 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 260●3●8 accept rate: 0% I knew about SML, but Pyomo is a very welcomed news! (21 Jul '15, 03:01) Andrea T
 toggle preview community wiki

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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

Tags:

×46
×30
×21