<div dir="ltr">HiĀ <span style="font-size:12.8px">Felix,</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If you are familiar with the Python language, the PuLP (<a href="https://pythonhosted.org/PuLP/index.html">https://pythonhosted.org/PuLP/index.html</a>) package does exactly that. After modeling the problem in a more natural fashion, very similar to the one you describe in the Gurobi API, you can either call CBC from Python or use it to write a file that describes the problem. You can write the problem as a .mps or a .lp, both formats are compatible with CBC.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Another option is JuMP (<a href="https://jump.readthedocs.org/en/latest/">https://jump.readthedocs.org/en/latest/</a>), a very similar package for the Julia language.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Cheers,</span></div><div><span style="font-size:12.8px">Mario Souto.</span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-29 0:30 GMT-02:00 Stefan Vigerske <span dir="ltr"><<a href="mailto:stefan@math.hu-berlin.de" target="_blank">stefan@math.hu-berlin.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
there are FlopC++ (<a href="https://projects.coin-or.org/FlopC++" rel="noreferrer" target="_blank">https://projects.coin-or.org/FlopC++</a>) and Rehearse (<a href="https://projects.coin-or.org/Rehearse" rel="noreferrer" target="_blank">https://projects.coin-or.org/Rehearse</a>) that should let you do something like that.<br>
FlopC++ is no longer developed, but might still be working.<br>
<br>
Stefan<div><div class="h5"><br>
<br>
On 01/28/2016 07:50 PM, Felix Brandt wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Dear all,<br>
<br>
I'm looking for a way to describe the constraints of a CBC model in a<br>
more natural way than by using row/column indices. Gurobi has a simple<br>
API where vars and constraints can be specified directly, looking like<br>
the following:<br>
<br>
Model model;<br>
Variable var1 = model.addVar();<br>
Variable var2 = model.addVar();<br>
model.addConstr (2 * var1 + var2 <= 5);<br>
<br>
I wonder if something similar exists for CBC (maybe in other CoinOR<br>
projects)? I searched the web and this ML but found nothing so far.<br>
Maybe I'm just using the wrong keywords.<br>
Technically, this should not be that hard as the objects can just be<br>
wrappers for the matrix indices and the matrix can be rendered after all<br>
constraints have been added. So, before I reinvent the wheel I thought I<br>
better ask here ;) Thanks!<br>
<br>
Cheers,<br>
Felix<br>
<br>
<br>
<br></div></div>
_______________________________________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/cbc" rel="noreferrer" target="_blank">http://list.coin-or.org/mailman/listinfo/cbc</a><br>
<br><span class="HOEnZb"><font color="#888888">
</font></span></blockquote><span class="HOEnZb"><font color="#888888">
<br>
<br>
-- <br>
<a href="http://www.gams.com/~stefan" rel="noreferrer" target="_blank">http://www.gams.com/~stefan</a><br>
_______________________________________________<br>
Cbc mailing list<br>
<a href="mailto:Cbc@list.coin-or.org" target="_blank">Cbc@list.coin-or.org</a><br>
<a href="http://list.coin-or.org/mailman/listinfo/cbc" rel="noreferrer" target="_blank">http://list.coin-or.org/mailman/listinfo/cbc</a><br>
</font></span></blockquote></div><br></div>