[FlopCpp] getStatus return false OPTIMAL

Tim Hultberg Tim.Hultberg at eumetsat.int
Thu May 10 09:37:40 EDT 2007


First make sure that the wrong status comes from Cbc by trying
instance->isProvenOptimal()
Then post the question to the Cbc mailing list.

You can also try your model with cplex as solver (i.e not via MPS
file)
and Cbc on the MPS file...

Cheers, Tim

>>> "Vishy Jeet" <vishv.jeet at gmail.com> 09/05/2007 18:32 >>>
Hi Everyone,

I am running the following little program. My class "dir" has a set of
binary variables called "X".
After minimization getStatus() return "OPTIMAL" while Xs are displayed
as
fractional. When I
solve the mipModel.mps using CPLEX: it tells me the problem is
infeasible! I
don't understand
why cbc solver is returning false message OPTIMAL. Any help on this is
appreciated.

regards,
vishy


#include "mathModel.h"

typedef enum {SUCCESS = 0, FAILURE = -1};

int main() {
  int retcode = FAILURE;
  container c;                                       /* container
class
object that will contains all data*/
  c.readData("c:/dataLocation");
  dir instance(c);                                /* Instantiate an
object
of dir class */
  instance.minimize();
  retcode = instance.getStatus();
  if (MP_model::OPTIMAL == retcode){
    instance->writeMps("mipModel", "mps", 1.0);
    instance.X.display("instance (X)");
    cout<<"obj val:="<<instance->getObjValue()<<endl;
  }
  return SUCCESS;
}// main


More information about the FlopCpp mailing list