[Coin-discuss] OSI, CLP pivot

Matthew Galati magh at lehigh.edu
Wed May 17 17:39:33 EDT 2006


Hi John. Thanks! This is much better to be able to just get the sparse row.

The other bottleneck in our codes is related to the enable and disable 
simplex interface. It's too messy to strip out the codes and give you a 
small sample, but I can tell you the sequence of calls that we use which 
involve the simplex interface. We did our best to minimize the number of 
calls to enable/disable - but it is still too often. If you have a 
special option that could allow us to call this less often, that would 
be great.

{
    //solve an LP
   
    //get basis header
    clp->enableSimplexInterface(false);
    clp->getBasics(head);
    clp->disableSimplexInterface();

    //save warm start
      CoinWarmStartBasis * ws =
    dynamic_cast<CoinWarmStartBasis*>(si->getWarmStart());

    for(...){

      //go back to original ws
      clp->setWarmStart(ws);
      clp->resolve()
      ...

      //get basis header
      clp->enableSimplexInterface(false);
      clp->getBasics(head);
      clp->disableSimplexInterface();

      clp->enableSimplexInterface(false);
      while(...){
          osiclp->getBInvARow(row, abar1, sbar1);
          for(...)
            osiclp->getBInvARow(row, abar2, sbar2);
            clp->pivot(in_col, out_col, out_status);
            clp->disableSimplexInterface();
            clp->enableSimplexInterface(false);
          }
       }
       clp->disableSimplexInterface();     
       ...
    }
}

Thanks,
Matt


>Matt,
>
>Done - example code at line 1366 of Osi/test/OsiClpSolverInterfaceTest.cpp.
>
>You get the underlying CoinIndexedVectors so you can just get nonzeros.
>Zeroing out the contents was optional but may be slightly faster.
>
>John
>
>
>  
>



More information about the Coin-discuss mailing list