Changes from releases/2.8.10 at r2347 to releases/2.8.11 at r2347


Ignore:
Location:
releases/2.8.11
Files:
1 added
19 edited

Legend:

Unmodified
Added
Removed
  • releases/2.8.11/Cbc

  • releases/2.8.11/Cbc/configure

    r2347 r2347  
    11#! /bin/sh
    22# Guess values for system-dependent variables and create Makefiles.
    3 # Generated by GNU Autoconf 2.59 for Cbc 2.8.10.
     3# Generated by GNU Autoconf 2.59 for Cbc 2.8.11.
    44#
    55# Report bugs to <cbc@lists.coin-or.org>.
     
    430430PACKAGE_NAME='Cbc'
    431431PACKAGE_TARNAME='cbc'
    432 PACKAGE_VERSION='2.8.10'
    433 PACKAGE_STRING='Cbc 2.8.10'
     432PACKAGE_VERSION='2.8.11'
     433PACKAGE_STRING='Cbc 2.8.11'
    434434PACKAGE_BUGREPORT='cbc@lists.coin-or.org'
    435435
     
    10061006  # This message is too long to be a string in the A/UX 3.1 sh.
    10071007  cat <<_ACEOF
    1008 \`configure' configures Cbc 2.8.10 to adapt to many kinds of systems.
     1008\`configure' configures Cbc 2.8.11 to adapt to many kinds of systems.
    10091009
    10101010Usage: $0 [OPTION]... [VAR=VALUE]...
     
    10721072if test -n "$ac_init_help"; then
    10731073  case $ac_init_help in
    1074      short | recursive ) echo "Configuration of Cbc 2.8.10:";;
     1074     short | recursive ) echo "Configuration of Cbc 2.8.11:";;
    10751075   esac
    10761076  cat <<\_ACEOF
     
    13061306if $ac_init_version; then
    13071307  cat <<\_ACEOF
    1308 Cbc configure 2.8.10
     1308Cbc configure 2.8.11
    13091309generated by GNU Autoconf 2.59
    13101310
     
    13261326running configure, to aid debugging if configure makes a mistake.
    13271327
    1328 It was created by Cbc $as_me 2.8.10, which was
     1328It was created by Cbc $as_me 2.8.11, which was
    13291329generated by GNU Autoconf 2.59.  Invocation command line was
    13301330
     
    18521852
    18531853# Capture libtool library version, if given.
    1854  coin_libversion=11:10:8
     1854 coin_libversion=11:11:8
    18551855
    18561856
     
    45744574# Define the identity of the package.
    45754575 PACKAGE='cbc'
    4576  VERSION='2.8.10'
     4576 VERSION='2.8.11'
    45774577
    45784578
     
    3115931159cat >&5 <<_CSEOF
    3116031160
    31161 This file was extended by Cbc $as_me 2.8.10, which was
     31161This file was extended by Cbc $as_me 2.8.11, which was
    3116231162generated by GNU Autoconf 2.59.  Invocation command line was
    3116331163
     
    3122231222cat >>$CONFIG_STATUS <<_ACEOF
    3122331223ac_cs_version="\\
    31224 Cbc config.status 2.8.10
     31224Cbc config.status 2.8.11
    3122531225configured by $0, generated by GNU Autoconf 2.59,
    3122631226  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
  • releases/2.8.11/Cbc/configure.ac

    r2347 r2347  
    1313AC_PREREQ(2.59)
    1414
    15 AC_INIT([Cbc],[2.8.10],[cbc@lists.coin-or.org])
     15AC_INIT([Cbc],[2.8.11],[cbc@lists.coin-or.org])
    1616
    1717AC_COPYRIGHT([
     
    4242# externals.  The following macro ensures that those externals are
    4343# retrieved by svn if they are not there yet.
    44 AC_COIN_PROJECTDIR_INIT(Cbc,11:10:8)
     44AC_COIN_PROJECTDIR_INIT(Cbc,11:11:8)
    4545
    4646# Check if user wants to produce debugging code
  • releases/2.8.11/Cbc/src/CbcBranchLotsize.cpp

    r2347 r2347  
    505505    } else {
    506506        // ranges
    507         solver->setColLower(columnNumber_, bound_[2*range_]);
    508         solver->setColUpper(columnNumber_, bound_[2*range_+1]);
     507        solver->setColLower(columnNumber_, CoinMax(bound_[2*range_],
     508                                                   lower[columnNumber_]));
     509        solver->setColUpper(columnNumber_, CoinMin(bound_[2*range_+1],
     510                                                   upper[columnNumber_]));
    509511        if (value > bound_[2*range_+1])
    510512            nearest = bound_[2*range_+1];
     
    739741    int iColumn = variable_;
    740742    if (way_ < 0) {
    741 #ifdef CBC_DEBUG
     743#ifndef NDEBUG
    742744        { double olb, oub ;
    743745            olb = model_->solver()->getColLower()[iColumn] ;
    744746            oub = model_->solver()->getColUpper()[iColumn] ;
     747#ifdef CBC_DEBUG
    745748            printf("branching down on var %d: [%g,%g] => [%g,%g]\n",
    746749                   iColumn, olb, oub, down_[0], down_[1]) ;
     750#endif
     751            assert (olb<down_[0]+1.0e-7&&oub>down_[1]-1.0e-7);
    747752        }
    748753#endif
     
    751756        way_ = 1;
    752757    } else {
    753 #ifdef CBC_DEBUG
     758#ifndef NDEBUG
    754759        { double olb, oub ;
    755760            olb = model_->solver()->getColLower()[iColumn] ;
    756761            oub = model_->solver()->getColUpper()[iColumn] ;
     762#ifdef CBC_DEBUG
    757763            printf("branching up on var %d: [%g,%g] => [%g,%g]\n",
    758764                   iColumn, olb, oub, up_[0], up_[1]) ;
     765#endif
     766            assert (olb<up_[0]+1.0e-7&&oub>up_[1]-1.0e-7);
    759767        }
    760768#endif
  • releases/2.8.11/Cbc/src/CbcHeuristic.cpp

    r2347 r2347  
    277277    // No longer used for original purpose - so use for ever run at all JJF
    278278#ifndef JJF_ONE
    279     // Don't run if hot start
    280     if (model_ && model_->hotstartSolution())
     279    // Don't run if hot start or no rows!
     280    if (model_ && (model_->hotstartSolution()||!model_->getNumRows()))
    281281        return false;
    282282    else
  • releases/2.8.11/Cbc/src/CbcModel.cpp

    r2347 r2347  
    12351235    int * del = new int [CoinMax(numberColumns, numberRows)];
    12361236    int * original = new int [numberColumns];
     1237    int numberOriginalIntegers=numberIntegers_;
    12371238    char * possibleRow = new char [numberRows];
    12381239    {
     
    12651266                    j < rowStart[i] + rowLength[i]; j++) {
    12661267                int iColumn = column[j];
     1268                double value = fabs(element[j]);
    12671269                if (continuousSolver_->isInteger(iColumn)) {
    1268                     if (fabs(element[j]) != 1.0)
     1270                    if (value != 1.0)
    12691271                        possible = false;
    12701272                } else {
    12711273                    nLeft++;
     1274                    if (value>100.0)
     1275                      allSame=-1.0; // not safe
    12721276                    if (!allSame) {
    1273                       allSame = fabs(element[j]);
     1277                      allSame = value;
    12741278                    } else if (allSame>0.0) {
    1275                       if (allSame!=fabs(element[j]))
     1279                      if (allSame!=value)
    12761280                        allSame = -1.0;
    12771281                    }
     
    12911295        if (continuousSolver_->isInteger(i))
    12921296            del[nDel++] = i;
     1297    }
     1298    {
     1299      // we must not exclude current best solution (rounding errors)
     1300      // also not if large values
     1301      const int * row = continuousSolver_->getMatrixByCol()->getIndices();
     1302      const CoinBigIndex * columnStart = continuousSolver_->getMatrixByCol()->getVectorStarts();
     1303      const int * columnLength = continuousSolver_->getMatrixByCol()->getVectorLengths();
     1304      const double * solution = continuousSolver_->getColSolution();
     1305      for (int iColumn = 0; iColumn < numberColumns; iColumn++) {
     1306        if (!continuousSolver_->isInteger(iColumn)) {
     1307          double value = bestSolution_ ? bestSolution_[iColumn] : 0.0;
     1308          double value2 = solution[iColumn];
     1309          if (fabs(value-floor(value+0.5))>1.0e-8 ||
     1310              fabs(value2)>1.0e3) {
     1311            CoinBigIndex start = columnStart[iColumn];
     1312            CoinBigIndex end = start + columnLength[iColumn];
     1313            for (CoinBigIndex j = start; j < end; j++) {
     1314              int iRow = row[j];
     1315              possibleRow[iRow]=0;
     1316            }
     1317          }
     1318        }
     1319      }
    12931320    }
    12941321    int nExtra = 0;
     
    15581585    // double check increment
    15591586    analyzeObjective();
     1587    // If any changes - tell code
     1588    if(numberOriginalIntegers<numberIntegers_)
     1589      synchronizeModel();
    15601590}
    15611591/**
     
    20062036#endif
    20072037    bool feasible;
     2038    {
     2039      // check
     2040      int numberOdd = 0;
     2041      for (int i = 0; i < numberObjects_; i++) {
     2042        CbcSimpleInteger * obj =
     2043          dynamic_cast <CbcSimpleInteger *>(object_[i]) ;
     2044        if (!obj)
     2045          numberOdd++;
     2046      }
     2047      if (numberOdd)
     2048        moreSpecialOptions_ |= 1073741824;
     2049    }
    20082050    numberSolves_ = 0 ;
    20092051    // If NLP then we assume already solved outside branchAndbound
     
    98199861    }
    98209862    // Can't happen if strong branching as would have been found before
    9821     if (!numberStrong_ && numberObjects_ > numberIntegers_) {
     9863    if ((!numberStrong_||(moreSpecialOptions_&1073741824)!=0)
     9864        && numberObjects_ > numberIntegers_) {
    98229865        int iColumn;
    98239866        int numberColumns = solver_->getNumCols();
     
    98559898        }
    98569899        if (clpSolver && (!currentNode_ || (currentNode_->depth()&2) != 0) &&
    9857                 !solverCharacteristics_->solutionAddsCuts())
     9900                !solverCharacteristics_->solutionAddsCuts() &&
     9901            (moreSpecialOptions_&1073741824)==0)
    98589902            nTightened = clpSolver->tightenBounds();
    98599903        if (nTightened) {
  • releases/2.8.11/Cbc/src/CbcModel.hpp

    r2347 r2347  
    18291829        28 bit (268435456) - idiot branching
    18301830        29 bit (536870912) - don't make fake objective
     1831        30 bit (1073741824) - Funny SOS or similar - be careful
    18311832    */
    18321833    inline void setMoreSpecialOptions(int value) {
  • releases/2.8.11/Cbc/src/CbcNode.cpp

    r2347 r2347  
    28202820                int preferredWay;
    28212821                double infeasibility = object->infeasibility(&usefulInfo, preferredWay);
     2822                double predictedChange=0.0;
    28222823                // may have become feasible
    28232824                if (!infeasibility) {
     
    29102911                    */
    29112912                    choice.possibleBranch->way(-1) ;
    2912                     choice.possibleBranch->branch() ;
     2913                    predictedChange = choice.possibleBranch->branch() ;
    29132914                    solver->solveFromHotStart() ;
    29142915                    bool needHotStartUpdate = false;
     
    29592960#endif
    29602961                    }
     2962                    // say infeasible if branch says so
     2963                    if (predictedChange==COIN_DBL_MAX)
     2964                      iStatus=1;
    29612965                    if (iStatus != 2 && solver->getIterationCount() >
    29622966                            realMaxHotIterations)
     
    30963100
    30973101                    // repeat the whole exercise, forcing the variable up
    3098                     choice.possibleBranch->branch();
     3102                    predictedChange=choice.possibleBranch->branch();
    30993103                    solver->solveFromHotStart() ;
    31003104                    numberStrongDone++;
     
    31443148#endif
    31453149                    }
     3150                    // say infeasible if branch says so
     3151                    if (predictedChange==COIN_DBL_MAX)
     3152                      iStatus=1;
    31463153                    if (iStatus != 2 && solver->getIterationCount() >
    31473154                            realMaxHotIterations)
  • releases/2.8.11/Cbc/src/CbcSOS.cpp

    r2347 r2347  
    461461        }
    462462    }
    463     assert (lastNonZero - firstNonZero < sosType_) ;
    464     for (j = 0; j < firstNonZero; j++) {
     463    // Might get here in odd situation if so fix all
     464    if (lastNonZero - firstNonZero < sosType_) {
     465      for (j = 0; j < firstNonZero; j++) {
    465466        int iColumn = members_[j];
    466467        solver->setColUpper(iColumn, 0.0);
    467     }
    468     for (j = lastNonZero + 1; j < numberMembers_; j++) {
     468      }
     469      for (j = lastNonZero + 1; j < numberMembers_; j++) {
    469470        int iColumn = members_[j];
    470471        solver->setColUpper(iColumn, 0.0);
     472      }
     473    } else {
     474      for (j = 0; j < numberMembers_; j++) {
     475        int iColumn = members_[j];
     476        solver->setColUpper(iColumn, 0.0);
     477        solver->setColLower(iColumn, 1.0);
     478      }
    471479    }
    472480}
     
    836844    const double * weights = set_->weights();
    837845    OsiSolverInterface * solver = model_->solver();
    838     //const double * lower = solver->getColLower();
    839     //const double * upper = solver->getColUpper();
     846    const double * lower = solver->getColLower();
     847    const double * upper = solver->getColUpper();
    840848    // *** for way - up means fix all those in down section
    841849    if (way_ < 0) {
     
    861869    }
    862870    computeNonzeroRange();
    863     return 0.0;
     871    double predictedChange=0.0;
     872    for (int i = 0; i < numberMembers; i++) {
     873      int iColumn=which[i];
     874      if (lower[iColumn]>upper[iColumn])
     875        predictedChange=COIN_DBL_MAX;
     876    }
     877    return predictedChange;
    864878}
    865879/* Update bounds in solver as in 'branch' and update given bounds.
  • releases/2.8.11/Cbc/src/CbcSolver.cpp

    r2347 r2347  
    38123812                                  dynamic_cast <CbcSimpleInteger *>(objects[iObj]) ;
    38133813                                if (!objSimpleInteger&&!objSOS) {
     3814                                  // find all integers anyway
     3815                                  babModel_->findIntegers(true);
    38143816                                  preProcess=0;
    38153817                                  break;
     
    43854387                                    model_.setProblemStatus(0);
    43864388                                    model_.setSecondaryStatus(1);
     4389                                    // say infeasible for solution
     4390                                    integerStatus = 6;
    43874391                                    // and in babModel_ if exists
    43884392                                    if (babModel_) {
  • releases/2.8.11/Cbc/src/Cbc_C_Interface.cpp

    r2347 r2347  
    44// This code is licensed under the terms of the Eclipse Public License (EPL).
    55
    6 #include <math.h>
     6#include <cmath>
    77#include <cfloat>
    88
     
    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}
     35
     36#define CbcSetSolverProperty(T,prop) \
     37COINLIBAPI void COINLINKAGE \
     38Cbc_ ## prop (Cbc_Model *m, int index, T val) \
     39{ \
     40    m->model_->solver()->prop(index,val); \
     41}
    2842
    2943const int  VERBOSE = 0;
     
    213227
    214228/* Version */
    215 COINLIBAPI double COINLINKAGE Cbc_getVersion()
    216 {
    217     double v = 1.0;
    218     return v;
     229COINLIBAPI const char* COINLINKAGE Cbc_getVersion()
     230{
     231    return CBC_VERSION;
    219232}
    220233
     
    227240    if (VERBOSE > 0) printf("%s begin\n", prefix);
    228241
    229     Cbc_Model * model = new Cbc_Model;
     242    Cbc_Model * model = new Cbc_Model();
    230243    OsiClpSolverInterface solver1;
    231244    model->solver_    = &solver1;
    232     model->solver_->OsiClpSolverInterface::setHintParam(OsiDoReducePrint, true, OsiHintTry);
    233245    model->model_     = new CbcModel(solver1);
     246    CbcMain0(*model->model_);
    234247    model->handler_   = NULL;
    235     model->information_ = NULL;
    236248
    237249    if (VERBOSE > 0) printf("%s return\n", prefix);
     
    254266    fflush(stdout);
    255267    delete model->handler_;
    256 
    257     if (VERBOSE > 1) printf("%s free model->information_\n", prefix);
    258     fflush(stdout);
    259     if (model->information_) free(model->information_);
    260268
    261269    if (VERBOSE > 1) printf("%s delete model\n", prefix);
     
    310318    fflush(stdout);
    311319
    312     if (1) {
    313         solver->loadProblem(numcols, numrows, start, index, value,
    314                             collb, colub, obj, rowlb, rowub);
    315     } else {
    316         solver->loadProblem(0, 0, NULL, NULL, NULL,
    317                             NULL, NULL, NULL, NULL, NULL);
    318     }
     320    solver->loadProblem(numcols, numrows, start, index, value,
     321                        collb, colub, obj, rowlb, rowub);
    319322    if (VERBOSE > 1) printf("%s Finished solver->loadProblem()\n", prefix);
    320323    fflush(stdout);
     
    348351    if (VERBOSE > 1) printf("%s filename = '%s'\n", prefix, filename);
    349352
    350     model->model_->solver()->writeMps(filename, "mps", Cbc_optimizationDirection(model));
     353    model->model_->solver()->writeMps(filename, "mps", Cbc_getObjSense(model));
    351354
    352355    if (VERBOSE > 0) printf("%s return\n", prefix);
    353356    return;
    354357}
    355 /* Integer information */
    356 COINLIBAPI char * COINLINKAGE
    357 Cbc_integerInformation(Cbc_Model * model)
    358 {
    359     const char prefix[] = "Cbc_C_Interface::Cbc_integerInformation(): ";
    360 //  const int  VERBOSE = 1;
    361     if (VERBOSE > 0) printf("%s begin\n", prefix);
    362 
    363     int col;
    364     int numcols = Cbc_getNumCols(model);
    365 
    366     // allocate model->information_ if null
    367     // this is freed in Cbc_deleteModel() if not null
    368     if (!model->information_)
    369         model->information_ = (char *) malloc(numcols * sizeof(char));
    370 
    371     for (col = 0; col < numcols; col++)
    372         if (model->model_->solver()->isContinuous(col))
    373             model->information_[col] = 0;
    374         else
    375             model->information_[col] = 1;
    376 
    377     char * result = model->information_;
    378 
    379     if (VERBOSE > 0) printf("%s return %p\n", prefix, result);
    380     return result;
    381 }
    382 /* Copy in integer information */
    383 COINLIBAPI void COINLINKAGE
    384 Cbc_copyInIntegerInformation(Cbc_Model * model, const char * information)
    385 {
    386     const char prefix[] = "Cbc_C_Interface::Cbc_copyInIntegerInformation(): ";
    387 //  const int  VERBOSE = 1;
    388     if (VERBOSE > 0) printf("%s begin\n", prefix);
    389 
    390     int col;
    391     int numcols = Cbc_getNumCols(model);
    392     for (col = 0; col < numcols; col++)
    393         if (information[col])
    394             model->model_->solver()->setInteger(col);
    395         else
    396             model->model_->solver()->setContinuous(col);
    397 
    398     if (VERBOSE > 0) printf("%s return\n", prefix);
    399 }
    400 /* Drop integer informations */
    401 COINLIBAPI void COINLINKAGE
    402 Cbc_deleteIntegerInformation(Cbc_Model * /*model*/)
    403 {
    404     const char prefix[] = "Cbc_C_Interface::Cbc_deleteIntegerInformation(): ";
    405 //  const int  VERBOSE = 1;
    406     if (VERBOSE > 0) printf("%s begin\n", prefix);
    407 
    408 //  available through
    409 //    OsiClpSolverInterface::setContinuous
    410 //tbd  model->model_->deleteIntegerInformation();
    411     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    412 
    413     if (VERBOSE > 0) printf("%s return\n", prefix);
    414 }
    415 /* Resizes rim part of model  */
    416 COINLIBAPI void COINLINKAGE
    417 Cbc_resize (Cbc_Model * /*model*/, int /*newNumberRows*/,
    418             int /*newNumberColumns*/)
    419 {
    420     const char prefix[] = "Cbc_C_Interface::Cbc_resize(): ";
    421 //  const int  VERBOSE = 1;
    422     if (VERBOSE > 0) printf("%s begin\n", prefix);
    423 
    424 // cannot find this in Cbc, Osi, or OsiClp
    425 //tbd  model->model_->solver()->resize(newNumberRows,newNumberColumns);
    426     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    427 
    428     if (VERBOSE > 0) printf("%s return\n", prefix);
    429 }
    430 /* Deletes rows */
    431 COINLIBAPI void COINLINKAGE
    432 Cbc_deleteRows(Cbc_Model * model, int number, const int * which)
    433 {
    434     const char prefix[] = "Cbc_C_Interface::Cbc_deleteRows(): ";
    435 //  const int  VERBOSE = 1;
    436     if (VERBOSE > 0) printf("%s begin\n", prefix);
    437 
    438     OsiSolverInterface * solver = model->model_->solver();
    439     solver->deleteRows(number, which);
    440 
    441     if (VERBOSE > 0) printf("%s return\n", prefix);
    442 }
    443 /* Add rows */
    444 COINLIBAPI void COINLINKAGE
    445 Cbc_addRows(Cbc_Model * /*model*/, const int /*number*/,
    446             const double * /*rowLower*/,
    447             const double * /*rowUpper*/,
    448             const int * /*rowStarts*/, const int * /*columns*/,
    449             const double * /*elements*/)
    450 {
    451     const char prefix[] = "Cbc_C_Interface::Cbc_addRows(): ";
    452 //  const int  VERBOSE = 1;
    453     if (VERBOSE > 0) printf("%s begin\n", prefix);
    454 
    455 // available through OsiClp
    456 //tbd  model->model_->addRows(number,rowLower,rowUpper,rowStarts,columns,elements);
    457     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    458 
    459     if (VERBOSE > 0) printf("%s return\n", prefix);
    460 }
    461 
    462 /* Deletes columns */
    463 COINLIBAPI void COINLINKAGE
    464 Cbc_deleteColumns(Cbc_Model * model, int number, const int * which)
    465 {
    466     const char prefix[] = "Cbc_C_Interface::Cbc_deleteColumns(): ";
    467 //  const int  VERBOSE = 1;
    468     if (VERBOSE > 0) printf("%s begin\n", prefix);
    469 
    470     OsiSolverInterface * solver = model->model_->solver();
    471     solver->deleteCols(number, which);
    472 
    473     if (VERBOSE > 0) printf("%s return\n", prefix);
    474 }
    475 /* Add columns */
    476 COINLIBAPI void COINLINKAGE
    477 Cbc_addColumns(Cbc_Model * /*model*/, int /*number*/,
    478                const double * /*columnLower*/,
    479                const double * /*columnUpper*/,
    480                const double * /*objective*/,
    481                const int * /*columnStarts*/, const int * /*rows*/,
    482                const double * /*elements*/)
    483 {
    484     const char prefix[] = "Cbc_C_Interface::Cbc_addColumns(): ";
    485 //  const int  VERBOSE = 1;
    486     if (VERBOSE > 0) printf("%s begin\n", prefix);
    487 
    488 // available through OsiClp
    489 //tbd  model->model_->addColumns(number,columnLower,columnUpper,objective,
    490 //tbd                       columnStarts,rows,elements);
    491     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    492 
    493     if (VERBOSE > 0) printf("%s return\n", prefix);
    494 }
    495 /* Drops names - makes lengthnames 0 and names empty */
    496 COINLIBAPI void COINLINKAGE
    497 Cbc_dropNames(Cbc_Model * /*model*/)
    498 {
    499     const char prefix[] = "Cbc_C_Interface::Cbc_dropNames(): ";
    500 //  const int  VERBOSE = 1;
    501     if (VERBOSE > 0) printf("%s begin\n", prefix);
    502 
    503 // cannot find names in Cbc, Osi, or OsiClp
    504 //tbd  model->model_->dropNames();
    505     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    506 
    507     if (VERBOSE > 0) printf("%s return\n", prefix);
    508 }
    509 /* Copies in names */
    510 COINLIBAPI void COINLINKAGE
    511 Cbc_copyNames(Cbc_Model * /*model*/, const char * const * /*rowNamesIn*/,
    512               const char * const * /*columnNamesIn*/)
    513 {
    514     const char prefix[] = "Cbc_C_Interface::Cbc_copyNames(): ";
    515 //  const int  VERBOSE = 1;
    516     if (VERBOSE > 0) printf("%s begin\n", prefix);
    517 
    518 // cannot find names in Cbc, Osi, or OsiClp
    519     /*clean
    520       int iRow;
    521       std::vector<std::string> rowNames;
    522       int numberRows = model->model_->getNumRows();
    523       rowNames.reserve(numberRows);
    524       for (iRow=0;iRow<numberRows;iRow++) {
    525         rowNames.push_back(rowNamesIn[iRow]);
    526       }
    527 
    528       int iColumn;
    529       std::vector<std::string> columnNames;
    530       int numberColumns = model->model_->getNumCols();
    531       columnNames.reserve(numberColumns);
    532       for (iColumn=0;iColumn<numberColumns;iColumn++) {
    533         columnNames.push_back(columnNamesIn[iColumn]);
    534       }
    535       model->model_->copyNames(rowNames,columnNames);
    536     */
    537 
    538     if (VERBOSE > 0) printf("%s return\n", prefix);
    539 }
    540 
    541 /* Number of rows */
    542 COINLIBAPI int COINLINKAGE
    543 Cbc_numberRows(Cbc_Model * model)
    544 {
    545     const char prefix[] = "Cbc_C_Interface::Cbc_numberRows(): ";
    546 //  const int  VERBOSE = 1;
    547     if (VERBOSE > 0) printf("%s begin\n", prefix);
    548 
    549     int result = 0;
    550     result = model->model_->getNumRows();
    551 
    552     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    553     return result;
    554 }
    555 /* Number of columns */
    556 COINLIBAPI int COINLINKAGE
    557 Cbc_numberColumns(Cbc_Model * model)
    558 {
    559     const char prefix[] = "Cbc_C_Interface::Cbc_numberColumns(): ";
    560 //  const int  VERBOSE = 1;
    561     if (VERBOSE > 0) printf("%s begin\n", prefix);
    562 
    563     int result = 0;
    564     result = model->model_->getNumCols();
    565 
    566     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    567     return result;
    568 }
    569 /* Primal tolerance to use */
    570 COINLIBAPI double COINLINKAGE
    571 Cbc_primalTolerance(Cbc_Model * model)
    572 {
    573     const char prefix[] = "Cbc_C_Interface::Cbc_primalTolerance(): ";
    574 //  const int  VERBOSE = 1;
    575     if (VERBOSE > 0) printf("%s begin\n", prefix);
    576 
    577     double result = 0.0;
    578     model->model_->solver()->getDblParam(OsiPrimalTolerance, result) ;
    579 
    580     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    581     return result;
    582 }
    583 COINLIBAPI void COINLINKAGE
    584 Cbc_setPrimalTolerance(Cbc_Model * model,  double value)
    585 {
    586     const char prefix[] = "Cbc_C_Interface::Cbc_setPrimalTolerance(): ";
    587 //  const int  VERBOSE = 1;
    588     if (VERBOSE > 0) printf("%s begin\n", prefix);
    589 
    590     model->model_->solver()->setDblParam(OsiPrimalTolerance, value) ;
    591 
    592     if (VERBOSE > 0) printf("%s return\n", prefix);
    593 }
    594 /* Dual tolerance to use */
    595 COINLIBAPI double COINLINKAGE
    596 Cbc_dualTolerance(Cbc_Model * model)
    597 {
    598     const char prefix[] = "Cbc_C_Interface::Cbc_dualTolerance(): ";
    599 //  const int  VERBOSE = 1;
    600     if (VERBOSE > 0) printf("%s begin\n", prefix);
    601 
    602     double result = 0.0;
    603     model->model_->solver()->getDblParam(OsiDualTolerance, result) ;
    604 
    605     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    606     return result;
    607 }
    608 COINLIBAPI void COINLINKAGE
    609 Cbc_setDualTolerance(Cbc_Model * model,  double value)
    610 {
    611     const char prefix[] = "Cbc_C_Interface::Cbc_setDualTolerance(): ";
    612 //  const int  VERBOSE = 1;
    613     if (VERBOSE > 0) printf("%s begin\n", prefix);
    614 
    615     model->model_->solver()->setDblParam(OsiDualTolerance, value) ;
    616 
    617     if (VERBOSE > 0) printf("%s return\n", prefix);
    618 }
    619 /* Integer tolerance to use */
    620 COINLIBAPI double COINLINKAGE
    621 Cbc_integerTolerance(Cbc_Model * model)
    622 {
    623     const char prefix[] = "Cbc_C_Interface::Cbc_primalTolerance(): ";
    624 //  const int  VERBOSE = 1;
    625     if (VERBOSE > 0) printf("%s begin\n", prefix);
    626 
    627     double result = 0.0;
    628     result = model->model_->getDblParam(CbcModel::CbcIntegerTolerance) ;
    629 
    630     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    631     return result;
    632 }
    633 COINLIBAPI void COINLINKAGE
    634 Cbc_setIntegerTolerance(Cbc_Model * model,  double value)
    635 {
    636     const char prefix[] = "Cbc_C_Interface::Cbc_setPrimalTolerance(): ";
    637 //  const int  VERBOSE = 1;
    638     if (VERBOSE > 0) printf("%s begin\n", prefix);
    639 
    640     model->model_->setDblParam(CbcModel::CbcIntegerTolerance, value) ;
    641 
    642     if (VERBOSE > 0) printf("%s return\n", prefix);
    643 }
    644 /* Dual objective limit */
    645 COINLIBAPI double COINLINKAGE
    646 Cbc_dualObjectiveLimit(Cbc_Model * model)
    647 {
    648     const char prefix[] = "Cbc_C_Interface::Cbc_dualObjectiveLimit(): ";
    649 //  const int  VERBOSE = 1;
    650     if (VERBOSE > 0) printf("%s begin\n", prefix);
    651 
    652     double result = 0.0;
    653     model->model_->solver()->getDblParam(OsiDualObjectiveLimit, result) ;
    654 
    655     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    656     return result;
    657 }
    658 COINLIBAPI void COINLINKAGE
    659 Cbc_setDualObjectiveLimit(Cbc_Model * model, double value)
    660 {
    661     const char prefix[] = "Cbc_C_Interface::Cbc_setDualObjectiveLimit(): ";
    662 //  const int  VERBOSE = 1;
    663     if (VERBOSE > 0) printf("%s begin\n", prefix);
    664 
    665     model->model_->solver()->setDblParam(OsiDualObjectiveLimit, value) ;
    666 
    667     if (VERBOSE > 0) printf("%s return\n", prefix);
    668 }
    669 /* Objective offset */
    670 COINLIBAPI double COINLINKAGE
    671 Cbc_objectiveOffset(Cbc_Model * /*model*/)
    672 {
    673     const char prefix[] = "Cbc_C_Interface::Cbc_objectiveOffset(): ";
    674 //  const int  VERBOSE = 1;
    675     if (VERBOSE > 0) printf("%s begin\n", prefix);
    676 
    677     double result = 0.0;
    678 // cannot find names in Cbc, Osi, or OsiClp
    679 //tbd  return model->model_->objectiveOffset();
    680     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    681 
    682     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    683     return result;
    684 }
    685 COINLIBAPI void COINLINKAGE
    686 Cbc_setObjectiveOffset(Cbc_Model * /*model*/, double /*value*/)
    687 {
    688     const char prefix[] = "Cbc_C_Interface::Cbc_setObjectiveOffset(): ";
    689 //  const int  VERBOSE = 1;
    690     if (VERBOSE > 0) printf("%s begin\n", prefix);
    691 
    692 // cannot find names in Cbc, Osi, or OsiClp
    693 //tbd  model->model_->solver()->setObjectiveOffset(value);
    694     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    695 
    696     if (VERBOSE > 0) printf("%s return\n", prefix);
    697 }
     358
     359
     360COINLIBAPI void COINLINKAGE
     361Cbc_setInitialSolution(Cbc_Model *model, const double * sol)
     362{
     363    int n = Cbc_getNumCols(model);
     364    // We need to manually compute the objective here for some reason
     365    const double *objvec = Cbc_getObjCoefficients(model);
     366    double objval = 0;
     367    for (int i = 0; i < n; i++) {
     368        objval += objvec[i]*sol[i];
     369    }
     370    model->model_->setBestSolution(sol, n, objval, true);
     371}
     372
     373COINLIBAPI void COINLINKAGE
     374Cbc_setParameter(Cbc_Model * model, const char * name, const char * value)
     375{
     376    model->cmdargs_.push_back(std::string("-")+name);
     377    model->cmdargs_.push_back(value);
     378}
     379
    698380/* Fills in array with problem name  */
    699381COINLIBAPI void COINLINKAGE
    700382Cbc_problemName(Cbc_Model * model, int maxNumberCharacters, char * array)
    701383{
    702     const char prefix[] = "Cbc_C_Interface::Cbc_problemName(): ";
    703 //  const int  VERBOSE = 1;
    704     if (VERBOSE > 0) printf("%s begin\n", prefix);
    705 
    706384    std::string name;
    707385    model->model_->solver()->getStrParam(OsiProbName, name);
    708     maxNumberCharacters = CoinMin(maxNumberCharacters, (int)strlen(name.c_str()));
    709     strncpy(array, name.c_str(), maxNumberCharacters - 1);
    710     array[maxNumberCharacters-1] = '\0';
    711 
    712     if (VERBOSE > 0) printf("%s return\n", prefix);
     386    strncpy(array, name.c_str(), maxNumberCharacters);
    713387}
    714388/* Sets problem name.  Must have \0 at end.  */
    715389COINLIBAPI int COINLINKAGE
    716 Cbc_setProblemName(Cbc_Model * model, int /*maxNumberCharacters*/, char * array)
    717 {
    718     const char prefix[] = "Cbc_C_Interface::Cbc_setProblemName(): ";
    719 //  const int  VERBOSE = 1;
    720     if (VERBOSE > 0) printf("%s begin\n", prefix);
    721 
     390Cbc_setProblemName(Cbc_Model * model, const char * array)
     391{
    722392    bool result = false;
    723393    result = model->model_->solver()->setStrParam(OsiProbName, array);
    724394
    725     if (VERBOSE > 0) printf("%s return\n", prefix);
    726395    return (result) ? 1 : 0;
    727396}
    728 /* Number of iterations */
    729 COINLIBAPI int COINLINKAGE
    730 Cbc_numberIterations(Cbc_Model * model)
    731 {
    732     const char prefix[] = "Cbc_C_Interface::Cbc_numberIterations(): ";
    733 //  const int  VERBOSE = 1;
    734     if (VERBOSE > 0) printf("%s begin\n", prefix);
    735 
    736     int result = 0;
    737     result = model->model_->getIterationCount();
    738 
    739     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    740     return result;
    741 }
    742 COINLIBAPI void COINLINKAGE
    743 Cbc_setNumberIterations(Cbc_Model * /*model*/, int /*numberIterations*/)
    744 {
    745     const char prefix[] = "Cbc_C_Interface::Cbc_setNumberIterations(): ";
    746 //  const int  VERBOSE = 1;
    747     if (VERBOSE > 0) printf("%s begin\n", prefix);
    748 
    749 // cannot find this in Cbc, Osi, or OsiClp
    750 //tbd  model->model_->setNumberIterations(numberIterations);
    751     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    752 
    753     if (VERBOSE > 0) printf("%s return\n", prefix);
    754     return;
    755 }
    756 /* Maximum number of iterations */
    757 COINLIBAPI int COINLINKAGE
    758 Cbc_maximumIterations(Cbc_Model * /*model*/)
    759 {
    760     const char prefix[] = "Cbc_C_Interface::Cbc_maximumIterations(): ";
    761 //  const int  VERBOSE = 1;
    762     if (VERBOSE > 0) printf("%s begin\n", prefix);
    763 
    764     int result = 0;
    765 // cannot find this in Cbc, Osi, or OsiClp
    766 //tbd  result = model->model_->solver()->maximumIterations();
    767     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    768 
    769     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    770     return result;
    771 }
    772 COINLIBAPI void COINLINKAGE
    773 Cbc_setMaximumIterations(Cbc_Model * /*model*/, int /*value*/)
    774 {
    775     const char prefix[] = "Cbc_C_Interface::Cbc_setMaximumIterations(): ";
    776 //  const int  VERBOSE = 1;
    777     if (VERBOSE > 0) printf("%s begin\n", prefix);
    778 
    779 // cannot find this in Cbc, Osi, or OsiClp
    780 //tbd  model->model_->setMaximumIterations(value);
    781     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    782 
    783     if (VERBOSE > 0) printf("%s return\n", prefix);
    784 }
    785 /* Maximum number of nodes */
    786 COINLIBAPI int COINLINKAGE
    787 Cbc_maxNumNode(Cbc_Model * model)
    788 {
    789     const char prefix[] = "Cbc_C_Interface::Cbc_maxNumNode(): ";
    790 //  const int  VERBOSE = 1;
    791     if (VERBOSE > 0) printf("%s begin\n", prefix);
    792 
    793     int result = 0;
    794     result = model->model_->getIntParam(CbcModel::CbcMaxNumNode);
    795 
    796     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    797     return result;
    798 }
    799 COINLIBAPI void COINLINKAGE
    800 Cbc_setMaxNumNode(Cbc_Model * model, int value)
    801 {
    802     const char prefix[] = "Cbc_C_Interface::Cbc_setMaxNumNode(): ";
    803 //  const int  VERBOSE = 1;
    804     if (VERBOSE > 0) printf("%s begin\n", prefix);
    805 
    806     model->model_->setIntParam(CbcModel::CbcMaxNumNode, value);
    807 
    808     if (VERBOSE > 0) printf("%s return\n", prefix);
    809 }
    810 /* Maximum number of solutions */
    811 COINLIBAPI int COINLINKAGE
    812 Cbc_maxNumSol(Cbc_Model * model)
    813 {
    814     const char prefix[] = "Cbc_C_Interface::maxNumSol(): ";
    815 //  const int  VERBOSE = 1;
    816     if (VERBOSE > 0) printf("%s begin\n", prefix);
    817 
    818     int result = 0;
    819     result = model->model_->getIntParam(CbcModel::CbcMaxNumSol);
    820 
    821     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    822     return result;
    823 }
    824 COINLIBAPI void COINLINKAGE
    825 Cbc_setMaxNumSol(Cbc_Model * model, int value)
    826 {
    827     const char prefix[] = "Cbc_C_Interface::Cbc_setMaxNumSol(): ";
    828 //  const int  VERBOSE = 1;
    829     if (VERBOSE > 0) printf("%s begin\n", prefix);
    830 
    831     model->model_->setIntParam(CbcModel::CbcMaxNumSol, value);
    832 
    833     if (VERBOSE > 0) printf("%s return\n", prefix);
    834 }
    835 /* Maximum time in seconds (from when set called) */
    836 COINLIBAPI double COINLINKAGE
    837 Cbc_maximumSeconds(Cbc_Model * model)
    838 {
    839     const char prefix[] = "Cbc_C_Interface::Cbc_maximumSeconds(): ";
    840 //  const int  VERBOSE = 1;
    841     if (VERBOSE > 0) printf("%s begin\n", prefix);
    842 
    843     double result = 0.0;
    844     result = model->model_->getDblParam(CbcModel::CbcMaximumSeconds);
    845 
    846     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    847     return result;
    848 }
    849 COINLIBAPI void COINLINKAGE
    850 Cbc_setMaximumSeconds(Cbc_Model * model, double value)
    851 {
    852     const char prefix[] = "Cbc_C_Interface::Cbc_setMaximumSeconds(): ";
    853 //  const int  VERBOSE = 1;
    854     if (VERBOSE > 0) printf("%s begin\n", prefix);
    855 
    856     model->model_->setDblParam(CbcModel::CbcMaximumSeconds, value);
    857 
    858     if (VERBOSE > 0) printf("%s return\n", prefix);
    859 }
    860 /* Returns true if hit maximum iteratio`ns (or time) */
    861 COINLIBAPI int COINLINKAGE
    862 Cbc_hitMaximumIterations(Cbc_Model * /*model*/)
    863 {
    864     const char prefix[] = "Cbc_C_Interface::Cbc_hitMaximumIterations(): ";
    865 //  const int  VERBOSE = 1;
    866     if (VERBOSE > 0) printf("%s begin\n", prefix);
    867 
    868     int result = 0;
    869 // cannot find names in Cbc, Osi, or OsiClp
    870 //tbd  result = model->model_->solver()->hitMaximumIterations() ? 1 : 0;
    871     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    872 
    873     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    874     return result;
    875 }
    876 /* Status of problem:
    877    0 - optimal
    878    1 - primal infeasible
    879    2 - dual infeasible
    880    3 - stopped on iterations etc
    881    4 - stopped due to errors
    882 */
    883 COINLIBAPI int COINLINKAGE
    884 Cbc_status(Cbc_Model * model)
    885 {
    886     const char prefix[] = "Cbc_C_Interface::Cbc_status(): ";
    887 //  const int  VERBOSE = 1;
    888     if (VERBOSE > 0) printf("%s begin\n", prefix);
    889 
    890     int result = 0;
    891     result = model->model_->status();
    892 
    893     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    894     return result;
    895 }
    896 /* Set problem status */
    897 COINLIBAPI void COINLINKAGE
    898 Cbc_setProblemStatus(Cbc_Model * /*model*/, int /*problemStatus*/)
    899 {
    900     const char prefix[] = "Cbc_C_Interface::Cbc_setProblemStatus(): ";
    901 //  const int  VERBOSE = 1;
    902     if (VERBOSE > 0) printf("%s begin\n", prefix);
    903 
    904 // cannot find this in Cbc, Osi, or OsiClp
    905 //tbd  model->model_->setProblemStatus(problemStatus);
    906     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    907 
    908     if (VERBOSE > 0) printf("%s return\n", prefix);
    909 }
    910 /* Secondary status of problem - may get extended
    911    0 - none
    912    1 - primal infeasible because dual limit reached
    913    2 - scaled problem optimal - unscaled has primal infeasibilities
    914    3 - scaled problem optimal - unscaled has dual infeasibilities
    915    4 - scaled problem optimal - unscaled has both dual and primal infeasibilities
    916 */
    917 COINLIBAPI int COINLINKAGE
    918 Cbc_secondaryStatus(Cbc_Model * model)
    919 {
    920     const char prefix[] = "Cbc_C_Interface::Cbc_secondaryStatus(): ";
    921 //  const int  VERBOSE = 1;
    922     if (VERBOSE > 0) printf("%s begin\n", prefix);
    923 
    924     int result = 0;
    925 // cannot find this in Cbc, Osi, or OsiClp
    926     result = model->model_->secondaryStatus();
    927     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    928 
    929     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    930     return result;
    931 }
    932 COINLIBAPI void COINLINKAGE
    933 Cbc_setSecondaryStatus(Cbc_Model * /*model*/, int /*status*/)
    934 {
    935     const char prefix[] = "Cbc_C_Interface::Cbc_setSecondaryStatus(): ";
    936 //  const int  VERBOSE = 1;
    937     if (VERBOSE > 0) printf("%s begin\n", prefix);
    938 
    939 // cannot find this in Cbc, Osi, or OsiClp
    940 //tbd  model->model_->setSecondaryStatus(status);
    941     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    942 
    943     if (VERBOSE > 0) printf("%s return\n", prefix);
    944 }
    945 /* Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    946 COINLIBAPI double COINLINKAGE
    947 Cbc_optimizationDirection(Cbc_Model * model)
    948 {
    949     const char prefix[] = "Cbc_C_Interface::Cbc_optimizationDirection(): ";
    950 //  const int  VERBOSE = 1;
    951     if (VERBOSE > 0) printf("%s begin\n", prefix);
    952 
    953     double result = 0.0;
    954     result = model->model_->getObjSense();
    955 
    956     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    957     return result;
    958 }
    959 COINLIBAPI void COINLINKAGE
    960 Cbc_setOptimizationDirection(Cbc_Model * model, double value)
    961 {
    962     const char prefix[] = "Cbc_C_Interface::Cbc_setOptimizationDirection(): ";
    963 //  const int  VERBOSE = 1;
    964     if (VERBOSE > 0) printf("%s begin, value = %g\n", prefix, value);
    965 
    966     model->model_->setObjSense(value);
    967 //  model->model_->solver()->setObjSense(value);
    968 
    969     if (VERBOSE > 0) printf("%s return\n", prefix);
    970 }
    971 /* Primal row solution */
    972 COINLIBAPI double * COINLINKAGE
    973 Cbc_primalRowSolution(Cbc_Model * /*model*/)
    974 {
    975     const char prefix[] = "Cbc_C_Interface::Cbc_primalRowSolution(): ";
    976 //  const int  VERBOSE = 1;
    977     if (VERBOSE > 0) printf("%s begin\n", prefix);
    978 
    979     double * result = NULL;
    980 
    981 // cannot find this in Cbc, Osi, or OsiClp
    982 // may have to make it somehow
    983 //tbd  return model->model_->primalRowSolution();
    984     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    985 
    986     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    987     return result;
    988 }
    989 /* Primal column solution */
    990 COINLIBAPI double * COINLINKAGE
    991 Cbc_primalColumnSolution(Cbc_Model * /*model*/)
    992 {
    993     const char prefix[] = "Cbc_C_Interface::Cbc_primalColumnSolution(): ";
    994 //  const int  VERBOSE = 1;
    995     if (VERBOSE > 0) printf("%s begin\n", prefix);
    996 
    997     double * result = NULL;
    998 // cannot find this in Cbc, Osi, or OsiClp
    999 // may have to make it somehow
    1000 //  result = model->model_->getColSolution();
    1001     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1002 
    1003     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1004     return result;
    1005 }
    1006 /* Dual row solution */
    1007 COINLIBAPI double * COINLINKAGE
    1008 Cbc_dualRowSolution(Cbc_Model * /*model*/)
    1009 {
    1010     const char prefix[] = "Cbc_C_Interface::Cbc_dualRowSolution(): ";
    1011 //  const int  VERBOSE = 1;
    1012     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1013 
    1014     double * result = NULL;
    1015 // cannot find this in Cbc, Osi, or OsiClp
    1016 // may have to make it somehow
    1017 //tbd  return model->model_->dualRowSolution();
    1018     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1019 
    1020     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1021     return NULL;
    1022 }
    1023 /* Reduced costs */
    1024 COINLIBAPI double * COINLINKAGE
    1025 Cbc_dualColumnSolution(Cbc_Model * /*model*/)
    1026 {
    1027     const char prefix[] = "Cbc_C_Interface::Cbc_dualColumnSolution(): ";
    1028 //  const int  VERBOSE = 1;
    1029     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1030 
    1031     double * result = NULL;
    1032 // cannot find this in Cbc, Osi, or OsiClp
    1033 // may have to make it somehow
    1034 //tbd  return model->model_->dualColumnSolution();
    1035     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1036 
    1037     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1038     return NULL;
    1039 }
    1040 /* Row lower */
    1041 COINLIBAPI double * COINLINKAGE
    1042 Cbc_rowLower(Cbc_Model * /*model*/)
    1043 {
    1044     const char prefix[] = "Cbc_C_Interface::Cbc_rowLower(): ";
    1045 //  const int  VERBOSE = 1;
    1046     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1047 
    1048     double * result = NULL;
    1049 // cannot find this in Cbc, Osi, or OsiClp
    1050 // may have to make it somehow
    1051 //tbd  return model->model_->rowLower();
    1052     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1053 
    1054     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1055     return NULL;
    1056 }
    1057 /* Row upper  */
    1058 COINLIBAPI double * COINLINKAGE
    1059 Cbc_rowUpper(Cbc_Model * /*model*/)
    1060 {
    1061     const char prefix[] = "Cbc_C_Interface::Cbc_rowUpper(): ";
    1062 //  const int  VERBOSE = 1;
    1063     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1064 
    1065     double * result = NULL;
    1066 // cannot find this in Cbc, Osi, or OsiClp
    1067 // may have to make it somehow
    1068 //tbd  return model->model_->rowUpper();
    1069     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1070 
    1071     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1072     return NULL;
    1073 }
    1074 /* Objective Coefficients */
    1075 COINLIBAPI double * COINLINKAGE
    1076 Cbc_objective(Cbc_Model * /*model*/)
    1077 {
    1078     const char prefix[] = "Cbc_C_Interface::Cbc_objective(): ";
    1079 //  const int  VERBOSE = 1;
    1080     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1081 
    1082     double * result = NULL;
    1083 // cannot find this in Cbc, Osi, or OsiClp
    1084 // may have to make it somehow
    1085 //  result = model->model_->objective();
    1086     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1087 
    1088     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1089     return NULL;
    1090 }
    1091 /* Column Lower */
    1092 COINLIBAPI double * COINLINKAGE
    1093 Cbc_columnLower(Cbc_Model * /*model*/)
    1094 {
    1095     const char prefix[] = "Cbc_C_Interface::Cbc_columnLower(): ";
    1096 //  const int  VERBOSE = 1;
    1097     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1098 
    1099     double * result = NULL;
    1100 // cannot find this in Cbc, Osi, or OsiClp
    1101 // may have to make it somehow
    1102 //tbd  return model->model_->columnLower();
    1103     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1104 
    1105     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1106     return NULL;
    1107 }
    1108 /* Column Upper */
    1109 COINLIBAPI double * COINLINKAGE
    1110 Cbc_columnUpper(Cbc_Model * /*model*/)
    1111 {
    1112     const char prefix[] = "Cbc_C_Interface::Cbc_columnUpper(): ";
    1113 //  const int  VERBOSE = 1;
    1114     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1115 
    1116     double * result = NULL;
    1117 // cannot find this in Cbc, Osi, or OsiClp
    1118 // may have to make it somehow
    1119 //tbd  return model->model_->columnUpper();
    1120     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1121 
    1122     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1123     return NULL;
    1124 }
     397
     398CbcGetProperty(int, status)
     399
     400CbcGetProperty(int, secondaryStatus)
     401
    1125402/* Number of elements in matrix */
    1126403COINLIBAPI int COINLINKAGE
     
    1164441}
    1165442
    1166 // Column vector lengths in matrix
    1167 COINLIBAPI const int * COINLINKAGE
    1168 Cbc_getVectorLengths(Cbc_Model * model)
    1169 {
    1170     const char prefix[] = "Cbc_C_Interface::Cbc_getVectorLengths(): ";
    1171 //  const int  VERBOSE = 1;
    1172     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1173 
    1174     const int * result = NULL;
    1175     const CoinPackedMatrix * matrix = NULL;
    1176     matrix = model->model_->solver()->getMatrixByCol();
    1177     result = (matrix == NULL) ? NULL : matrix->getVectorLengths();
    1178 
    1179     if (VERBOSE > 0)
    1180         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    1181     return result;
    1182 }
    1183443
    1184444// Element values in matrix
     
    1201461// ======================================================================
    1202462
    1203 /* Objective value */
    1204 COINLIBAPI double COINLINKAGE
    1205 Cbc_objectiveValue(Cbc_Model * model)
    1206 {
    1207     const char prefix[] = "Cbc_C_Interface::Cbc_objectiveValue(): ";
    1208 //  const int  VERBOSE = 1;
    1209     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1210 
    1211     double result = 0.0;
    1212     result = model->model_->getObjValue();
    1213 
    1214     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1215     return result;
    1216 }
    1217 /* Infeasibility/unbounded ray (NULL returned if none/wrong)
    1218    Up to user to use delete [] on these arrays.  */
    1219 COINLIBAPI double * COINLINKAGE
    1220 Cbc_infeasibilityRay(Cbc_Model * /*model*/)
    1221 {
    1222     const char prefix[] = "Cbc_C_Interface::Cbc_infeasibilityRay(): ";
    1223 //  const int  VERBOSE = 1;
    1224     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1225 
    1226     double * result = NULL;
    1227     // lots of rays (probably too many) are available in
    1228     // OsiClpSolverInterface::getDualRays()
    1229     //
    1230 //tbd  result = model->model_->infeasibilityRay();
    1231     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1232 
    1233     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1234     return result;
    1235 }
    1236 COINLIBAPI double * COINLINKAGE
    1237 Cbc_unboundedRay(Cbc_Model * /*model*/)
    1238 {
    1239     const char prefix[] = "Cbc_C_Interface::Cbc_unboundedRay(): ";
    1240 //  const int  VERBOSE = 1;
    1241     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1242 
    1243     double * result = NULL;
    1244     // lots of rays (probably too many) are available in
    1245     // OsiClpSolverInterface::getPrimalRays()
    1246     //
    1247 //tbd  result = model->model_->unboundedRay();
    1248     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1249 
    1250     if (VERBOSE > 0) printf("%s return %p\n", prefix, static_cast<void*>(result));
    1251     return result;
    1252 }
    1253 /* See if status array exists (partly for OsiClp) */
    1254 COINLIBAPI int COINLINKAGE
    1255 Cbc_statusExists(Cbc_Model * /*model*/)
    1256 {
    1257     const char prefix[] = "Cbc_C_Interface::Cbc_statusExists(): ";
    1258 //  const int  VERBOSE = 1;
    1259     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1260 
    1261     int result = 0;
    1262 //tbd  result = model->model_->statusExists() ? 1 : 0;
    1263     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1264 
    1265     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1266     return result;
    1267 }
    1268 /* Return address of status array (char[numberRows+numberColumns]) */
    1269 COINLIBAPI void  COINLINKAGE
    1270 Cbc_getBasisStatus(Cbc_Model * /*model*/, int * /*cstat*/, int * /*rstat*/)
    1271 {
    1272     const char prefix[] = "Cbc_C_Interface::Cbc_getBasisStatus(): ";
    1273 //  const int  VERBOSE = 1;
    1274     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1275 
    1276 // have to figure this out
    1277 //tbd  model->model_->solver()->getBasisStatus(cstat, rstat);
    1278     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1279 
    1280     if (VERBOSE > 0) printf("%s return\n", prefix);
    1281     return;
    1282 }
    1283 /* Copy in status vector */
    1284 COINLIBAPI void COINLINKAGE
    1285 Cbc_setBasisStatus(Cbc_Model * /*model*/,  int * /*cstat*/, int * /*rstat*/)
    1286 {
    1287     const char prefix[] = "Cbc_C_Interface::Cbc_setBasisStatus(): ";
    1288 //  const int  VERBOSE = 1;
    1289     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1290 
    1291 //  model->model_->solver()->setBasisStatus(cstat, rstat);
    1292     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1293 
    1294     if (VERBOSE > 0) printf("%s return\n", prefix);
    1295 }
    1296 
    1297 /* User pointer for whatever reason */
    1298 COINLIBAPI void COINLINKAGE
    1299 Cbc_setUserPointer (Cbc_Model * /*model*/, void * /*pointer*/)
    1300 {
    1301     const char prefix[] = "Cbc_C_Interface::Cbc_setUserPointer(): ";
    1302 //  const int  VERBOSE = 1;
    1303     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1304 
    1305     // not sure what this is for
    1306     //
    1307 //tbd  model->model_->setUserPointer(pointer);
    1308     if (VERBOSE > 0) printf("%s WARNING: NOT IMPLEMENTED\n", prefix);
    1309 
    1310     if (VERBOSE > 0) printf("%s return\n", prefix);
    1311 }
    1312 COINLIBAPI void * COINLINKAGE
    1313 Cbc_getUserPointer (Cbc_Model * /*model*/)
    1314 {
    1315     const char prefix[] = "Cbc_C_Interface::Cbc_getUserPointer(): ";
    1316 //  const int  VERBOSE = 1;
    1317     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1318 
    1319     void * result = NULL;
    1320     // not sure what this is for
    1321     //
    1322 //tbd result = model->model_->getUserPointer();
    1323     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1324 
    1325     if (VERBOSE > 0) printf("%s return %p\n", prefix, result);
    1326     return result;
    1327 }
     463
     464
    1328465/* Pass in Callback function */
    1329466COINLIBAPI void COINLINKAGE
     
    1335472    if (VERBOSE > 0) printf("%s begin\n", prefix);
    1336473
    1337     // reuse existing log level
    1338     int oldLogLevel = model->model_->messageHandler()->logLevel();
    1339474    // Will be copy of users one
    1340475    delete model->handler_;
     
    1343478    model->handler_->setModel(model);
    1344479    model->model_->passInMessageHandler(model->handler_);
    1345     model->model_->messageHandler()->setLogLevel(oldLogLevel);
    1346480
    1347481    if (VERBOSE > 0) printf("%s return\n", prefix);
     
    1360494    if (VERBOSE > 0) printf("%s return\n", prefix);
    1361495}
    1362 /* Amount of print out:
    1363    0 - none
    1364    1 - just final
    1365    2 - just factorizations
    1366    3 - as 2 plus a bit more
    1367    4 - verbose
    1368    above that 8,16,32 etc just for selective debug
    1369 */
    1370 COINLIBAPI void COINLINKAGE
    1371 Cbc_setLogLevel(Cbc_Model * model, int value)
    1372 {
    1373     const char prefix[] = "Cbc_C_Interface::Cbc_setLogLevel(): ";
    1374 //  const int  VERBOSE = 1;
    1375     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1376     if (VERBOSE > 1) printf("%s value = %i\n", prefix, value);
    1377 
    1378     model->model_->messageHandler()->setLogLevel(value);
    1379 
    1380     if (VERBOSE > 0) printf("%s return\n", prefix);
    1381 }
     496/* length of names (0 means no names0 */
     497COINLIBAPI size_t COINLINKAGE
     498Cbc_maxNameLength(Cbc_Model * model)
     499{
     500    size_t result = 0;
     501    OsiSolverInterface::OsiNameVec const & rownames = model->model_->solver()->getRowNames();
     502    for (size_t i = 0; i < rownames.size(); i++) {
     503        if (rownames[i].length() > result) result = rownames[i].length();
     504    }
     505    OsiSolverInterface::OsiNameVec const & colnames = model->model_->solver()->getColNames();
     506    for (size_t i = 0; i < colnames.size(); i++) {
     507        if (colnames[i].length() > result) result = colnames[i].length();
     508    }
     509    return result;
     510}
     511COINLIBAPI void COINLINKAGE
     512Cbc_getRowName(Cbc_Model * model, int iRow, char * name, size_t maxLength)
     513{
     514    std::string rowname = model->model_->solver()->getRowName(iRow);
     515    strncpy(name, rowname.c_str(), maxLength);
     516    name[maxLength-1] = '\0';
     517}
     518COINLIBAPI void COINLINKAGE
     519Cbc_getColName(Cbc_Model * model, int iRow, char * name, size_t maxLength)
     520{
     521    std::string colname = model->model_->solver()->getColName(iRow);
     522    strncpy(name, colname.c_str(), maxLength);
     523    name[maxLength-1] = '\0';
     524}
     525
     526COINLIBAPI void COINLINKAGE
     527Cbc_setColName(Cbc_Model * model, int iColumn, const char * name)
     528{
     529    model->model_->solver()->setColName(iColumn, name);
     530}
     531
     532COINLIBAPI void COINLINKAGE
     533Cbc_setRowName(Cbc_Model * model, int iRow, const char * name)
     534{
     535    model->model_->solver()->setRowName(iRow, name);
     536}
     537
     538
    1382539COINLIBAPI int COINLINKAGE
    1383 Cbc_logLevel(Cbc_Model * model)
    1384 {
    1385     const char prefix[] = "Cbc_C_Interface::Cbc_logLevel(): ";
    1386 //  const int  VERBOSE = 1;
    1387     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1388 
     540Cbc_solve(Cbc_Model * model)
     541{
     542    const char prefix[] = "Cbc_C_Interface::Cbc_solve(): ";
    1389543    int result = 0;
    1390     result = model->model_->messageHandler()->logLevel();
    1391 
    1392     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1393     return result;
    1394 }
    1395 /* length of names (0 means no names0 */
    1396 COINLIBAPI int COINLINKAGE
    1397 Cbc_lengthNames(Cbc_Model * /*model*/)
    1398 {
    1399     const char prefix[] = "Cbc_C_Interface::Cbc_lengthNames(): ";
    1400 //  const int  VERBOSE = 1;
    1401     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1402 
    1403     int result = 0;
    1404 // cannot find names in Cbc, Osi, or OsiClp
    1405 //tbd  result = model->model_->lengthNames();
    1406     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1407 
    1408     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1409     return result;
    1410 }
    1411 /* Fill in array (at least lengthNames+1 long) with a row name */
    1412 COINLIBAPI void COINLINKAGE
    1413 Cbc_rowName(Cbc_Model * /*model*/, int iRow, char * name)
    1414 {
    1415     const char prefix[] = "Cbc_C_Interface::Cbc_rowName(): ";
    1416 //  const int  VERBOSE = 1;
    1417     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1418 
    1419     sprintf(name, "ROW%5i", iRow);
    1420 // cannot find names in Cbc, Osi, or OsiClp
    1421 //tbd  std::string rowName=model->model_->rowName(iRow);
    1422 //tbd  strcpy(name,rowName.c_str());
    1423 
    1424     if (VERBOSE > 0) printf("%s return\n", prefix);
    1425 }
    1426 /* Fill in array (at least lengthNames+1 long) with a column name */
    1427 // cannot find names in Cbc, Osi, or OsiClp
    1428 COINLIBAPI void COINLINKAGE
    1429 Cbc_columnName(Cbc_Model * /*model*/, int iColumn, char * name)
    1430 {
    1431     const char prefix[] = "Cbc_C_Interface::Cbc_columnName(): ";
    1432 //  const int  VERBOSE = 1;
    1433     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1434 
    1435     sprintf(name, "COL%5i", iColumn);
    1436 //tbd  std::string columnName= model->model_->columnName(iColumn);
    1437 //tbd  strcpy(name,columnName.c_str());
    1438 
    1439     if (VERBOSE > 0) printf("%s return\n", prefix);
    1440 }
    1441 
    1442 /* General branch and bound solve algorithm which can do presolve.
    1443    See  CbcSolve.hpp for options
    1444 */
    1445 COINLIBAPI int COINLINKAGE
    1446 Cbc_initialSolve(Cbc_Model * model)
    1447 {
    1448     const char prefix[] = "Cbc_C_Interface::Cbc_initialSolve(): ";
    1449 //  const int  VERBOSE = 1;
    1450     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1451 
    1452     int result = 0;
    1453     model->model_->initialSolve();
    1454     result = model->model_->status();
    1455 
    1456     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1457     return result;
    1458 }
    1459 /* General solve algorithm which can do presolve.
    1460    See  CbcModel.hpp for options
    1461 */
    1462 COINLIBAPI int COINLINKAGE
    1463 Cbc_branchAndBound(Cbc_Model * model)
    1464 {
    1465     const char prefix[] = "Cbc_C_Interface::Cbc_branchAndBound(): ";
    1466 //  const int  VERBOSE = 3;
    1467     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1468 
    1469     int result = 0;
    1470     if (VERBOSE > 2) Cbc_printModel(model, prefix);
     544    std::vector<const char*> argv;
     545    argv.push_back("Cbc_C_Interface");
     546    for (size_t i = 0; i < model->cmdargs_.size(); i++) {
     547        argv.push_back(model->cmdargs_[i].c_str());
     548    }
     549    argv.push_back("-solve");
     550    argv.push_back("-quit");
    1471551    try {
    1472         model->model_->branchAndBound();
    1473         model->model_->solver()->resolve();
     552       
     553        CbcMain1((int)argv.size(), &argv[0], *model->model_);
    1474554    } catch (CoinError e) {
    1475555        printf("%s ERROR: %s::%s, %s\n", prefix,
     
    1478558    result = model->model_->status();
    1479559
    1480     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1481560    return result;
    1482561}
    1483 /* Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later) */
    1484 COINLIBAPI void COINLINKAGE
    1485 Cbc_scaling(Cbc_Model * model, int mode)
    1486 {
    1487     const char prefix[] = "Cbc_C_Interface::Cbc_scaling(): ";
    1488 //  const int  VERBOSE = 1;
    1489     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1490 
    1491     OsiSolverInterface * solver = model->model_->solver();
    1492     bool modeBool = (mode == 0);
    1493     solver->setHintParam(OsiDoScale, modeBool);
    1494 
    1495     if (VERBOSE > 0) printf("%s return\n", prefix);
    1496 }
    1497 /* Gets scalingFlag */
    1498 COINLIBAPI int COINLINKAGE
    1499 Cbc_scalingFlag(Cbc_Model * /*model*/)
    1500 {
    1501     const char prefix[] = "Cbc_C_Interface::Cbc_scalingFlag(): ";
    1502 //  const int  VERBOSE = 1;
    1503     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1504 
    1505     int result = 0;
    1506 // try to use OsiSolverInterface::getHintParam(OsiDoScale, ???)
    1507 //tbd  result = model->model_->scalingFlag();
    1508     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1509 
    1510     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1511     return result;
    1512 }
    1513 /* Crash - at present just aimed at dual, returns
    1514    -2 if dual preferred and crash basis created
    1515    -1 if dual preferred and all slack basis preferred
    1516    0 if basis going in was not all slack
    1517    1 if primal preferred and all slack basis preferred
    1518    2 if primal preferred and crash basis created.
    1519 
    1520    if gap between bounds <="gap" variables can be flipped
    1521 
    1522    If "pivot" is
    1523    0 No pivoting (so will just be choice of algorithm)
    1524    1 Simple pivoting e.g. gub
    1525    2 Mini iterations
    1526 */
    1527 COINLIBAPI int COINLINKAGE
    1528 Cbc_crash(Cbc_Model * /*model*/, double /*gap*/, int /*pivot*/)
    1529 {
    1530     const char prefix[] = "Cbc_C_Interface::Cbc_crash(): ";
    1531 //  const int  VERBOSE = 1;
    1532     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1533 
    1534     int result = 0;
    1535 // cannot find names in Cbc, Osi, or OsiClp
    1536 //tbd  result = model->model_->crash(gap,pivot);
    1537     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1538 
    1539     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1540     return result;
    1541 }
    1542 /* If problem is primal feasible */
    1543 COINLIBAPI int COINLINKAGE
    1544 Cbc_primalFeasible(Cbc_Model * model)
    1545 {
    1546     const char prefix[] = "Cbc_C_Interface::Cbc_primalFeasible(): ";
    1547 //  const int  VERBOSE = 1;
    1548     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1549 
    1550     int result = 0;
    1551     OsiSolverInterface * solver = model->model_->solver();
    1552     result = solver->isProvenPrimalInfeasible() ? 0 : 1;
    1553 
    1554     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1555     return result;
    1556 }
    1557 /* If problem is dual feasible */
    1558 COINLIBAPI int COINLINKAGE
    1559 Cbc_dualFeasible(Cbc_Model * model)
    1560 {
    1561     const char prefix[] = "Cbc_C_Interface::Cbc_dualFeasible(): ";
    1562 //  const int  VERBOSE = 1;
    1563     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1564 
    1565     int result = 0;
    1566     OsiSolverInterface * solver = model->model_->solver();
    1567     result = solver->isProvenDualInfeasible() ? 0 : 1;
    1568 
    1569     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1570     return result;
    1571 }
    1572 /* Dual bound */
    1573 COINLIBAPI double COINLINKAGE
    1574 Cbc_dualBound(Cbc_Model * /*model*/)
    1575 {
    1576     const char prefix[] = "Cbc_C_Interface::Cbc_dualBound(): ";
    1577 //  const int  VERBOSE = 1;
    1578     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1579 
    1580     double result = 0;
    1581 // cannot find in Cbc, Osi, or OsiClp
    1582 //tbd  result = model->model_->dualBound();
    1583     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1584 
    1585     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1586     return result;
    1587 }
    1588 COINLIBAPI void COINLINKAGE
    1589 Cbc_setDualBound(Cbc_Model * /*model*/, double /*value*/)
    1590 {
    1591     const char prefix[] = "Cbc_C_Interface::Cbc_setDualBound(): ";
    1592 //  const int  VERBOSE = 1;
    1593     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1594 
    1595 // cannot find names in Cbc, Osi, or OsiClp
    1596 //tbd  model->model_->setDualBound(value);
    1597     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1598 
    1599     if (VERBOSE > 0) printf("%s return\n", prefix);
    1600 }
    1601 /* Infeasibility cost */
    1602 COINLIBAPI double COINLINKAGE
    1603 Cbc_infeasibilityCost(Cbc_Model * /*model*/)
    1604 {
    1605     const char prefix[] = "Cbc_C_Interface::Cbc_infeasibilityCost(): ";
    1606 //  const int  VERBOSE = 1;
    1607     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1608 
    1609     double result = 0;
    1610 // cannot find names in Cbc, Osi, or OsiClp
    1611 //tbd  result = model->model_->solver()->infeasibilityCost();
    1612     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1613 
    1614     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1615     return result;
    1616 }
    1617 COINLIBAPI void COINLINKAGE
    1618 Cbc_setInfeasibilityCost(Cbc_Model * /*model*/, double /*value*/)
    1619 {
    1620     const char prefix[] = "Cbc_C_Interface::Cbc_setInfeasibilityCost(): ";
    1621 //  const int  VERBOSE = 1;
    1622     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1623 
    1624 // cannot find names in Cbc, Osi, or OsiClp
    1625 //tbd  model->model_->setInfeasibilityCost(value);
    1626     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1627 
    1628     if (VERBOSE > 0) printf("%s return\n", prefix);
    1629 }
    1630 /* Perturbation:
    1631    50  - switch on perturbation
    1632    100 - auto perturb if takes too long (1.0e-6 largest nonzero)
    1633    101 - we are perturbed
    1634    102 - don't try perturbing again
    1635    default is 100
    1636    others are for playing
    1637 */
    1638 COINLIBAPI int COINLINKAGE
    1639 Cbc_perturbation(Cbc_Model * /*model*/)
    1640 {
    1641     const char prefix[] = "Cbc_C_Interface::Cbc_perturbation(): ";
    1642 //  const int  VERBOSE = 1;
    1643     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1644 
    1645     int result = 0;
    1646 // cannot find names in Cbc, Osi, or OsiClp
    1647 //tbd  result = model->model_->perturbation();
    1648     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1649 
    1650     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1651     return result;
    1652 }
    1653 COINLIBAPI void COINLINKAGE
    1654 Cbc_setPerturbation(Cbc_Model * /*model*/, int /*value*/)
    1655 {
    1656     const char prefix[] = "Cbc_C_Interface::Cbc_setPerturbation(): ";
    1657 //  const int  VERBOSE = 1;
    1658     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1659 
    1660 // cannot find names in Cbc, Osi, or OsiClp
    1661 //tbd  model->model_->setPerturbation(value);
    1662     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1663 
    1664     if (VERBOSE > 0) printf("%s return\n", prefix);
    1665 }
    1666 /* Current (or last) algorithm */
    1667 COINLIBAPI int COINLINKAGE
    1668 Cbc_algorithm(Cbc_Model * /*model*/)
    1669 {
    1670     const char prefix[] = "Cbc_C_Interface::Cbc_setPerturbation(): ";
    1671 //  const int  VERBOSE = 1;
    1672     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1673 
    1674     int result = 0;
    1675 // cannot find names in Cbc, Osi, or OsiClp
    1676 //tbd  result = model->model_->algorithm();
    1677     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1678 
    1679     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1680     return result;
    1681 }
    1682 /* Set algorithm */
    1683 COINLIBAPI void COINLINKAGE
    1684 Cbc_setAlgorithm(Cbc_Model * /*model*/, int /*value*/)
    1685 {
    1686     const char prefix[] = "Cbc_C_Interface::Cbc_setAlgorithm(): ";
    1687 //  const int  VERBOSE = 1;
    1688     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1689 
    1690 // cannot find names in Cbc, Osi, or OsiClp
    1691 //tbd  model->model_->setAlgorithm(value);
    1692     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1693 
    1694     if (VERBOSE > 0) printf("%s return\n", prefix);
    1695 }
    1696 /* Sum of dual infeasibilities */
    1697 COINLIBAPI double COINLINKAGE
    1698 Cbc_sumDualInfeasibilities(Cbc_Model * /*model*/)
    1699 {
    1700     const char prefix[] = "Cbc_C_Interface::Cbc_sumDualInfeasibilities(): ";
    1701 //  const int  VERBOSE = 1;
    1702     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1703 
    1704     double result = 0;
    1705 // cannot find names in Cbc, Osi, or OsiClp
    1706 //tbd  result = model->model_->sumDualInfeasibilities();
    1707     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1708 
    1709     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1710     return result;
    1711 }
    1712 /* Number of dual infeasibilities */
    1713 COINLIBAPI int COINLINKAGE
    1714 Cbc_numberDualInfeasibilities(Cbc_Model * /*model*/)
    1715 {
    1716     const char prefix[] = "Cbc_C_Interface::Cbc_numberDualInfeasibilities(): ";
    1717 //  const int  VERBOSE = 1;
    1718     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1719 
    1720     int result = 0;
    1721 // cannot find names in Cbc, Osi, or OsiClp
    1722 //tbd  result = model->model_->numberDualInfeasibilities();
    1723     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1724 
    1725     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1726     return result;
    1727 }
     562
    1728563/* Sum of primal infeasibilities */
    1729564COINLIBAPI double COINLINKAGE
     
    1757592    return result;
    1758593}
    1759 /* Save model to file, returns 0 if success.  This is designed for
    1760    use outside algorithms so does not save iterating arrays etc.
    1761    It does not save any messaging information.
    1762    Does not save scaling values.
    1763    It does not know about all types of virtual functions.
    1764 */
    1765 COINLIBAPI int COINLINKAGE
    1766 Cbc_saveModel(Cbc_Model * /*model*/, const char * /*fileName*/)
    1767 {
    1768     const char prefix[] = "Cbc_C_Interface::Cbc_saveModel(): ";
    1769 //  const int  VERBOSE = 1;
    1770     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1771 
    1772     int result = 0;
    1773 // there is a writeMPS method in Osi
    1774 //tbd  result = model->model_->saveModel(fileName);
    1775     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1776 
    1777     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1778     return result;
    1779 }
    1780 /* Restore model from file, returns 0 if success,
    1781    deletes current model */
    1782 COINLIBAPI int COINLINKAGE
    1783 Cbc_restoreModel(Cbc_Model * /*model*/, const char * /*fileName*/)
    1784 {
    1785     const char prefix[] = "Cbc_C_Interface::Cbc_restoreModel(): ";
    1786 //  const int  VERBOSE = 1;
    1787     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1788 
    1789     int result = 0;
    1790 // there is a readMPS method in Osi
    1791 //tbd  result = model->model_->restoreModel(fileName);
    1792     if (VERBOSE > 0) printf("%s WARNING:  NOT IMPLEMENTED\n", prefix);
    1793 
    1794     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1795     return result;
    1796 }
     594
    1797595
    1798596/** Call this to really test if a valid solution can be feasible
     
    1815613    return;
    1816614}
    1817 /* Number of rows */
    1818 COINLIBAPI int COINLINKAGE
    1819 Cbc_getNumRows(Cbc_Model * model)
    1820 {
    1821     const char prefix[] = "Cbc_C_Interface::Cbc_getNumRows(): ";
    1822 //  const int  VERBOSE = 1;
    1823     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1824 
    1825     int result = 0;
    1826     result = model->model_->getNumRows();
    1827 
    1828     if (VERBOSE > 0) printf("%s return %d\n", prefix, result);
    1829     return result;
    1830 }
    1831 /* Number of columns */
    1832 COINLIBAPI int COINLINKAGE
    1833 Cbc_getNumCols(Cbc_Model * model)
    1834 {
    1835     const char prefix[] = "Cbc_C_Interface::Cbc_getNumCols(): ";
    1836 //  const int  VERBOSE = 1;
    1837     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1838 
    1839     int result = 0;
    1840     result = model->model_->getNumCols();
    1841 
    1842     if (VERBOSE > 0) printf("%s return %d\n", prefix, result);
    1843     return result;
    1844 }
    1845 /* Number of iterations */
    1846 COINLIBAPI int COINLINKAGE
    1847 Cbc_getIterationCount(Cbc_Model * model)
    1848 {
    1849     const char prefix[] = "Cbc_C_Interface::Cbc_getIterationCount(): ";
    1850 //  const int  VERBOSE = 1;
    1851     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1852 
    1853     int result = 0;
    1854     result = model->model_->getIterationCount();
    1855 
    1856     if (VERBOSE > 0) printf("%s return %d\n", prefix, result);
    1857     return result;
    1858 }
    1859 /* Are there a numerical difficulties? */
    1860 COINLIBAPI int COINLINKAGE
    1861 Cbc_isAbandoned(Cbc_Model * model)
    1862 {
    1863     const char prefix[] = "Cbc_C_Interface::Cbc_isAbandoned(): ";
    1864 //  const int  VERBOSE = 1;
    1865     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1866 
    1867     int result = 0;
    1868     result = model->model_->isAbandoned() ? 1 : 0;
    1869 
    1870     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1871     return result;
    1872 }
    1873 /* Is optimality proven? */
    1874 COINLIBAPI int COINLINKAGE
    1875 Cbc_isProvenOptimal(Cbc_Model * model)
    1876 {
    1877     const char prefix[] = "Cbc_C_Interface::Cbc_isProvenOptimal(): ";
    1878 //  const int  VERBOSE = 1;
    1879     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1880 
    1881     int result = 0;
    1882     result = model->model_->isProvenOptimal() ? 1 : 0;
    1883 
    1884     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1885     return result;
    1886 }
    1887 /* Is primal infeasiblity proven? */
    1888 COINLIBAPI int COINLINKAGE
    1889 Cbc_isProvenPrimalInfeasible(Cbc_Model * model)
    1890 {
    1891     const char prefix[] = "Cbc_C_Interface::Cbc_isProvenPrimalInfeasible(): ";
    1892 //  const int  VERBOSE = 1;
    1893     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1894 
    1895     int result = 0;
    1896     OsiSolverInterface * solver = model->model_->solver();
    1897     result = solver->isProvenPrimalInfeasible() ? 1 : 0;
    1898 
    1899     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1900     return result;
    1901 }
    1902 /* Is dual infeasiblity proven? */
    1903 COINLIBAPI int COINLINKAGE
    1904 Cbc_isProvenDualInfeasible(Cbc_Model * model)
    1905 {
    1906     const char prefix[] = "Cbc_C_Interface::Cbc_isProvenDualInfeasible(): ";
    1907 //  const int  VERBOSE = 1;
    1908     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1909 
    1910     int result = 0;
    1911     OsiSolverInterface * solver = model->model_->solver();
    1912     result = solver->isProvenDualInfeasible() ? 1 : 0;
    1913 
    1914     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1915     return result;
    1916 }
    1917 /* Is the given primal objective limit reached? */
    1918 COINLIBAPI int COINLINKAGE
    1919 Cbc_isPrimalObjectiveLimitReached(Cbc_Model * model)
    1920 {
    1921     const char prefix[] = "Cbc_C_Interface::Cbc_isPrimalObjectiveLimitReached(): ";
    1922 //  const int  VERBOSE = 1;
    1923     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1924 
    1925     int result = 0;
    1926     OsiSolverInterface * solver = model->model_->solver();
    1927     result = solver->isPrimalObjectiveLimitReached() ? 1 : 0;
    1928 
    1929     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1930     return result;
    1931 }
    1932 /* Is the given dual objective limit reached? */
    1933 COINLIBAPI int COINLINKAGE
    1934 Cbc_isDualObjectiveLimitReached(Cbc_Model * model)
    1935 {
    1936     const char prefix[] = "Cbc_C_Interface::Cbc_isDualObjectiveLimitReached(): ";
    1937 //  const int  VERBOSE = 1;
    1938     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1939 
    1940     int result = 0;
    1941     OsiSolverInterface * solver = model->model_->solver();
    1942     result = solver->isDualObjectiveLimitReached() ? 1 : 0;
    1943 
    1944     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1945     return result;
    1946 }
    1947 /* Iteration limit reached? */
    1948 COINLIBAPI int COINLINKAGE
    1949 Cbc_isIterationLimitReached(Cbc_Model * model)
    1950 {
    1951     const char prefix[] = "Cbc_C_Interface::Cbc_isIterationLimitReached(): ";
    1952 //  const int  VERBOSE = 1;
    1953     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1954 
    1955     int result = 0;
    1956     OsiSolverInterface * solver = model->model_->solver();
    1957     result = solver->isIterationLimitReached() ? 1 : 0;
    1958 
    1959     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    1960     return result;
    1961 }
    1962 /* Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    1963 COINLIBAPI double COINLINKAGE
    1964 Cbc_getObjSense(Cbc_Model * model)
    1965 {
    1966     const char prefix[] = "Cbc_C_Interface::Cbc_getObjSense(): ";
    1967 //  const int  VERBOSE = 1;
    1968     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1969 
    1970     double result = 0;
    1971     result = model->model_->getObjSense();
    1972 
    1973     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    1974     return result;
    1975 }
    1976 /* Primal row solution */
    1977 COINLIBAPI const double * COINLINKAGE
    1978 Cbc_getRowActivity(Cbc_Model * model)
    1979 {
    1980     const char prefix[] = "Cbc_C_Interface::Cbc_getRowActivity(): ";
    1981 //  const int  VERBOSE = 1;
    1982     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1983 
    1984     const double * result = NULL;
    1985     result = model->model_->getRowActivity();
    1986 
    1987     if (VERBOSE > 0)
    1988         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    1989     return result;
    1990 }
    1991 /* Primal column solution */
    1992 COINLIBAPI const double * COINLINKAGE
    1993 Cbc_getColSolution(Cbc_Model * model)
    1994 {
    1995     const char prefix[] = "Cbc_C_Interface::Cbc_getColSolution(): ";
    1996 //  const int  VERBOSE = 1;
    1997     if (VERBOSE > 0) printf("%s begin\n", prefix);
    1998 
    1999     const double * result = NULL;
    2000     result = model->model_->getColSolution();
    2001 
    2002     if (VERBOSE > 0)
    2003         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2004     return result;
    2005 }
    2006 COINLIBAPI void COINLINKAGE
    2007 Cbc_setColSolution(Cbc_Model * model, const double * input)
    2008 {
    2009     const char prefix[] = "Cbc_C_Interface::Cbc_setColSolution(): ";
    2010 //  const int  VERBOSE = 1;
    2011     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2012 
    2013     OsiSolverInterface * solver = model->model_->solver();
    2014     solver->setColSolution(input);
    2015 
    2016     if (VERBOSE > 0) printf("%s return\n", prefix);
    2017     return;
    2018 }
    2019 /* Dual row solution */
    2020 COINLIBAPI const double * COINLINKAGE
    2021 Cbc_getRowPrice(Cbc_Model * model)
    2022 {
    2023     const char prefix[] = "Cbc_C_Interface::Cbc_getRowPrice(): ";
    2024 //  const int  VERBOSE = 1;
    2025     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2026 
    2027     const double * result = NULL;
    2028     result = model->model_->getRowPrice();
    2029 
    2030     if (VERBOSE > 0)
    2031         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2032     return result;
    2033 }
    2034 /* Reduced costs */
    2035 COINLIBAPI const double * COINLINKAGE
    2036 Cbc_getReducedCost(Cbc_Model * model)
    2037 {
    2038     const char prefix[] = "Cbc_C_Interface::Cbc_getReducedCost(): ";
    2039 //  const int  VERBOSE = 1;
    2040     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2041 
    2042     const double * result = NULL;
    2043     result = model->model_->getReducedCost();
    2044 
    2045     if (VERBOSE > 0)
    2046         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2047     return result;
    2048 }
    2049 /* Row lower */
    2050 COINLIBAPI const double * COINLINKAGE
    2051 Cbc_getRowLower(Cbc_Model * model)
    2052 {
    2053     const char prefix[] = "Cbc_C_Interface::Cbc_getRowLower(): ";
    2054 //  const int  VERBOSE = 1;
    2055     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2056 
    2057     const double * result = NULL;
    2058     result = model->model_->getRowLower();
    2059 
    2060     if (VERBOSE > 0)
    2061         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2062     return result;
    2063 }
    2064 /* Row upper  */
    2065 COINLIBAPI const double * COINLINKAGE
    2066 Cbc_getRowUpper(Cbc_Model * model)
    2067 {
    2068     const char prefix[] = "Cbc_C_Interface::Cbc_getRowUpper(): ";
    2069 //  const int  VERBOSE = 1;
    2070     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2071 
    2072     const double * result = NULL;
    2073     result = model->model_->getRowUpper();
    2074 
    2075     if (VERBOSE > 0)
    2076         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2077     return result;
    2078 }
    2079 /* Objective Coefficients */
    2080 COINLIBAPI const double * COINLINKAGE
    2081 Cbc_getObjCoefficients(Cbc_Model * model)
    2082 {
    2083     const char prefix[] = "Cbc_C_Interface::Cbc_getObjCoefficients(): ";
    2084 //  const int  VERBOSE = 1;
    2085     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2086 
    2087     const double * result = NULL;
    2088     result = model->model_->getObjCoefficients();
    2089 
    2090     if (VERBOSE > 0)
    2091         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2092     return result;
    2093 }
    2094 /* Column Lower */
    2095 COINLIBAPI const double * COINLINKAGE
    2096 Cbc_getColLower(Cbc_Model * model)
    2097 {
    2098     const char prefix[] = "Cbc_C_Interface::Cbc_getColLower(): ";
    2099 //  const int  VERBOSE = 1;
    2100     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2101 
    2102     const double * result = NULL;
    2103     result = model->model_->getColLower();
    2104 
    2105     if (VERBOSE > 0)
    2106         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2107     return result;
    2108 }
    2109 /* Column Upper */
    2110 COINLIBAPI const double * COINLINKAGE
    2111 Cbc_getColUpper(Cbc_Model * model)
    2112 {
    2113     const char prefix[] = "Cbc_C_Interface::Cbc_getColUpper(): ";
    2114 //  const int  VERBOSE = 1;
    2115     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2116 
    2117     const double * result = NULL;
    2118     result = model->model_->getColUpper();
    2119 
    2120     if (VERBOSE > 0)
    2121         printf("%s return %p\n", prefix, static_cast<const void*>(result));
    2122     return result;
    2123 }
    2124 /* Objective value */
    2125 COINLIBAPI double COINLINKAGE
    2126 Cbc_getObjValue(Cbc_Model * model)
    2127 {
    2128     const char prefix[] = "Cbc_C_Interface::Cbc_getObjValue(): ";
    2129 //  const int  VERBOSE = 1;
    2130     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2131 
    2132     double result = 0;
    2133     result = model->model_->getObjValue();
    2134 
    2135     if (VERBOSE > 0)
    2136         printf("%s return %g\n", prefix, result);
    2137     return result;
    2138 }
     615
     616
     617
     618CbcGetProperty(int, getNumCols)
     619CbcGetProperty(int, getNumRows)
     620CbcGetProperty(int, getIterationCount)
     621CbcGetProperty(int, isAbandoned)
     622CbcGetProperty(int, isProvenOptimal)
     623CbcGetProperty(int, isProvenInfeasible)
     624CbcGetProperty(int, isContinuousUnbounded)
     625CbcGetProperty(int, isNodeLimitReached)
     626CbcGetProperty(int, isSecondsLimitReached)
     627CbcGetProperty(int, isSolutionLimitReached)
     628CbcGetProperty(int, isInitialSolveAbandoned)
     629CbcGetProperty(int, isInitialSolveProvenOptimal)
     630CbcGetProperty(int, isInitialSolveProvenPrimalInfeasible)
     631
     632CbcGetProperty(double, getObjSense)
     633
     634COINLIBAPI void COINLINKAGE
     635Cbc_setObjSense(Cbc_Model * model, double sense)
     636{
     637    model->model_->setObjSense(sense);
     638}
     639
     640CbcGetProperty(const double*, getRowActivity)
     641CbcGetProperty(const double*, getColSolution)
     642
     643CbcGetProperty(const double*, getRowLower)
     644CbcSetSolverProperty(double, setRowLower)
     645CbcGetProperty(const double*, getRowUpper)
     646CbcSetSolverProperty(double, setRowUpper)
     647CbcGetProperty(const double*, getObjCoefficients)
     648CbcSetSolverProperty(double, setObjCoeff)
     649CbcGetProperty(const double*, getColLower)
     650CbcSetSolverProperty(double, setColLower)
     651CbcGetProperty(const double*, getColUpper)
     652CbcSetSolverProperty(double, setColUpper)
     653
     654CbcGetProperty(double, getObjValue)
     655CbcGetProperty(double, getBestPossibleObjValue)
     656
    2139657/* Print model */
    2140658COINLIBAPI void COINLINKAGE
     
    2178696           static_cast<const void*>(colub), static_cast<const void*>(obj),
    2179697           static_cast<const void*>(rowlb), static_cast<const void*>(rowub));
    2180     printf("%s optimization direction = %g\n", argPrefix, Cbc_optimizationDirection(model));
     698    printf("%s optimization direction = %g\n", argPrefix, Cbc_getObjSense(model));
    2181699    printf("  (1 - minimize, -1 - maximize, 0 - ignore)\n");
    2182700    {
     
    2207725}
    2208726
    2209 COINLIBAPI double COINLINKAGE
    2210 Cbc_cpuTime(Cbc_Model * /*model*/)
    2211 {
    2212     const char prefix[] = "Cbc_C_Interface::Cbc_cpuTime(): ";
    2213 //  const int  VERBOSE = 1;
    2214     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2215 
    2216     double result = 0;
    2217     result = CoinCpuTime() ;
    2218 
    2219     if (VERBOSE > 0) printf("%s return %g\n", prefix, result);
    2220     return result;
    2221 }
    2222 /** Number of nodes explored in B&B tree */
    2223 COINLIBAPI int COINLINKAGE
    2224 Cbc_getNodeCount(Cbc_Model * model)
    2225 {
    2226     const char prefix[] = "Cbc_C_Interface::Cbc_getNodeCount(): ";
    2227 //  const int  VERBOSE = 1;
    2228     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2229 
    2230     int result = 0;
    2231     result = model->model_->getNodeCount() ;
    2232 
    2233     if (VERBOSE > 0) printf("%s return %i\n", prefix, result);
    2234     return result;
    2235 }
     727CbcGetProperty(int, getNodeCount)
     728
    2236729/** Return a copy of this model */
    2237730COINLIBAPI Cbc_Model * COINLINKAGE
     
    2242735    if (VERBOSE > 0) printf("%s begin\n", prefix);
    2243736
    2244     Cbc_Model * result = new Cbc_Model;
     737    Cbc_Model * result = new Cbc_Model();
    2245738    result->model_     = new CbcModel(*(model->model_));
    2246739    result->solver_    = dynamic_cast< OsiClpSolverInterface*> (result->model_->solver());
    2247740    result->handler_   = NULL;
     741    result->cmdargs_   = model->cmdargs_;
    2248742
    2249743    if (VERBOSE > 0) printf("%s return\n", prefix);
     
    2251745}
    2252746/** Set this the variable to be continuous */
    2253 COINLIBAPI Cbc_Model * COINLINKAGE
     747COINLIBAPI void COINLINKAGE
    2254748Cbc_setContinuous(Cbc_Model * model, int iColumn)
    2255749{
     
    2261755
    2262756    if (VERBOSE > 0) printf("%s return\n", prefix);
    2263     return model;
    2264 }
    2265 /* Add an SOS constraint to the model */
     757}
     758/** Set this the variable to be integer */
     759COINLIBAPI void COINLINKAGE
     760Cbc_setInteger(Cbc_Model * model, int iColumn)
     761{
     762    const char prefix[] = "Cbc_C_Interface::Cbc_setContinuous(): ";
     763//  const int  VERBOSE = 1;
     764    if (VERBOSE > 0) printf("%s begin\n", prefix);
     765
     766    model->model_->solver()->setInteger(iColumn);
     767
     768    if (VERBOSE > 0) printf("%s return\n", prefix);
     769}
     770/** Add SOS constraints to the model using row-order matrix */
     771
    2266772COINLIBAPI void  COINLINKAGE
    2267 Cbc_addSOS_Dense(Cbc_Model * model, int numObjects, const int * len,
    2268                  const int * const* which, const double * weights, const int type)
    2269 {
    2270     const char prefix[] = "Cbc_C_Interface::Cbc_addSOS_Dense(): ";
    2271 //  const int  VERBOSE = 2;
     773Cbc_addSOS(Cbc_Model * model, int numRows, const int * rowStarts,
     774           const int * colIndices, const double * weights, const int type)
     775{
     776    const char prefix[] = "Cbc_C_Interface::Cbc_addSOS(): ";
     777  //const int  VERBOSE = 4;
    2272778    if (VERBOSE > 0) printf("%sbegin\n", prefix);
    2273779
    2274     assert(1 > 0);// this is probably broken
    2275     int i, j;
    2276     // I think this is a different model due to overriding = operator
    2277     CbcModel m = *(model->model_);
    2278 
    2279     CbcObject ** objects = new CbcObject * [numObjects];
    2280 
    2281     if (VERBOSE > 1) printf("%s numObjects = %i\n", prefix, numObjects);
    2282     for (i = 0; i < numObjects; i++) {
    2283         if (VERBOSE > 1) {
    2284             printf("%s len[%i] = %i, identifier = %i, type = %i\n",
    2285                    prefix, i, len[i], i, type);
    2286             fflush(stdout);
    2287             for (j = 0; j < len[i]; j++) {
    2288                 if (VERBOSE > 2 || j == 0 || j == (len[i] - 1)) {
    2289                     printf("%s which[%i][%i] = %d, weights[%i] = %g\n",
    2290                            prefix, i, j, which[i][j], j, weights[j]);
    2291                     fflush(stdout);
    2292                 }
    2293             }
    2294         }
    2295 
    2296         // Make a CbcSOS and assign it to objects
    2297         if (VERBOSE > 1) printf("%s len[%i] = %i\n", prefix, i, len[i]);
    2298         if (VERBOSE > 1) printf("%s new CbcSOS()\n", prefix);
    2299         // ***
    2300         objects[i] = new CbcSOS(model->model_, (int)(len[i]),
    2301                                 (const int*)which[i], (const double*)weights, (int)i, (int)type);
    2302         // ***
    2303         if (objects[i] == NULL) {
    2304             printf("%s ERROR: objects[%i] == NULL\n", prefix, i);
    2305             fflush(stdout);
    2306             assert(objects[i] != NULL);
    2307         }
    2308     }
    2309     if (VERBOSE > 1) printf("%s calling addObjects()\n", prefix);
    2310     fflush(stdout);
    2311     model->model_->addObjects(numObjects, objects);
    2312     if (VERBOSE > 1) printf("%s finished addObjects()\n", prefix);
    2313 
    2314     for (i = 0; i < numObjects; i++) delete objects[i];
    2315     delete [] objects;
    2316 
    2317     if (VERBOSE > 0) printf("%sreturn\n", prefix);
    2318     return;
    2319 }
    2320 /** Add SOS constraints to the model using row-order matrix */
    2321 COINLIBAPI void  COINLINKAGE
    2322 Cbc_addSOS_Sparse(Cbc_Model * model, const int * rowStarts,
    2323                   const int * rowIndices, const double * weights, const int type)
    2324 {
    2325     const char prefix[] = "Cbc_C_Interface::Cbc_addSOS_Sparse(): ";
    2326 //  const int  VERBOSE = 1;
    2327     if (VERBOSE > 0) printf("%sbegin\n", prefix);
    2328 
    2329     int numRows = Cbc_numberRows(model);
    2330780    if (VERBOSE > 0) printf("%s numRows = %i\n", prefix, numRows);
    2331 
    2332     // The passed sparse matrix must have the same number of rows as the model
    2333     assert(numRows == Cbc_numberRows(model));
    2334781
    2335782    int row, i;
     
    2365812        const int numWeights = rowStarts[row+1] - rowStarts[row];
    2366813        if (VERBOSE > 2) printf("%s  numWeights = %i\n", prefix, numWeights);
    2367         colIndex    = rowIndices + rowStarts[row];
     814        colIndex    = colIndices + rowStarts[row];
    2368815        colWeight   = weights + rowStarts[row];
    2369816        if (numWeights > 0) {
     
    2389836    if (VERBOSE > 2) {
    2390837        printf("%s calling addObjects()\n", prefix);
    2391         /*
    2392             printf("%s numObjects = %i, objects = %X\n",prefix,numObjects,objects);
    2393             for (row=0; row<numObjects; row++)
    2394               printf("%s  objects[%i] = %X\n",prefix,row,objects[row]);
    2395         */
     838       
     839        //    printf("%s numObjects = %i, objects = %X\n",prefix,numObjects,objects);
     840        //    for (row=0; row<numObjects; row++)
     841        //      printf("%s  objects[%i] = %X\n",prefix,row,objects[row]);
     842       
    2396843    }
    2397844    fflush(stdout);
     
    2403850
    2404851    if (VERBOSE > 0) printf("%sreturn\n", prefix);
    2405     return;
    2406 }
    2407 
    2408 /** Delete all object information */
    2409 COINLIBAPI void  COINLINKAGE
    2410 Cbc_deleteObjects(Cbc_Model * model)
    2411 {
    2412     const char prefix[] = "Cbc_C_Interface::Cbc_deleteObjects(): ";
    2413 //  const int  VERBOSE = 2;
    2414     if (VERBOSE > 0) printf("%s begin\n", prefix);
    2415 
    2416     model->model_->deleteObjects();
    2417 
    2418     if (VERBOSE > 0) printf("%s return\n", prefix);
    2419852    return;
    2420853}
     
    2439872
    2440873        const double * rowPrimal = Cbc_getRowActivity(model);
    2441         // * Alternatively getReducedCost(model)
    2442         const double * rowDual = Cbc_getRowPrice(model);
    2443         // * Alternatively getColLower(model)
    2444874        const double * rowLower = Cbc_getRowLower(model);
    2445         // * Alternatively getColUpper(model)
    2446875        const double * rowUpper = Cbc_getRowUpper(model);
    2447876        printf("--------------------------------------\n");
     
    2450879        //    assert(Cbc_lengthNames(model));
    2451880
    2452         printf("                       Primal          Dual         Lower         Upper\n");
     881        printf("                       Primal          Lower         Upper\n");
    2453882        for (iRow = 0; iRow < numberRows; iRow++) {
    2454883            double value;
     
    2460889                printf("%6d %8s", iRow, name);
    2461890                printf(" %13g", rowPrimal[iRow]);
    2462                 printf(" %13g", rowDual[iRow]);
    2463891                printf(" %13g", rowLower[iRow]);
    2464892                printf(" %13g", rowUpper[iRow]);
     
    2479907        // * Columns
    2480908
    2481         int numberColumns = Cbc_numberColumns(model);
     909        int numberColumns = Cbc_getNumCols(model);
    2482910        int iColumn;
    2483911
    2484912
    2485         // * Alternatively getColSolution(model)
    2486913        const double * columnPrimal = Cbc_getColSolution(model);
    2487         // * Alternatively getReducedCost(model)
    2488         const double * columnDual = Cbc_getReducedCost(model);
    2489         // * Alternatively getColLower(model)
    2490914        const double * columnLower = Cbc_getColLower(model);
    2491         // * Alternatively getColUpper(model)
    2492915        const double * columnUpper = Cbc_getColUpper(model);
    2493         // * Alternatively getObjCoefficients(model)
    2494916        const double * columnObjective = Cbc_getObjCoefficients(model);
    2495 
    2496         const char * isInteger = Cbc_integerInformation(model);
    2497917
    2498918        printf("--------------------------------------\n");
     
    2501921//    assert(Cbc_lengthNames(model));
    2502922
    2503         printf("                       Primal          Dual         Lower         Upper          Cost     isInteger\n");
     923        printf("                       Primal          Lower         Upper          Cost     isInteger\n");
    2504924        for (iColumn = 0; iColumn < numberColumns; iColumn++) {
    2505925            double value;
     
    2511931                printf("%6d %8s", iColumn, name);
    2512932                printf(" %13g", columnPrimal[iColumn]);
    2513                 printf(" %13g", columnDual[iColumn]);
    2514933                printf(" %13g", columnLower[iColumn]);
    2515934                printf(" %13g", columnUpper[iColumn]);
    2516935                printf(" %13g", columnObjective[iColumn]);
    2517                 printf(" %13i", isInteger[iColumn]);
     936                printf(" %13i", Cbc_isInteger(model,iColumn));
    2518937                printf("\n");
    2519938            }
     
    2524943    return;
    2525944}
    2526 /** Dual initial solve */
    2527 COINLIBAPI int COINLINKAGE
    2528 Cbc_initialDualSolve(Cbc_Model * /*model*/)
    2529 {
    2530     return 0;
    2531 }
    2532 /** Primal initial solve */
    2533 COINLIBAPI int COINLINKAGE
    2534 Cbc_initialPrimalSolve(Cbc_Model * /*model*/)
    2535 {
    2536     return 0;
    2537 }
    2538 /** Dual algorithm - see ClpSimplexDual.hpp for method */
    2539 COINLIBAPI int COINLINKAGE
    2540 Cbc_dual(Cbc_Model * /*model*/, int /*ifValuesPass*/)
    2541 {
    2542     return 0;
    2543 }
    2544 /** Primal algorithm - see ClpSimplexPrimal.hpp for method */
    2545 COINLIBAPI int COINLINKAGE
    2546 Cbc_primal(Cbc_Model * /*model*/, int /*ifValuesPass*/)
    2547 {
    2548     return 0;
    2549 }
     945
    2550946#if defined(__MWERKS__)
    2551947#pragma export off
  • releases/2.8.11/Cbc/src/Cbc_C_Interface.h

    r2347 r2347  
    1111/* include all defines and ugly stuff */
    1212#include "Coin_C_defines.h"
    13 
    14 /** This is a first "C" interface to Cbc.
    15     It is mostly similar to the "C" interface to Clp and
    16     was contributed by Bob Entriken.
     13#include <stddef.h>
     14
     15/*
     16 * Original verison contributed by Bob Entriken,
     17 * significantly updated by Miles Lubin.
    1718*/
     19
    1820
    1921#ifdef __cplusplus
     
    2224
    2325    /**@name Constructors and destructor
    24        These do not have an exact analogue in C++.
    25        The user does not need to know structure of Cbc_Model.
    26 
    27        For all functions outside this group there is an exact C++
    28        analogue created by taking the first parameter out, removing the Cbc_
    29        from name and applying the method to an object of type ClpSimplex.
    30     */
    31     /*@{*/
    32 
    33     /** Version */
    34     COINLIBAPI double COINLINKAGE Cbc_getVersion()
    35     ;
     26      This is a "C" interface to Cbc.
     27      The user does not need to know structure of Cbc_Model.
     28    */
     29    /*@{*/
     30
    3631    /** Default Cbc_Model constructor */
    3732    COINLIBAPI Cbc_Model * COINLINKAGE
    38     Cbc_newModel()
     33    Cbc_newModel(void)
    3934    ;
    4035    /** Cbc_Model Destructor */
     
    4237    Cbc_deleteModel(Cbc_Model * model)
    4338    ;
    44     /*@}*/
    45 
    46     /**@name Load model - loads some stuff and initializes others */
    47     /*@{*/
    48     /* Loads a problem (the constraints on the
     39    /** Current version of Cbc */
     40    COINLIBAPI const char* COINLINKAGE Cbc_getVersion(void)
     41    ;
     42    /*@}*/
     43
     44    /**@name Getting and setting model data
     45     Note that problem access and modification methods,
     46       such as getColLower and setColLower,
     47       are *not valid* after calling Cbc_solve().
     48       Therefore it is not recommended to reuse a Cbc_Model
     49       object for multiple solves. A workaround is to call Cbc_clone()
     50       before solving.
     51     * */
     52    /*@{*/
     53    /** Loads a problem (the constraints on the
    4954        rows are given by lower and upper bounds). If a pointer is NULL then the
    5055        following values are the default:
     
    5762        </ul>
    5863
    59      Just like the other loadProblem() method except that the matrix is
    60      given in a standard column major ordered format (without gaps).
     64     The constraint matrix is
     65     given in standard compressed sparse column (without gaps).
     66     <ul>
     67     <li> <code>start[i]</code> stores the starting index of the ith column
     68     <li> <code>index[k]</code> stores the row index of the kth nonzero element
     69     <li> <code>value[k]</code> stores the coefficient of the kth nonzero element
     70     </ul>
    6171    */
    6272    COINLIBAPI void COINLINKAGE
     
    7686    Cbc_writeMps(Cbc_Model * model, const char *filename)
    7787    ;
    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     ;
    94     /** Deletes rows */
    95     COINLIBAPI void COINLINKAGE
    96     Cbc_deleteRows(Cbc_Model * model, int number, const int * which)
    97     ;
    98     /** Add rows */
    99     COINLIBAPI void COINLINKAGE
    100     Cbc_addRows(Cbc_Model * model, const int number, const double * rowLower,
    101                 const double * rowUpper,
    102                 const int * rowStarts, const int * columns,
    103                 const double * elements)
    104     ;
    105 
    106     /** Deletes columns */
    107     COINLIBAPI void COINLINKAGE
    108     Cbc_deleteColumns(Cbc_Model * model, int number, const int * which)
    109     ;
    110     /** Add columns */
    111     COINLIBAPI void COINLINKAGE
    112     Cbc_addColumns(Cbc_Model * model, int number, const double * columnLower,
    113                    const double * columnUpper,
    114                    const double * objective,
    115                    const int * columnStarts, const int * rows,
    116                    const double * elements);
    117     /** Drops names - makes lengthnames 0 and names empty */
    118     COINLIBAPI void COINLINKAGE
    119     Cbc_dropNames(Cbc_Model * model)
    120     ;
    121     /** Copies in names */
    122     COINLIBAPI void COINLINKAGE
    123     Cbc_copyNames(Cbc_Model * model, const char * const * rowNamesIn,
    124                   const char * const * columnNamesIn)
    125     ;
    126 
    127     /*@}*/
    128     /**@name gets and sets - you will find some synonyms at the end of this file */
    129     /*@{*/
    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     ;
    166     /** Objective offset */
    167     COINLIBAPI double COINLINKAGE
    168     Cbc_objectiveOffset(Cbc_Model * model)
    169     ;
    170     COINLIBAPI void COINLINKAGE
    171     Cbc_setObjectiveOffset(Cbc_Model * model, double value)
     88    /** Provide an initial feasible solution to accelerate branch-and-bound
     89     Note that feasibility of the solution is *not* verified.
     90    */
     91    COINLIBAPI void COINLINKAGE
     92    Cbc_setInitialSolution(Cbc_Model *model, const double * sol)
    17293    ;
    17394    /** Fills in array with problem name  */
     
    180101    */
    181102    COINLIBAPI int COINLINKAGE
    182     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)
    222     ;
    223     /** Status of problem:
    224         0 - optimal
    225         1 - primal infeasible
    226         2 - dual infeasible
    227         3 - stopped on iterations etc
    228         4 - stopped due to errors
    229     */
    230     COINLIBAPI int COINLINKAGE
    231     Cbc_status(Cbc_Model * model)
    232     ;
    233     /** Set problem status */
    234     COINLIBAPI void COINLINKAGE
    235     Cbc_setProblemStatus(Cbc_Model * model, int problemStatus)
    236     ;
    237     /** Secondary status of problem - may get extended
    238         0 - none
    239         1 - primal infeasible because dual limit reached
    240         2 - scaled problem optimal - unscaled has primal infeasibilities
    241         3 - scaled problem optimal - unscaled has dual infeasibilities
    242         4 - scaled problem optimal - unscaled has both dual and primal infeasibilities
    243     */
    244     COINLIBAPI int COINLINKAGE
    245     Cbc_secondaryStatus(Cbc_Model * model)
    246     ;
    247     COINLIBAPI void COINLINKAGE
    248     Cbc_setSecondaryStatus(Cbc_Model * model, int status)
    249     ;
    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     ;
    293     /** Number of elements in matrix */
     103    Cbc_setProblemName(Cbc_Model * model, const char * array)
     104    ;
     105
     106    /** Number of nonzero elements in constraint matrix */
    294107    COINLIBAPI int COINLINKAGE
    295108    Cbc_getNumElements(Cbc_Model * model)
    296109    ;
    297     /** Column starts in matrix */
     110    /** "Column start" vector of constraint matrix. Same format as Cbc_loadProblem() */
    298111    COINLIBAPI const CoinBigIndex * COINLINKAGE
    299112    Cbc_getVectorStarts(Cbc_Model * model)
    300113    ;
    301     /** Row indices in matrix */
     114    /** "Row index" vector of constraint matrix */
    302115    COINLIBAPI const int * COINLINKAGE
    303116    Cbc_getIndices(Cbc_Model * model)
    304117    ;
    305     /** Column vector lengths in matrix */
    306     COINLIBAPI const int * COINLINKAGE
    307     Cbc_getVectorLengths(Cbc_Model * model)
    308     ;
    309     /** Element values in matrix */
     118    /** Coefficient vector of constraint matrix */
    310119    COINLIBAPI const double * COINLINKAGE
    311120    Cbc_getElements(Cbc_Model * model)
    312121    ;
    313     /** Objective value */
     122
     123    /** Maximum lenght of a row or column name */
     124    COINLIBAPI size_t COINLINKAGE
     125    Cbc_maxNameLength(Cbc_Model * model)
     126    ;
     127    /** Fill in first maxLength bytes of name array with a row name */
     128    COINLIBAPI void COINLINKAGE
     129    Cbc_getRowName(Cbc_Model * model, int iRow, char * name, size_t maxLength)
     130    ;
     131    /** Fill in first maxLength bytes of name array with a column name */
     132    COINLIBAPI void COINLINKAGE
     133    Cbc_getColName(Cbc_Model * model, int iColumn, char * name, size_t maxLength)
     134    ;
     135    /** Set the name of a column */
     136    COINLIBAPI void COINLINKAGE
     137    Cbc_setColName(Cbc_Model * model, int iColumn, const char * name)
     138    ;
     139    /** Set the name of a row */
     140    COINLIBAPI void COINLINKAGE
     141    Cbc_setRowName(Cbc_Model * model, int iRow, const char * name)
     142    ;
     143    /** Number of constraints in the model */
     144    COINLIBAPI int COINLINKAGE
     145    Cbc_getNumRows(Cbc_Model * model)
     146    ;
     147    /** Number of variables in the model */
     148    COINLIBAPI int COINLINKAGE
     149    Cbc_getNumCols(Cbc_Model * model)
     150    ;
     151    /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore) */
     152    COINLIBAPI void COINLINKAGE
     153    Cbc_setObjSense(Cbc_Model * model, double sense)
     154    ;
     155    /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore) */
    314156    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]) */
     157    Cbc_getObjSense(Cbc_Model * model)
     158    ;
     159    /** Constraint lower bounds */
     160    COINLIBAPI const double* COINLINKAGE
     161    Cbc_getRowLower(Cbc_Model * model)
     162    ;
     163    /** Set the lower bound of a single constraint */
     164    COINLIBAPI void COINLINKAGE
     165    Cbc_setRowLower(Cbc_Model * model, int index, double value)
     166    ;
     167    /** Constraint upper bounds */
     168    COINLIBAPI const double* COINLINKAGE
     169    Cbc_getRowUpper(Cbc_Model * model)
     170    ;
     171    /** Set the upper bound of a single constraint */
     172    COINLIBAPI void COINLINKAGE
     173    Cbc_setRowUpper(Cbc_Model * model, int index, double value)
     174    ;
     175    /** Objective vector */
     176    COINLIBAPI const double * COINLINKAGE
     177    Cbc_getObjCoefficients(Cbc_Model * model)
     178    ;
     179    /** Set the objective coefficient of a single variable */
     180    COINLIBAPI void COINLINKAGE
     181    Cbc_setObjCoeff(Cbc_Model * model, int index, double value)
     182    ;
     183    /** Variable lower bounds */
     184    COINLIBAPI const double * COINLINKAGE
     185    Cbc_getColLower(Cbc_Model * model)
     186    ;
     187    /** Set the lower bound of a single variable */
     188    COINLIBAPI void COINLINKAGE
     189    Cbc_setColLower(Cbc_Model * model, int index, double value)
     190    ;
     191    /** Variable upper bounds */
     192    COINLIBAPI const double * COINLINKAGE
     193    Cbc_getColUpper(Cbc_Model * model)
     194    ;
     195    /** Set the upper bound of a single variable */
     196    COINLIBAPI void COINLINKAGE
     197    Cbc_setColUpper(Cbc_Model * model, int index, double value)
     198    ;
     199    /** Determine whether the ith variable is integer restricted */
     200    COINLIBAPI int COINLINKAGE
     201    Cbc_isInteger(Cbc_Model * model, int i)
     202    ;
     203    /** Set this variable to be continuous */
     204    COINLIBAPI void COINLINKAGE
     205    Cbc_setContinuous(Cbc_Model * model, int iColumn)
     206    ;
     207    /** Set this variable to be integer */
     208    COINLIBAPI void COINLINKAGE
     209    Cbc_setInteger(Cbc_Model * model, int iColumn)
     210    ;
     211    /** Add SOS constraints to the model using row-order matrix
     212     * Unable to confirm that this function is working. */
    330213    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     ;
     214    Cbc_addSOS(Cbc_Model * model, int numRows, const int * rowStarts,
     215               const int * colIndices, const double * weights, const int type)
     216    ;
     217    /** Print the model */
     218    COINLIBAPI void COINLINKAGE
     219    Cbc_printModel(Cbc_Model * model, const char * argPrefix)
     220    ;
     221    /** Return a copy of this model */
     222    COINLIBAPI Cbc_Model * COINLINKAGE
     223    Cbc_clone(Cbc_Model * model)
     224    ;
     225    /*@}*/
     226    /**@name Solver parameters */
     227    /*@{*/
     228    /** Set parameter "name" to value "value". Note that this
     229     * translates directly to using "-name value" as a
     230     * command-line argument to Cbc.*/
     231    COINLIBAPI void COINLINKAGE
     232    Cbc_setParameter(Cbc_Model * model, const char * name, const char * value)
     233    ;
     234
     235   
    345236    /*@}*/
    346237    /**@name Message handling.  Call backs are handled by ONE function */
     
    356247    Cbc_clearCallBack(Cbc_Model * model)
    357248    ;
    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     ;
    372     /** length of names (0 means no names0 */
    373     COINLIBAPI int COINLINKAGE
    374     Cbc_lengthNames(Cbc_Model * model)
    375     ;
    376     /** Fill in array (at least lengthNames+1 long) with a row name */
    377     COINLIBAPI void COINLINKAGE
    378     Cbc_rowName(Cbc_Model * model, int iRow, char * name)
    379     ;
    380     /** Fill in array (at least lengthNames+1 long) with a column name */
    381     COINLIBAPI void COINLINKAGE
    382     Cbc_columnName(Cbc_Model * model, int iColumn, char * name)
    383     ;
    384 
    385     /*@}*/
    386 
    387 
    388     /**@name Functions most useful to user */
    389     /*@{*/
    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     ;
    402     /** Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later) */
    403     COINLIBAPI void COINLINKAGE
    404     Cbc_scaling(Cbc_Model * model, int mode)
    405     ;
    406     /** Gets scalingFlag */
    407     COINLIBAPI int COINLINKAGE
    408     Cbc_scalingFlag(Cbc_Model * model)
    409     ;
    410     /** Crash - at present just aimed at dual, returns
    411         -2 if dual preferred and crash basis created
    412         -1 if dual preferred and all slack basis preferred
    413          0 if basis going in was not all slack
    414          1 if primal preferred and all slack basis preferred
    415          2 if primal preferred and crash basis created.
    416 
    417          if gap between bounds <="gap" variables can be flipped
    418 
    419          If "pivot" is
    420          0 No pivoting (so will just be choice of algorithm)
    421          1 Simple pivoting e.g. gub
    422          2 Mini iterations
    423     */
    424     COINLIBAPI int COINLINKAGE
    425     Cbc_crash(Cbc_Model * model, double gap, int pivot)
    426     ;
    427     /*@}*/
    428 
    429 
    430     /**@name most useful gets and sets */
    431     /*@{*/
    432     /** If problem is primal feasible */
    433     COINLIBAPI int COINLINKAGE
    434     Cbc_primalFeasible(Cbc_Model * model)
    435     ;
    436     /** If problem is dual feasible */
    437     COINLIBAPI int COINLINKAGE
    438     Cbc_dualFeasible(Cbc_Model * model)
    439     ;
    440     /** Dual bound */
    441     COINLIBAPI double COINLINKAGE
    442     Cbc_dualBound(Cbc_Model * model)
    443     ;
    444     COINLIBAPI void COINLINKAGE
    445     Cbc_setDualBound(Cbc_Model * model, double value)
    446     ;
    447     /** Infeasibility cost */
    448     COINLIBAPI double COINLINKAGE
    449     Cbc_infeasibilityCost(Cbc_Model * model)
    450     ;
    451     COINLIBAPI void COINLINKAGE
    452     Cbc_setInfeasibilityCost(Cbc_Model * model, double value)
    453     ;
    454     /** Perturbation:
    455         50  - switch on perturbation
    456         100 - auto perturb if takes too long (1.0e-6 largest nonzero)
    457         101 - we are perturbed
    458         102 - don't try perturbing again
    459         default is 100
    460         others are for playing
    461     */
    462     COINLIBAPI int COINLINKAGE
    463     Cbc_perturbation(Cbc_Model * model)
    464     ;
    465     COINLIBAPI void COINLINKAGE
    466     Cbc_setPerturbation(Cbc_Model * model, int value)
    467     ;
    468     /** Current (or last) algorithm */
    469     COINLIBAPI int COINLINKAGE
    470     Cbc_algorithm(Cbc_Model * model)
    471     ;
    472     /** Set algorithm */
    473     COINLIBAPI void COINLINKAGE
    474     Cbc_setAlgorithm(Cbc_Model * model, int value)
    475     ;
    476     /** Sum of dual infeasibilities */
    477     COINLIBAPI double COINLINKAGE
    478     Cbc_sumDualInfeasibilities(Cbc_Model * model)
    479     ;
    480     /** Number of dual infeasibilities */
    481     COINLIBAPI int COINLINKAGE
    482     Cbc_numberDualInfeasibilities(Cbc_Model * model)
    483     ;
     249
     250    /*@}*/
     251
     252
     253    /**@name Solving the model */
     254    /*@{*/
     255    /* Solve the model with Cbc (using CbcMain1).
     256    */
     257    COINLIBAPI int COINLINKAGE
     258    Cbc_solve(Cbc_Model * model)
     259    ;
     260    /*@}*/
     261
     262
     263    /**@name Accessing the solution and solution status */
     264    /*@{*/
     265
    484266    /** Sum of primal infeasibilities */
    485267    COINLIBAPI double COINLINKAGE
     
    490272    Cbc_numberPrimalInfeasibilities(Cbc_Model * model)
    491273    ;
    492     /** Save model to file, returns 0 if success.  This is designed for
    493         use outside algorithms so does not save iterating arrays etc.
    494     It does not save any messaging information.
    495     Does not save scaling values.
    496     It does not know about all types of virtual functions.
    497     */
    498     COINLIBAPI int COINLINKAGE
    499     Cbc_saveModel(Cbc_Model * model, const char * fileName)
    500     ;
    501     /** Restore model from file, returns 0 if success,
    502         deletes current model */
    503     COINLIBAPI int COINLINKAGE
    504     Cbc_restoreModel(Cbc_Model * model, const char * fileName)
    505     ;
    506274
    507275    /** Just check solution (for external use) - sets sum of
     
    510278    Cbc_checkSolution(Cbc_Model * model)
    511279    ;
    512     /*@}*/
    513 
    514     /******************** End of most useful part **************/
    515     /**@name gets and sets - some synonyms */
    516     /*@{*/
    517     /** Number of rows */
    518     COINLIBAPI int COINLINKAGE
    519     Cbc_getNumRows(Cbc_Model * model)
    520     ;
    521     /** Number of columns */
    522     COINLIBAPI int COINLINKAGE
    523     Cbc_getNumCols(Cbc_Model * model)
    524     ;
     280
    525281    /** Number of iterations */
    526282    COINLIBAPI int COINLINKAGE
     
    535291    Cbc_isProvenOptimal(Cbc_Model * model)
    536292    ;
    537     /** Is primal infeasiblity proven? */
    538     COINLIBAPI int COINLINKAGE
    539     Cbc_isProvenPrimalInfeasible(Cbc_Model * model)
    540     ;
    541     /** Is dual infeasiblity proven? */
    542     COINLIBAPI int COINLINKAGE
    543     Cbc_isProvenDualInfeasible(Cbc_Model * model)
    544     ;
    545     /** Is the given primal objective limit reached? */
    546     COINLIBAPI int COINLINKAGE
    547     Cbc_isPrimalObjectiveLimitReached(Cbc_Model * model)
    548     ;
    549     /** Is the given dual objective limit reached? */
    550     COINLIBAPI int COINLINKAGE
    551     Cbc_isDualObjectiveLimitReached(Cbc_Model * model)
    552     ;
    553     /** Iteration limit reached? */
    554     COINLIBAPI int COINLINKAGE
    555     Cbc_isIterationLimitReached(Cbc_Model * model)
    556     ;
    557     /** Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    558     COINLIBAPI double COINLINKAGE
    559     Cbc_getObjSense(Cbc_Model * model)
    560     ;
    561     /** Primal row solution */
     293    /** Is infeasiblity proven (or none better than cutoff)? */
     294    COINLIBAPI int COINLINKAGE
     295    Cbc_isProvenInfeasible(Cbc_Model * model)
     296    ;
     297    /** Was continuous solution unbounded? */
     298    COINLIBAPI int COINLINKAGE
     299    Cbc_isContinuousUnbounded(Cbc_Model * model)
     300    ;
     301    /** Node limit reached? */
     302    COINLIBAPI int COINLINKAGE
     303    Cbc_isNodeLimitReached(Cbc_Model * model)
     304    ;
     305    /** Time limit reached? */
     306    COINLIBAPI int COINLINKAGE
     307    Cbc_isSecondsLimitReached(Cbc_Model * model)
     308    ;
     309    /** Solution limit reached? */
     310    COINLIBAPI int COINLINKAGE
     311    Cbc_isSolutionLimitReached(Cbc_Model * model)
     312    ;
     313    /** Are there numerical difficulties (for initialSolve) ? */
     314    COINLIBAPI int COINLINKAGE
     315    Cbc_isInitialSolveAbandoned(Cbc_Model * model)
     316    ;
     317    /** Is optimality proven (for initialSolve) ? */
     318    COINLIBAPI int COINLINKAGE
     319    Cbc_isInitialSolveProvenOptimal(Cbc_Model * model)
     320    ;
     321    /** Is primal infeasiblity proven (for initialSolve) ? */
     322    COINLIBAPI int COINLINKAGE
     323    Cbc_isInitialSolveProvenPrimalInfeasible(Cbc_Model * model)
     324    ;
     325    /** "row" solution
     326     *  This is the vector A*x, where A is the constraint matrix
     327     *  and x is the current solution. */
    562328    COINLIBAPI const double * COINLINKAGE
    563329    Cbc_getRowActivity(Cbc_Model * model)
    564330    ;
    565     /** Primal column solution */
     331    /** Best feasible solution vector */
    566332    COINLIBAPI const double * COINLINKAGE
    567333    Cbc_getColSolution(Cbc_Model * model)
    568334    ;
    569     COINLIBAPI void COINLINKAGE
    570     Cbc_setColSolution(Cbc_Model * model, const double * input)
    571     ;
    572     /** Dual row solution */
    573     COINLIBAPI const double * COINLINKAGE
    574     Cbc_getRowPrice(Cbc_Model * model)
    575     ;
    576     /** Reduced costs */
    577     COINLIBAPI const double * COINLINKAGE
    578     Cbc_getReducedCost(Cbc_Model * model)
    579     ;
    580     /** Row lower */
    581     COINLIBAPI const double* COINLINKAGE
    582     Cbc_getRowLower(Cbc_Model * model)
    583     ;
    584     /** Row upper  */
    585     COINLIBAPI const double* COINLINKAGE
    586     Cbc_getRowUpper(Cbc_Model * model)
    587     ;
    588     /** Objective */
    589     COINLIBAPI const double * COINLINKAGE
    590     Cbc_getObjCoefficients(Cbc_Model * model)
    591     ;
    592     /** Column Lower */
    593     COINLIBAPI const double * COINLINKAGE
    594     Cbc_getColLower(Cbc_Model * model)
    595     ;
    596     /** Column Upper */
    597     COINLIBAPI const double * COINLINKAGE
    598     Cbc_getColUpper(Cbc_Model * model)
    599     ;
    600     /** Objective value */
     335    /** Objective value of best feasible solution */
    601336    COINLIBAPI double COINLINKAGE
    602337    Cbc_getObjValue(Cbc_Model * model)
    603338    ;
    604     /** Print the model */
    605     COINLIBAPI void COINLINKAGE
    606     Cbc_printModel(Cbc_Model * model, const char * argPrefix)
    607     ;
    608     /** Determine whether the variable at location i is integer restricted */
    609     COINLIBAPI int COINLINKAGE
    610     Cbc_isInteger(Cbc_Model * model, int i)
    611     ;
    612     /** Return CPU time */
     339    /** Best known bound on the optimal objective value */
    613340    COINLIBAPI double COINLINKAGE
    614     Cbc_cpuTime(Cbc_Model * model)
     341    Cbc_getBestPossibleObjValue(Cbc_Model * model)
    615342    ;
    616343    /** Number of nodes explored in B&B tree */
    617344    COINLIBAPI int COINLINKAGE
    618345    Cbc_getNodeCount(Cbc_Model * model)
    619     ;
    620     /** Return a copy of this model */
    621     COINLIBAPI Cbc_Model * COINLINKAGE
    622     Cbc_clone(Cbc_Model * model)
    623     ;
    624     /** Set this the variable to be continuous */
    625     COINLIBAPI Cbc_Model * COINLINKAGE
    626     Cbc_setContinuous(Cbc_Model * model, int iColumn)
    627     ;
    628     /** Add SOS constraints to the model using dense matrix */
    629     COINLIBAPI void  COINLINKAGE
    630     Cbc_addSOS_Dense(Cbc_Model * model, int numObjects, const int * len,
    631                      const int * const * which, const double * weights, const int type)
    632     ;
    633     /** Add SOS constraints to the model using row-order matrix */
    634     COINLIBAPI void  COINLINKAGE
    635     Cbc_addSOS_Sparse(Cbc_Model * model, const int * rowStarts,
    636                       const int * rowIndices, const double * weights, const int type)
    637     ;
    638     /** Delete all object information */
    639     COINLIBAPI void  COINLINKAGE
    640     Cbc_deleteObjects(Cbc_Model * model)
    641346    ;
    642347    /** Print the solution */
     
    644349    Cbc_printSolution(Cbc_Model * model)
    645350    ;
    646     /** Dual initial solve */
    647     COINLIBAPI int COINLINKAGE
    648     Cbc_initialDualSolve(Cbc_Model * model)
    649     ;
    650     /** Primal initial solve */
    651     COINLIBAPI int COINLINKAGE
    652     Cbc_initialPrimalSolve(Cbc_Model * model)
    653     ;
    654     /** Dual algorithm - see ClpSimplexDual.hpp for method */
    655     COINLIBAPI int COINLINKAGE
    656     Cbc_dual(Cbc_Model * model, int ifValuesPass)
    657     ;
    658     /** Primal algorithm - see ClpSimplexPrimal.hpp for method */
    659     COINLIBAPI int COINLINKAGE
    660     Cbc_primal(Cbc_Model * model, int ifValuesPass)
     351    /** Final status of problem
     352        Some of these can be found out by is...... functions
     353        -1 before branchAndBound
     354        0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found
     355        (or check value of best solution)
     356        1 stopped - on maxnodes, maxsols, maxtime
     357        2 difficulties so run was abandoned
     358        (5 event user programmed event occurred)
     359    */
     360    COINLIBAPI int COINLINKAGE
     361    Cbc_status(Cbc_Model * model)
     362    ;
     363    /** Secondary status of problem
     364        -1 unset (status_ will also be -1)
     365        0 search completed with solution
     366        1 linear relaxation not feasible (or worse than cutoff)
     367        2 stopped on gap
     368        3 stopped on nodes
     369        4 stopped on time
     370        5 stopped on user event
     371        6 stopped on solutions
     372        7 linear relaxation unbounded
     373        8 stopped on iteration limit
     374    */
     375    COINLIBAPI int COINLINKAGE
     376    Cbc_secondaryStatus(Cbc_Model * model)
    661377    ;
    662378    /*@}*/
  • releases/2.8.11/Cbc/src/Makefile.am

    r2347 r2347  
    1919# List all source files for this library, including headers
    2020libCbc_la_SOURCES = \
    21         Cbc_C_Interface.cpp Cbc_C_Interface.h \
    2221        CbcConfig.h \
    2322        CbcBranchActual.hpp \
     
    9392
    9493libCbcSolver_la_SOURCES = \
     94        Cbc_C_Interface.cpp Cbc_C_Interface.h \
    9595        CbcCbcParam.cpp \
    9696        Cbc_ampl.cpp Cbc_ampl.h \
  • releases/2.8.11/Cbc/src/Makefile.in

    r2347 r2347  
    9292@DEPENDENCY_LINKING_TRUE@libCbc_la_DEPENDENCIES =  \
    9393@DEPENDENCY_LINKING_TRUE@       $(am__DEPENDENCIES_1)
    94 am_libCbc_la_OBJECTS = Cbc_C_Interface.lo CbcBranchAllDifferent.lo \
    95         CbcBranchCut.lo CbcBranchDecision.lo \
    96         CbcBranchDefaultDecision.lo CbcBranchDynamic.lo \
    97         CbcBranchingObject.lo CbcBranchLotsize.lo \
     94am_libCbc_la_OBJECTS = CbcBranchAllDifferent.lo CbcBranchCut.lo \
     95        CbcBranchDecision.lo CbcBranchDefaultDecision.lo \
     96        CbcBranchDynamic.lo CbcBranchingObject.lo CbcBranchLotsize.lo \
    9897        CbcBranchToFixLots.lo CbcCompareDefault.lo CbcCompareDepth.lo \
    9998        CbcCompareEstimate.lo CbcCompareObjective.lo CbcConsequence.lo \
     
    120119@DEPENDENCY_LINKING_TRUE@libCbcSolver_la_DEPENDENCIES =  \
    121120@DEPENDENCY_LINKING_TRUE@       $(am__DEPENDENCIES_1) libCbc.la
    122 am_libCbcSolver_la_OBJECTS = CbcCbcParam.lo Cbc_ampl.lo CbcLinked.lo \
    123         CbcLinkedUtils.lo unitTestClp.lo CbcSolver.lo \
    124         CbcSolverHeuristics.lo CbcSolverAnalyze.lo CbcMipStartIO.lo \
    125         CbcSolverExpandKnapsack.lo
     121am_libCbcSolver_la_OBJECTS = Cbc_C_Interface.lo CbcCbcParam.lo \
     122        Cbc_ampl.lo CbcLinked.lo CbcLinkedUtils.lo unitTestClp.lo \
     123        CbcSolver.lo CbcSolverHeuristics.lo CbcSolverAnalyze.lo \
     124        CbcMipStartIO.lo CbcSolverExpandKnapsack.lo
    126125libCbcSolver_la_OBJECTS = $(am_libCbcSolver_la_OBJECTS)
    127126@COIN_HAS_CLP_TRUE@am__EXEEXT_1 = cbc$(EXEEXT)
     
    513512# List all source files for this library, including headers
    514513libCbc_la_SOURCES = \
    515         Cbc_C_Interface.cpp Cbc_C_Interface.h \
    516514        CbcConfig.h \
    517515        CbcBranchActual.hpp \
     
    587585
    588586libCbcSolver_la_SOURCES = \
     587        Cbc_C_Interface.cpp Cbc_C_Interface.h \
    589588        CbcCbcParam.cpp \
    590589        Cbc_ampl.cpp Cbc_ampl.h \
  • releases/2.8.11/Cbc/src/config_cbc_default.h

    r2347 r2347  
    66
    77/* Version number of project */
    8 #define CBC_VERSION "2.8.10"
     8#define CBC_VERSION "2.8.11"
    99
    1010/* Major Version number of project */
     
    1515
    1616/* Release Version number of project */
    17 #define CBC_VERSION_RELEASE 10
     17#define CBC_VERSION_RELEASE 11
  • releases/2.8.11/Cbc/test/Makefile.am

    r2347 r2347  
    1616
    1717if COIN_HAS_CLP
    18   CBC_TEST_TGTS += test_cbc
     18  CBC_TEST_TGTS += test_cbc ctests
    1919endif
    2020if CBC_BUILD_CBC_GENERIC
     
    5757.PHONY: test
    5858
    59 bin_PROGRAMS = gamsTest osiUnitTest
     59bin_PROGRAMS = gamsTest osiUnitTest CInterfaceTest
    6060
    6161gamsTest_SOURCES = gamsTest.cpp
     
    8787
    8888########################################################################
     89#                         unitTest for CbcCInterface                   #
     90########################################################################
     91
     92CInterfaceTest_SOURCES = CInterfaceTest.c
     93nodist_EXTRA_CInterfaceTest_SOURCES = dummy.cpp # force using C++ linker
     94
     95CInterfaceTest_LDADD = ../src/libCbcSolver.la ../src/libCbc.la $(CBCLIB_LIBS)
     96
     97CInterfaceTest_DEPENDENCIES = ../src/libCbcSolver.la ../src/libCbc.la $(CBCLIB_DEPENDENCIES)
     98
     99ctests: CInterfaceTest$(EXEEXT)
     100        ./CInterfaceTest$(EXEEXT)
     101
     102########################################################################
    89103#                          Cleaning stuff                              #
    90104########################################################################
  • releases/2.8.11/Cbc/test/Makefile.in

    r2347 r2347  
    4343build_triplet = @build@
    4444host_triplet = @host@
    45 @COIN_HAS_CLP_TRUE@am__append_1 = test_cbc
     45@COIN_HAS_CLP_TRUE@am__append_1 = test_cbc ctests
    4646@CBC_BUILD_CBC_GENERIC_TRUE@@COIN_HAS_SAMPLE_TRUE@am__append_2 = test_cbc_generic
    4747@COIN_HAS_SAMPLE_TRUE@am__append_3 = -dirSample `$(CYGPATH_W) $(SAMPLE_DATA)`
     
    4949@COIN_HAS_MIPLIB3_TRUE@am__append_5 = -dirMiplib `$(CYGPATH_W) $(MIPLIB3_DATA)` -miplib
    5050@COIN_HAS_NETLIB_TRUE@am__append_6 = -netlibDir=`$(CYGPATH_W) $(NETLIB_DATA)` -testOsiSolverInterface
    51 bin_PROGRAMS = gamsTest$(EXEEXT) osiUnitTest$(EXEEXT)
     51bin_PROGRAMS = gamsTest$(EXEEXT) osiUnitTest$(EXEEXT) \
     52        CInterfaceTest$(EXEEXT)
    5253subdir = test
    5354DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
     
    6465binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
    6566PROGRAMS = $(bin_PROGRAMS)
     67am_CInterfaceTest_OBJECTS = CInterfaceTest.$(OBJEXT)
     68CInterfaceTest_OBJECTS = $(am_CInterfaceTest_OBJECTS)
     69am__DEPENDENCIES_1 =
    6670am_gamsTest_OBJECTS = gamsTest.$(OBJEXT)
    6771gamsTest_OBJECTS = $(am_gamsTest_OBJECTS)
    68 am__DEPENDENCIES_1 =
    6972am_osiUnitTest_OBJECTS = osiUnitTest.$(OBJEXT) \
    7073        OsiCbcSolverInterfaceTest.$(OBJEXT)
     
    7275depcomp = $(SHELL) $(top_srcdir)/depcomp
    7376am__depfiles_maybe = depfiles
     77COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
     78        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
     79LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
     80        $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
     81        $(AM_CFLAGS) $(CFLAGS)
     82CCLD = $(CC)
     83LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
     84        $(AM_LDFLAGS) $(LDFLAGS) -o $@
    7485CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
    7586        $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
     
    8091CXXLINK = $(LIBTOOL) --tag=CXX --mode=link $(CXXLD) $(AM_CXXFLAGS) \
    8192        $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
    82 SOURCES = $(gamsTest_SOURCES) $(osiUnitTest_SOURCES)
    83 DIST_SOURCES = $(gamsTest_SOURCES) $(osiUnitTest_SOURCES)
     93SOURCES = $(CInterfaceTest_SOURCES) \
     94        $(nodist_EXTRA_CInterfaceTest_SOURCES) $(gamsTest_SOURCES) \
     95        $(osiUnitTest_SOURCES)
     96DIST_SOURCES = $(CInterfaceTest_SOURCES) $(gamsTest_SOURCES) \
     97        $(osiUnitTest_SOURCES)
    8498ETAGS = etags
    8599CTAGS = ctags
     
    438452
    439453########################################################################
     454#                         unitTest for CbcCInterface                   #
     455########################################################################
     456CInterfaceTest_SOURCES = CInterfaceTest.c
     457nodist_EXTRA_CInterfaceTest_SOURCES = dummy.cpp # force using C++ linker
     458CInterfaceTest_LDADD = ../src/libCbcSolver.la ../src/libCbc.la $(CBCLIB_LIBS)
     459CInterfaceTest_DEPENDENCIES = ../src/libCbcSolver.la ../src/libCbc.la $(CBCLIB_DEPENDENCIES)
     460
     461########################################################################
    440462#                          Cleaning stuff                              #
    441463########################################################################
     
    447469
    448470.SUFFIXES:
    449 .SUFFIXES: .cpp .lo .o .obj
     471.SUFFIXES: .c .cpp .lo .o .obj
    450472$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
    451473        @for dep in $?; do \
     
    505527          rm -f $$p $$f ; \
    506528        done
     529CInterfaceTest$(EXEEXT): $(CInterfaceTest_OBJECTS) $(CInterfaceTest_DEPENDENCIES)
     530        @rm -f CInterfaceTest$(EXEEXT)
     531        $(CXXLINK) $(CInterfaceTest_LDFLAGS) $(CInterfaceTest_OBJECTS) $(CInterfaceTest_LDADD) $(LIBS)
    507532gamsTest$(EXEEXT): $(gamsTest_OBJECTS) $(gamsTest_DEPENDENCIES)
    508533        @rm -f gamsTest$(EXEEXT)
     
    518543        -rm -f *.tab.c
    519544
     545@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/CInterfaceTest.Po@am__quote@
    520546@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/OsiCbcSolverInterfaceTest.Po@am__quote@
     547@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dummy.Po@am__quote@
    521548@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gamsTest.Po@am__quote@
    522549@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osiUnitTest.Po@am__quote@
     550
     551.c.o:
     552@am__fastdepCC_TRUE@    if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
     553@am__fastdepCC_TRUE@    then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
     554@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     555@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     556@am__fastdepCC_FALSE@   $(COMPILE) -c $<
     557
     558.c.obj:
     559@am__fastdepCC_TRUE@    if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
     560@am__fastdepCC_TRUE@    then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
     561@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
     562@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     563@am__fastdepCC_FALSE@   $(COMPILE) -c `$(CYGPATH_W) '$<'`
     564
     565.c.lo:
     566@am__fastdepCC_TRUE@    if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
     567@am__fastdepCC_TRUE@    then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
     568@AMDEP_TRUE@@am__fastdepCC_FALSE@       source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
     569@AMDEP_TRUE@@am__fastdepCC_FALSE@       DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     570@am__fastdepCC_FALSE@   $(LTCOMPILE) -c -o $@ $<
    523571
    524572.cpp.o:
     
    742790ositests: osiUnitTest$(EXEEXT)
    743791        ./osiUnitTest$(EXEEXT) $(ositestsflags)
     792
     793ctests: CInterfaceTest$(EXEEXT)
     794        ./CInterfaceTest$(EXEEXT)
    744795# Tell versions [3.59,3.63) of GNU make to not export all variables.
    745796# Otherwise a system limit (for SysV at least) may be exceeded.
  • releases/2.8.11/configure

    r2347 r2347  
    22# From configure.ac 0.9.
    33# Guess values for system-dependent variables and create Makefiles.
    4 # Generated by GNU Autoconf 2.59 for Cbc 2.8.10.
     4# Generated by GNU Autoconf 2.59 for Cbc 2.8.11.
    55#
    66# Report bugs to <cbc@lists.coin-or.org>.
     
    431431PACKAGE_NAME='Cbc'
    432432PACKAGE_TARNAME='cbc'
    433 PACKAGE_VERSION='2.8.10'
    434 PACKAGE_STRING='Cbc 2.8.10'
     433PACKAGE_VERSION='2.8.11'
     434PACKAGE_STRING='Cbc 2.8.11'
    435435PACKAGE_BUGREPORT='cbc@lists.coin-or.org'
    436436
     
    10391039  # This message is too long to be a string in the A/UX 3.1 sh.
    10401040  cat <<_ACEOF
    1041 \`configure' configures Cbc 2.8.10 to adapt to many kinds of systems.
     1041\`configure' configures Cbc 2.8.11 to adapt to many kinds of systems.
    10421042
    10431043Usage: $0 [OPTION]... [VAR=VALUE]...
     
    11051105if test -n "$ac_init_help"; then
    11061106  case $ac_init_help in
    1107      short | recursive ) echo "Configuration of Cbc 2.8.10:";;
     1107     short | recursive ) echo "Configuration of Cbc 2.8.11:";;
    11081108   esac
    11091109  cat <<\_ACEOF
     
    13281328if $ac_init_version; then
    13291329  cat <<\_ACEOF
    1330 Cbc configure 2.8.10
     1330Cbc configure 2.8.11
    13311331generated by GNU Autoconf 2.59
    13321332
     
    13481348running configure, to aid debugging if configure makes a mistake.
    13491349
    1350 It was created by Cbc $as_me 2.8.10, which was
     1350It was created by Cbc $as_me 2.8.11, which was
    13511351generated by GNU Autoconf 2.59.  Invocation command line was
    13521352
     
    51145114# Define the identity of the package.
    51155115 PACKAGE='cbc'
    5116  VERSION='2.8.10'
     5116 VERSION='2.8.11'
    51175117
    51185118
     
    2343323433cat >&5 <<_CSEOF
    2343423434
    23435 This file was extended by Cbc $as_me 2.8.10, which was
     23435This file was extended by Cbc $as_me 2.8.11, which was
    2343623436generated by GNU Autoconf 2.59.  Invocation command line was
    2343723437
     
    2349123491cat >>$CONFIG_STATUS <<_ACEOF
    2349223492ac_cs_version="\\
    23493 Cbc config.status 2.8.10
     23493Cbc config.status 2.8.11
    2349423494configured by $0, generated by GNU Autoconf 2.59,
    2349523495  with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
  • releases/2.8.11/configure.ac

    r2347 r2347  
    1313AC_PREREQ(2.59)
    1414
    15 AC_INIT([Cbc],[2.8.10],[cbc@lists.coin-or.org])
     15AC_INIT([Cbc],[2.8.11],[cbc@lists.coin-or.org])
    1616
    1717AC_COPYRIGHT([
Note: See TracChangeset for help on using the changeset viewer.