Hi guys,<br><br><span id="result_box" class="" lang="en"><span class="hps">I'm using</span> <span class="hps">the following</span> <span class="hps">methods</span> <span class="hps">to print</span> <span class="hps">my model</span><span>. (OsiCbcSolverInterface) <br>
<br>MPS:<br>getModel()->solver()->writeMps(filename);<br>LP:<br>getModel()->solver()->writeLp(filename);<br></span><br> <span class="hps">but</span><span>,</span> <span class="hps">after</span> <span class="hps">making a change in</span> <span class="hps">the coefficient</span> <span class="hps">matrix</span> <span class="hps">of</span> <span class="hps">the</span> <span class="hps">constraints</span> <span class="hps">and make</span> <span class="hps">the new</span> <span class="hps">print</span> <span class="hps">file</span> <span class="hps">in</span> <span class="hps">LP format</span> <span class="hps">remains the same</span> <span class="hps">while the</span> <span class="hps">MPS</span> <span class="hps">suffers</span> <span class="hps">the appropriate changes</span><span>.</span><br>
<br> <span class="hps">what do I do</span><span class="">?</span></span><br><br clear="all">i'm using the following methods to chage the coefficient:<br><br><blockquote><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
bool OPT_COIN::chgCoef( int row, int col, double newcoef )<br>{<br> bool ret = true;<br> CbcModel *model = getModel();<br> CoinPackedMatrix *matrix = lp->getMutableMatrixByCol();<br> matrix->modifyCoefficient(row, col, newcoef);<br>
model->synchronizeModel();<br> return ret;<br>}<br></blockquote></blockquote><br>and this:<br><br><blockquote style="margin:0px 0px 0px 6.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote">
/// Get pointer to mutable column-wise copy of matrix<br> inline CoinPackedMatrix * getMutableMatrixByCol() const {<br> return solver_->getMutableMatrixByCol();<br> }<br></blockquote><br><b><br>first MPS:</b><br>
<br>NAME BLANK FREE<br>ROWS<br> N OBJROW<br> L constraint0<br> L constraint1<br>COLUMNS<br> x0 OBJROW 200. constraint0 1. <br> x0 constraint1 -100. <br> x1 OBJROW -20. constraint0 12. <br>
x1 constraint1 1. <br> x2 OBJROW -5. constraint0 9. <br>RHS<br> RHS constraint0 100. <br>BOUNDS<br> BV BOUND x0 1. <br> UI BOUND x1 35. <br> UP BOUND x2 1e+10<br>
ENDATA<br><br><b>second MPS (after change):</b><br><br>NAME BLANK FREE<br>ROWS<br> N OBJROW<br> L constraint0<br> L constraint1<br>COLUMNS<br> x0 OBJROW 200. constraint0 15. <br> x0 constraint1 15. <br>
x1 OBJROW -20. constraint0 15. <br> x1 constraint1 15. <br> x2 OBJROW -5. constraint0 15. <br>RHS<br> RHS constraint0 100. <br>BOUNDS<br> BV BOUND x0 1. <br>
UI BOUND x1 35. <br> UP BOUND x2 1e+10<br>ENDATA<br><br><b>File LP before and after change.:</b><br><br>\Problem name: <br><br>Minimize<br>OBJROW: 200 x0 -20 x1 -5 x2<br>Subject To<br>constraint0: x0 + 12 x1 + 9 x2 <= 100<br>
constraint1: -100 x0 + x1 <= 0<br>Bounds<br> 0 <= x0 <= 1<br> 0 <= x1 <= 35<br> 0 <= x2 <= 10000000000<br>Integers<br>x0 x1 <br>End<br><br>-- <br><table cellpadding="2" cellspacing="2" width="591" border="0">
<tbody><tr><td style="font-family:Arial,Helvetica,sans-serif;font-size:11px;color:rgb(102,102,102)" rowspan="2" valign="middle" width="150"><b>Ivan Meireles Costa</b><br>
<b>Estágiario em otimização</b><br> <b>Telefone:</b> 31 3508-1323<br> <b>Celular:</b> 31 9869-6987<br>
</td>
<td rowspan="2" width="19"><img src="http://www.gapso.com.br/wp-content/uploads/2011/03/pontilhado.jpg" height="150" width="19" border="0"></td>
<td height="57" width="372"><img src="http://www.gapso.com.br/wp-content/uploads/2011/03/logo_gapso_sig.jpg" height="57" width="372"></td>
</tr>
<tr>
<td style="font-family:Arial,Helvetica,sans-serif;font-size:9px;color:rgb(102,102,102)" valign="top" width="372">
A Gapso é a escolha das empresas que buscam se diferenciar pela gestão da complexidade.<br>
Desenvolvemos sistemas analíticos de planejamento, que auxiliam a definir estratégias,<br>
         planejar operações, reduzir riscos e lidar melhor com as incertezas do futuro. <br>
<a href="http://www.gapso.com.br/" target="_blank">www.gapso.com.br</a></td></tr></tbody></table><br>