[Coin-discuss] OsiCpx and writeMps

Matthew Galati Matthew.Galati at sas.com
Sat Jun 23 11:45:24 EDT 2007


If I do the following (with OsiCpx), my integers don't show up in MPS file (it gives the continuous relaxation). Am I using it wrong? Or a bug? 

Works fine for OsiClp.

Thanks,
Matt


// --------------------------------------------------------------------- //
void DecompAlgo::createFullMps(const string fileName){

    //
    // ---
    // --- Construct the full model by combining:
    // ---   [A' ,b' ] modelRelax
    // ---   [A'',b''] modelCore
    // ---
    int i;
    OsiIpSolverInterface * si = new OsiIpSolverInterface();
    si->loadProblem(*m_modelCore->M,
                    &m_modelCore->colLB[0],
                    &m_modelCore->colUB[0],
                    m_app->m_model.objCoeff,
                    &m_modelCore->rowLB[0],
                    &m_modelCore->rowUB[0]);

    //or, could use bottomAppendPackedMatrix
    for(i = 0; i < m_modelRelax->getNumRows(); i++){
        si->addRow(m_modelRelax->M->getVector(i),
                   m_modelRelax->rowLB[i],
                   m_modelRelax->rowUB[i]);
    }

    int n_integerVars = static_cast<int>(m_modelRelax->integerVars.size());
    for(i = 0; i < n_integerVars; i++){
        si->setInteger(m_modelRelax->integerVars[i]);
    }

    si->writeMps(fileName.c_str());
    UTIL_DELPTR(si);
}




More information about the Coin-discuss mailing list