如何复制SoPlex模型?

时间:2019-04-01 20:26:10

标签: c++ scip

我正在使用SoPlex设置lp并解决它。然后,我尝试制作原始lp的副本并进行修改。我的代码如下:

int main()
{
   using namespase soplex;
   SoPlex spx;
   // add columns
   // add rows
   auto status = spx.optimize();

   SoPlex copy(spx);
   // modify some columns

   status = copy.optimize();

   return 0;
}

当我在valgrind中运行代码时,我注意到SoPlex复制构造函数中的方法分配的内存没有释放。

SoPlex内是否存在内存泄漏?或者我使用不正确吗?

1 个答案:

答案 0 :(得分:1)

您正在正确使用复印功能。实际上,SoPlex中确实存在内存泄漏,将在下一版本中修复。

同时,您可以尝试将此补丁用于SoPlex-4.0.1:

<div>
  <div class="top">
    <center>
      <h1 class="profile">Ticket #123461</h1>
    </center>
  </div>

  <hr>

  <div class="table">
    <div class="tr">
      <div class="td"><b>Ticket #</b></div>
      <div class="td"><b>Username</b></div>
      <div class="td"><b>Name</b></div>
      <div class="td"><b>Residence</b></div>
      <div class="td"><b>Issue</b></div>
      <div class="td"><b>Date</b></div>
      <div class="td"><b>Appointment Time</b></div>
    </div>
    <div class="tr">
      <div class="td">123461</div>
      <div class="td">username</div>
      <div class="td">John Doe</div>
      <div class="td">dorm 5</div>
      <div class="td">WiFi not working</div>
      <div class="td">06/01/19</div>
      <div class="td">12:00 PM-12:50 PM</div>
    </div>
  </div><br>
  <hr>
  <p>
  </p>
  <center>
    <h2>Issue Description</h2>
  </center>
  <center>In fermentum facilisis lorem in pharetra. Fusce massa arcu, tincidunt at arcu sed, pellentesque volutpat augue. Curabitur viverra mauris id magna ultricies tristique vitae nec sapien. Nam aliquet pulvinar tincidunt. Phasellus molestie in tellus vitae
    pharetra. Nunc facilisis mi tincidunt turpis elementum sodales. Vivamus sed molestie tellus, condimentum feugiat metus.</center><br>
</div>



<!-- Footer div -->
<div class="footer">
  <style>
    div.footer {
      margin: auto;
      text-align: center;
    }