Changeset 2019 for trunk/Cbc


Ignore:
Timestamp:
Mar 11, 2014 5:10:15 PM (5 years ago)
Author:
mlubin
Message:

Major cleaning of C interface, more to come

Location:
trunk/Cbc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cbc/src/Cbc_C_Interface.cpp

    r2016 r2019  
    2626#define CBC_EXTERN_C
    2727#include "Coin_C_defines.h"
     28
     29#define CbcGetProperty(T,prop) \
     30COINLIBAPI T COINLINKAGE \
     31Cbc_ ## prop (Cbc_Model *m) \
     32{ \
     33    return m->model_->prop(); \
     34}
    2835
    2936const int  VERBOSE = 0;
     
    227234    if (VERBOSE > 0) printf("%s begin\n", prefix);
    228235
    229     Cbc_Model * model = new Cbc_Model;
     236    Cbc_Model * model = new Cbc_Model();
    230237    OsiClpSolverInterface solver1;
    231238    model->solver_    = &solver1;
     
    234241    CbcMain0(*model->model_);
    235242    model->handler_   = NULL;
    236     model->information_ = NULL;
    237243
    238244    if (VERBOSE > 0) printf("%s return\n", prefix);
     
    255261    fflush(stdout);
    256262    delete model->handler_;
    257 
    258     if (VERBOSE > 1) printf("%s free model->information_\n", prefix);
    259     fflush(stdout);
    260     if (model->information_) free(model->information_);
    261263
    262264    if (VERBOSE > 1) printf("%s delete model\n", prefix);
     
    344346    if (VERBOSE > 1) printf("%s filename = '%s'\n", prefix, filename);
    345347
    346     model->model_->solver()->writeMps(filename, "mps", Cbc_optimizationDirection(model));
     348    model->model_->solver()->writeMps(filename, "mps", Cbc_getObjSense(model));
    347349
    348350    if (VERBOSE > 0) printf("%s return\n", prefix);
    349351    return;
    350352}
    351 /* Integer information */
    352 COINLIBAPI char * COINLINKAGE
    353 Cbc_integerInformation(Cbc_Model * model)
    354 {
    355     const char prefix[] = "Cbc_C_Interface::Cbc_integerInformation(): ";
    356 //  const int  VERBOSE = 1;
    357     if (VERBOSE > 0) printf("%s begin\n", prefix);
    358 
    359     int col;
    360     int numcols = Cbc_getNumCols(model);
    361 
    362     // allocate model->information_ if null
    363     // this is freed in Cbc_deleteModel() if not null
    364     if (!model->information_)
    365         model->information_ = (char *) malloc(numcols * sizeof(char));
    366 
    367     for (col = 0; col < numcols; col++)
    368         if (model->model_->solver()->isContinuous(col))
    369             model->information_[col] = 0;
    370         else
    371             model->information_[col] = 1;
    372 
    373     char * result = model->information_;
    374 
    375     if (VERBOSE > 0) printf("%s return %p\n", prefix, result);
    376     return result;
    377 }
    378 /* Copy in integer information */
    379 COINLIBAPI void COINLINKAGE
    380 Cbc_copyInIntegerInformation(Cbc_Model * model, const char * information)
    381 {
    382     const char prefix[] = "Cbc_C_Interface::Cbc_copyInIntegerInformation(): ";
    383 //  const int  VERBOSE = 1;
    384     if (VERBOSE > 0) printf("%s begin\n", prefix);
    385 
    386     int col;
    387     int numcols = Cbc_getNumCols(model);
    388     for (col = 0; col < numcols; col++)
    389         if (information[col])
    390             model->model_->solver()->setInteger(col);
    391         else
    392             model->model_->solver()->setContinuous(col);
    393 
    394     if (VERBOSE > 0) printf("%s return\n", prefix);
    395 }
    396 /* Drop integer informations */
    397 COINLIBAPI void COINLINKAGE
    398 Cbc_deleteIntegerInformation(Cbc_Model * /*model*/)
    399 {
    400     const char prefix[] = "Cbc_C_Interface::Cbc_deleteIntegerInformation(): ";
    401 //  const int  VERBOSE = 1;
    402     if (VERBOSE > 0) printf("%s begin\n", prefix);
    403 
    404 //  available through
    405 //    OsiClpSolverInterface::setContinuous
    406 //tbd  model->model_->deleteIntegerInformation();
    407     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    408 
    409     if (VERBOSE > 0) printf("%s return\n", prefix);
    410 }
    411 /* Resizes rim part of model  */
    412 COINLIBAPI void COINLINKAGE
    413 Cbc_resize (Cbc_Model * /*model*/, int /*newNumberRows*/,
    414             int /*newNumberColumns*/)
    415 {
    416     const char prefix[] = "Cbc_C_Interface::Cbc_resize(): ";
    417 //  const int  VERBOSE = 1;
    418     if (VERBOSE > 0) printf("%s begin\n", prefix);
    419 
    420 // cannot find this in Cbc, Osi, or OsiClp
    421 //tbd  model->model_->solver()->resize(newNumberRows,newNumberColumns);
    422     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    423 
    424     if (VERBOSE > 0) printf("%s return\n", prefix);
    425 }
     353
    426354/* Deletes rows */
    427355COINLIBAPI void COINLINKAGE
     
    429357{
    430358    const char prefix[] = "Cbc_C_Interface::Cbc_deleteRows(): ";
    431 //  const int  VERBOSE = 1;
    432359    if (VERBOSE > 0) printf("%s begin\n", prefix);
    433360
     
    446373{
    447374    const char prefix[] = "Cbc_C_Interface::Cbc_addRows(): ";
    448 //  const int  VERBOSE = 1;
    449375    if (VERBOSE > 0) printf("%s begin\n", prefix);
    450376
     
    535461}
    536462
    537 /* Number of rows */
    538 COINLIBAPI int COINLINKAGE
    539 Cbc_numberRows(Cbc_Model * model)
    540 {
    541     const char prefix[] = "Cbc_C_Interface::Cbc_numberRows(): ";
    542 //  const int  VERBOSE = 1;
    543     if (VERBOSE > 0) printf("%s begin\n", prefix);
    544 
    545     int result = 0;
    546     result = model->model_->getNumRows();
    547 
    548     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    549     return result;
    550 }
    551 /* Number of columns */
    552 COINLIBAPI int COINLINKAGE
    553 Cbc_numberColumns(Cbc_Model * model)
    554 {
    555     const char prefix[] = "Cbc_C_Interface::Cbc_numberColumns(): ";
    556 //  const int  VERBOSE = 1;
    557     if (VERBOSE > 0) printf("%s begin\n", prefix);
    558 
    559     int result = 0;
    560     result = model->model_->getNumCols();
    561 
    562     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    563     return result;
    564 }
    565 /* Primal tolerance to use */
    566 COINLIBAPI double COINLINKAGE
    567 Cbc_primalTolerance(Cbc_Model * model)
    568 {
    569     const char prefix[] = "Cbc_C_Interface::Cbc_primalTolerance(): ";
    570 //  const int  VERBOSE = 1;
    571     if (VERBOSE > 0) printf("%s begin\n", prefix);
    572 
    573     double result = 0.0;
    574     model->model_->solver()->getDblParam(OsiPrimalTolerance, result) ;
    575 
    576     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    577     return result;
    578 }
    579 COINLIBAPI void COINLINKAGE
    580 Cbc_setPrimalTolerance(Cbc_Model * model,  double value)
    581 {
    582     const char prefix[] = "Cbc_C_Interface::Cbc_setPrimalTolerance(): ";
    583 //  const int  VERBOSE = 1;
    584     if (VERBOSE > 0) printf("%s begin\n", prefix);
    585 
    586     model->model_->solver()->setDblParam(OsiPrimalTolerance, value) ;
    587 
    588     if (VERBOSE > 0) printf("%s return\n", prefix);
    589 }
    590 /* Dual tolerance to use */
    591 COINLIBAPI double COINLINKAGE
    592 Cbc_dualTolerance(Cbc_Model * model)
    593 {
    594     const char prefix[] = "Cbc_C_Interface::Cbc_dualTolerance(): ";
    595 //  const int  VERBOSE = 1;
    596     if (VERBOSE > 0) printf("%s begin\n", prefix);
    597 
    598     double result = 0.0;
    599     model->model_->solver()->getDblParam(OsiDualTolerance, result) ;
    600 
    601     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    602     return result;
    603 }
    604 COINLIBAPI void COINLINKAGE
    605 Cbc_setDualTolerance(Cbc_Model * model,  double value)
    606 {
    607     const char prefix[] = "Cbc_C_Interface::Cbc_setDualTolerance(): ";
    608 //  const int  VERBOSE = 1;
    609     if (VERBOSE > 0) printf("%s begin\n", prefix);
    610 
    611     model->model_->solver()->setDblParam(OsiDualTolerance, value) ;
    612 
    613     if (VERBOSE > 0) printf("%s return\n", prefix);
    614 }
    615 /* Integer tolerance to use */
    616 COINLIBAPI double COINLINKAGE
    617 Cbc_integerTolerance(Cbc_Model * model)
    618 {
    619     const char prefix[] = "Cbc_C_Interface::Cbc_primalTolerance(): ";
    620 //  const int  VERBOSE = 1;
    621     if (VERBOSE > 0) printf("%s begin\n", prefix);
    622 
    623     double result = 0.0;
    624     result = model->model_->getDblParam(CbcModel::CbcIntegerTolerance) ;
    625 
    626     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    627     return result;
    628 }
    629 COINLIBAPI void COINLINKAGE
    630 Cbc_setIntegerTolerance(Cbc_Model * model,  double value)
    631 {
    632     const char prefix[] = "Cbc_C_Interface::Cbc_setPrimalTolerance(): ";
    633 //  const int  VERBOSE = 1;
    634     if (VERBOSE > 0) printf("%s begin\n", prefix);
    635 
    636     model->model_->setDblParam(CbcModel::CbcIntegerTolerance, value) ;
    637 
    638     if (VERBOSE > 0) printf("%s return\n", prefix);
    639 }
    640 /* Dual objective limit */
    641 COINLIBAPI double COINLINKAGE
    642 Cbc_dualObjectiveLimit(Cbc_Model * model)
    643 {
    644     const char prefix[] = "Cbc_C_Interface::Cbc_dualObjectiveLimit(): ";
    645 //  const int  VERBOSE = 1;
    646     if (VERBOSE > 0) printf("%s begin\n", prefix);
    647 
    648     double result = 0.0;
    649     model->model_->solver()->getDblParam(OsiDualObjectiveLimit, result) ;
    650 
    651     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    652     return result;
    653 }
    654 COINLIBAPI void COINLINKAGE
    655 Cbc_setDualObjectiveLimit(Cbc_Model * model, double value)
    656 {
    657     const char prefix[] = "Cbc_C_Interface::Cbc_setDualObjectiveLimit(): ";
    658 //  const int  VERBOSE = 1;
    659     if (VERBOSE > 0) printf("%s begin\n", prefix);
    660 
    661     model->model_->solver()->setDblParam(OsiDualObjectiveLimit, value) ;
    662 
    663     if (VERBOSE > 0) printf("%s return\n", prefix);
    664 }
    665463/* Objective offset */
    666464COINLIBAPI double COINLINKAGE
     
    721519    if (VERBOSE > 0) printf("%s return\n", prefix);
    722520    return (result) ? 1 : 0;
    723 }
    724 /* Number of iterations */
    725 COINLIBAPI int COINLINKAGE
    726 Cbc_numberIterations(Cbc_Model * model)
    727 {
    728     const char prefix[] = "Cbc_C_Interface::Cbc_numberIterations(): ";
    729 //  const int  VERBOSE = 1;
    730     if (VERBOSE > 0) printf("%s begin\n", prefix);
    731 
    732     int result = 0;
    733     result = model->model_->getIterationCount();
    734 
    735     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    736     return result;
    737 }
    738 COINLIBAPI void COINLINKAGE
    739 Cbc_setNumberIterations(Cbc_Model * /*model*/, int /*numberIterations*/)
    740 {
    741     const char prefix[] = "Cbc_C_Interface::Cbc_setNumberIterations(): ";
    742 //  const int  VERBOSE = 1;
    743     if (VERBOSE > 0) printf("%s begin\n", prefix);
    744 
    745 // cannot find this in Cbc, Osi, or OsiClp
    746 //tbd  model->model_->setNumberIterations(numberIterations);
    747     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    748 
    749     if (VERBOSE > 0) printf("%s return\n", prefix);
    750     return;
    751 }
    752 /* Maximum number of iterations */
    753 COINLIBAPI int COINLINKAGE
    754 Cbc_maximumIterations(Cbc_Model * /*model*/)
    755 {
    756     const char prefix[] = "Cbc_C_Interface::Cbc_maximumIterations(): ";
    757 //  const int  VERBOSE = 1;
    758     if (VERBOSE > 0) printf("%s begin\n", prefix);
    759 
    760     int result = 0;
    761 // cannot find this in Cbc, Osi, or OsiClp
    762 //tbd  result = model->model_->solver()->maximumIterations();
    763     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    764 
    765     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    766     return result;
    767 }
    768 COINLIBAPI void COINLINKAGE
    769 Cbc_setMaximumIterations(Cbc_Model * /*model*/, int /*value*/)
    770 {
    771     const char prefix[] = "Cbc_C_Interface::Cbc_setMaximumIterations(): ";
    772 //  const int  VERBOSE = 1;
    773     if (VERBOSE > 0) printf("%s begin\n", prefix);
    774 
    775 // cannot find this in Cbc, Osi, or OsiClp
    776 //tbd  model->model_->setMaximumIterations(value);
    777     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    778 
    779     if (VERBOSE > 0) printf("%s return\n", prefix);
    780 }
    781 /* Maximum number of nodes */
    782 COINLIBAPI int COINLINKAGE
    783 Cbc_maxNumNode(Cbc_Model * model)
    784 {
    785     const char prefix[] = "Cbc_C_Interface::Cbc_maxNumNode(): ";
    786 //  const int  VERBOSE = 1;
    787     if (VERBOSE > 0) printf("%s begin\n", prefix);
    788 
    789     int result = 0;
    790     result = model->model_->getIntParam(CbcModel::CbcMaxNumNode);
    791 
    792     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    793     return result;
    794 }
    795 COINLIBAPI void COINLINKAGE
    796 Cbc_setMaxNumNode(Cbc_Model * model, int value)
    797 {
    798     const char prefix[] = "Cbc_C_Interface::Cbc_setMaxNumNode(): ";
    799 //  const int  VERBOSE = 1;
    800     if (VERBOSE > 0) printf("%s begin\n", prefix);
    801 
    802     model->model_->setIntParam(CbcModel::CbcMaxNumNode, value);
    803 
    804     if (VERBOSE > 0) printf("%s return\n", prefix);
    805 }
    806 /* Maximum number of solutions */
    807 COINLIBAPI int COINLINKAGE
    808 Cbc_maxNumSol(Cbc_Model * model)
    809 {
    810     const char prefix[] = "Cbc_C_Interface::maxNumSol(): ";
    811 //  const int  VERBOSE = 1;
    812     if (VERBOSE > 0) printf("%s begin\n", prefix);
    813 
    814     int result = 0;
    815     result = model->model_->getIntParam(CbcModel::CbcMaxNumSol);
    816 
    817     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    818     return result;
    819 }
    820 COINLIBAPI void COINLINKAGE
    821 Cbc_setMaxNumSol(Cbc_Model * model, int value)
    822 {
    823     const char prefix[] = "Cbc_C_Interface::Cbc_setMaxNumSol(): ";
    824 //  const int  VERBOSE = 1;
    825     if (VERBOSE > 0) printf("%s begin\n", prefix);
    826 
    827     model->model_->setIntParam(CbcModel::CbcMaxNumSol, value);
    828 
    829     if (VERBOSE > 0) printf("%s return\n", prefix);
    830 }
    831 /* Maximum time in seconds (from when set called) */
    832 COINLIBAPI double COINLINKAGE
    833 Cbc_maximumSeconds(Cbc_Model * model)
    834 {
    835     const char prefix[] = "Cbc_C_Interface::Cbc_maximumSeconds(): ";
    836 //  const int  VERBOSE = 1;
    837     if (VERBOSE > 0) printf("%s begin\n", prefix);
    838 
    839     double result = 0.0;
    840     result = model->model_->getDblParam(CbcModel::CbcMaximumSeconds);
    841 
    842     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    843     return result;
    844 }
    845 COINLIBAPI void COINLINKAGE
    846 Cbc_setMaximumSeconds(Cbc_Model * model, double value)
    847 {
    848     const char prefix[] = "Cbc_C_Interface::Cbc_setMaximumSeconds(): ";
    849 //  const int  VERBOSE = 1;
    850     if (VERBOSE > 0) printf("%s begin\n", prefix);
    851 
    852     model->model_->setDblParam(CbcModel::CbcMaximumSeconds, value);
    853 
    854     if (VERBOSE > 0) printf("%s return\n", prefix);
    855 }
    856 /* Returns true if hit maximum iteratio`ns (or time) */
    857 COINLIBAPI int COINLINKAGE
    858 Cbc_hitMaximumIterations(Cbc_Model * /*model*/)
    859 {
    860     const char prefix[] = "Cbc_C_Interface::Cbc_hitMaximumIterations(): ";
    861 //  const int  VERBOSE = 1;
    862     if (VERBOSE > 0) printf("%s begin\n", prefix);
    863 
    864     int result = 0;
    865 // cannot find names in Cbc, Osi, or OsiClp
    866 //tbd  result = model->model_->solver()->hitMaximumIterations() ? 1 : 0;
    867     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    868 
    869     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    870     return result;
    871521}
    872522/* Status of problem:
     
    877527   4 - stopped due to errors
    878528*/
    879 COINLIBAPI int COINLINKAGE
    880 Cbc_status(Cbc_Model * model)
    881 {
    882     const char prefix[] = "Cbc_C_Interface::Cbc_status(): ";
    883 //  const int  VERBOSE = 1;
    884     if (VERBOSE > 0) printf("%s begin\n", prefix);
    885 
    886     int result = 0;
    887     result = model->model_->status();
    888 
    889     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    890     return result;
    891 }
    892 /* Set problem status */
    893 COINLIBAPI void COINLINKAGE
    894 Cbc_setProblemStatus(Cbc_Model * /*model*/, int /*problemStatus*/)
    895 {
    896     const char prefix[] = "Cbc_C_Interface::Cbc_setProblemStatus(): ";
    897 //  const int  VERBOSE = 1;
    898     if (VERBOSE > 0) printf("%s begin\n", prefix);
    899 
    900 // cannot find this in Cbc, Osi, or OsiClp
    901 //tbd  model->model_->setProblemStatus(problemStatus);
    902     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    903 
    904     if (VERBOSE > 0) printf("%s return\n", prefix);
    905 }
     529CbcGetProperty(int, status)
     530
    906531/* Secondary status of problem - may get extended
    907532   0 - none
     
    911536   4 - scaled problem optimal - unscaled has both dual and primal infeasibilities
    912537*/
    913 COINLIBAPI int COINLINKAGE
    914 Cbc_secondaryStatus(Cbc_Model * model)
    915 {
    916     const char prefix[] = "Cbc_C_Interface::Cbc_secondaryStatus(): ";
    917 //  const int  VERBOSE = 1;
    918     if (VERBOSE > 0) printf("%s begin\n", prefix);
    919 
    920     int result = 0;
    921 // cannot find this in Cbc, Osi, or OsiClp
    922     result = model->model_->secondaryStatus();
    923     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    924 
    925     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    926     return result;
    927 }
     538CbcGetProperty(int, secondaryStatus)
     539
    928540COINLIBAPI void COINLINKAGE
    929541Cbc_setSecondaryStatus(Cbc_Model * /*model*/, int /*status*/)
     
    939551    if (VERBOSE > 0) printf("%s return\n", prefix);
    940552}
    941 /* Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    942 COINLIBAPI double COINLINKAGE
    943 Cbc_optimizationDirection(Cbc_Model * model)
    944 {
    945     const char prefix[] = "Cbc_C_Interface::Cbc_optimizationDirection(): ";
    946 //  const int  VERBOSE = 1;
    947     if (VERBOSE > 0) printf("%s begin\n", prefix);
    948 
    949     double result = 0.0;
    950     result = model->model_->getObjSense();
    951 
    952     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    953     return result;
    954 }
    955 COINLIBAPI void COINLINKAGE
    956 Cbc_setOptimizationDirection(Cbc_Model * model, double value)
    957 {
    958     const char prefix[] = "Cbc_C_Interface::Cbc_setOptimizationDirection(): ";
    959 //  const int  VERBOSE = 1;
    960     if (VERBOSE > 0) printf("%s begin, value = %g\n", prefix, value);
    961 
    962     model->model_->setObjSense(value);
    963 //  model->model_->solver()->setObjSense(value);
    964 
    965     if (VERBOSE > 0) printf("%s return\n", prefix);
    966 }
    967 /* Primal row solution */
    968 COINLIBAPI double * COINLINKAGE
    969 Cbc_primalRowSolution(Cbc_Model * /*model*/)
    970 {
    971     const char prefix[] = "Cbc_C_Interface::Cbc_primalRowSolution(): ";
    972 //  const int  VERBOSE = 1;
    973     if (VERBOSE > 0) printf("%s begin\n", prefix);
    974 
    975     double * result = NULL;
    976 
    977 // cannot find this in Cbc, Osi, or OsiClp
    978 // may have to make it somehow
    979 //tbd  return model->model_->primalRowSolution();
    980     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    981 
    982     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    983     return result;
    984 }
    985 /* Primal column solution */
    986 COINLIBAPI double * COINLINKAGE
    987 Cbc_primalColumnSolution(Cbc_Model * /*model*/)
    988 {
    989     const char prefix[] = "Cbc_C_Interface::Cbc_primalColumnSolution(): ";
    990 //  const int  VERBOSE = 1;
    991     if (VERBOSE > 0) printf("%s begin\n", prefix);
    992 
    993     double * result = NULL;
    994 // cannot find this in Cbc, Osi, or OsiClp
    995 // may have to make it somehow
    996 //  result = model->model_->getColSolution();
    997     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    998 
    999     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1000     return result;
    1001 }
    1002 /* Dual row solution */
    1003 COINLIBAPI double * COINLINKAGE
    1004 Cbc_dualRowSolution(Cbc_Model * /*model*/)
    1005 {
    1006     const char prefix[] = "Cbc_C_Interface::Cbc_dualRowSolution(): ";
    1007 //  const int  VERBOSE = 1;
    1008     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1009 
    1010     double * result = NULL;
    1011 // cannot find this in Cbc, Osi, or OsiClp
    1012 // may have to make it somehow
    1013 //tbd  return model->model_->dualRowSolution();
    1014     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1015 
    1016     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1017     return NULL;
    1018 }
    1019 /* Reduced costs */
    1020 COINLIBAPI double * COINLINKAGE
    1021 Cbc_dualColumnSolution(Cbc_Model * /*model*/)
    1022 {
    1023     const char prefix[] = "Cbc_C_Interface::Cbc_dualColumnSolution(): ";
    1024 //  const int  VERBOSE = 1;
    1025     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1026 
    1027     double * result = NULL;
    1028 // cannot find this in Cbc, Osi, or OsiClp
    1029 // may have to make it somehow
    1030 //tbd  return model->model_->dualColumnSolution();
    1031     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1032 
    1033     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1034     return NULL;
    1035 }
    1036 /* Row lower */
    1037 COINLIBAPI double * COINLINKAGE
    1038 Cbc_rowLower(Cbc_Model * /*model*/)
    1039 {
    1040     const char prefix[] = "Cbc_C_Interface::Cbc_rowLower(): ";
    1041 //  const int  VERBOSE = 1;
    1042     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1043 
    1044     double * result = NULL;
    1045 // cannot find this in Cbc, Osi, or OsiClp
    1046 // may have to make it somehow
    1047 //tbd  return model->model_->rowLower();
    1048     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1049 
    1050     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1051     return NULL;
    1052 }
    1053 /* Row upper  */
    1054 COINLIBAPI double * COINLINKAGE
    1055 Cbc_rowUpper(Cbc_Model * /*model*/)
    1056 {
    1057     const char prefix[] = "Cbc_C_Interface::Cbc_rowUpper(): ";
    1058 //  const int  VERBOSE = 1;
    1059     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1060 
    1061     double * result = NULL;
    1062 // cannot find this in Cbc, Osi, or OsiClp
    1063 // may have to make it somehow
    1064 //tbd  return model->model_->rowUpper();
    1065     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1066 
    1067     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1068     return NULL;
    1069 }
    1070 /* Objective Coefficients */
    1071 COINLIBAPI double * COINLINKAGE
    1072 Cbc_objective(Cbc_Model * /*model*/)
    1073 {
    1074     const char prefix[] = "Cbc_C_Interface::Cbc_objective(): ";
    1075 //  const int  VERBOSE = 1;
    1076     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1077 
    1078     double * result = NULL;
    1079 // cannot find this in Cbc, Osi, or OsiClp
    1080 // may have to make it somehow
    1081 //  result = model->model_->objective();
    1082     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1083 
    1084     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1085     return NULL;
    1086 }
    1087 /* Column Lower */
    1088 COINLIBAPI double * COINLINKAGE
    1089 Cbc_columnLower(Cbc_Model * /*model*/)
    1090 {
    1091     const char prefix[] = "Cbc_C_Interface::Cbc_columnLower(): ";
    1092 //  const int  VERBOSE = 1;
    1093     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1094 
    1095     double * result = NULL;
    1096 // cannot find this in Cbc, Osi, or OsiClp
    1097 // may have to make it somehow
    1098 //tbd  return model->model_->columnLower();
    1099     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1100 
    1101     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1102     return NULL;
    1103 }
    1104 /* Column Upper */
    1105 COINLIBAPI double * COINLINKAGE
    1106 Cbc_columnUpper(Cbc_Model * /*model*/)
    1107 {
    1108     const char prefix[] = "Cbc_C_Interface::Cbc_columnUpper(): ";
    1109 //  const int  VERBOSE = 1;
    1110     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1111 
    1112     double * result = NULL;
    1113 // cannot find this in Cbc, Osi, or OsiClp
    1114 // may have to make it somehow
    1115 //tbd  return model->model_->columnUpper();
    1116     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1117 
    1118     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1119     return NULL;
    1120 }
     553
    1121554/* Number of elements in matrix */
    1122555COINLIBAPI int COINLINKAGE
     
    1197630// ======================================================================
    1198631
    1199 /* Objective value */
    1200 COINLIBAPI double COINLINKAGE
    1201 Cbc_objectiveValue(Cbc_Model * model)
    1202 {
    1203     const char prefix[] = "Cbc_C_Interface::Cbc_objectiveValue(): ";
    1204 //  const int  VERBOSE = 1;
    1205     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1206 
    1207     double result = 0.0;
    1208     result = model->model_->getObjValue();
    1209 
    1210     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1211     return result;
    1212 }
    1213 /* Infeasibility/unbounded ray (NULL returned if none/wrong)
    1214    Up to user to use delete [] on these arrays.  */
    1215 COINLIBAPI double * COINLINKAGE
    1216 Cbc_infeasibilityRay(Cbc_Model * /*model*/)
    1217 {
    1218     const char prefix[] = "Cbc_C_Interface::Cbc_infeasibilityRay(): ";
    1219 //  const int  VERBOSE = 1;
    1220     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1221 
    1222     double * result = NULL;
    1223     // lots of rays (probably too many) are available in
    1224     // OsiClpSolverInterface::getDualRays()
    1225     //
    1226 //tbd  result = model->model_->infeasibilityRay();
    1227     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1228 
    1229     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1230     return result;
    1231 }
    1232 COINLIBAPI double * COINLINKAGE
    1233 Cbc_unboundedRay(Cbc_Model * /*model*/)
    1234 {
    1235     const char prefix[] = "Cbc_C_Interface::Cbc_unboundedRay(): ";
    1236 //  const int  VERBOSE = 1;
    1237     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1238 
    1239     double * result = NULL;
    1240     // lots of rays (probably too many) are available in
    1241     // OsiClpSolverInterface::getPrimalRays()
    1242     //
    1243 //tbd  result = model->model_->unboundedRay();
    1244     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1245 
    1246     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1247     return result;
    1248 }
    1249 /* See if status array exists (partly for OsiClp) */
    1250 COINLIBAPI int COINLINKAGE
    1251 Cbc_statusExists(Cbc_Model * /*model*/)
    1252 {
    1253     const char prefix[] = "Cbc_C_Interface::Cbc_statusExists(): ";
    1254 //  const int  VERBOSE = 1;
    1255     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1256 
    1257     int result = 0;
    1258 //tbd  result = model->model_->statusExists() ? 1 : 0;
    1259     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1260 
    1261     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1262     return result;
    1263 }
    1264 /* Return address of status array (char[numberRows+numberColumns]) */
    1265 COINLIBAPI void  COINLINKAGE
    1266 Cbc_getBasisStatus(Cbc_Model * /*model*/, int * /*cstat*/, int * /*rstat*/)
    1267 {
    1268     const char prefix[] = "Cbc_C_Interface::Cbc_getBasisStatus(): ";
    1269 //  const int  VERBOSE = 1;
    1270     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1271 
    1272 // have to figure this out
    1273 //tbd  model->model_->solver()->getBasisStatus(cstat, rstat);
    1274     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1275 
    1276     if (VERBOSE > 0) printf("%s return\n", prefix);
    1277     return;
    1278 }
    1279 /* Copy in status vector */
    1280 COINLIBAPI void COINLINKAGE
    1281 Cbc_setBasisStatus(Cbc_Model * /*model*/,  int * /*cstat*/, int * /*rstat*/)
    1282 {
    1283     const char prefix[] = "Cbc_C_Interface::Cbc_setBasisStatus(): ";
    1284 //  const int  VERBOSE = 1;
    1285     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1286 
    1287 //  model->model_->solver()->setBasisStatus(cstat, rstat);
    1288     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1289 
    1290     if (VERBOSE > 0) printf("%s return\n", prefix);
    1291 }
    1292 
    1293 /* User pointer for whatever reason */
    1294 COINLIBAPI void COINLINKAGE
    1295 Cbc_setUserPointer (Cbc_Model * /*model*/, void * /*pointer*/)
    1296 {
    1297     const char prefix[] = "Cbc_C_Interface::Cbc_setUserPointer(): ";
    1298 //  const int  VERBOSE = 1;
    1299     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1300 
    1301     // not sure what this is for
    1302     //
    1303 //tbd  model->model_->setUserPointer(pointer);
    1304     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1305 
    1306     if (VERBOSE > 0) printf("%s return\n", prefix);
    1307 }
    1308 COINLIBAPI void * COINLINKAGE
    1309 Cbc_getUserPointer (Cbc_Model * /*model*/)
    1310 {
    1311     const char prefix[] = "Cbc_C_Interface::Cbc_getUserPointer(): ";
    1312 //  const int  VERBOSE = 1;
    1313     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1314 
    1315     void * result = NULL;
    1316     // not sure what this is for
    1317     //
    1318 //tbd result = model->model_->getUserPointer();
    1319     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1320 
    1321     if (VERBOSE > 0) printf("%s return %p\n", prefix, result);
    1322     return result;
    1323 }
     632
     633
    1324634/* Pass in Callback function */
    1325635COINLIBAPI void COINLINKAGE
     
    1356666    if (VERBOSE > 0) printf("%s return\n", prefix);
    1357667}
    1358 /* Amount of print out:
    1359    0 - none
    1360    1 - just final
    1361    2 - just factorizations
    1362    3 - as 2 plus a bit more
    1363    4 - verbose
    1364    above that 8,16,32 etc just for selective debug
    1365 */
    1366 COINLIBAPI void COINLINKAGE
    1367 Cbc_setLogLevel(Cbc_Model * model, int value)
    1368 {
    1369     const char prefix[] = "Cbc_C_Interface::Cbc_setLogLevel(): ";
    1370 //  const int  VERBOSE = 1;
    1371     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1372     if (VERBOSE > 1) printf("%s value = %i\n", prefix, value);
    1373 
    1374     model->model_->messageHandler()->setLogLevel(value);
    1375 
    1376     if (VERBOSE > 0) printf("%s return\n", prefix);
    1377 }
    1378 COINLIBAPI int COINLINKAGE
    1379 Cbc_logLevel(Cbc_Model * model)
    1380 {
    1381     const char prefix[] = "Cbc_C_Interface::Cbc_logLevel(): ";
    1382 //  const int  VERBOSE = 1;
    1383     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1384 
    1385     int result = 0;
    1386     result = model->model_->messageHandler()->logLevel();
    1387 
    1388     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1389     return result;
    1390 }
    1391668/* length of names (0 means no names0 */
    1392669COINLIBAPI int COINLINKAGE
     
    1436713}
    1437714
    1438 /* General branch and bound solve algorithm which can do presolve.
    1439    See  CbcSolve.hpp for options
    1440 */
    1441 COINLIBAPI int COINLINKAGE
    1442 Cbc_initialSolve(Cbc_Model * model)
    1443 {
    1444     const char prefix[] = "Cbc_C_Interface::Cbc_initialSolve(): ";
    1445 //  const int  VERBOSE = 1;
    1446     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1447 
    1448     int result = 0;
    1449     model->model_->initialSolve();
    1450     result = model->model_->status();
    1451 
    1452     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1453     return result;
    1454 }
    1455 /* General solve algorithm which can do presolve.
    1456    See  CbcModel.hpp for options
    1457 */
    1458 COINLIBAPI int COINLINKAGE
    1459 Cbc_branchAndBound(Cbc_Model * model)
    1460 {
    1461     const char prefix[] = "Cbc_C_Interface::Cbc_branchAndBound(): ";
    1462 //  const int  VERBOSE = 3;
    1463     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1464 
    1465     int result = 0;
    1466     if (VERBOSE > 2) Cbc_printModel(model, prefix);
    1467     try {
    1468         model->model_->branchAndBound();
    1469         model->model_->solver()->resolve();
    1470     } catch (CoinError e) {
    1471         printf("%s ERROR: %s::%s, %s\n", prefix,
    1472                e.className().c_str(), e.methodName().c_str(), e.message().c_str());
    1473     }
    1474     result = model->model_->status();
    1475 
    1476     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1477     return result;
    1478 }
    1479715COINLIBAPI int COINLINKAGE
    1480716Cbc_solve(Cbc_Model * model)
     
    1494730    return result;
    1495731}
    1496 /* Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later) */
    1497 COINLIBAPI void COINLINKAGE
    1498 Cbc_scaling(Cbc_Model * model, int mode)
    1499 {
    1500     const char prefix[] = "Cbc_C_Interface::Cbc_scaling(): ";
    1501 //  const int  VERBOSE = 1;
    1502     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1503 
    1504     OsiSolverInterface * solver = model->model_->solver();
    1505     bool modeBool = (mode == 0);
    1506     solver->setHintParam(OsiDoScale, modeBool);
    1507 
    1508     if (VERBOSE > 0) printf("%s return\n", prefix);
    1509 }
    1510 /* Gets scalingFlag */
    1511 COINLIBAPI int COINLINKAGE
    1512 Cbc_scalingFlag(Cbc_Model * /*model*/)
    1513 {
    1514     const char prefix[] = "Cbc_C_Interface::Cbc_scalingFlag(): ";
    1515 //  const int  VERBOSE = 1;
    1516     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1517 
    1518     int result = 0;
    1519 // try to use OsiSolverInterface::getHintParam(OsiDoScale, ???)
    1520 //tbd  result = model->model_->scalingFlag();
    1521     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1522 
    1523     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1524     return result;
    1525 }
    1526 /* Crash - at present just aimed at dual, returns
    1527    -2 if dual preferred and crash basis created
    1528    -1 if dual preferred and all slack basis preferred
    1529    0 if basis going in was not all slack
    1530    1 if primal preferred and all slack basis preferred
    1531    2 if primal preferred and crash basis created.
    1532 
    1533    if gap between bounds <="gap" variables can be flipped
    1534 
    1535    If "pivot" is
    1536    0 No pivoting (so will just be choice of algorithm)
    1537    1 Simple pivoting e.g. gub
    1538    2 Mini iterations
    1539 */
    1540 COINLIBAPI int COINLINKAGE
    1541 Cbc_crash(Cbc_Model * /*model*/, double /*gap*/, int /*pivot*/)
    1542 {
    1543     const char prefix[] = "Cbc_C_Interface::Cbc_crash(): ";
    1544 //  const int  VERBOSE = 1;
    1545     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1546 
    1547     int result = 0;
    1548 // cannot find names in Cbc, Osi, or OsiClp
    1549 //tbd  result = model->model_->crash(gap,pivot);
    1550     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1551 
    1552     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1553     return result;
    1554 }
    1555 /* If problem is primal feasible */
    1556 COINLIBAPI int COINLINKAGE
    1557 Cbc_primalFeasible(Cbc_Model * model)
    1558 {
    1559     const char prefix[] = "Cbc_C_Interface::Cbc_primalFeasible(): ";
    1560 //  const int  VERBOSE = 1;
    1561     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1562 
    1563     int result = 0;
    1564     OsiSolverInterface * solver = model->model_->solver();
    1565     result = solver->isProvenPrimalInfeasible() ? 0 : 1;
    1566 
    1567     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1568     return result;
    1569 }
    1570 /* If problem is dual feasible */
    1571 COINLIBAPI int COINLINKAGE
    1572 Cbc_dualFeasible(Cbc_Model * model)
    1573 {
    1574     const char prefix[] = "Cbc_C_Interface::Cbc_dualFeasible(): ";
    1575 //  const int  VERBOSE = 1;
    1576     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1577 
    1578     int result = 0;
    1579     OsiSolverInterface * solver = model->model_->solver();
    1580     result = solver->isProvenDualInfeasible() ? 0 : 1;
    1581 
    1582     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1583     return result;
    1584 }
    1585 /* Dual bound */
    1586 COINLIBAPI double COINLINKAGE
    1587 Cbc_dualBound(Cbc_Model * /*model*/)
    1588 {
    1589     const char prefix[] = "Cbc_C_Interface::Cbc_dualBound(): ";
    1590 //  const int  VERBOSE = 1;
    1591     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1592 
    1593     double result = 0;
    1594 // cannot find in Cbc, Osi, or OsiClp
    1595 //tbd  result = model->model_->dualBound();
    1596     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1597 
    1598     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1599     return result;
    1600 }
    1601 COINLIBAPI void COINLINKAGE
    1602 Cbc_setDualBound(Cbc_Model * /*model*/, double /*value*/)
    1603 {
    1604     const char prefix[] = "Cbc_C_Interface::Cbc_setDualBound(): ";
    1605 //  const int  VERBOSE = 1;
    1606     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1607 
    1608 // cannot find names in Cbc, Osi, or OsiClp
    1609 //tbd  model->model_->setDualBound(value);
    1610     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1611 
    1612     if (VERBOSE > 0) printf("%s return\n", prefix);
    1613 }
    1614 /* Infeasibility cost */
    1615 COINLIBAPI double COINLINKAGE
    1616 Cbc_infeasibilityCost(Cbc_Model * /*model*/)
    1617 {
    1618     const char prefix[] = "Cbc_C_Interface::Cbc_infeasibilityCost(): ";
    1619 //  const int  VERBOSE = 1;
    1620     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1621 
    1622     double result = 0;
    1623 // cannot find names in Cbc, Osi, or OsiClp
    1624 //tbd  result = model->model_->solver()->infeasibilityCost();
    1625     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1626 
    1627     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1628     return result;
    1629 }
    1630 COINLIBAPI void COINLINKAGE
    1631 Cbc_setInfeasibilityCost(Cbc_Model * /*model*/, double /*value*/)
    1632 {
    1633     const char prefix[] = "Cbc_C_Interface::Cbc_setInfeasibilityCost(): ";
    1634 //  const int  VERBOSE = 1;
    1635     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1636 
    1637 // cannot find names in Cbc, Osi, or OsiClp
    1638 //tbd  model->model_->setInfeasibilityCost(value);
    1639     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1640 
    1641     if (VERBOSE > 0) printf("%s return\n", prefix);
    1642 }
    1643 /* Perturbation:
    1644    50  - switch on perturbation
    1645    100 - auto perturb if takes too long (1.0e-6 largest nonzero)
    1646    101 - we are perturbed
    1647    102 - don't try perturbing again
    1648    default is 100
    1649    others are for playing
    1650 */
    1651 COINLIBAPI int COINLINKAGE
    1652 Cbc_perturbation(Cbc_Model * /*model*/)
    1653 {
    1654     const char prefix[] = "Cbc_C_Interface::Cbc_perturbation(): ";
    1655 //  const int  VERBOSE = 1;
    1656     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1657 
    1658     int result = 0;
    1659 // cannot find names in Cbc, Osi, or OsiClp
    1660 //tbd  result = model->model_->perturbation();
    1661     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1662 
    1663     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1664     return result;
    1665 }
    1666 COINLIBAPI void COINLINKAGE
    1667 Cbc_setPerturbation(Cbc_Model * /*model*/, int /*value*/)
    1668 {
    1669     const char prefix[] = "Cbc_C_Interface::Cbc_setPerturbation(): ";
    1670 //  const int  VERBOSE = 1;
    1671     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1672 
    1673 // cannot find names in Cbc, Osi, or OsiClp
    1674 //tbd  model->model_->setPerturbation(value);
    1675     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1676 
    1677     if (VERBOSE > 0) printf("%s return\n", prefix);
    1678 }
    1679 /* Current (or last) algorithm */
    1680 COINLIBAPI int COINLINKAGE
    1681 Cbc_algorithm(Cbc_Model * /*model*/)
    1682 {
    1683     const char prefix[] = "Cbc_C_Interface::Cbc_setPerturbation(): ";
    1684 //  const int  VERBOSE = 1;
    1685     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1686 
    1687     int result = 0;
    1688 // cannot find names in Cbc, Osi, or OsiClp
    1689 //tbd  result = model->model_->algorithm();
    1690     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1691 
    1692     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1693     return result;
    1694 }
    1695 /* Set algorithm */
    1696 COINLIBAPI void COINLINKAGE
    1697 Cbc_setAlgorithm(Cbc_Model * /*model*/, int /*value*/)
    1698 {
    1699     const char prefix[] = "Cbc_C_Interface::Cbc_setAlgorithm(): ";
    1700 //  const int  VERBOSE = 1;
    1701     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1702 
    1703 // cannot find names in Cbc, Osi, or OsiClp
    1704 //tbd  model->model_->setAlgorithm(value);
    1705     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1706 
    1707     if (VERBOSE > 0) printf("%s return\n", prefix);
    1708 }
    1709 /* Sum of dual infeasibilities */
    1710 COINLIBAPI double COINLINKAGE
    1711 Cbc_sumDualInfeasibilities(Cbc_Model * /*model*/)
    1712 {
    1713     const char prefix[] = "Cbc_C_Interface::Cbc_sumDualInfeasibilities(): ";
    1714 //  const int  VERBOSE = 1;
    1715     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1716 
    1717     double result = 0;
    1718 // cannot find names in Cbc, Osi, or OsiClp
    1719 //tbd  result = model->model_->sumDualInfeasibilities();
    1720     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1721 
    1722     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1723     return result;
    1724 }
    1725 /* Number of dual infeasibilities */
    1726 COINLIBAPI int COINLINKAGE
    1727 Cbc_numberDualInfeasibilities(Cbc_Model * /*model*/)
    1728 {
    1729     const char prefix[] = "Cbc_C_Interface::Cbc_numberDualInfeasibilities(): ";
    1730 //  const int  VERBOSE = 1;
    1731     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1732 
    1733     int result = 0;
    1734 // cannot find names in Cbc, Osi, or OsiClp
    1735 //tbd  result = model->model_->numberDualInfeasibilities();
    1736     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1737 
    1738     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1739     return result;
    1740 }
     732
    1741733/* Sum of primal infeasibilities */
    1742734COINLIBAPI double COINLINKAGE
     
    1770762    return result;
    1771763}
    1772 /* Save model to file, returns 0 if success.  This is designed for
    1773    use outside algorithms so does not save iterating arrays etc.
    1774    It does not save any messaging information.
    1775    Does not save scaling values.
    1776    It does not know about all types of virtual functions.
    1777 */
    1778 COINLIBAPI int COINLINKAGE
    1779 Cbc_saveModel(Cbc_Model * /*model*/, const char * /*fileName*/)
    1780 {
    1781     const char prefix[] = "Cbc_C_Interface::Cbc_saveModel(): ";
    1782 //  const int  VERBOSE = 1;
    1783     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1784 
    1785     int result = 0;
    1786 // there is a writeMPS method in Osi
    1787 //tbd  result = model->model_->saveModel(fileName);
    1788     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1789 
    1790     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1791     return result;
    1792 }
    1793 /* Restore model from file, returns 0 if success,
    1794    deletes current model */
    1795 COINLIBAPI int COINLINKAGE
    1796 Cbc_restoreModel(Cbc_Model * /*model*/, const char * /*fileName*/)
    1797 {
    1798     const char prefix[] = "Cbc_C_Interface::Cbc_restoreModel(): ";
    1799 //  const int  VERBOSE = 1;
    1800     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1801 
    1802     int result = 0;
    1803 // there is a readMPS method in Osi
    1804 //tbd  result = model->model_->restoreModel(fileName);
    1805     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1806 
    1807     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1808     return result;
    1809 }
     764
    1810765
    1811766/** Call this to really test if a valid solution can be feasible
     
    1828783    return;
    1829784}
    1830 /* Number of rows */
    1831 COINLIBAPI int COINLINKAGE
    1832 Cbc_getNumRows(Cbc_Model * model)
    1833 {
    1834     const char prefix[] = "Cbc_C_Interface::Cbc_getNumRows(): ";
    1835 //  const int  VERBOSE = 1;
    1836     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1837 
    1838     int result = 0;
    1839     result = model->model_->getNumRows();
    1840 
    1841     if (VERBOSE > 0) printf("%s return %d\n", prefix, result);
    1842     return result;
    1843 }
    1844 /* Number of columns */
    1845 COINLIBAPI int COINLINKAGE
    1846 Cbc_getNumCols(Cbc_Model * model)
    1847 {
    1848     const char prefix[] = "Cbc_C_Interface::Cbc_getNumCols(): ";
    1849 //  const int  VERBOSE = 1;
    1850     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1851 
    1852     int result = 0;
    1853     result = model->model_->getNumCols();
    1854 
    1855     if (VERBOSE > 0) printf("%s return %d\n", prefix, result);
    1856     return result;
    1857 }
    1858 /* Number of iterations */
    1859 COINLIBAPI int COINLINKAGE
    1860 Cbc_getIterationCount(Cbc_Model * model)
    1861 {
    1862     const char prefix[] = "Cbc_C_Interface::Cbc_getIterationCount(): ";
    1863 //  const int  VERBOSE = 1;
    1864     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1865 
    1866     int result = 0;
    1867     result = model->model_->getIterationCount();
    1868 
    1869     if (VERBOSE > 0) printf("%s return %d\n", prefix, result);
    1870     return result;
    1871 }
    1872 /* Are there a numerical difficulties? */
    1873 COINLIBAPI int COINLINKAGE
    1874 Cbc_isAbandoned(Cbc_Model * model)
    1875 {
    1876     const char prefix[] = "Cbc_C_Interface::Cbc_isAbandoned(): ";
    1877 //  const int  VERBOSE = 1;
    1878     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1879 
    1880     int result = 0;
    1881     result = model->model_->isAbandoned() ? 1 : 0;
    1882 
    1883     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1884     return result;
    1885 }
    1886 /* Is optimality proven? */
    1887 COINLIBAPI int COINLINKAGE
    1888 Cbc_isProvenOptimal(Cbc_Model * model)
    1889 {
    1890     const char prefix[] = "Cbc_C_Interface::Cbc_isProvenOptimal(): ";
    1891 //  const int  VERBOSE = 1;
    1892     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1893 
    1894     int result = 0;
    1895     result = model->model_->isProvenOptimal() ? 1 : 0;
    1896 
    1897     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1898     return result;
    1899 }
    1900 /* Is primal infeasiblity proven? */
    1901 COINLIBAPI int COINLINKAGE
    1902 Cbc_isProvenPrimalInfeasible(Cbc_Model * model)
    1903 {
    1904     const char prefix[] = "Cbc_C_Interface::Cbc_isProvenPrimalInfeasible(): ";
    1905 //  const int  VERBOSE = 1;
    1906     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1907 
    1908     int result = 0;
    1909     OsiSolverInterface * solver = model->model_->solver();
    1910     result = solver->isProvenPrimalInfeasible() ? 1 : 0;
    1911 
    1912     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1913     return result;
    1914 }
    1915 /* Is dual infeasiblity proven? */
    1916 COINLIBAPI int COINLINKAGE
    1917 Cbc_isProvenDualInfeasible(Cbc_Model * model)
    1918 {
    1919     const char prefix[] = "Cbc_C_Interface::Cbc_isProvenDualInfeasible(): ";
    1920 //  const int  VERBOSE = 1;
    1921     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1922 
    1923     int result = 0;
    1924     OsiSolverInterface * solver = model->model_->solver();
    1925     result = solver->isProvenDualInfeasible() ? 1 : 0;
    1926 
    1927     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1928     return result;
    1929 }
    1930 /* Is the given primal objective limit reached? */
    1931 COINLIBAPI int COINLINKAGE
    1932 Cbc_isPrimalObjectiveLimitReached(Cbc_Model * model)
    1933 {
    1934     const char prefix[] = "Cbc_C_Interface::Cbc_isPrimalObjectiveLimitReached(): ";
    1935 //  const int  VERBOSE = 1;
    1936     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1937 
    1938     int result = 0;
    1939     OsiSolverInterface * solver = model->model_->solver();
    1940     result = solver->isPrimalObjectiveLimitReached() ? 1 : 0;
    1941 
    1942     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1943     return result;
    1944 }
    1945 /* Is the given dual objective limit reached? */
    1946 COINLIBAPI int COINLINKAGE
    1947 Cbc_isDualObjectiveLimitReached(Cbc_Model * model)
    1948 {
    1949     const char prefix[] = "Cbc_C_Interface::Cbc_isDualObjectiveLimitReached(): ";
    1950 //  const int  VERBOSE = 1;
    1951     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1952 
    1953     int result = 0;
    1954     OsiSolverInterface * solver = model->model_->solver();
    1955     result = solver->isDualObjectiveLimitReached() ? 1 : 0;
    1956 
    1957     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1958     return result;
    1959 }
    1960 /* Iteration limit reached? */
    1961 COINLIBAPI int COINLINKAGE
    1962 Cbc_isIterationLimitReached(Cbc_Model * model)
    1963 {
    1964     const char prefix[] = "Cbc_C_Interface::Cbc_isIterationLimitReached(): ";
    1965 //  const int  VERBOSE = 1;
    1966     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1967 
    1968     int result = 0;
    1969     OsiSolverInterface * solver = model->model_->solver();
    1970     result = solver->isIterationLimitReached() ? 1 : 0;
    1971 
    1972     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1973     return result;
    1974 }
    1975 /* Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    1976 COINLIBAPI double COINLINKAGE
    1977 Cbc_getObjSense(Cbc_Model * model)
    1978 {
    1979     const char prefix[] = "Cbc_C_Interface::Cbc_getObjSense(): ";
    1980 //  const int  VERBOSE = 1;
    1981     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1982 
    1983     double result = 0;
    1984     result = model->model_->getObjSense();
    1985 
    1986     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1987     return result;
    1988 }
    1989 /* Primal row solution */
    1990 COINLIBAPI const double * COINLINKAGE
    1991 Cbc_getRowActivity(Cbc_Model * model)
    1992 {
    1993     const char prefix[] = "Cbc_C_Interface::Cbc_getRowActivity(): ";
    1994 //  const int  VERBOSE = 1;
    1995     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1996 
    1997     const double * result = NULL;
    1998     result = model->model_->getRowActivity();
    1999 
    2000     if (VERBOSE > 0)
    2001         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2002     return result;
    2003 }
    2004 /* Primal column solution */
    2005 COINLIBAPI const double * COINLINKAGE
    2006 Cbc_getColSolution(Cbc_Model * model)
    2007 {
    2008     const char prefix[] = "Cbc_C_Interface::Cbc_getColSolution(): ";
    2009 //  const int  VERBOSE = 1;
    2010     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2011 
    2012     const double * result = NULL;
    2013     result = model->model_->getColSolution();
    2014 
    2015     if (VERBOSE > 0)
    2016         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2017     return result;
    2018 }
     785
     786
     787
     788CbcGetProperty(int, getNumCols)
     789CbcGetProperty(int, getNumRows)
     790CbcGetProperty(int, getIterationCount)
     791CbcGetProperty(int, isAbandoned)
     792CbcGetProperty(int, isProvenOptimal)
     793CbcGetProperty(int, isProvenInfeasible)
     794CbcGetProperty(int, isContinuousUnbounded)
     795CbcGetProperty(int, isNodeLimitReached)
     796CbcGetProperty(int, isSecondsLimitReached)
     797CbcGetProperty(int, isSolutionLimitReached)
     798CbcGetProperty(int, isInitialSolveAbandoned)
     799CbcGetProperty(int, isInitialSolveProvenOptimal)
     800CbcGetProperty(int, isInitialSolveProvenPrimalInfeasible)
     801
     802CbcGetProperty(double, getObjSense)
     803
     804COINLIBAPI void COINLINKAGE
     805Cbc_setObjSense(Cbc_Model * model, double sense)
     806{
     807    model->model_->setObjSense(sense);
     808}
     809
     810CbcGetProperty(const double*, getRowActivity)
     811CbcGetProperty(const double*, getColSolution)
     812
    2019813COINLIBAPI void COINLINKAGE
    2020814Cbc_setColSolution(Cbc_Model * model, const double * input)
     
    2030824    return;
    2031825}
    2032 /* Dual row solution */
    2033 COINLIBAPI const double * COINLINKAGE
    2034 Cbc_getRowPrice(Cbc_Model * model)
    2035 {
    2036     const char prefix[] = "Cbc_C_Interface::Cbc_getRowPrice(): ";
    2037 //  const int  VERBOSE = 1;
    2038     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2039 
    2040     const double * result = NULL;
    2041     result = model->model_->getRowPrice();
    2042 
    2043     if (VERBOSE > 0)
    2044         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2045     return result;
    2046 }
    2047 /* Reduced costs */
    2048 COINLIBAPI const double * COINLINKAGE
    2049 Cbc_getReducedCost(Cbc_Model * model)
    2050 {
    2051     const char prefix[] = "Cbc_C_Interface::Cbc_getReducedCost(): ";
    2052 //  const int  VERBOSE = 1;
    2053     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2054 
    2055     const double * result = NULL;
    2056     result = model->model_->getReducedCost();
    2057 
    2058     if (VERBOSE > 0)
    2059         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2060     return result;
    2061 }
    2062 /* Row lower */
    2063 COINLIBAPI const double * COINLINKAGE
    2064 Cbc_getRowLower(Cbc_Model * model)
    2065 {
    2066     const char prefix[] = "Cbc_C_Interface::Cbc_getRowLower(): ";
    2067 //  const int  VERBOSE = 1;
    2068     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2069 
    2070     const double * result = NULL;
    2071     result = model->model_->getRowLower();
    2072 
    2073     if (VERBOSE > 0)
    2074         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2075     return result;
    2076 }
    2077 /* Row upper  */
    2078 COINLIBAPI const double * COINLINKAGE
    2079 Cbc_getRowUpper(Cbc_Model * model)
    2080 {
    2081     const char prefix[] = "Cbc_C_Interface::Cbc_getRowUpper(): ";
    2082 //  const int  VERBOSE = 1;
    2083     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2084 
    2085     const double * result = NULL;
    2086     result = model->model_->getRowUpper();
    2087 
    2088     if (VERBOSE > 0)
    2089         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2090     return result;
    2091 }
    2092 /* Objective Coefficients */
    2093 COINLIBAPI const double * COINLINKAGE
    2094 Cbc_getObjCoefficients(Cbc_Model * model)
    2095 {
    2096     const char prefix[] = "Cbc_C_Interface::Cbc_getObjCoefficients(): ";
    2097 //  const int  VERBOSE = 1;
    2098     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2099 
    2100     const double * result = NULL;
    2101     result = model->model_->getObjCoefficients();
    2102 
    2103     if (VERBOSE > 0)
    2104         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2105     return result;
    2106 }
    2107 /* Column Lower */
    2108 COINLIBAPI const double * COINLINKAGE
    2109 Cbc_getColLower(Cbc_Model * model)
    2110 {
    2111     const char prefix[] = "Cbc_C_Interface::Cbc_getColLower(): ";
    2112 //  const int  VERBOSE = 1;
    2113     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2114 
    2115     const double * result = NULL;
    2116     result = model->model_->getColLower();
    2117 
    2118     if (VERBOSE > 0)
    2119         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2120     return result;
    2121 }
    2122 /* Column Upper */
    2123 COINLIBAPI const double * COINLINKAGE
    2124 Cbc_getColUpper(Cbc_Model * model)
    2125 {
    2126     const char prefix[] = "Cbc_C_Interface::Cbc_getColUpper(): ";
    2127 //  const int  VERBOSE = 1;
    2128     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2129 
    2130     const double * result = NULL;
    2131     result = model->model_->getColUpper();
    2132 
    2133     if (VERBOSE > 0)
    2134         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2135     return result;
    2136 }
    2137 /* Objective value */
    2138 COINLIBAPI double COINLINKAGE
    2139 Cbc_getObjValue(Cbc_Model * model)
    2140 {
    2141     const char prefix[] = "Cbc_C_Interface::Cbc_getObjValue(): ";
    2142 //  const int  VERBOSE = 1;
    2143     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2144 
    2145     double result = 0;
    2146     result = model->model_->getObjValue();
    2147 
    2148     if (VERBOSE > 0)
    2149         printf("%s return %g\n", prefix, result);
    2150     return result;
    2151 }
     826
     827CbcGetProperty(const double*, getRowLower)
     828CbcGetProperty(const double*, getRowUpper)
     829CbcGetProperty(const double*, getObjCoefficients)
     830CbcGetProperty(const double*, getColLower)
     831CbcGetProperty(const double*, getColUpper)
     832
     833CbcGetProperty(double, getObjValue)
     834
    2152835/* Print model */
    2153836COINLIBAPI void COINLINKAGE
     
    2191874           static_cast<const void*>(colub), static_cast<const void*>(obj),
    2192875           static_cast<const void*>(rowlb), static_cast<const void*>(rowub));
    2193     printf("%s optimization direction = %g\n", argPrefix, Cbc_optimizationDirection(model));
     876    printf("%s optimization direction = %g\n", argPrefix, Cbc_getObjSense(model));
    2194877    printf("  (1 - minimize, -1 - maximize, 0 - ignore)\n");
    2195878    {
     
    2233916    return result;
    2234917}
    2235 /** Number of nodes explored in B&B tree */
    2236 COINLIBAPI int COINLINKAGE
    2237 Cbc_getNodeCount(Cbc_Model * model)
    2238 {
    2239     const char prefix[] = "Cbc_C_Interface::Cbc_getNodeCount(): ";
    2240 //  const int  VERBOSE = 1;
    2241     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2242 
    2243     int result = 0;
    2244     result = model->model_->getNodeCount() ;
    2245 
    2246     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    2247     return result;
    2248 }
     918
     919CbcGetProperty(int, getNodeCount)
     920
    2249921/** Return a copy of this model */
    2250922COINLIBAPI Cbc_Model * COINLINKAGE
     
    2255927    if (VERBOSE > 0) printf("%s begin\n", prefix);
    2256928
    2257     Cbc_Model * result = new Cbc_Model;
     929    Cbc_Model * result = new Cbc_Model();
    2258930    result->model_     = new CbcModel(*(model->model_));
    2259931    result->solver_    = dynamic_cast< OsiClpSolverInterface*> (result->model_->solver());
     
    2272944
    2273945    model->model_->solver()->setContinuous(iColumn);
     946
     947    if (VERBOSE > 0) printf("%s return\n", prefix);
     948    return model;
     949}
     950/** Set this the variable to be integer */
     951COINLIBAPI Cbc_Model * COINLINKAGE
     952Cbc_setInteger(Cbc_Model * model, int iColumn)
     953{
     954    const char prefix[] = "Cbc_C_Interface::Cbc_setContinuous(): ";
     955//  const int  VERBOSE = 1;
     956    if (VERBOSE > 0) printf("%s begin\n", prefix);
     957
     958    model->model_->solver()->setInteger(iColumn);
    2274959
    2275960    if (VERBOSE > 0) printf("%s return\n", prefix);
     
    23401025    if (VERBOSE > 0) printf("%sbegin\n", prefix);
    23411026
    2342     int numRows = Cbc_numberRows(model);
     1027    int numRows = Cbc_getNumRows(model);
    23431028    if (VERBOSE > 0) printf("%s numRows = %i\n", prefix, numRows);
    23441029
    23451030    // The passed sparse matrix must have the same number of rows as the model
    2346     assert(numRows == Cbc_numberRows(model));
     1031    assert(numRows == Cbc_getNumRows(model));
    23471032
    23481033    int row, i;
     
    24521137
    24531138        const double * rowPrimal = Cbc_getRowActivity(model);
    2454         // * Alternatively getReducedCost(model)
    2455         const double * rowDual = Cbc_getRowPrice(model);
    2456         // * Alternatively getColLower(model)
    24571139        const double * rowLower = Cbc_getRowLower(model);
    2458         // * Alternatively getColUpper(model)
    24591140        const double * rowUpper = Cbc_getRowUpper(model);
    24601141        printf("--------------------------------------\n");
     
    24631144        //    assert(Cbc_lengthNames(model));
    24641145
    2465         printf("                       Primal          Dual         Lower         Upper\n");
     1146        printf("                       Primal          Lower         Upper\n");
    24661147        for (iRow = 0; iRow < numberRows; iRow++) {
    24671148            double value;
     
    24731154                printf("%6d %8s", iRow, name);
    24741155                printf(" %13g", rowPrimal[iRow]);
    2475                 printf(" %13g", rowDual[iRow]);
    24761156                printf(" %13g", rowLower[iRow]);
    24771157                printf(" %13g", rowUpper[iRow]);
     
    24921172        // * Columns
    24931173
    2494         int numberColumns = Cbc_numberColumns(model);
     1174        int numberColumns = Cbc_getNumCols(model);
    24951175        int iColumn;
    24961176
    24971177
    2498         // * Alternatively getColSolution(model)
    24991178        const double * columnPrimal = Cbc_getColSolution(model);
    2500         // * Alternatively getReducedCost(model)
    2501         const double * columnDual = Cbc_getReducedCost(model);
    2502         // * Alternatively getColLower(model)
    25031179        const double * columnLower = Cbc_getColLower(model);
    2504         // * Alternatively getColUpper(model)
    25051180        const double * columnUpper = Cbc_getColUpper(model);
    2506         // * Alternatively getObjCoefficients(model)
    25071181        const double * columnObjective = Cbc_getObjCoefficients(model);
    2508 
    2509         const char * isInteger = Cbc_integerInformation(model);
    25101182
    25111183        printf("--------------------------------------\n");
     
    25141186//    assert(Cbc_lengthNames(model));
    25151187
    2516         printf("                       Primal          Dual         Lower         Upper          Cost     isInteger\n");
     1188        printf("                       Primal          Lower         Upper          Cost     isInteger\n");
    25171189        for (iColumn = 0; iColumn < numberColumns; iColumn++) {
    25181190            double value;
     
    25241196                printf("%6d %8s", iColumn, name);
    25251197                printf(" %13g", columnPrimal[iColumn]);
    2526                 printf(" %13g", columnDual[iColumn]);
    25271198                printf(" %13g", columnLower[iColumn]);
    25281199                printf(" %13g", columnUpper[iColumn]);
    25291200                printf(" %13g", columnObjective[iColumn]);
    2530                 printf(" %13i", isInteger[iColumn]);
     1201                printf(" %13i", Cbc_isInteger(model,iColumn));
    25311202                printf("\n");
    25321203            }
     
    25371208    return;
    25381209}
    2539 /** Dual initial solve */
    2540 COINLIBAPI int COINLINKAGE
    2541 Cbc_initialDualSolve(Cbc_Model * /*model*/)
    2542 {
    2543     return 0;
    2544 }
    2545 /** Primal initial solve */
    2546 COINLIBAPI int COINLINKAGE
    2547 Cbc_initialPrimalSolve(Cbc_Model * /*model*/)
    2548 {
    2549     return 0;
    2550 }
    2551 /** Dual algorithm - see ClpSimplexDual.hpp for method */
    2552 COINLIBAPI int COINLINKAGE
    2553 Cbc_dual(Cbc_Model * /*model*/, int /*ifValuesPass*/)
    2554 {
    2555     return 0;
    2556 }
    2557 /** Primal algorithm - see ClpSimplexPrimal.hpp for method */
    2558 COINLIBAPI int COINLINKAGE
    2559 Cbc_primal(Cbc_Model * /*model*/, int /*ifValuesPass*/)
    2560 {
    2561     return 0;
    2562 }
     1210
    25631211#if defined(__MWERKS__)
    25641212#pragma export off
  • trunk/Cbc/src/Cbc_C_Interface.h

    r2016 r2019  
    7676    Cbc_writeMps(Cbc_Model * model, const char *filename)
    7777    ;
    78     /** Integer information */
    79     COINLIBAPI char * COINLINKAGE
    80     Cbc_integerInformation(Cbc_Model * model)
    81     ;
    82     /** Copy in integer information */
    83     COINLIBAPI void COINLINKAGE
    84     Cbc_copyInIntegerInformation(Cbc_Model * model, const char * information)
    85     ;
    86     /** Drop integer informations */
    87     COINLIBAPI void COINLINKAGE
    88     Cbc_deleteIntegerInformation(Cbc_Model * model)
    89     ;
    90     /** Resizes rim part of model  */
    91     COINLIBAPI void COINLINKAGE
    92     Cbc_resize (Cbc_Model * model, int newNumberRows, int newNumberColumns)
    93     ;
    9478    /** Deletes rows */
    9579    COINLIBAPI void COINLINKAGE
     
    128112    /**@name gets and sets - you will find some synonyms at the end of this file */
    129113    /*@{*/
    130     /** Number of rows */
    131     COINLIBAPI int COINLINKAGE
    132     Cbc_numberRows(Cbc_Model * model)
    133     ;
    134     /** Number of columns */
    135     COINLIBAPI int COINLINKAGE
    136     Cbc_numberColumns(Cbc_Model * model)
    137     ;
    138     /** Primal tolerance to use */
    139     COINLIBAPI double COINLINKAGE
    140     Cbc_primalTolerance(Cbc_Model * model)
    141     ;
    142     COINLIBAPI void COINLINKAGE
    143     Cbc_setPrimalTolerance(Cbc_Model * model,  double value)
    144     ;
    145     /** Dual tolerance to use */
    146     COINLIBAPI double COINLINKAGE
    147     Cbc_dualTolerance(Cbc_Model * model)
    148     ;
    149     COINLIBAPI void COINLINKAGE
    150     Cbc_setDualTolerance(Cbc_Model * model,  double value)
    151     ;
    152     /* Integer tolerance to use */
    153     COINLIBAPI double COINLINKAGE
    154     Cbc_integerTolerance(Cbc_Model * model)
    155     ;
    156     COINLIBAPI void COINLINKAGE
    157     Cbc_setIntegerTolerance(Cbc_Model * model,  double value)
    158     ;
    159     /** Dual objective limit */
    160     COINLIBAPI double COINLINKAGE
    161     Cbc_dualObjectiveLimit(Cbc_Model * model)
    162     ;
    163     COINLIBAPI void COINLINKAGE
    164     Cbc_setDualObjectiveLimit(Cbc_Model * model, double value)
    165     ;
    166114    /** Objective offset */
    167115    COINLIBAPI double COINLINKAGE
     
    181129    COINLIBAPI int COINLINKAGE
    182130    Cbc_setProblemName(Cbc_Model * model, int maxNumberCharacters, char * array)
    183     ;
    184     /** Number of iterations */
    185     COINLIBAPI int COINLINKAGE
    186     Cbc_numberIterations(Cbc_Model * model)
    187     ;
    188     COINLIBAPI void COINLINKAGE
    189     Cbc_setNumberIterations(Cbc_Model * model, int numberIterations)
    190     ;
    191     /** Maximum number of iterations */
    192     COINLIBAPI int COINLINKAGE
    193     Cbc_maximumIterations(Cbc_Model * model)
    194     ;
    195     COINLIBAPI void COINLINKAGE
    196     Cbc_setMaximumIterations(Cbc_Model * model, int value)
    197     ;
    198     /** Maximum number of nodes */
    199     COINLIBAPI int COINLINKAGE
    200     Cbc_maxNumNode(Cbc_Model * model)
    201     ;
    202     COINLIBAPI void COINLINKAGE
    203     Cbc_setMaxNumNode(Cbc_Model * model, int value)
    204     ;
    205     /* Maximum number of solutions */
    206     COINLIBAPI int COINLINKAGE
    207     Cbc_maxNumSol(Cbc_Model * model)
    208     ;
    209     COINLIBAPI void COINLINKAGE
    210     Cbc_setMaxNumSol(Cbc_Model * model, int value)
    211     ;
    212     /** Maximum time in seconds (from when set called) */
    213     COINLIBAPI double COINLINKAGE
    214     Cbc_maximumSeconds(Cbc_Model * model)
    215     ;
    216     COINLIBAPI void COINLINKAGE
    217     Cbc_setMaximumSeconds(Cbc_Model * model, double value)
    218     ;
    219     /** Returns true if hit maximum iterations (or time) */
    220     COINLIBAPI int COINLINKAGE
    221     Cbc_hitMaximumIterations(Cbc_Model * model)
    222131    ;
    223132    /** Status of problem:
     
    231140    Cbc_status(Cbc_Model * model)
    232141    ;
    233     /** Set problem status */
    234     COINLIBAPI void COINLINKAGE
    235     Cbc_setProblemStatus(Cbc_Model * model, int problemStatus)
    236     ;
    237142    /** Secondary status of problem - may get extended
    238143        0 - none
     
    248153    Cbc_setSecondaryStatus(Cbc_Model * model, int status)
    249154    ;
    250     /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    251     COINLIBAPI double COINLINKAGE
    252     Cbc_optimizationDirection(Cbc_Model * model)
    253     ;
    254     COINLIBAPI void COINLINKAGE
    255     Cbc_setOptimizationDirection(Cbc_Model * model, double value)
    256     ;
    257     /** Primal row solution */
    258     COINLIBAPI double * COINLINKAGE
    259     Cbc_primalRowSolution(Cbc_Model * model)
    260     ;
    261     /** Primal column solution */
    262     COINLIBAPI double * COINLINKAGE
    263     Cbc_primalColumnSolution(Cbc_Model * model)
    264     ;
    265     /** Dual row solution */
    266     COINLIBAPI double * COINLINKAGE
    267     Cbc_dualRowSolution(Cbc_Model * model)
    268     ;
    269     /** Reduced costs */
    270     COINLIBAPI double * COINLINKAGE
    271     Cbc_dualColumnSolution(Cbc_Model * model)
    272     ;
    273     /** Row lower */
    274     COINLIBAPI double* COINLINKAGE
    275     Cbc_rowLower(Cbc_Model * model)
    276     ;
    277     /** Row upper  */
    278     COINLIBAPI double* COINLINKAGE
    279     Cbc_rowUpper(Cbc_Model * model)
    280     ;
    281     /** Objective */
    282     COINLIBAPI double * COINLINKAGE
    283     Cbc_objective(Cbc_Model * model)
    284     ;
    285     /** Column Lower */
    286     COINLIBAPI double * COINLINKAGE
    287     Cbc_columnLower(Cbc_Model * model)
    288     ;
    289     /** Column Upper */
    290     COINLIBAPI double * COINLINKAGE
    291     Cbc_columnUpper(Cbc_Model * model)
    292     ;
    293155    /** Number of elements in matrix */
    294156    COINLIBAPI int COINLINKAGE
     
    311173    Cbc_getElements(Cbc_Model * model)
    312174    ;
    313     /** Objective value */
    314     COINLIBAPI double COINLINKAGE
    315     Cbc_objectiveValue(Cbc_Model * model)
    316     ;
    317     /** Infeasibility/unbounded ray (NULL returned if none/wrong)
    318         Up to user to use delete [] on these arrays.  */
    319     COINLIBAPI double * COINLINKAGE
    320     Cbc_infeasibilityRay(Cbc_Model * model)
    321     ;
    322     COINLIBAPI double * COINLINKAGE
    323     Cbc_unboundedRay(Cbc_Model * model)
    324     ;
    325     /** See if status array exists (partly for OsiClp) */
    326     COINLIBAPI int COINLINKAGE
    327     Cbc_statusExists(Cbc_Model * model)
    328     ;
    329     /** Return address of status array (char[numberRows+numberColumns]) */
    330     COINLIBAPI void  COINLINKAGE
    331     Cbc_getBasisStatus(Cbc_Model * model, int * cstat, int * rstat)
    332     ;
    333     /** Copy in status vector */
    334     COINLIBAPI void COINLINKAGE
    335     Cbc_setBasisStatus(Cbc_Model * model, int * cstat, int * rstat)
    336     ;
    337 
    338     /** User pointer for whatever reason */
    339     COINLIBAPI void COINLINKAGE
    340     Cbc_setUserPointer (Cbc_Model * model, void * pointer)
    341     ;
    342     COINLIBAPI void * COINLINKAGE
    343     Cbc_getUserPointer (Cbc_Model * model)
    344     ;
     175   
    345176    /*@}*/
    346177    /**@name Message handling.  Call backs are handled by ONE function */
     
    356187    Cbc_clearCallBack(Cbc_Model * model)
    357188    ;
    358     /** Amount of print out:
    359         0 - none
    360         1 - just final
    361         2 - just factorizations
    362         3 - as 2 plus a bit more
    363         4 - verbose
    364         above that 8,16,32 etc just for selective debug
    365     */
    366     COINLIBAPI void COINLINKAGE
    367     Cbc_setLogLevel(Cbc_Model * model, int value)
    368     ;
    369     COINLIBAPI int COINLINKAGE
    370     Cbc_logLevel(Cbc_Model * model)
    371     ;
    372189    /** length of names (0 means no names0 */
    373190    COINLIBAPI int COINLINKAGE
     
    388205    /**@name Functions most useful to user */
    389206    /*@{*/
    390     /** General solve algorithm which can do presolve.
    391         See  ClpSolve.hpp for options
    392      */
    393     COINLIBAPI int COINLINKAGE
    394     Cbc_initialSolve(Cbc_Model * model)
    395     ;
    396     /* General solve algorithm which can do presolve.
    397        See  CbcModel.hpp for options
    398     */
    399     COINLIBAPI int COINLINKAGE
    400     Cbc_branchAndBound(Cbc_Model * model)
    401     ;
    402207    /* Solve using CbcMain1. This is the recommended default solve function.
    403208    */
     
    405210    Cbc_solve(Cbc_Model * model)
    406211    ;
    407     /** Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later) */
    408     COINLIBAPI void COINLINKAGE
    409     Cbc_scaling(Cbc_Model * model, int mode)
    410     ;
    411     /** Gets scalingFlag */
    412     COINLIBAPI int COINLINKAGE
    413     Cbc_scalingFlag(Cbc_Model * model)
    414     ;
    415     /** Crash - at present just aimed at dual, returns
    416         -2 if dual preferred and crash basis created
    417         -1 if dual preferred and all slack basis preferred
    418          0 if basis going in was not all slack
    419          1 if primal preferred and all slack basis preferred
    420          2 if primal preferred and crash basis created.
    421 
    422          if gap between bounds <="gap" variables can be flipped
    423 
    424          If "pivot" is
    425          0 No pivoting (so will just be choice of algorithm)
    426          1 Simple pivoting e.g. gub
    427          2 Mini iterations
    428     */
    429     COINLIBAPI int COINLINKAGE
    430     Cbc_crash(Cbc_Model * model, double gap, int pivot)
    431     ;
    432212    /*@}*/
    433213
     
    435215    /**@name most useful gets and sets */
    436216    /*@{*/
    437     /** If problem is primal feasible */
    438     COINLIBAPI int COINLINKAGE
    439     Cbc_primalFeasible(Cbc_Model * model)
    440     ;
    441     /** If problem is dual feasible */
    442     COINLIBAPI int COINLINKAGE
    443     Cbc_dualFeasible(Cbc_Model * model)
    444     ;
    445     /** Dual bound */
    446     COINLIBAPI double COINLINKAGE
    447     Cbc_dualBound(Cbc_Model * model)
    448     ;
    449     COINLIBAPI void COINLINKAGE
    450     Cbc_setDualBound(Cbc_Model * model, double value)
    451     ;
    452     /** Infeasibility cost */
    453     COINLIBAPI double COINLINKAGE
    454     Cbc_infeasibilityCost(Cbc_Model * model)
    455     ;
    456     COINLIBAPI void COINLINKAGE
    457     Cbc_setInfeasibilityCost(Cbc_Model * model, double value)
    458     ;
    459     /** Perturbation:
    460         50  - switch on perturbation
    461         100 - auto perturb if takes too long (1.0e-6 largest nonzero)
    462         101 - we are perturbed
    463         102 - don't try perturbing again
    464         default is 100
    465         others are for playing
    466     */
    467     COINLIBAPI int COINLINKAGE
    468     Cbc_perturbation(Cbc_Model * model)
    469     ;
    470     COINLIBAPI void COINLINKAGE
    471     Cbc_setPerturbation(Cbc_Model * model, int value)
    472     ;
    473     /** Current (or last) algorithm */
    474     COINLIBAPI int COINLINKAGE
    475     Cbc_algorithm(Cbc_Model * model)
    476     ;
    477     /** Set algorithm */
    478     COINLIBAPI void COINLINKAGE
    479     Cbc_setAlgorithm(Cbc_Model * model, int value)
    480     ;
    481     /** Sum of dual infeasibilities */
    482     COINLIBAPI double COINLINKAGE
    483     Cbc_sumDualInfeasibilities(Cbc_Model * model)
    484     ;
    485     /** Number of dual infeasibilities */
    486     COINLIBAPI int COINLINKAGE
    487     Cbc_numberDualInfeasibilities(Cbc_Model * model)
    488     ;
    489217    /** Sum of primal infeasibilities */
    490218    COINLIBAPI double COINLINKAGE
     
    494222    COINLIBAPI int COINLINKAGE
    495223    Cbc_numberPrimalInfeasibilities(Cbc_Model * model)
    496     ;
    497     /** Save model to file, returns 0 if success.  This is designed for
    498         use outside algorithms so does not save iterating arrays etc.
    499     It does not save any messaging information.
    500     Does not save scaling values.
    501     It does not know about all types of virtual functions.
    502     */
    503     COINLIBAPI int COINLINKAGE
    504     Cbc_saveModel(Cbc_Model * model, const char * fileName)
    505     ;
    506     /** Restore model from file, returns 0 if success,
    507         deletes current model */
    508     COINLIBAPI int COINLINKAGE
    509     Cbc_restoreModel(Cbc_Model * model, const char * fileName)
    510224    ;
    511225
     
    540254    Cbc_isProvenOptimal(Cbc_Model * model)
    541255    ;
    542     /** Is primal infeasiblity proven? */
    543     COINLIBAPI int COINLINKAGE
    544     Cbc_isProvenPrimalInfeasible(Cbc_Model * model)
    545     ;
    546     /** Is dual infeasiblity proven? */
    547     COINLIBAPI int COINLINKAGE
    548     Cbc_isProvenDualInfeasible(Cbc_Model * model)
    549     ;
    550     /** Is the given primal objective limit reached? */
    551     COINLIBAPI int COINLINKAGE
    552     Cbc_isPrimalObjectiveLimitReached(Cbc_Model * model)
    553     ;
    554     /** Is the given dual objective limit reached? */
    555     COINLIBAPI int COINLINKAGE
    556     Cbc_isDualObjectiveLimitReached(Cbc_Model * model)
    557     ;
    558     /** Iteration limit reached? */
    559     COINLIBAPI int COINLINKAGE
    560     Cbc_isIterationLimitReached(Cbc_Model * model)
    561     ;
    562     /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
     256    /** Is infeasiblity proven (or none better than cutoff)? */
     257    COINLIBAPI int COINLINKAGE
     258    Cbc_isProvenInfeasible(Cbc_Model * model)
     259    ;
     260    /** Was continuous solution unbounded? */
     261    COINLIBAPI int COINLINKAGE
     262    Cbc_isContinuousUnbounded(Cbc_Model * model)
     263    ;
     264    /** Node limit reached? */
     265    COINLIBAPI int COINLINKAGE
     266    Cbc_isNodeLimitReached(Cbc_Model * model)
     267    ;
     268    /** Time limit reached? */
     269    COINLIBAPI int COINLINKAGE
     270    Cbc_isSecondsLimitReached(Cbc_Model * model)
     271    ;
     272    /** Solution limit reached? */
     273    COINLIBAPI int COINLINKAGE
     274    Cbc_isSolutionLimitReached(Cbc_Model * model)
     275    ;
     276    /** Are there numerical difficulties (for initialSolve) ? */
     277    COINLIBAPI int COINLINKAGE
     278    Cbc_isInitialSolveAbandoned(Cbc_Model * model)
     279    ;
     280    /** Is optimality proven (for initialSolve) ? */
     281    COINLIBAPI int COINLINKAGE
     282    Cbc_isInitialSolveProvenOptimal(Cbc_Model * model)
     283    ;
     284    /** Is primal infeasiblity proven (for initialSolve) ? */
     285    COINLIBAPI int COINLINKAGE
     286    Cbc_isInitialSolveProvenPrimalInfeasible(Cbc_Model * model)
     287    ;
     288    /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore) */
     289    COINLIBAPI void COINLINKAGE
     290    Cbc_setObjSense(Cbc_Model * model, double sense)
     291    ;
     292    /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore) */
    563293    COINLIBAPI double COINLINKAGE
    564294    Cbc_getObjSense(Cbc_Model * model)
    565295    ;
    566     /** Primal row solution */
     296    /** Primal row solution
     297     *  This is the vector A*x, where A is the constraint matrix
     298     *  and x is the current solution. */
    567299    COINLIBAPI const double * COINLINKAGE
    568300    Cbc_getRowActivity(Cbc_Model * model)
     
    574306    COINLIBAPI void COINLINKAGE
    575307    Cbc_setColSolution(Cbc_Model * model, const double * input)
    576     ;
    577     /** Dual row solution */
    578     COINLIBAPI const double * COINLINKAGE
    579     Cbc_getRowPrice(Cbc_Model * model)
    580     ;
    581     /** Reduced costs */
    582     COINLIBAPI const double * COINLINKAGE
    583     Cbc_getReducedCost(Cbc_Model * model)
    584308    ;
    585309    /** Row lower */
     
    630354    COINLIBAPI Cbc_Model * COINLINKAGE
    631355    Cbc_setContinuous(Cbc_Model * model, int iColumn)
     356    ;
     357    /** Set this the variable to be integer */
     358    COINLIBAPI Cbc_Model * COINLINKAGE
     359    Cbc_setInteger(Cbc_Model * model, int iColumn)
    632360    ;
    633361    /** Add SOS constraints to the model using dense matrix */
     
    649377    Cbc_printSolution(Cbc_Model * model)
    650378    ;
    651     /** Dual initial solve */
    652     COINLIBAPI int COINLINKAGE
    653     Cbc_initialDualSolve(Cbc_Model * model)
    654     ;
    655     /** Primal initial solve */
    656     COINLIBAPI int COINLINKAGE
    657     Cbc_initialPrimalSolve(Cbc_Model * model)
    658     ;
    659     /** Dual algorithm - see ClpSimplexDual.hpp for method */
    660     COINLIBAPI int COINLINKAGE
    661     Cbc_dual(Cbc_Model * model, int ifValuesPass)
    662     ;
    663     /** Primal algorithm - see ClpSimplexPrimal.hpp for method */
    664     COINLIBAPI int COINLINKAGE
    665     Cbc_primal(Cbc_Model * model, int ifValuesPass)
    666     ;
    667379    /*@}*/
    668380#ifdef __cplusplus
  • trunk/Cbc/test/CInterfaceTest.c

    r2016 r2019  
    1616
    1717    /* Simple knapsack problem
    18        Minimize -5x[1] - 3x[2] - 2x[3] - 7x[4] - 4x[5]
     18       Maximize  5x[1] + 3x[2] + 2x[3] + 7x[4] + 4x[5]
    1919       s.t.      2x[1] + 8x[2] + 4x[3] + 2x[4] + 5x[5] <= 10
    2020       All x binary
     
    2626    double collb[] = {0,0,0,0,0};
    2727    double colub[] = {1,1,1,1,1};
    28     double obj[] = {-5, -3, -2, -7, -4};
     28    double obj[] = {5, 3, 2, 7, 4};
    2929    double rowlb[] = {-INFINITY};
    3030    double rowub[] = {10};
    31     char integer[] = {1,1,1,1,1};
    32     char *information;
    3331    const double *sol;
    3432    int i;
     
    3634    Cbc_loadProblem(model, 5, 1, start, rowindex, value, collb, colub, obj, rowlb, rowub);
    3735
    38     Cbc_copyInIntegerInformation(model, integer);
    39 
    4036    assert(Cbc_getNumCols(model) == 5);
    4137    assert(Cbc_getNumRows(model) == 1);
    4238
    43     information = Cbc_integerInformation(model);
    4439    for (i = 0; i < 5; i++) {
    45         assert(information[i] == 1);
     40        Cbc_setInteger(model, i);
     41        assert(Cbc_isInteger(model,i));
    4642    }
    4743
    48     assert(Cbc_optimizationDirection(model) == 1);
     44    Cbc_setObjSense(model, -1);
     45    assert(Cbc_getObjSense(model) == -1);
    4946
    5047    Cbc_solve(model);
    5148
    5249    assert(Cbc_isProvenOptimal(model));
    53     assert(fabs( Cbc_objectiveValue(model)- (-16.0) < 1e-6));
     50    assert(!Cbc_isAbandoned(model));
     51    assert(!Cbc_isProvenInfeasible(model));
     52    assert(!Cbc_isContinuousUnbounded(model));
     53    assert(!Cbc_isNodeLimitReached(model));
     54    assert(!Cbc_isSecondsLimitReached(model));
     55    assert(!Cbc_isSolutionLimitReached(model));
     56    assert(fabs( Cbc_getObjValue(model)- (16.0) < 1e-6));
    5457   
    5558    sol = Cbc_getColSolution(model);
     
    8083    double colub[] = {1.0};
    8184    double obj[] = {1.0};
    82     char integer[] = {1};
    8385
    8486    Cbc_loadProblem(model, 1, 1, start, rowindex, value, collb, colub, obj, rowlb, rowub);
    8587
    86     Cbc_copyInIntegerInformation(model, integer);
     88    Cbc_setInteger(model, 0);
    8789
    8890    assert(Cbc_getNumCols(model) == 1);
     
    9294   
    9395    assert(!Cbc_isProvenOptimal(model));
    94     assert(Cbc_isProvenPrimalInfeasible(model));
     96    assert(Cbc_isProvenInfeasible(model));
    9597
    9698}
     
    115117    double colub[] = {INFINITY, INFINITY};
    116118    double obj[] = {1.0};
    117     char integer[] = {1,0};
    118119
    119120    Cbc_loadProblem(model, 2, 2, start, rowindex, value, collb, colub, obj, rowlb, rowub);
    120121
    121     Cbc_copyInIntegerInformation(model, integer);
     122    Cbc_setInteger(model, 0);
    122123
    123124    Cbc_solve(model);
    124125   
    125126    assert(!Cbc_isProvenOptimal(model));
    126     assert(!Cbc_isProvenPrimalInfeasible(model));
    127     assert(Cbc_isProvenDualInfeasible(model));
     127    assert(!Cbc_isProvenInfeasible(model));
     128    assert(Cbc_isContinuousUnbounded(model));
    128129
    129130
Note: See TracChangeset for help on using the changeset viewer.