<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hello Felix,<div class=""><br class=""></div><div class="">There is also CMPL (Coin Mathematical Programming Language) -> <a href="http://www.coin-or.org/projects/Cmpl.xml" class="">http://www.coin-or.org/projects/Cmpl.xml</a> which could be interesting for you. </div><div class=""><br class=""></div><div class="">E.g. the diet problem looks in CMPL like follows:</div><div class=""><br class=""></div><div class=""><i class="">parameters:<br class=""><span class="Apple-tab-span" style="white-space:pre">      </span>NUTR := set("A","B1", "B2", "C");<br class=""><span class="Apple-tab-span" style="white-space:pre">      </span>FOOD := set("BEEF", "CHK", "FISH", "HAM", "MCH", "MTL", "SPG", "TUR");<br class=""><span class="Apple-tab-span" style="white-space:pre"> </span><br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>#cost per package<br class=""><span class="Apple-tab-span" style="white-space:pre">      </span>costs[FOOD] := ( 3.19, 2.59, 2.29, 2.89, 1.89, 1.99, 1.99, 2.49 );<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>#provision of the daily requirements for vitamins in percentages <br class=""><span class="Apple-tab-span" style="white-space:pre"> </span>vitamin[NUTR, FOOD] := ( (60, 8, 8, 40, 15, 70, 25, 60) ,<br class=""><span class="Apple-tab-span" style="white-space:pre">                              </span> <span class="Apple-tab-span" style="white-space:pre">      </span>  (20, 0, 10, 40, 35, 30, 50, 20) ,<br class=""><span class="Apple-tab-span" style="white-space:pre">                               </span> <span class="Apple-tab-span" style="white-space:pre">      </span>  (10, 20, 15, 35, 15, 15, 25, 15),<br class=""><span class="Apple-tab-span" style="white-space:pre">                               </span> <span class="Apple-tab-span" style="white-space:pre">      </span>  (15, 20, 10, 10, 15, 15, 15, 10)<br class=""><span class="Apple-tab-span" style="white-space:pre">                </span>     <span class="Apple-tab-span" style="white-space:pre">        </span>       <span class="Apple-tab-span" style="white-space:pre"> </span>);<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>#weekly vitamin requirements<br class=""><span class="Apple-tab-span" style="white-space:pre">   </span>vitMin[NUTR]:= (700,700,700,700);<br class="">variables:<br class=""><span class="Apple-tab-span" style="white-space:pre">       </span>x[FOOD]: integer[2..10];<br class=""><br class="">objectives:<br class=""><span class="Apple-tab-span" style="white-space:pre">  </span>cost: costs[]T * x[]->min;<br class=""><br class="">constraints:<br class=""><span class="Apple-tab-span" style="white-space:pre">    </span># capacity restriction <br class=""><span class="Apple-tab-span" style="white-space:pre">   </span>vitamin[,] * x[] >= vitMin[];</i></div><div class=""><br class=""></div><div class="">CMPL executes CBC (and other solvers) directly.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Cheers,</div><div class=""><br class=""></div><div class="">Mike</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Am 28.01.2016 um 19:50 schrieb Felix Brandt <<a href="mailto:brandt@fzi.de" class="">brandt@fzi.de</a>>:</div><br class="Apple-interchange-newline"><div class="">Dear all,<br class=""><br class="">I'm looking for a way to describe the constraints of a CBC model in a more natural way than by using row/column indices. Gurobi has a simple API where vars and constraints can be specified directly, looking like the following:<br class=""><br class="">Model model;<br class="">Variable var1 = model.addVar();<br class="">Variable var2 = model.addVar();<br class="">model.addConstr (2 * var1 + var2 <= 5);<br class=""><br class="">I wonder if something similar exists for CBC (maybe in other CoinOR projects)? I searched the web and this ML but found nothing so far. Maybe I'm just using the wrong keywords.<br class="">Technically, this should not be that hard as the objects can just be wrappers for the matrix indices and the matrix can be rendered after all constraints have been added. So, before I reinvent the wheel I thought I better ask here ;) Thanks!<br class=""><br class="">Cheers,<br class="">Felix<br class=""><br class="">_______________________________________________<br class="">Cbc mailing list<br class=""><a href="mailto:Cbc@list.coin-or.org" class="">Cbc@list.coin-or.org</a><br class="">http://list.coin-or.org/mailman/listinfo/cbc<br class=""></div></blockquote></div><br class=""></div></body></html>