[Coin-lpsolver] OsiSimplexInterface::pivot()
    Francois Margot 
    fmargot at andrew.cmu.edu
       
    Tue Apr 27 08:39:57 EDT 2004
    
    
  
I am trying to choose leaving and entering variables when pivoting,
but I am unable to use the OsiSimplexInterface::pivot() method.
I can use OsiSimplexInterface::primalPivotResult(), however.
Here is what I do:
I define                    *si = new OsiClpSolverInterface;
I read an mps file:          si->readMps();
I solve                      si->initialSolve();
I call                       si->enableSimplexInterface(true);
I modify the cost function : si->setObjectiveAndRefresh();
First variant:
---------------------------------------------------------------
I set col_in = -1, direction = -1;
Now, if I call
si->primalPivotResult(col_in, direction, col_out, out_status, t, NULL);
I get that
col_out = -2, out_status = -1;
This is correct and the pivot yields the optimal tableau.
Second variant:
-------------------------------------------------------------
Now if instead of calling si->primalPivotResult(), I define
col_in = -1, col_out = -2, out_status = -1;
and then call
si->pivot(col_in, col_out, out_status);
The program stops with the error message:
pivot: ClpSimplex.cpp:4841 int ClpSimplex::pivot(): Assertion
`fabs(solution_[sequenceOut_]-lowerOut_)<1.0e-7' failed.
If anybody knows what is wrong with the above, I would appreciate to hear
it. I can also send or post the code and mps file, if needed.
Francois
    
    
More information about the Clp
mailing list