Ignore:
Timestamp:
Jan 6, 2019 2:43:06 PM (4 months ago)
Author:
unxusr
Message:

formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/Clp_C_Interface.cpp

    r2366 r2385  
    33// Corporation and others.  All Rights Reserved.
    44// This code is licensed under the terms of the Eclipse Public License (EPL).
    5 
    65
    76#include "CoinPragma.hpp"
     
    2625
    2726public:
    28      /**@name Overrides */
    29      //@{
    30      virtual int print();
    31      //@}
    32      /**@name set and get */
    33      //@{
    34      /// Model
    35      const Clp_Simplex * model() const;
    36      void setModel(Clp_Simplex * model);
    37      /// Call back
    38      void setCallBack(clp_callback callback);
    39      //@}
    40 
    41      /**@name Constructors, destructor */
    42      //@{
    43      /** Default constructor. */
    44      CMessageHandler();
    45      /// Constructor with pointer to model
    46      CMessageHandler(Clp_Simplex * model,
    47                      FILE * userPointer = NULL);
    48      /** Destructor */
    49      virtual ~CMessageHandler();
    50      //@}
    51 
    52      /**@name Copy method */
    53      //@{
    54      /** The copy constructor. */
    55      CMessageHandler(const CMessageHandler&);
    56      /** The copy constructor from an CoinSimplexMessageHandler. */
    57      CMessageHandler(const CoinMessageHandler&);
    58 
    59      CMessageHandler& operator=(const CMessageHandler&);
    60      /// Clone
    61      virtual CoinMessageHandler * clone() const ;
    62      //@}
    63 
     27  /**@name Overrides */
     28  //@{
     29  virtual int print();
     30  //@}
     31  /**@name set and get */
     32  //@{
     33  /// Model
     34  const Clp_Simplex *model() const;
     35  void setModel(Clp_Simplex *model);
     36  /// Call back
     37  void setCallBack(clp_callback callback);
     38  //@}
     39
     40  /**@name Constructors, destructor */
     41  //@{
     42  /** Default constructor. */
     43  CMessageHandler();
     44  /// Constructor with pointer to model
     45  CMessageHandler(Clp_Simplex *model,
     46    FILE *userPointer = NULL);
     47  /** Destructor */
     48  virtual ~CMessageHandler();
     49  //@}
     50
     51  /**@name Copy method */
     52  //@{
     53  /** The copy constructor. */
     54  CMessageHandler(const CMessageHandler &);
     55  /** The copy constructor from an CoinSimplexMessageHandler. */
     56  CMessageHandler(const CoinMessageHandler &);
     57
     58  CMessageHandler &operator=(const CMessageHandler &);
     59  /// Clone
     60  virtual CoinMessageHandler *clone() const;
     61  //@}
    6462
    6563protected:
    66      /**@name Data members
     64  /**@name Data members
    6765        The data members are protected to allow access for derived classes. */
    68      //@{
    69      /// Pointer back to model
    70      Clp_Simplex * model_;
    71      /// call back
    72      clp_callback callback_;
    73      //@}
     66  //@{
     67  /// Pointer back to model
     68  Clp_Simplex *model_;
     69  /// call back
     70  clp_callback callback_;
     71  //@}
    7472};
    75 
    7673
    7774//-------------------------------------------------------------------
    7875// Default Constructor
    7976//-------------------------------------------------------------------
    80 CMessageHandler::CMessageHandler ()
    81      : CoinMessageHandler(),
    82        model_(NULL),
    83       callback_(NULL)
     77CMessageHandler::CMessageHandler()
     78  : CoinMessageHandler()
     79  , model_(NULL)
     80  , callback_(NULL)
    8481{
    8582}
     
    8885// Copy constructor
    8986//-------------------------------------------------------------------
    90 CMessageHandler::CMessageHandler (const CMessageHandler & rhs)
    91      : CoinMessageHandler(rhs),
    92        model_(rhs.model_),
    93       callback_(rhs.callback_)
    94 {
    95 }
    96 
    97 CMessageHandler::CMessageHandler (const CoinMessageHandler & rhs)
    98      : CoinMessageHandler(rhs),
    99        model_(NULL),
    100       callback_(NULL)
     87CMessageHandler::CMessageHandler(const CMessageHandler &rhs)
     88  : CoinMessageHandler(rhs)
     89  , model_(rhs.model_)
     90  , callback_(rhs.callback_)
     91{
     92}
     93
     94CMessageHandler::CMessageHandler(const CoinMessageHandler &rhs)
     95  : CoinMessageHandler(rhs)
     96  , model_(NULL)
     97  , callback_(NULL)
    10198{
    10299}
    103100
    104101// Constructor with pointer to model
    105 CMessageHandler::CMessageHandler(Clp_Simplex * model,
    106                                  FILE * )
    107      : CoinMessageHandler(),
    108        model_(model),
    109       callback_(NULL)
     102CMessageHandler::CMessageHandler(Clp_Simplex *model,
     103  FILE *)
     104  : CoinMessageHandler()
     105  , model_(model)
     106  , callback_(NULL)
    110107{
    111108}
     
    114111// Destructor
    115112//-------------------------------------------------------------------
    116 CMessageHandler::~CMessageHandler ()
     113CMessageHandler::~CMessageHandler()
    117114{
    118115}
     
    122119//-------------------------------------------------------------------
    123120CMessageHandler &
    124 CMessageHandler::operator=(const CMessageHandler& rhs)
    125 {
    126      if (this != &rhs) {
    127           CoinMessageHandler::operator=(rhs);
    128           model_ = rhs.model_;
    129           callback_ = rhs.callback_;
    130      }
    131      return *this;
     121CMessageHandler::operator=(const CMessageHandler &rhs)
     122{
     123  if (this != &rhs) {
     124    CoinMessageHandler::operator=(rhs);
     125    model_ = rhs.model_;
     126    callback_ = rhs.callback_;
     127  }
     128  return *this;
    132129}
    133130//-------------------------------------------------------------------
    134131// Clone
    135132//-------------------------------------------------------------------
    136 CoinMessageHandler * CMessageHandler::clone() const
    137 {
    138      return new CMessageHandler(*this);
    139 }
    140 
    141 int
    142 CMessageHandler::print()
    143 {
    144      if (callback_) {
    145           int messageNumber = currentMessage().externalNumber();
    146           if (currentSource() != "Clp")
    147                messageNumber += 1000000;
    148           int i;
    149           int nDouble = numberDoubleFields();
    150           assert (nDouble <= 10);
    151           double vDouble[10];
    152           for (i = 0; i < nDouble; i++)
    153                vDouble[i] = doubleValue(i);
    154           int nInt = numberIntFields();
    155           assert (nInt <= 10);
    156           CoinBigIndex vInt[10];
    157           for (i = 0; i < nInt; i++)
    158                vInt[i] = intValue(i);
    159           int nString = numberStringFields();
    160           assert (nString <= 10);
    161           char * vString[10];
    162           for (i = 0; i < nString; i++) {
    163                std::string value = stringValue(i);
    164                vString[i] = CoinStrdup(value.c_str());
    165           }
    166           callback_(model_, messageNumber,
    167                     nDouble, vDouble,
    168                     nInt, vInt,
    169                     nString, vString);
    170           for (i = 0; i < nString; i++)
    171                free(vString[i]);
    172 
    173      }
    174      return CoinMessageHandler::print();
     133CoinMessageHandler *CMessageHandler::clone() const
     134{
     135  return new CMessageHandler(*this);
     136}
     137
     138int CMessageHandler::print()
     139{
     140  if (callback_) {
     141    int messageNumber = currentMessage().externalNumber();
     142    if (currentSource() != "Clp")
     143      messageNumber += 1000000;
     144    int i;
     145    int nDouble = numberDoubleFields();
     146    assert(nDouble <= 10);
     147    double vDouble[10];
     148    for (i = 0; i < nDouble; i++)
     149      vDouble[i] = doubleValue(i);
     150    int nInt = numberIntFields();
     151    assert(nInt <= 10);
     152    CoinBigIndex vInt[10];
     153    for (i = 0; i < nInt; i++)
     154      vInt[i] = intValue(i);
     155    int nString = numberStringFields();
     156    assert(nString <= 10);
     157    char *vString[10];
     158    for (i = 0; i < nString; i++) {
     159      std::string value = stringValue(i);
     160      vString[i] = CoinStrdup(value.c_str());
     161    }
     162    callback_(model_, messageNumber,
     163      nDouble, vDouble,
     164      nInt, vInt,
     165      nString, vString);
     166    for (i = 0; i < nString; i++)
     167      free(vString[i]);
     168  }
     169  return CoinMessageHandler::print();
    175170}
    176171const Clp_Simplex *
    177172CMessageHandler::model() const
    178173{
    179      return model_;
    180 }
    181 void
    182 CMessageHandler::setModel(Clp_Simplex * model)
    183 {
    184      model_ = model;
     174  return model_;
     175}
     176void CMessageHandler::setModel(Clp_Simplex *model)
     177{
     178  model_ = model;
    185179}
    186180// Call back
    187 void
    188 CMessageHandler::setCallBack(clp_callback callback)
    189 {
    190      callback_ = callback;
     181void CMessageHandler::setCallBack(clp_callback callback)
     182{
     183  callback_ = callback;
    191184}
    192185
     
    200193#endif
    201194
    202 
    203 COINLIBAPI const char* COINLINKAGE
     195COINLIBAPI const char *COINLINKAGE
    204196Clp_Version(void)
    205197{
    206    return CLP_VERSION;
     198  return CLP_VERSION;
    207199}
    208200COINLIBAPI int COINLINKAGE
    209201Clp_VersionMajor(void)
    210202{
    211    return CLP_VERSION_MAJOR;
     203  return CLP_VERSION_MAJOR;
    212204}
    213205COINLIBAPI int COINLINKAGE Clp_VersionMinor(void)
    214206{
    215    return CLP_VERSION_MINOR;
     207  return CLP_VERSION_MINOR;
    216208}
    217209COINLIBAPI int COINLINKAGE Clp_VersionRelease(void)
    218210{
    219    return CLP_VERSION_RELEASE;
     211  return CLP_VERSION_RELEASE;
    220212}
    221213
    222214/* Default constructor */
    223 COINLIBAPI Clp_Simplex *  COINLINKAGE
     215COINLIBAPI Clp_Simplex *COINLINKAGE
    224216Clp_newModel()
    225217{
    226      Clp_Simplex * model = new Clp_Simplex;
    227      model->model_ = new ClpSimplex();
    228      model->handler_ = NULL;
    229      return model;
     218  Clp_Simplex *model = new Clp_Simplex;
     219  model->model_ = new ClpSimplex();
     220  model->handler_ = NULL;
     221  return model;
    230222}
    231223/* Destructor */
    232224COINLIBAPI void COINLINKAGE
    233 Clp_deleteModel(Clp_Simplex * model)
    234 {
    235      delete model->model_;
    236      delete model->handler_;
    237      delete model;
     225Clp_deleteModel(Clp_Simplex *model)
     226{
     227  delete model->model_;
     228  delete model->handler_;
     229  delete model;
    238230}
    239231
     
    252244   given in a standard column major ordered format (without gaps). */
    253245COINLIBAPI void COINLINKAGE
    254 Clp_loadProblem (Clp_Simplex * model, const int numcols, const int numrows,
    255                  const CoinBigIndex * start, const int* index,
    256                  const double* value,
    257                  const double* collb, const double* colub,
    258                  const double* obj,
    259                  const double* rowlb, const double* rowub)
    260 {
    261      const char prefix[] = "Clp_c_Interface::Clp_loadProblem(): ";
    262      const int verbose = 0;
    263      if (verbose > 1) {
    264           printf("%s numcols = %i, numrows = %i\n",
    265                  prefix, numcols, numrows);
    266           printf("%s model = %p, start = %p, index = %p, value = %p\n",
    267                  prefix, reinterpret_cast<const void *>(model), reinterpret_cast<const void *>(start), reinterpret_cast<const void *>(index), reinterpret_cast<const void *>(value));
    268           printf("%s collb = %p, colub = %p, obj = %p, rowlb = %p, rowub = %p\n",
    269                  prefix, reinterpret_cast<const void *>(collb), reinterpret_cast<const void *>(colub), reinterpret_cast<const void *>(obj), reinterpret_cast<const void *>(rowlb), reinterpret_cast<const void *>(rowub));
    270      }
    271      model->model_->loadProblem(numcols, numrows, start, index, value,
    272                                 collb, colub, obj, rowlb, rowub);
     246Clp_loadProblem(Clp_Simplex *model, const int numcols, const int numrows,
     247  const CoinBigIndex *start, const int *index,
     248  const double *value,
     249  const double *collb, const double *colub,
     250  const double *obj,
     251  const double *rowlb, const double *rowub)
     252{
     253  const char prefix[] = "Clp_c_Interface::Clp_loadProblem(): ";
     254  const int verbose = 0;
     255  if (verbose > 1) {
     256    printf("%s numcols = %i, numrows = %i\n",
     257      prefix, numcols, numrows);
     258    printf("%s model = %p, start = %p, index = %p, value = %p\n",
     259      prefix, reinterpret_cast< const void * >(model), reinterpret_cast< const void * >(start), reinterpret_cast< const void * >(index), reinterpret_cast< const void * >(value));
     260    printf("%s collb = %p, colub = %p, obj = %p, rowlb = %p, rowub = %p\n",
     261      prefix, reinterpret_cast< const void * >(collb), reinterpret_cast< const void * >(colub), reinterpret_cast< const void * >(obj), reinterpret_cast< const void * >(rowlb), reinterpret_cast< const void * >(rowub));
     262  }
     263  model->model_->loadProblem(numcols, numrows, start, index, value,
     264    collb, colub, obj, rowlb, rowub);
    273265}
    274266/* read quadratic part of the objective (the matrix part) */
    275267COINLIBAPI void COINLINKAGE
    276 Clp_loadQuadraticObjective(Clp_Simplex * model,
    277                            const int numberColumns,
    278                            const CoinBigIndex * start,
    279                            const int * column,
    280                            const double * element)
    281 {
    282 
    283      model->model_->loadQuadraticObjective(numberColumns,
    284                                            start, column, element);
    285 
     268Clp_loadQuadraticObjective(Clp_Simplex *model,
     269  const int numberColumns,
     270  const CoinBigIndex *start,
     271  const int *column,
     272  const double *element)
     273{
     274
     275  model->model_->loadQuadraticObjective(numberColumns,
     276    start, column, element);
    286277}
    287278/* Read an mps file from the given filename */
    288279COINLIBAPI int COINLINKAGE
    289 Clp_readMps(Clp_Simplex * model, const char *filename,
    290             int keepNames,
    291             int ignoreErrors)
    292 {
    293      return model->model_->readMps(filename, keepNames != 0, ignoreErrors != 0);
     280Clp_readMps(Clp_Simplex *model, const char *filename,
     281  int keepNames,
     282  int ignoreErrors)
     283{
     284  return model->model_->readMps(filename, keepNames != 0, ignoreErrors != 0);
    294285}
    295286/* Copy in integer informations */
    296287COINLIBAPI void COINLINKAGE
    297 Clp_copyInIntegerInformation(Clp_Simplex * model, const char * information)
    298 {
    299      model->model_->copyInIntegerInformation(information);
     288Clp_copyInIntegerInformation(Clp_Simplex *model, const char *information)
     289{
     290  model->model_->copyInIntegerInformation(information);
    300291}
    301292/* Drop integer informations */
    302293COINLIBAPI void COINLINKAGE
    303 Clp_deleteIntegerInformation(Clp_Simplex * model)
    304 {
    305      model->model_->deleteIntegerInformation();
     294Clp_deleteIntegerInformation(Clp_Simplex *model)
     295{
     296  model->model_->deleteIntegerInformation();
    306297}
    307298/* Resizes rim part of model  */
    308299COINLIBAPI void COINLINKAGE
    309 Clp_resize (Clp_Simplex * model, int newNumberRows, int newNumberColumns)
    310 {
    311      model->model_->resize(newNumberRows, newNumberColumns);
     300Clp_resize(Clp_Simplex *model, int newNumberRows, int newNumberColumns)
     301{
     302  model->model_->resize(newNumberRows, newNumberColumns);
    312303}
    313304/* Deletes rows */
    314305COINLIBAPI void COINLINKAGE
    315 Clp_deleteRows(Clp_Simplex * model, int number, const int * which)
    316 {
    317      model->model_->deleteRows(number, which);
     306Clp_deleteRows(Clp_Simplex *model, int number, const int *which)
     307{
     308  model->model_->deleteRows(number, which);
    318309}
    319310/* Add rows */
    320311COINLIBAPI void COINLINKAGE
    321 Clp_addRows(Clp_Simplex * model, int number, const double * rowLower,
    322             const double * rowUpper,
    323             const CoinBigIndex * rowStarts, const int * columns,
    324             const double * elements)
    325 {
    326      model->model_->addRows(number, rowLower, rowUpper, rowStarts, columns, elements);
     312Clp_addRows(Clp_Simplex *model, int number, const double *rowLower,
     313  const double *rowUpper,
     314  const CoinBigIndex *rowStarts, const int *columns,
     315  const double *elements)
     316{
     317  model->model_->addRows(number, rowLower, rowUpper, rowStarts, columns, elements);
    327318}
    328319
    329320/* Deletes columns */
    330321COINLIBAPI void COINLINKAGE
    331 Clp_deleteColumns(Clp_Simplex * model, int number, const int * which)
    332 {
    333      model->model_->deleteColumns(number, which);
     322Clp_deleteColumns(Clp_Simplex *model, int number, const int *which)
     323{
     324  model->model_->deleteColumns(number, which);
    334325}
    335326/* Add columns */
    336327COINLIBAPI void COINLINKAGE
    337 Clp_addColumns(Clp_Simplex * model, int number, const double * columnLower,
    338                const double * columnUpper,
    339                const double * objective,
    340                const CoinBigIndex * columnStarts, const int * rows,
    341                const double * elements)
    342 {
    343      model->model_->addColumns(number, columnLower, columnUpper, objective,
    344                                columnStarts, rows, elements);
     328Clp_addColumns(Clp_Simplex *model, int number, const double *columnLower,
     329  const double *columnUpper,
     330  const double *objective,
     331  const CoinBigIndex *columnStarts, const int *rows,
     332  const double *elements)
     333{
     334  model->model_->addColumns(number, columnLower, columnUpper, objective,
     335    columnStarts, rows, elements);
    345336}
    346337/* Change row lower bounds */
    347338COINLIBAPI void COINLINKAGE
    348 Clp_chgRowLower(Clp_Simplex * model, const double * rowLower)
    349 {
    350      model->model_->chgRowLower(rowLower);
     339Clp_chgRowLower(Clp_Simplex *model, const double *rowLower)
     340{
     341  model->model_->chgRowLower(rowLower);
    351342}
    352343/* Change row upper bounds */
    353344COINLIBAPI void COINLINKAGE
    354 Clp_chgRowUpper(Clp_Simplex * model, const double * rowUpper)
    355 {
    356      model->model_->chgRowUpper(rowUpper);
     345Clp_chgRowUpper(Clp_Simplex *model, const double *rowUpper)
     346{
     347  model->model_->chgRowUpper(rowUpper);
    357348}
    358349/* Change column lower bounds */
    359350COINLIBAPI void COINLINKAGE
    360 Clp_chgColumnLower(Clp_Simplex * model, const double * columnLower)
    361 {
    362      model->model_->chgColumnLower(columnLower);
     351Clp_chgColumnLower(Clp_Simplex *model, const double *columnLower)
     352{
     353  model->model_->chgColumnLower(columnLower);
    363354}
    364355/* Change column upper bounds */
    365356COINLIBAPI void COINLINKAGE
    366 Clp_chgColumnUpper(Clp_Simplex * model, const double * columnUpper)
    367 {
    368      model->model_->chgColumnUpper(columnUpper);
     357Clp_chgColumnUpper(Clp_Simplex *model, const double *columnUpper)
     358{
     359  model->model_->chgColumnUpper(columnUpper);
    369360}
    370361/* Change objective coefficients */
    371362COINLIBAPI void COINLINKAGE
    372 Clp_chgObjCoefficients(Clp_Simplex * model, const double * objIn)
    373 {
    374      model->model_->chgObjCoefficients(objIn);
     363Clp_chgObjCoefficients(Clp_Simplex *model, const double *objIn)
     364{
     365  model->model_->chgObjCoefficients(objIn);
    375366}
    376367/* Drops names - makes lengthnames 0 and names empty */
    377368COINLIBAPI void COINLINKAGE
    378 Clp_dropNames(Clp_Simplex * model)
    379 {
    380      model->model_->dropNames();
     369Clp_dropNames(Clp_Simplex *model)
     370{
     371  model->model_->dropNames();
    381372}
    382373/* Copies in names */
    383374COINLIBAPI void COINLINKAGE
    384 Clp_copyNames(Clp_Simplex * model, const char * const * rowNamesIn,
    385               const char * const * columnNamesIn)
    386 {
    387      int iRow;
    388      std::vector<std::string> rowNames;
    389      int numberRows = model->model_->numberRows();
    390      rowNames.reserve(numberRows);
    391      for (iRow = 0; iRow < numberRows; iRow++) {
    392           rowNames.push_back(rowNamesIn[iRow]);
    393      }
    394 
    395      int iColumn;
    396      std::vector<std::string> columnNames;
    397      int numberColumns = model->model_->numberColumns();
    398      columnNames.reserve(numberColumns);
    399      for (iColumn = 0; iColumn < numberColumns; iColumn++) {
    400           columnNames.push_back(columnNamesIn[iColumn]);
    401      }
    402      model->model_->copyNames(rowNames, columnNames);
     375Clp_copyNames(Clp_Simplex *model, const char *const *rowNamesIn,
     376  const char *const *columnNamesIn)
     377{
     378  int iRow;
     379  std::vector< std::string > rowNames;
     380  int numberRows = model->model_->numberRows();
     381  rowNames.reserve(numberRows);
     382  for (iRow = 0; iRow < numberRows; iRow++) {
     383    rowNames.push_back(rowNamesIn[iRow]);
     384  }
     385
     386  int iColumn;
     387  std::vector< std::string > columnNames;
     388  int numberColumns = model->model_->numberColumns();
     389  columnNames.reserve(numberColumns);
     390  for (iColumn = 0; iColumn < numberColumns; iColumn++) {
     391    columnNames.push_back(columnNamesIn[iColumn]);
     392  }
     393  model->model_->copyNames(rowNames, columnNames);
    403394}
    404395
    405396/* Number of rows */
    406397COINLIBAPI int COINLINKAGE
    407 Clp_numberRows(Clp_Simplex * model)
    408 {
    409      return model->model_->numberRows();
     398Clp_numberRows(Clp_Simplex *model)
     399{
     400  return model->model_->numberRows();
    410401}
    411402/* Number of columns */
    412403COINLIBAPI int COINLINKAGE
    413 Clp_numberColumns(Clp_Simplex * model)
    414 {
    415      return model->model_->numberColumns();
     404Clp_numberColumns(Clp_Simplex *model)
     405{
     406  return model->model_->numberColumns();
    416407}
    417408/* Primal tolerance to use */
    418409COINLIBAPI double COINLINKAGE
    419 Clp_primalTolerance(Clp_Simplex * model)
    420 {
    421      return model->model_->primalTolerance();
    422 }
    423 COINLIBAPI void COINLINKAGE
    424 Clp_setPrimalTolerance(Clp_Simplex * model, double value)
    425 {
    426      model->model_->setPrimalTolerance(value);
     410Clp_primalTolerance(Clp_Simplex *model)
     411{
     412  return model->model_->primalTolerance();
     413}
     414COINLIBAPI void COINLINKAGE
     415Clp_setPrimalTolerance(Clp_Simplex *model, double value)
     416{
     417  model->model_->setPrimalTolerance(value);
    427418}
    428419/* Dual tolerance to use */
    429420COINLIBAPI double COINLINKAGE
    430 Clp_dualTolerance(Clp_Simplex * model)
    431 {
    432      return model->model_->dualTolerance();
    433 }
    434 COINLIBAPI void COINLINKAGE
    435 Clp_setDualTolerance(Clp_Simplex * model, double value)
    436 {
    437      model->model_->setDualTolerance(value);
     421Clp_dualTolerance(Clp_Simplex *model)
     422{
     423  return model->model_->dualTolerance();
     424}
     425COINLIBAPI void COINLINKAGE
     426Clp_setDualTolerance(Clp_Simplex *model, double value)
     427{
     428  model->model_->setDualTolerance(value);
    438429}
    439430/* Dual objective limit */
    440431COINLIBAPI double COINLINKAGE
    441 Clp_dualObjectiveLimit(Clp_Simplex * model)
    442 {
    443      return model->model_->dualObjectiveLimit();
    444 }
    445 COINLIBAPI void COINLINKAGE
    446 Clp_setDualObjectiveLimit(Clp_Simplex * model, double value)
    447 {
    448      model->model_->setDualObjectiveLimit(value);
     432Clp_dualObjectiveLimit(Clp_Simplex *model)
     433{
     434  return model->model_->dualObjectiveLimit();
     435}
     436COINLIBAPI void COINLINKAGE
     437Clp_setDualObjectiveLimit(Clp_Simplex *model, double value)
     438{
     439  model->model_->setDualObjectiveLimit(value);
    449440}
    450441/* Objective offset */
    451442COINLIBAPI double COINLINKAGE
    452 Clp_objectiveOffset(Clp_Simplex * model)
    453 {
    454      return model->model_->objectiveOffset();
    455 }
    456 COINLIBAPI void COINLINKAGE
    457 Clp_setObjectiveOffset(Clp_Simplex * model, double value)
    458 {
    459      model->model_->setObjectiveOffset(value);
     443Clp_objectiveOffset(Clp_Simplex *model)
     444{
     445  return model->model_->objectiveOffset();
     446}
     447COINLIBAPI void COINLINKAGE
     448Clp_setObjectiveOffset(Clp_Simplex *model, double value)
     449{
     450  model->model_->setObjectiveOffset(value);
    460451}
    461452/* Fills in array with problem name  */
    462453COINLIBAPI void COINLINKAGE
    463 Clp_problemName(Clp_Simplex * model, int maxNumberCharacters, char * array)
    464 {
    465      std::string name = model->model_->problemName();
    466      maxNumberCharacters = CoinMin(maxNumberCharacters,
    467                                    ((int) strlen(name.c_str()))+1) ;
    468      strncpy(array, name.c_str(), maxNumberCharacters - 1);
    469      array[maxNumberCharacters-1] = '\0';
     454Clp_problemName(Clp_Simplex *model, int maxNumberCharacters, char *array)
     455{
     456  std::string name = model->model_->problemName();
     457  maxNumberCharacters = CoinMin(maxNumberCharacters,
     458    ((int)strlen(name.c_str())) + 1);
     459  strncpy(array, name.c_str(), maxNumberCharacters - 1);
     460  array[maxNumberCharacters - 1] = '\0';
    470461}
    471462/* Sets problem name.  Must have \0 at end.  */
    472463COINLIBAPI int COINLINKAGE
    473 Clp_setProblemName(Clp_Simplex * model, int /*maxNumberCharacters*/, char * array)
    474 {
    475      return model->model_->setStrParam(ClpProbName, array);
     464Clp_setProblemName(Clp_Simplex *model, int /*maxNumberCharacters*/, char *array)
     465{
     466  return model->model_->setStrParam(ClpProbName, array);
    476467}
    477468/* Number of iterations */
    478469COINLIBAPI int COINLINKAGE
    479 Clp_numberIterations(Clp_Simplex * model)
    480 {
    481      return model->model_->numberIterations();
    482 }
    483 COINLIBAPI void COINLINKAGE
    484 Clp_setNumberIterations(Clp_Simplex * model, int numberIterations)
    485 {
    486      model->model_->setNumberIterations(numberIterations);
     470Clp_numberIterations(Clp_Simplex *model)
     471{
     472  return model->model_->numberIterations();
     473}
     474COINLIBAPI void COINLINKAGE
     475Clp_setNumberIterations(Clp_Simplex *model, int numberIterations)
     476{
     477  model->model_->setNumberIterations(numberIterations);
    487478}
    488479/* Maximum number of iterations */
    489 COINLIBAPI int maximumIterations(Clp_Simplex * model)
    490 {
    491      return model->model_->maximumIterations();
    492 }
    493 COINLIBAPI void COINLINKAGE
    494 Clp_setMaximumIterations(Clp_Simplex * model, int value)
    495 {
    496      model->model_->setMaximumIterations(value);
     480COINLIBAPI int maximumIterations(Clp_Simplex *model)
     481{
     482  return model->model_->maximumIterations();
     483}
     484COINLIBAPI void COINLINKAGE
     485Clp_setMaximumIterations(Clp_Simplex *model, int value)
     486{
     487  model->model_->setMaximumIterations(value);
    497488}
    498489/* Maximum time in seconds (from when set called) */
    499490COINLIBAPI double COINLINKAGE
    500 Clp_maximumSeconds(Clp_Simplex * model)
    501 {
    502      return model->model_->maximumSeconds();
    503 }
    504 COINLIBAPI void COINLINKAGE
    505 Clp_setMaximumSeconds(Clp_Simplex * model, double value)
    506 {
    507      model->model_->setMaximumSeconds(value);
     491Clp_maximumSeconds(Clp_Simplex *model)
     492{
     493  return model->model_->maximumSeconds();
     494}
     495COINLIBAPI void COINLINKAGE
     496Clp_setMaximumSeconds(Clp_Simplex *model, double value)
     497{
     498  model->model_->setMaximumSeconds(value);
    508499}
    509500/* Returns true if hit maximum iteratio`ns (or time) */
    510501COINLIBAPI int COINLINKAGE
    511 Clp_hitMaximumIterations(Clp_Simplex * model)
    512 {
    513      return model->model_->hitMaximumIterations() ? 1 : 0;
     502Clp_hitMaximumIterations(Clp_Simplex *model)
     503{
     504  return model->model_->hitMaximumIterations() ? 1 : 0;
    514505}
    515506/* Status of problem:
     
    521512*/
    522513COINLIBAPI int COINLINKAGE
    523 Clp_status(Clp_Simplex * model)
    524 {
    525      return model->model_->status();
     514Clp_status(Clp_Simplex *model)
     515{
     516  return model->model_->status();
    526517}
    527518/* Set problem status */
    528519COINLIBAPI void COINLINKAGE
    529 Clp_setProblemStatus(Clp_Simplex * model, int problemStatus)
    530 {
    531      model->model_->setProblemStatus(problemStatus);
     520Clp_setProblemStatus(Clp_Simplex *model, int problemStatus)
     521{
     522  model->model_->setProblemStatus(problemStatus);
    532523}
    533524/* Secondary status of problem - may get extended
     
    539530*/
    540531COINLIBAPI int COINLINKAGE
    541 Clp_secondaryStatus(Clp_Simplex * model)
    542 {
    543      return model->model_->secondaryStatus();
    544 }
    545 COINLIBAPI void COINLINKAGE
    546 Clp_setSecondaryStatus(Clp_Simplex * model, int status)
    547 {
    548      model->model_->setSecondaryStatus(status);
     532Clp_secondaryStatus(Clp_Simplex *model)
     533{
     534  return model->model_->secondaryStatus();
     535}
     536COINLIBAPI void COINLINKAGE
     537Clp_setSecondaryStatus(Clp_Simplex *model, int status)
     538{
     539  model->model_->setSecondaryStatus(status);
    549540}
    550541/* Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    551542COINLIBAPI double COINLINKAGE
    552 Clp_optimizationDirection(Clp_Simplex * model)
    553 {
    554      return model->model_->optimizationDirection();
    555 }
    556 COINLIBAPI void COINLINKAGE
    557 Clp_setOptimizationDirection(Clp_Simplex * model, double value)
    558 {
    559      model->model_->setOptimizationDirection(value);
     543Clp_optimizationDirection(Clp_Simplex *model)
     544{
     545  return model->model_->optimizationDirection();
     546}
     547COINLIBAPI void COINLINKAGE
     548Clp_setOptimizationDirection(Clp_Simplex *model, double value)
     549{
     550  model->model_->setOptimizationDirection(value);
    560551}
    561552/* Primal row solution */
    562 COINLIBAPI double * COINLINKAGE
    563 Clp_primalRowSolution(Clp_Simplex * model)
    564 {
    565      return model->model_->primalRowSolution();
     553COINLIBAPI double *COINLINKAGE
     554Clp_primalRowSolution(Clp_Simplex *model)
     555{
     556  return model->model_->primalRowSolution();
    566557}
    567558/* Primal column solution */
    568 COINLIBAPI double * COINLINKAGE
    569 Clp_primalColumnSolution(Clp_Simplex * model)
    570 {
    571      return model->model_->primalColumnSolution();
     559COINLIBAPI double *COINLINKAGE
     560Clp_primalColumnSolution(Clp_Simplex *model)
     561{
     562  return model->model_->primalColumnSolution();
    572563}
    573564/* Dual row solution */
    574 COINLIBAPI double * COINLINKAGE
    575 Clp_dualRowSolution(Clp_Simplex * model)
    576 {
    577      return model->model_->dualRowSolution();
     565COINLIBAPI double *COINLINKAGE
     566Clp_dualRowSolution(Clp_Simplex *model)
     567{
     568  return model->model_->dualRowSolution();
    578569}
    579570/* Reduced costs */
    580 COINLIBAPI double * COINLINKAGE
    581 Clp_dualColumnSolution(Clp_Simplex * model)
    582 {
    583      return model->model_->dualColumnSolution();
     571COINLIBAPI double *COINLINKAGE
     572Clp_dualColumnSolution(Clp_Simplex *model)
     573{
     574  return model->model_->dualColumnSolution();
    584575}
    585576/* Row lower */
    586 COINLIBAPI double* COINLINKAGE
    587 Clp_rowLower(Clp_Simplex * model)
    588 {
    589      return model->model_->rowLower();
     577COINLIBAPI double *COINLINKAGE
     578Clp_rowLower(Clp_Simplex *model)
     579{
     580  return model->model_->rowLower();
    590581}
    591582/* Row upper  */
    592 COINLIBAPI double* COINLINKAGE
    593 Clp_rowUpper(Clp_Simplex * model)
    594 {
    595      return model->model_->rowUpper();
     583COINLIBAPI double *COINLINKAGE
     584Clp_rowUpper(Clp_Simplex *model)
     585{
     586  return model->model_->rowUpper();
    596587}
    597588/* Objective */
    598 COINLIBAPI double * COINLINKAGE
    599 Clp_objective(Clp_Simplex * model)
    600 {
    601      return model->model_->objective();
     589COINLIBAPI double *COINLINKAGE
     590Clp_objective(Clp_Simplex *model)
     591{
     592  return model->model_->objective();
    602593}
    603594/* Column Lower */
    604 COINLIBAPI double * COINLINKAGE
    605 Clp_columnLower(Clp_Simplex * model)
    606 {
    607      return model->model_->columnLower();
     595COINLIBAPI double *COINLINKAGE
     596Clp_columnLower(Clp_Simplex *model)
     597{
     598  return model->model_->columnLower();
    608599}
    609600/* Column Upper */
    610 COINLIBAPI double * COINLINKAGE
    611 Clp_columnUpper(Clp_Simplex * model)
    612 {
    613      return model->model_->columnUpper();
     601COINLIBAPI double *COINLINKAGE
     602Clp_columnUpper(Clp_Simplex *model)
     603{
     604  return model->model_->columnUpper();
    614605}
    615606/* Number of elements in matrix */
    616607COINLIBAPI CoinBigIndex COINLINKAGE
    617 Clp_getNumElements(Clp_Simplex * model)
    618 {
    619      return model->model_->getNumElements();
     608Clp_getNumElements(Clp_Simplex *model)
     609{
     610  return model->model_->getNumElements();
    620611}
    621612// Column starts in matrix
    622 COINLIBAPI const CoinBigIndex * COINLINKAGE Clp_getVectorStarts(Clp_Simplex * model)
    623 {
    624      CoinPackedMatrix * matrix;
    625      matrix = model->model_->matrix();
    626      return (matrix == NULL) ? NULL : matrix->getVectorStarts();
     613COINLIBAPI const CoinBigIndex *COINLINKAGE Clp_getVectorStarts(Clp_Simplex *model)
     614{
     615  CoinPackedMatrix *matrix;
     616  matrix = model->model_->matrix();
     617  return (matrix == NULL) ? NULL : matrix->getVectorStarts();
    627618}
    628619
    629620// Row indices in matrix
    630 COINLIBAPI const int * COINLINKAGE Clp_getIndices(Clp_Simplex * model)
    631 {
    632      CoinPackedMatrix * matrix = model->model_->matrix();
    633      return (matrix == NULL) ? NULL : matrix->getIndices();
     621COINLIBAPI const int *COINLINKAGE Clp_getIndices(Clp_Simplex *model)
     622{
     623  CoinPackedMatrix *matrix = model->model_->matrix();
     624  return (matrix == NULL) ? NULL : matrix->getIndices();
    634625}
    635626
    636627// Column vector lengths in matrix
    637 COINLIBAPI const int * COINLINKAGE Clp_getVectorLengths(Clp_Simplex * model)
    638 {
    639      CoinPackedMatrix * matrix = model->model_->matrix();
    640      return (matrix == NULL) ? NULL : matrix->getVectorLengths();
     628COINLIBAPI const int *COINLINKAGE Clp_getVectorLengths(Clp_Simplex *model)
     629{
     630  CoinPackedMatrix *matrix = model->model_->matrix();
     631  return (matrix == NULL) ? NULL : matrix->getVectorLengths();
    641632}
    642633
    643634// Element values in matrix
    644 COINLIBAPI const double * COINLINKAGE Clp_getElements(Clp_Simplex * model)
    645 {
    646      CoinPackedMatrix * matrix = model->model_->matrix();
    647      return (matrix == NULL) ? NULL : matrix->getElements();
     635COINLIBAPI const double *COINLINKAGE Clp_getElements(Clp_Simplex *model)
     636{
     637  CoinPackedMatrix *matrix = model->model_->matrix();
     638  return (matrix == NULL) ? NULL : matrix->getElements();
    648639}
    649640/* Objective value */
    650641COINLIBAPI double COINLINKAGE
    651 Clp_objectiveValue(Clp_Simplex * model)
    652 {
    653      return model->model_->objectiveValue();
     642Clp_objectiveValue(Clp_Simplex *model)
     643{
     644  return model->model_->objectiveValue();
    654645}
    655646/* Integer information */
    656 COINLIBAPI char * COINLINKAGE
    657 Clp_integerInformation(Clp_Simplex * model)
    658 {
    659      return model->model_->integerInformation();
     647COINLIBAPI char *COINLINKAGE
     648Clp_integerInformation(Clp_Simplex *model)
     649{
     650  return model->model_->integerInformation();
    660651}
    661652/* Infeasibility/unbounded ray (NULL returned if none/wrong)
    662653   Up to user to use free() on these arrays.  */
    663 COINLIBAPI double * COINLINKAGE
    664 Clp_infeasibilityRay(Clp_Simplex * model)
    665 {
    666      const double * ray = model->model_->internalRay();
    667      double * array = NULL;
    668      int numberRows = model->model_->numberRows();
    669      int status = model->model_->status();
    670      if (status == 1 && ray) {
    671           array = static_cast<double*>(malloc(numberRows*sizeof(double)));
    672           memcpy(array,ray,numberRows*sizeof(double));
     654COINLIBAPI double *COINLINKAGE
     655Clp_infeasibilityRay(Clp_Simplex *model)
     656{
     657  const double *ray = model->model_->internalRay();
     658  double *array = NULL;
     659  int numberRows = model->model_->numberRows();
     660  int status = model->model_->status();
     661  if (status == 1 && ray) {
     662    array = static_cast< double * >(malloc(numberRows * sizeof(double)));
     663    memcpy(array, ray, numberRows * sizeof(double));
    673664#ifdef PRINT_RAY_METHOD
    674           printf("Infeasibility ray obtained by algorithm %s\n",model->model_->algorithm()>0 ?
    675               "primal" : "dual");
     665    printf("Infeasibility ray obtained by algorithm %s\n", model->model_->algorithm() > 0 ? "primal" : "dual");
    676666#endif
    677      }
    678      return array;
    679 }
    680 COINLIBAPI double * COINLINKAGE
    681 Clp_unboundedRay(Clp_Simplex * model)
    682 {
    683      const double * ray = model->model_->internalRay();
    684      double * array = NULL;
    685      int numberColumns = model->model_->numberColumns();
    686      int status = model->model_->status();
    687      if (status == 2 && ray) {
    688           array = static_cast<double*>(malloc(numberColumns*sizeof(double)));
    689           memcpy(array,ray,numberColumns*sizeof(double));
    690      }
    691      return array;
    692 }
    693 COINLIBAPI void COINLINKAGE
    694 Clp_freeRay(Clp_Simplex * model, double * ray)
    695 {
    696      free(ray);
     667  }
     668  return array;
     669}
     670COINLIBAPI double *COINLINKAGE
     671Clp_unboundedRay(Clp_Simplex *model)
     672{
     673  const double *ray = model->model_->internalRay();
     674  double *array = NULL;
     675  int numberColumns = model->model_->numberColumns();
     676  int status = model->model_->status();
     677  if (status == 2 && ray) {
     678    array = static_cast< double * >(malloc(numberColumns * sizeof(double)));
     679    memcpy(array, ray, numberColumns * sizeof(double));
     680  }
     681  return array;
     682}
     683COINLIBAPI void COINLINKAGE
     684Clp_freeRay(Clp_Simplex *model, double *ray)
     685{
     686  free(ray);
    697687}
    698688/* See if status array exists (partly for OsiClp) */
    699689COINLIBAPI int COINLINKAGE
    700 Clp_statusExists(Clp_Simplex * model)
    701 {
    702      return model->model_->statusExists() ? 1 : 0;
     690Clp_statusExists(Clp_Simplex *model)
     691{
     692  return model->model_->statusExists() ? 1 : 0;
    703693}
    704694/* Return address of status array (char[numberRows+numberColumns]) */
    705 COINLIBAPI unsigned char *  COINLINKAGE
    706 Clp_statusArray(Clp_Simplex * model)
    707 {
    708      return model->model_->statusArray();
     695COINLIBAPI unsigned char *COINLINKAGE
     696Clp_statusArray(Clp_Simplex *model)
     697{
     698  return model->model_->statusArray();
    709699}
    710700/* Copy in status vector */
    711701COINLIBAPI void COINLINKAGE
    712 Clp_copyinStatus(Clp_Simplex * model, const unsigned char * statusArray)
    713 {
    714      model->model_->copyinStatus(statusArray);
     702Clp_copyinStatus(Clp_Simplex *model, const unsigned char *statusArray)
     703{
     704  model->model_->copyinStatus(statusArray);
    715705}
    716706
    717707/* User pointer for whatever reason */
    718708COINLIBAPI void COINLINKAGE
    719 Clp_setUserPointer (Clp_Simplex * model, void * pointer)
    720 {
    721      model->model_->setUserPointer(pointer);
    722 }
    723 COINLIBAPI void * COINLINKAGE
    724 Clp_getUserPointer (Clp_Simplex * model)
    725 {
    726      return model->model_->getUserPointer();
     709Clp_setUserPointer(Clp_Simplex *model, void *pointer)
     710{
     711  model->model_->setUserPointer(pointer);
     712}
     713COINLIBAPI void *COINLINKAGE
     714Clp_getUserPointer(Clp_Simplex *model)
     715{
     716  return model->model_->getUserPointer();
    727717}
    728718/* Pass in Callback function */
    729719COINLIBAPI void COINLINKAGE
    730 Clp_registerCallBack(Clp_Simplex * model,
    731                      clp_callback userCallBack)
    732 {
    733      // Will be copy of users one
    734      delete model->handler_;
    735      model->handler_ = new CMessageHandler(*(model->model_->messageHandler()));
    736      model->handler_->setCallBack(userCallBack);
    737      model->handler_->setModel(model);
    738      model->model_->passInMessageHandler(model->handler_);
     720Clp_registerCallBack(Clp_Simplex *model,
     721  clp_callback userCallBack)
     722{
     723  // Will be copy of users one
     724  delete model->handler_;
     725  model->handler_ = new CMessageHandler(*(model->model_->messageHandler()));
     726  model->handler_->setCallBack(userCallBack);
     727  model->handler_->setModel(model);
     728  model->model_->passInMessageHandler(model->handler_);
    739729}
    740730/* Unset Callback function */
    741731COINLIBAPI void COINLINKAGE
    742 Clp_clearCallBack(Clp_Simplex * model)
    743 {
    744      delete model->handler_;
    745      model->handler_ = NULL;
     732Clp_clearCallBack(Clp_Simplex *model)
     733{
     734  delete model->handler_;
     735  model->handler_ = NULL;
    746736}
    747737/* Amount of print out:
     
    754744*/
    755745COINLIBAPI void COINLINKAGE
    756 Clp_setLogLevel(Clp_Simplex * model, int value)
    757 {
    758      model->model_->setLogLevel(value);
    759 }
    760 COINLIBAPI int COINLINKAGE
    761 Clp_logLevel(Clp_Simplex * model)
    762 {
    763      return model->model_->logLevel();
     746Clp_setLogLevel(Clp_Simplex *model, int value)
     747{
     748  model->model_->setLogLevel(value);
     749}
     750COINLIBAPI int COINLINKAGE
     751Clp_logLevel(Clp_Simplex *model)
     752{
     753  return model->model_->logLevel();
    764754}
    765755/* length of names (0 means no names0 */
    766756COINLIBAPI int COINLINKAGE
    767 Clp_lengthNames(Clp_Simplex * model)
    768 {
    769      return model->model_->lengthNames();
     757Clp_lengthNames(Clp_Simplex *model)
     758{
     759  return model->model_->lengthNames();
    770760}
    771761/* Fill in array (at least lengthNames+1 long) with a row name */
    772762COINLIBAPI void COINLINKAGE
    773 Clp_rowName(Clp_Simplex * model, int iRow, char * name)
    774 {
    775      std::string rowName = model->model_->rowName(iRow);
    776      strcpy(name, rowName.c_str());
     763Clp_rowName(Clp_Simplex *model, int iRow, char *name)
     764{
     765  std::string rowName = model->model_->rowName(iRow);
     766  strcpy(name, rowName.c_str());
    777767}
    778768/* Fill in array (at least lengthNames+1 long) with a column name */
    779769COINLIBAPI void COINLINKAGE
    780 Clp_columnName(Clp_Simplex * model, int iColumn, char * name)
    781 {
    782      std::string columnName = model->model_->columnName(iColumn);
    783      strcpy(name, columnName.c_str());
     770Clp_columnName(Clp_Simplex *model, int iColumn, char *name)
     771{
     772  std::string columnName = model->model_->columnName(iColumn);
     773  strcpy(name, columnName.c_str());
    784774}
    785775
     
    788778*/
    789779COINLIBAPI int COINLINKAGE
    790 Clp_initialSolve(Clp_Simplex * model)
    791 {
    792      return model->model_->initialSolve();
     780Clp_initialSolve(Clp_Simplex *model)
     781{
     782  return model->model_->initialSolve();
    793783}
    794784/* Pass solve options. (Exception to direct analogue rule) */
    795785COINLIBAPI int COINLINKAGE
    796 Clp_initialSolveWithOptions(Clp_Simplex * model, Clp_Solve * s)
    797 {
    798      return model->model_->initialSolve(s->options);
     786Clp_initialSolveWithOptions(Clp_Simplex *model, Clp_Solve *s)
     787{
     788  return model->model_->initialSolve(s->options);
    799789}
    800790/* Barrier initial solve */
    801791COINLIBAPI int COINLINKAGE
    802 Clp_initialBarrierSolve(Clp_Simplex * model0)
    803 {
    804      ClpSimplex *model = model0->model_;
    805 
    806      return model->initialBarrierSolve();
    807 
     792Clp_initialBarrierSolve(Clp_Simplex *model0)
     793{
     794  ClpSimplex *model = model0->model_;
     795
     796  return model->initialBarrierSolve();
    808797}
    809798/* Barrier initial solve */
    810799COINLIBAPI int COINLINKAGE
    811 Clp_initialBarrierNoCrossSolve(Clp_Simplex * model0)
    812 {
    813      ClpSimplex *model = model0->model_;
    814 
    815      return model->initialBarrierNoCrossSolve();
    816 
     800Clp_initialBarrierNoCrossSolve(Clp_Simplex *model0)
     801{
     802  ClpSimplex *model = model0->model_;
     803
     804  return model->initialBarrierNoCrossSolve();
    817805}
    818806/* Dual initial solve */
    819807COINLIBAPI int COINLINKAGE
    820 Clp_initialDualSolve(Clp_Simplex * model)
    821 {
    822      return model->model_->initialDualSolve();
     808Clp_initialDualSolve(Clp_Simplex *model)
     809{
     810  return model->model_->initialDualSolve();
    823811}
    824812/* Primal initial solve */
    825813COINLIBAPI int COINLINKAGE
    826 Clp_initialPrimalSolve(Clp_Simplex * model)
    827 {
    828      return model->model_->initialPrimalSolve();
     814Clp_initialPrimalSolve(Clp_Simplex *model)
     815{
     816  return model->model_->initialPrimalSolve();
    829817}
    830818/* Dual algorithm - see ClpSimplexDual.hpp for method */
    831819COINLIBAPI int COINLINKAGE
    832 Clp_dual(Clp_Simplex * model, int ifValuesPass)
    833 {
    834      return model->model_->dual(ifValuesPass);
     820Clp_dual(Clp_Simplex *model, int ifValuesPass)
     821{
     822  return model->model_->dual(ifValuesPass);
    835823}
    836824/* Primal algorithm - see ClpSimplexPrimal.hpp for method */
    837825COINLIBAPI int COINLINKAGE
    838 Clp_primal(Clp_Simplex * model, int ifValuesPass)
    839 {
    840      return model->model_->primal(ifValuesPass);
     826Clp_primal(Clp_Simplex *model, int ifValuesPass)
     827{
     828  return model->model_->primal(ifValuesPass);
    841829}
    842830/* Sets or unsets scaling, 0 -off, 1 equilibrium, 2 geometric, 3, auto, 4 dynamic(later) */
    843831COINLIBAPI void COINLINKAGE
    844 Clp_scaling(Clp_Simplex * model, int mode)
    845 {
    846      model->model_->scaling(mode);
     832Clp_scaling(Clp_Simplex *model, int mode)
     833{
     834  model->model_->scaling(mode);
    847835}
    848836/* Gets scalingFlag */
    849837COINLIBAPI int COINLINKAGE
    850 Clp_scalingFlag(Clp_Simplex * model)
    851 {
    852      return model->model_->scalingFlag();
     838Clp_scalingFlag(Clp_Simplex *model)
     839{
     840  return model->model_->scalingFlag();
    853841}
    854842/* Crash - at present just aimed at dual, returns
     
    867855*/
    868856COINLIBAPI int COINLINKAGE
    869 Clp_crash(Clp_Simplex * model, double gap, int pivot)
    870 {
    871      return model->model_->crash(gap, pivot);
     857Clp_crash(Clp_Simplex *model, double gap, int pivot)
     858{
     859  return model->model_->crash(gap, pivot);
    872860}
    873861/* If problem is primal feasible */
    874862COINLIBAPI int COINLINKAGE
    875 Clp_primalFeasible(Clp_Simplex * model)
    876 {
    877      return model->model_->primalFeasible() ? 1 : 0;
     863Clp_primalFeasible(Clp_Simplex *model)
     864{
     865  return model->model_->primalFeasible() ? 1 : 0;
    878866}
    879867/* If problem is dual feasible */
    880868COINLIBAPI int COINLINKAGE
    881 Clp_dualFeasible(Clp_Simplex * model)
    882 {
    883      return model->model_->dualFeasible() ? 1 : 0;
     869Clp_dualFeasible(Clp_Simplex *model)
     870{
     871  return model->model_->dualFeasible() ? 1 : 0;
    884872}
    885873/* Dual bound */
    886874COINLIBAPI double COINLINKAGE
    887 Clp_dualBound(Clp_Simplex * model)
    888 {
    889      return model->model_->dualBound();
    890 }
    891 COINLIBAPI void COINLINKAGE
    892 Clp_setDualBound(Clp_Simplex * model, double value)
    893 {
    894      model->model_->setDualBound(value);
     875Clp_dualBound(Clp_Simplex *model)
     876{
     877  return model->model_->dualBound();
     878}
     879COINLIBAPI void COINLINKAGE
     880Clp_setDualBound(Clp_Simplex *model, double value)
     881{
     882  model->model_->setDualBound(value);
    895883}
    896884/* Infeasibility cost */
    897885COINLIBAPI double COINLINKAGE
    898 Clp_infeasibilityCost(Clp_Simplex * model)
    899 {
    900      return model->model_->infeasibilityCost();
    901 }
    902 COINLIBAPI void COINLINKAGE
    903 Clp_setInfeasibilityCost(Clp_Simplex * model, double value)
    904 {
    905      model->model_->setInfeasibilityCost(value);
     886Clp_infeasibilityCost(Clp_Simplex *model)
     887{
     888  return model->model_->infeasibilityCost();
     889}
     890COINLIBAPI void COINLINKAGE
     891Clp_setInfeasibilityCost(Clp_Simplex *model, double value)
     892{
     893  model->model_->setInfeasibilityCost(value);
    906894}
    907895/* Perturbation:
     
    914902*/
    915903COINLIBAPI int COINLINKAGE
    916 Clp_perturbation(Clp_Simplex * model)
    917 {
    918      return model->model_->perturbation();
    919 }
    920 COINLIBAPI void COINLINKAGE
    921 Clp_setPerturbation(Clp_Simplex * model, int value)
    922 {
    923      model->model_->setPerturbation(value);
     904Clp_perturbation(Clp_Simplex *model)
     905{
     906  return model->model_->perturbation();
     907}
     908COINLIBAPI void COINLINKAGE
     909Clp_setPerturbation(Clp_Simplex *model, int value)
     910{
     911  model->model_->setPerturbation(value);
    924912}
    925913/* Current (or last) algorithm */
    926914COINLIBAPI int COINLINKAGE
    927 Clp_algorithm(Clp_Simplex * model)
    928 {
    929      return model->model_->algorithm();
     915Clp_algorithm(Clp_Simplex *model)
     916{
     917  return model->model_->algorithm();
    930918}
    931919/* Set algorithm */
    932920COINLIBAPI void COINLINKAGE
    933 Clp_setAlgorithm(Clp_Simplex * model, int value)
    934 {
    935      model->model_->setAlgorithm(value);
     921Clp_setAlgorithm(Clp_Simplex *model, int value)
     922{
     923  model->model_->setAlgorithm(value);
    936924}
    937925/* Sum of dual infeasibilities */
    938926COINLIBAPI double COINLINKAGE
    939 Clp_sumDualInfeasibilities(Clp_Simplex * model)
    940 {
    941      return model->model_->sumDualInfeasibilities();
     927Clp_sumDualInfeasibilities(Clp_Simplex *model)
     928{
     929  return model->model_->sumDualInfeasibilities();
    942930}
    943931/* Number of dual infeasibilities */
    944932COINLIBAPI int COINLINKAGE
    945 Clp_numberDualInfeasibilities(Clp_Simplex * model)
    946 {
    947      return model->model_->numberDualInfeasibilities();
     933Clp_numberDualInfeasibilities(Clp_Simplex *model)
     934{
     935  return model->model_->numberDualInfeasibilities();
    948936}
    949937/* Sum of primal infeasibilities */
    950938COINLIBAPI double COINLINKAGE
    951 Clp_sumPrimalInfeasibilities(Clp_Simplex * model)
    952 {
    953      return model->model_->sumPrimalInfeasibilities();
     939Clp_sumPrimalInfeasibilities(Clp_Simplex *model)
     940{
     941  return model->model_->sumPrimalInfeasibilities();
    954942}
    955943/* Number of primal infeasibilities */
    956944COINLIBAPI int COINLINKAGE
    957 Clp_numberPrimalInfeasibilities(Clp_Simplex * model)
    958 {
    959      return model->model_->numberPrimalInfeasibilities();
     945Clp_numberPrimalInfeasibilities(Clp_Simplex *model)
     946{
     947  return model->model_->numberPrimalInfeasibilities();
    960948}
    961949/* Save model to file, returns 0 if success.  This is designed for
     
    966954*/
    967955COINLIBAPI int COINLINKAGE
    968 Clp_saveModel(Clp_Simplex * model, const char * fileName)
    969 {
    970      return model->model_->saveModel(fileName);
     956Clp_saveModel(Clp_Simplex *model, const char *fileName)
     957{
     958  return model->model_->saveModel(fileName);
    971959}
    972960/* Restore model from file, returns 0 if success,
    973961   deletes current model */
    974962COINLIBAPI int COINLINKAGE
    975 Clp_restoreModel(Clp_Simplex * model, const char * fileName)
    976 {
    977      return model->model_->restoreModel(fileName);
     963Clp_restoreModel(Clp_Simplex *model, const char *fileName)
     964{
     965  return model->model_->restoreModel(fileName);
    978966}
    979967
     
    981969   infeasibilities etc */
    982970COINLIBAPI void COINLINKAGE
    983 Clp_checkSolution(Clp_Simplex * model)
    984 {
    985      model->model_->checkSolution();
     971Clp_checkSolution(Clp_Simplex *model)
     972{
     973  model->model_->checkSolution();
    986974}
    987975/* Number of rows */
    988976COINLIBAPI int COINLINKAGE
    989 Clp_getNumRows(Clp_Simplex * model)
    990 {
    991      return model->model_->getNumRows();
     977Clp_getNumRows(Clp_Simplex *model)
     978{
     979  return model->model_->getNumRows();
    992980}
    993981/* Number of columns */
    994982COINLIBAPI int COINLINKAGE
    995 Clp_getNumCols(Clp_Simplex * model)
    996 {
    997      return model->model_->getNumCols();
     983Clp_getNumCols(Clp_Simplex *model)
     984{
     985  return model->model_->getNumCols();
    998986}
    999987/* Number of iterations */
    1000988COINLIBAPI int COINLINKAGE
    1001 Clp_getIterationCount(Clp_Simplex * model)
    1002 {
    1003      return model->model_->getIterationCount();
     989Clp_getIterationCount(Clp_Simplex *model)
     990{
     991  return model->model_->getIterationCount();
    1004992}
    1005993/* Are there a numerical difficulties? */
    1006994COINLIBAPI int COINLINKAGE
    1007 Clp_isAbandoned(Clp_Simplex * model)
    1008 {
    1009      return model->model_->isAbandoned() ? 1 : 0;
     995Clp_isAbandoned(Clp_Simplex *model)
     996{
     997  return model->model_->isAbandoned() ? 1 : 0;
    1010998}
    1011999/* Is optimality proven? */
    10121000COINLIBAPI int COINLINKAGE
    1013 Clp_isProvenOptimal(Clp_Simplex * model)
    1014 {
    1015      return model->model_->isProvenOptimal() ? 1 : 0;
     1001Clp_isProvenOptimal(Clp_Simplex *model)
     1002{
     1003  return model->model_->isProvenOptimal() ? 1 : 0;
    10161004}
    10171005/* Is primal infeasiblity proven? */
    10181006COINLIBAPI int COINLINKAGE
    1019 Clp_isProvenPrimalInfeasible(Clp_Simplex * model)
    1020 {
    1021      return model->model_->isProvenPrimalInfeasible() ? 1 : 0;
     1007Clp_isProvenPrimalInfeasible(Clp_Simplex *model)
     1008{
     1009  return model->model_->isProvenPrimalInfeasible() ? 1 : 0;
    10221010}
    10231011/* Is dual infeasiblity proven? */
    10241012COINLIBAPI int COINLINKAGE
    1025 Clp_isProvenDualInfeasible(Clp_Simplex * model)
    1026 {
    1027      return model->model_->isProvenDualInfeasible() ? 1 : 0;
     1013Clp_isProvenDualInfeasible(Clp_Simplex *model)
     1014{
     1015  return model->model_->isProvenDualInfeasible() ? 1 : 0;
    10281016}
    10291017/* Is the given primal objective limit reached? */
    10301018COINLIBAPI int COINLINKAGE
    1031 Clp_isPrimalObjectiveLimitReached(Clp_Simplex * model)
    1032 {
    1033      return model->model_->isPrimalObjectiveLimitReached() ? 1 : 0;
     1019Clp_isPrimalObjectiveLimitReached(Clp_Simplex *model)
     1020{
     1021  return model->model_->isPrimalObjectiveLimitReached() ? 1 : 0;
    10341022}
    10351023/* Is the given dual objective limit reached? */
    10361024COINLIBAPI int COINLINKAGE
    1037 Clp_isDualObjectiveLimitReached(Clp_Simplex * model)
    1038 {
    1039      return model->model_->isDualObjectiveLimitReached() ? 1 : 0;
     1025Clp_isDualObjectiveLimitReached(Clp_Simplex *model)
     1026{
     1027  return model->model_->isDualObjectiveLimitReached() ? 1 : 0;
    10401028}
    10411029/* Iteration limit reached? */
    10421030COINLIBAPI int COINLINKAGE
    1043 Clp_isIterationLimitReached(Clp_Simplex * model)
    1044 {
    1045      return model->model_->isIterationLimitReached() ? 1 : 0;
     1031Clp_isIterationLimitReached(Clp_Simplex *model)
     1032{
     1033  return model->model_->isIterationLimitReached() ? 1 : 0;
    10461034}
    10471035/* Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    10481036COINLIBAPI double COINLINKAGE
    1049 Clp_getObjSense(Clp_Simplex * model)
    1050 {
    1051      return model->model_->getObjSense();
     1037Clp_getObjSense(Clp_Simplex *model)
     1038{
     1039  return model->model_->getObjSense();
    10521040}
    10531041/* Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore */
    10541042COINLIBAPI void COINLINKAGE
    1055 Clp_setObjSense(Clp_Simplex * model, double objsen)
    1056 {
    1057      model->model_->setOptimizationDirection(objsen);
     1043Clp_setObjSense(Clp_Simplex *model, double objsen)
     1044{
     1045  model->model_->setOptimizationDirection(objsen);
    10581046}
    10591047/* Primal row solution */
    1060 COINLIBAPI const double * COINLINKAGE
    1061 Clp_getRowActivity(Clp_Simplex * model)
    1062 {
    1063      return model->model_->getRowActivity();
     1048COINLIBAPI const double *COINLINKAGE
     1049Clp_getRowActivity(Clp_Simplex *model)
     1050{
     1051  return model->model_->getRowActivity();
    10641052}
    10651053/* Primal column solution */
    1066 COINLIBAPI const double * COINLINKAGE
    1067 Clp_getColSolution(Clp_Simplex * model)
    1068 {
    1069      return model->model_->getColSolution();
    1070 }
    1071 COINLIBAPI void COINLINKAGE
    1072 Clp_setColSolution(Clp_Simplex * model, const double * input)
    1073 {
    1074      model->model_->setColSolution(input);
     1054COINLIBAPI const double *COINLINKAGE
     1055Clp_getColSolution(Clp_Simplex *model)
     1056{
     1057  return model->model_->getColSolution();
     1058}
     1059COINLIBAPI void COINLINKAGE
     1060Clp_setColSolution(Clp_Simplex *model, const double *input)
     1061{
     1062  model->model_->setColSolution(input);
    10751063}
    10761064/* Dual row solution */
    1077 COINLIBAPI const double * COINLINKAGE
    1078 Clp_getRowPrice(Clp_Simplex * model)
    1079 {
    1080      return model->model_->getRowPrice();
     1065COINLIBAPI const double *COINLINKAGE
     1066Clp_getRowPrice(Clp_Simplex *model)
     1067{
     1068  return model->model_->getRowPrice();
    10811069}
    10821070/* Reduced costs */
    1083 COINLIBAPI const double * COINLINKAGE
    1084 Clp_getReducedCost(Clp_Simplex * model)
    1085 {
    1086      return model->model_->getReducedCost();
     1071COINLIBAPI const double *COINLINKAGE
     1072Clp_getReducedCost(Clp_Simplex *model)
     1073{
     1074  return model->model_->getReducedCost();
    10871075}
    10881076/* Row lower */
    1089 COINLIBAPI const double* COINLINKAGE
    1090 Clp_getRowLower(Clp_Simplex * model)
    1091 {
    1092      return model->model_->getRowLower();
     1077COINLIBAPI const double *COINLINKAGE
     1078Clp_getRowLower(Clp_Simplex *model)
     1079{
     1080  return model->model_->getRowLower();
    10931081}
    10941082/* Row upper  */
    1095 COINLIBAPI const double* COINLINKAGE
    1096 Clp_getRowUpper(Clp_Simplex * model)
    1097 {
    1098      return model->model_->getRowUpper();
     1083COINLIBAPI const double *COINLINKAGE
     1084Clp_getRowUpper(Clp_Simplex *model)
     1085{
     1086  return model->model_->getRowUpper();
    10991087}
    11001088/* Objective */
    1101 COINLIBAPI const double * COINLINKAGE
    1102 Clp_getObjCoefficients(Clp_Simplex * model)
    1103 {
    1104      return model->model_->getObjCoefficients();
     1089COINLIBAPI const double *COINLINKAGE
     1090Clp_getObjCoefficients(Clp_Simplex *model)
     1091{
     1092  return model->model_->getObjCoefficients();
    11051093}
    11061094/* Column Lower */
    1107 COINLIBAPI const double * COINLINKAGE
    1108 Clp_getColLower(Clp_Simplex * model)
    1109 {
    1110      return model->model_->getColLower();
     1095COINLIBAPI const double *COINLINKAGE
     1096Clp_getColLower(Clp_Simplex *model)
     1097{
     1098  return model->model_->getColLower();
    11111099}
    11121100/* Column Upper */
    1113 COINLIBAPI const double * COINLINKAGE
    1114 Clp_getColUpper(Clp_Simplex * model)
    1115 {
    1116      return model->model_->getColUpper();
     1101COINLIBAPI const double *COINLINKAGE
     1102Clp_getColUpper(Clp_Simplex *model)
     1103{
     1104  return model->model_->getColUpper();
    11171105}
    11181106/* Objective value */
    11191107COINLIBAPI double COINLINKAGE
    1120 Clp_getObjValue(Clp_Simplex * model)
    1121 {
    1122      return model->model_->getObjValue();
     1108Clp_getObjValue(Clp_Simplex *model)
     1109{
     1110  return model->model_->getObjValue();
    11231111}
    11241112/* Get variable basis info */
    11251113COINLIBAPI int COINLINKAGE
    1126 Clp_getColumnStatus(Clp_Simplex * model, int sequence)
    1127 {
    1128      return (int) model->model_->getColumnStatus(sequence);
     1114Clp_getColumnStatus(Clp_Simplex *model, int sequence)
     1115{
     1116  return (int)model->model_->getColumnStatus(sequence);
    11291117}
    11301118/* Get row basis info */
    11311119COINLIBAPI int COINLINKAGE
    1132 Clp_getRowStatus(Clp_Simplex * model, int sequence)
    1133 {
    1134      return (int) model->model_->getRowStatus(sequence);
     1120Clp_getRowStatus(Clp_Simplex *model, int sequence)
     1121{
     1122  return (int)model->model_->getRowStatus(sequence);
    11351123}
    11361124/* Set variable basis info */
    11371125COINLIBAPI void COINLINKAGE
    1138 Clp_setColumnStatus(Clp_Simplex * model, int sequence, int value)
    1139 {
    1140      if (value >= 0 && value <= 5) {
    1141           model->model_->setColumnStatus(sequence, (ClpSimplex::Status) value );
    1142           if (value == 3 || value == 5)
    1143                model->model_->primalColumnSolution()[sequence] =
    1144                     model->model_->columnLower()[sequence];
    1145           else if (value == 2)
    1146                model->model_->primalColumnSolution()[sequence] =
    1147                     model->model_->columnUpper()[sequence];
    1148      }
     1126Clp_setColumnStatus(Clp_Simplex *model, int sequence, int value)
     1127{
     1128  if (value >= 0 && value <= 5) {
     1129    model->model_->setColumnStatus(sequence, (ClpSimplex::Status)value);
     1130    if (value == 3 || value == 5)
     1131      model->model_->primalColumnSolution()[sequence] = model->model_->columnLower()[sequence];
     1132    else if (value == 2)
     1133      model->model_->primalColumnSolution()[sequence] = model->model_->columnUpper()[sequence];
     1134  }
    11491135}
    11501136/* Set row basis info */
    11511137COINLIBAPI void COINLINKAGE
    1152 Clp_setRowStatus(Clp_Simplex * model, int sequence, int value)
    1153 {
    1154      if (value >= 0 && value <= 5) {
    1155           model->model_->setRowStatus(sequence, (ClpSimplex::Status) value );
    1156           if (value == 3 || value == 5)
    1157                model->model_->primalRowSolution()[sequence] =
    1158                     model->model_->rowLower()[sequence];
    1159           else if (value == 2)
    1160                model->model_->primalRowSolution()[sequence] =
    1161                     model->model_->rowUpper()[sequence];
    1162      }
     1138Clp_setRowStatus(Clp_Simplex *model, int sequence, int value)
     1139{
     1140  if (value >= 0 && value <= 5) {
     1141    model->model_->setRowStatus(sequence, (ClpSimplex::Status)value);
     1142    if (value == 3 || value == 5)
     1143      model->model_->primalRowSolution()[sequence] = model->model_->rowLower()[sequence];
     1144    else if (value == 2)
     1145      model->model_->primalRowSolution()[sequence] = model->model_->rowUpper()[sequence];
     1146  }
    11631147}
    11641148/* Small element value - elements less than this set to zero,
    11651149   default is 1.0e-20 */
    11661150COINLIBAPI double COINLINKAGE
    1167 Clp_getSmallElementValue(Clp_Simplex * model)
    1168 {
    1169      return model->model_->getSmallElementValue();
    1170 }
    1171 COINLIBAPI void COINLINKAGE
    1172 Clp_setSmallElementValue(Clp_Simplex * model, double value)
    1173 {
    1174      model->model_->setSmallElementValue(value);
     1151Clp_getSmallElementValue(Clp_Simplex *model)
     1152{
     1153  return model->model_->getSmallElementValue();
     1154}
     1155COINLIBAPI void COINLINKAGE
     1156Clp_setSmallElementValue(Clp_Simplex *model, double value)
     1157{
     1158  model->model_->setSmallElementValue(value);
    11751159}
    11761160/* Print model */
    11771161COINLIBAPI void COINLINKAGE
    1178 Clp_printModel(Clp_Simplex * model, const char * prefix)
    1179 {
    1180      ClpSimplex *clp_simplex = model->model_;
    1181      int numrows    = clp_simplex->numberRows();
    1182      int numcols    = clp_simplex->numberColumns();
    1183      CoinBigIndex numelem    = clp_simplex->getNumElements();
    1184      const CoinBigIndex *start = clp_simplex->matrix()->getVectorStarts();
    1185      const int *length = clp_simplex->matrix()->getVectorLengths();
    1186      const int *index    = clp_simplex->matrix()->getIndices();
    1187      const double *value = clp_simplex->matrix()->getElements();
    1188      const double *collb = model->model_->columnLower();
    1189      const double *colub = model->model_->columnUpper();
    1190      const double *obj    = model->model_->objective();
    1191      const double *rowlb = model->model_->rowLower();
    1192      const double *rowub = model->model_->rowUpper();
    1193      printf("%s numcols = %i, numrows = %i, numelem = %i\n",
    1194             prefix, numcols, numrows, numelem);
    1195      printf("%s model = %p, start = %p, index = %p, value = %p\n",
    1196             prefix, reinterpret_cast<const void *>(model), reinterpret_cast<const void *>(start), reinterpret_cast<const void *>(index), reinterpret_cast<const void *>(value));
    1197      clp_simplex->matrix()->dumpMatrix(NULL);
    1198      {
    1199           int i;
    1200           for (i = 0; i <= numcols; i++)
    1201                printf("%s start[%i] = %i\n", prefix, i, start[i]);
    1202           // may be gaps
    1203           for (i = 0; i < numcols; i++) {
    1204             for (CoinBigIndex j=start[i];j<start[i]+length[i];j++)
    1205                printf("%s index[%i] = %i, value[%i] = %g\n",
    1206                       prefix, j, index[j], j, value[j]);
    1207           }
    1208      }
    1209 
    1210      printf("%s collb = %p, colub = %p, obj = %p, rowlb = %p, rowub = %p\n",
    1211             prefix, reinterpret_cast<const void *>(collb), reinterpret_cast<const void *>(colub), reinterpret_cast<const void *>(obj), reinterpret_cast<const void *>(rowlb), reinterpret_cast<const void *>(rowub));
    1212      printf("%s optimization direction = %g\n", prefix, Clp_optimizationDirection(model));
    1213      printf("  (1 - minimize, -1 - maximize, 0 - ignore)\n");
    1214      {
    1215           int i;
    1216           for (i = 0; i < numcols; i++)
    1217                printf("%s collb[%i] = %g, colub[%i] = %g, obj[%i] = %g\n",
    1218                       prefix, i, collb[i], i, colub[i], i, obj[i]);
    1219           for (i = 0; i < numrows; i++)
    1220                printf("%s rowlb[%i] = %g, rowub[%i] = %g\n",
    1221                       prefix, i, rowlb[i], i, rowub[i]);
    1222      }
     1162Clp_printModel(Clp_Simplex *model, const char *prefix)
     1163{
     1164  ClpSimplex *clp_simplex = model->model_;
     1165  int numrows = clp_simplex->numberRows();
     1166  int numcols = clp_simplex->numberColumns();
     1167  CoinBigIndex numelem = clp_simplex->getNumElements();
     1168  const CoinBigIndex *start = clp_simplex->matrix()->getVectorStarts();
     1169  const int *length = clp_simplex->matrix()->getVectorLengths();
     1170  const int *index = clp_simplex->matrix()->getIndices();
     1171  const double *value = clp_simplex->matrix()->getElements();
     1172  const double *collb = model->model_->columnLower();
     1173  const double *colub = model->model_->columnUpper();
     1174  const double *obj = model->model_->objective();
     1175  const double *rowlb = model->model_->rowLower();
     1176  const double *rowub = model->model_->rowUpper();
     1177  printf("%s numcols = %i, numrows = %i, numelem = %i\n",
     1178    prefix, numcols, numrows, numelem);
     1179  printf("%s model = %p, start = %p, index = %p, value = %p\n",
     1180    prefix, reinterpret_cast< const void * >(model), reinterpret_cast< const void * >(start), reinterpret_cast< const void * >(index), reinterpret_cast< const void * >(value));
     1181  clp_simplex->matrix()->dumpMatrix(NULL);
     1182  {
     1183    int i;
     1184    for (i = 0; i <= numcols; i++)
     1185      printf("%s start[%i] = %i\n", prefix, i, start[i]);
     1186    // may be gaps
     1187    for (i = 0; i < numcols; i++) {
     1188      for (CoinBigIndex j = start[i]; j < start[i] + length[i]; j++)
     1189        printf("%s index[%i] = %i, value[%i] = %g\n",
     1190          prefix, j, index[j], j, value[j]);
     1191    }
     1192  }
     1193
     1194  printf("%s collb = %p, colub = %p, obj = %p, rowlb = %p, rowub = %p\n",
     1195    prefix, reinterpret_cast< const void * >(collb), reinterpret_cast< const void * >(colub), reinterpret_cast< const void * >(obj), reinterpret_cast< const void * >(rowlb), reinterpret_cast< const void * >(rowub));
     1196  printf("%s optimization direction = %g\n", prefix, Clp_optimizationDirection(model));
     1197  printf("  (1 - minimize, -1 - maximize, 0 - ignore)\n");
     1198  {
     1199    int i;
     1200    for (i = 0; i < numcols; i++)
     1201      printf("%s collb[%i] = %g, colub[%i] = %g, obj[%i] = %g\n",
     1202        prefix, i, collb[i], i, colub[i], i, obj[i]);
     1203    for (i = 0; i < numrows; i++)
     1204      printf("%s rowlb[%i] = %g, rowub[%i] = %g\n",
     1205        prefix, i, rowlb[i], i, rowub[i]);
     1206  }
    12231207}
    12241208
     
    12371221*/
    12381222COINLIBAPI void COINLINKAGE
    1239 Clp_idiot(Clp_Simplex * model, int tryhard)
    1240 {
    1241      ClpSimplex *clp = model->model_;
    1242      Idiot info(*clp);
    1243      int numberpass = tryhard >> 3;
    1244      int lightweight = tryhard & 7;
    1245      info.setLightweight(lightweight);
    1246      info.crash(numberpass, clp->messageHandler(), clp->messagesPointer(), false);
     1223Clp_idiot(Clp_Simplex *model, int tryhard)
     1224{
     1225  ClpSimplex *clp = model->model_;
     1226  Idiot info(*clp);
     1227  int numberpass = tryhard >> 3;
     1228  int lightweight = tryhard & 7;
     1229  info.setLightweight(lightweight);
     1230  info.crash(numberpass, clp->messageHandler(), clp->messagesPointer(), false);
    12471231}
    12481232#endif
    12491233
    1250 COINLIBAPI Clp_Solve * COINLINKAGE
    1251 ClpSolve_new() 
    1252 { 
    1253     return new Clp_Solve();
    1254 }
    1255 
    1256 COINLIBAPI void COINLINKAGE 
    1257 ClpSolve_delete(Clp_Solve * solve)
    1258 { 
    1259     delete solve;
     1234COINLIBAPI Clp_Solve *COINLINKAGE
     1235ClpSolve_new()
     1236{
     1237  return new Clp_Solve();
     1238}
     1239
     1240COINLIBAPI void COINLINKAGE
     1241ClpSolve_delete(Clp_Solve *solve)
     1242{
     1243  delete solve;
    12601244}
    12611245
    12621246// space- and error-saving macros
    12631247#define ClpSolveGetIntProperty(prop) \
    1264 COINLIBAPI int COINLINKAGE \
    1265 ClpSolve_ ## prop (Clp_Solve *s) \
    1266 { \
    1267     return s->options.prop(); \
    1268 }
    1269 
    1270 #define ClpSolveSetIntProperty(prop) \
    1271 COINLIBAPI void COINLINKAGE \
    1272 ClpSolve_ ## prop (Clp_Solve *s, int val) \
    1273 { \
    1274     s->options.prop(val); \
    1275 }
    1276 
    1277 COINLIBAPI void COINLINKAGE 
    1278 ClpSolve_setSpecialOption(Clp_Solve * s, int which, int value, int extraInfo)
    1279 {
    1280     s->options.setSpecialOption(which,value,extraInfo);
    1281 }
    1282 
    1283 COINLIBAPI int COINLINKAGE 
    1284 ClpSolve_getSpecialOption(Clp_Solve * s, int which)
    1285 {
    1286     return s->options.getSpecialOption(which);
    1287 }
    1288 
    1289 COINLIBAPI void COINLINKAGE 
    1290 ClpSolve_setSolveType(Clp_Solve * s, int method, int extraInfo)
    1291 {
    1292     s->options.setSolveType(static_cast<ClpSolve::SolveType>(method), extraInfo);
     1248  COINLIBAPI int COINLINKAGE        \
     1249    ClpSolve_##prop(Clp_Solve *s)    \
     1250  {                                  \
     1251    return s->options.prop();        \
     1252  }
     1253
     1254#define ClpSolveSetIntProperty(prop)       \
     1255  COINLIBAPI void COINLINKAGE              \
     1256    ClpSolve_##prop(Clp_Solve *s, int val) \
     1257  {                                        \
     1258    s->options.prop(val);                  \
     1259  }
     1260
     1261COINLIBAPI void COINLINKAGE
     1262ClpSolve_setSpecialOption(Clp_Solve *s, int which, int value, int extraInfo)
     1263{
     1264  s->options.setSpecialOption(which, value, extraInfo);
     1265}
     1266
     1267COINLIBAPI int COINLINKAGE
     1268ClpSolve_getSpecialOption(Clp_Solve *s, int which)
     1269{
     1270  return s->options.getSpecialOption(which);
     1271}
     1272
     1273COINLIBAPI void COINLINKAGE
     1274ClpSolve_setSolveType(Clp_Solve *s, int method, int extraInfo)
     1275{
     1276  s->options.setSolveType(static_cast< ClpSolve::SolveType >(method), extraInfo);
    12931277}
    12941278
    12951279ClpSolveGetIntProperty(getSolveType)
    12961280
    1297 COINLIBAPI void COINLINKAGE ClpSolve_setPresolveType(Clp_Solve * s, int amount, int extraInfo)
    1298 {
    1299     s->options.setPresolveType(static_cast<ClpSolve::PresolveType>(amount),extraInfo);
     1281  COINLIBAPI void COINLINKAGE ClpSolve_setPresolveType(Clp_Solve *s, int amount, int extraInfo)
     1282{
     1283  s->options.setPresolveType(static_cast< ClpSolve::PresolveType >(amount), extraInfo);
    13001284}
    13011285
    13021286ClpSolveGetIntProperty(getPresolveType)
    13031287
    1304 ClpSolveGetIntProperty(getPresolvePasses)
    1305 
    1306 
    1307 COINLIBAPI int COINLINKAGE
    1308 ClpSolve_getExtraInfo(Clp_Solve * s, int which) {
    1309      return s->options.getExtraInfo(which);
     1288  ClpSolveGetIntProperty(getPresolvePasses)
     1289
     1290    COINLIBAPI int COINLINKAGE
     1291  ClpSolve_getExtraInfo(Clp_Solve *s, int which)
     1292{
     1293  return s->options.getExtraInfo(which);
    13101294}
    13111295
    13121296ClpSolveSetIntProperty(setInfeasibleReturn)
    1313 ClpSolveGetIntProperty(infeasibleReturn)
    1314 
    1315 ClpSolveGetIntProperty(doDual)
    1316 ClpSolveSetIntProperty(setDoDual)
    1317 
    1318 ClpSolveGetIntProperty(doSingleton)
    1319 ClpSolveSetIntProperty(setDoSingleton)
    1320 
    1321 ClpSolveGetIntProperty(doDoubleton)
    1322 ClpSolveSetIntProperty(setDoDoubleton)
    1323 
    1324 ClpSolveGetIntProperty(doTripleton)
    1325 ClpSolveSetIntProperty(setDoTripleton)
    1326 
    1327 ClpSolveGetIntProperty(doTighten)
    1328 ClpSolveSetIntProperty(setDoTighten)
    1329 
    1330 ClpSolveGetIntProperty(doForcing)
    1331 ClpSolveSetIntProperty(setDoForcing)
    1332 
    1333 ClpSolveGetIntProperty(doImpliedFree)
    1334 ClpSolveSetIntProperty(setDoImpliedFree)
    1335 
    1336 ClpSolveGetIntProperty(doDupcol)
    1337 ClpSolveSetIntProperty(setDoDupcol)
    1338 
    1339 ClpSolveGetIntProperty(doDuprow)
    1340 ClpSolveSetIntProperty(setDoDuprow)
    1341 
    1342 ClpSolveGetIntProperty(doSingletonColumn)
    1343 ClpSolveSetIntProperty(setDoSingletonColumn)
    1344 
    1345 ClpSolveGetIntProperty(presolveActions)
    1346 ClpSolveSetIntProperty(setPresolveActions)
    1347 
    1348 ClpSolveGetIntProperty(substitution)
    1349 ClpSolveSetIntProperty(setSubstitution)
     1297  ClpSolveGetIntProperty(infeasibleReturn)
     1298
     1299    ClpSolveGetIntProperty(doDual)
     1300      ClpSolveSetIntProperty(setDoDual)
     1301
     1302        ClpSolveGetIntProperty(doSingleton)
     1303          ClpSolveSetIntProperty(setDoSingleton)
     1304
     1305            ClpSolveGetIntProperty(doDoubleton)
     1306              ClpSolveSetIntProperty(setDoDoubleton)
     1307
     1308                ClpSolveGetIntProperty(doTripleton)
     1309                  ClpSolveSetIntProperty(setDoTripleton)
     1310
     1311                    ClpSolveGetIntProperty(doTighten)
     1312                      ClpSolveSetIntProperty(setDoTighten)
     1313
     1314                        ClpSolveGetIntProperty(doForcing)
     1315                          ClpSolveSetIntProperty(setDoForcing)
     1316
     1317                            ClpSolveGetIntProperty(doImpliedFree)
     1318                              ClpSolveSetIntProperty(setDoImpliedFree)
     1319
     1320                                ClpSolveGetIntProperty(doDupcol)
     1321                                  ClpSolveSetIntProperty(setDoDupcol)
     1322
     1323                                    ClpSolveGetIntProperty(doDuprow)
     1324                                      ClpSolveSetIntProperty(setDoDuprow)
     1325
     1326                                        ClpSolveGetIntProperty(doSingletonColumn)
     1327                                          ClpSolveSetIntProperty(setDoSingletonColumn)
     1328
     1329                                            ClpSolveGetIntProperty(presolveActions)
     1330                                              ClpSolveSetIntProperty(setPresolveActions)
     1331
     1332                                                ClpSolveGetIntProperty(substitution)
     1333                                                  ClpSolveSetIntProperty(setSubstitution)
    13501334
    13511335#if defined(__MWERKS__)
     
    13531337#endif
    13541338
     1339  /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     1340*/
Note: See TracChangeset for help on using the changeset viewer.