Ignore:
Timestamp:
Jan 6, 2019 6:03:50 PM (2 years ago)
Author:
unxusr
Message:

formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/OsiClp/OsiClpSolverInterface.hpp

    r2332 r2386  
    33// Corporation and others.  All Rights Reserved.
    44// This code is licensed under the terms of the Eclipse Public License (EPL).
    5 
    65
    76#ifndef OsiClpSolverInterface_H
     
    3635*/
    3736
    38 class OsiClpSolverInterface :
    39   virtual public OsiSolverInterface {
    40   friend void OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
    41  
     37class OsiClpSolverInterface : virtual public OsiSolverInterface {
     38  friend void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
     39
    4240public:
    4341  //---------------------------------------------------------------------------
    4442  /**@name Solve methods */
    4543  //@{
    46   /// Solve initial LP relaxation 
     44  /// Solve initial LP relaxation
    4745  virtual void initialSolve();
    48  
     46
    4947  /// Resolve an LP relaxation after problem modification
    5048  virtual void resolve();
    51  
     49
    5250  /// Resolve an LP relaxation after problem modification (try GUB)
    5351  virtual void resolveGub(int needed);
    54  
     52
    5553  /// Invoke solver's built-in enumeration algorithm
    5654  virtual void branchAndBound();
     
    6361                1 try and put some in basis
    6462  */
    65   void crossover(int options,int basis);
    66   //@}
    67  
     63  void crossover(int options, int basis);
     64  //@}
     65
    6866  /*! @name OsiSimplexInterface methods
    6967      \brief Methods for the Osi Simplex API.
     
    9593  /*! \brief Undo any setting changes made by #enableFactorization */
    9694  virtual void disableFactorization() const;
    97  
     95
    9896  /** Returns true if a basis is available
    9997      AND problem is optimal.  This should be used to see if
     
    10199  */
    102100  virtual bool basisIsAvailable() const;
    103  
     101
    104102  /** The following two methods may be replaced by the
    105103      methods of OsiSolverInterface using OsiWarmStartBasis if:
     
    117115      in terms of row activities
    118116  */
    119   virtual void getBasisStatus(int* cstat, int* rstat) const;
    120  
     117  virtual void getBasisStatus(int *cstat, int *rstat) const;
     118
    121119  /** Set the status of structural/artificial variables and
    122120      factorize, update solution etc
     
    129127      Returns 0 if OK, 1 if problem is bad e.g. duplicate elements, too large ...
    130128  */
    131   virtual int setBasisStatus(const int* cstat, const int* rstat);
    132  
    133   ///Get the reduced gradient for the cost vector c 
    134   virtual void getReducedGradient(double* columnReducedCosts,
    135                                   double * duals,
    136                                   const double * c) const ;
    137  
     129  virtual int setBasisStatus(const int *cstat, const int *rstat);
     130
     131  ///Get the reduced gradient for the cost vector c
     132  virtual void getReducedGradient(double *columnReducedCosts,
     133    double *duals,
     134    const double *c) const;
     135
    138136  ///Get a row of the tableau (slack part in slack if not NULL)
    139   virtual void getBInvARow(int row, double* z, double * slack=NULL) const;
    140  
     137  virtual void getBInvARow(int row, double *z, double *slack = NULL) const;
     138
    141139  /** Get a row of the tableau (slack part in slack if not NULL)
    142140      If keepScaled is true then scale factors not applied after so
    143141      user has to use coding similar to what is in this method
    144142  */
    145   virtual void getBInvARow(int row, CoinIndexedVector * z, CoinIndexedVector * slack=NULL,
    146                            bool keepScaled=false) const;
    147  
     143  virtual void getBInvARow(int row, CoinIndexedVector *z, CoinIndexedVector *slack = NULL,
     144    bool keepScaled = false) const;
     145
    148146  ///Get a row of the basis inverse
    149   virtual void getBInvRow(int row, double* z) const;
    150  
     147  virtual void getBInvRow(int row, double *z) const;
     148
    151149  ///Get a column of the tableau
    152   virtual void getBInvACol(int col, double* vec) const ;
    153  
     150  virtual void getBInvACol(int col, double *vec) const;
     151
    154152  ///Get a column of the tableau
    155   virtual void getBInvACol(int col, CoinIndexedVector * vec) const ;
    156  
     153  virtual void getBInvACol(int col, CoinIndexedVector *vec) const;
     154
    157155  /** Update (i.e. ftran) the vector passed in.
    158156      Unscaling is applied after - can't be applied before
    159157  */
    160  
    161   virtual void getBInvACol(CoinIndexedVector * vec) const ;
    162  
     158
     159  virtual void getBInvACol(CoinIndexedVector *vec) const;
     160
    163161  ///Get a column of the basis inverse
    164   virtual void getBInvCol(int col, double* vec) const ;
    165  
     162  virtual void getBInvCol(int col, double *vec) const;
     163
    166164  /** Get basic indices (order of indices corresponds to the
    167165      order of elements in a vector retured by getBInvACol() and
    168166      getBInvCol()).
    169167  */
    170   virtual void getBasics(int* index) const;
     168  virtual void getBasics(int *index) const;
    171169
    172170  /*! \brief Enables simplex mode 2 (individual pivot control)
     
    178176  virtual void enableSimplexInterface(bool doingPrimal);
    179177  /// Copy across enabled stuff from one solver to another
    180   void copyEnabledSuff(OsiClpSolverInterface & rhs);
    181  
     178  void copyEnabledSuff(OsiClpSolverInterface &rhs);
     179
    182180  /*! \brief Undo setting changes made by #enableSimplexInterface */
    183181  virtual void disableSimplexInterface();
    184182  /// Copy across enabled stuff from one solver to another
    185   void copyEnabledStuff(ClpSimplex & rhs);
     183  void copyEnabledStuff(ClpSimplex &rhs);
    186184
    187185  /** Perform a pivot by substituting a colIn for colOut in the basis.
     
    193191  */
    194192  virtual int pivot(int colIn, int colOut, int outStatus);
    195  
     193
    196194  /** Obtain a result of the primal pivot
    197195      Outputs: colOut -- leaving column, outStatus -- its status,
     
    205203      Primal and dual solutions are updated
    206204  */
    207   virtual int primalPivotResult(int colIn, int sign, 
    208                                 int& colOut, int& outStatus,
    209                                 double& t, CoinPackedVector* dx);
    210  
     205  virtual int primalPivotResult(int colIn, int sign,
     206    int &colOut, int &outStatus,
     207    double &t, CoinPackedVector *dx);
     208
    211209  /** Obtain a result of the dual pivot (similar to the previous method)
    212210      Differences: entering variable and a sign of its change are now
     
    215213      Return code: same
    216214  */
    217   virtual int dualPivotResult(int& colIn, int& sign,
    218                               int colOut, int outStatus,
    219                               double& t, CoinPackedVector* dx);
    220  
    221  
     215  virtual int dualPivotResult(int &colIn, int &sign,
     216    int colOut, int outStatus,
     217    double &t, CoinPackedVector *dx);
     218
    222219  //@}
    223220  //---------------------------------------------------------------------------
     
    242239  bool setDblParam(OsiDblParam key, double value);
    243240  // Set a string parameter
    244   bool setStrParam(OsiStrParam key, const std::string & value);
     241  bool setStrParam(OsiStrParam key, const std::string &value);
    245242  // Get an integer parameter
    246   bool getIntParam(OsiIntParam key, int& value) const;
     243  bool getIntParam(OsiIntParam key, int &value) const;
    247244  // Get an double parameter
    248   bool getDblParam(OsiDblParam key, double& value) const;
     245  bool getDblParam(OsiDblParam key, double &value) const;
    249246  // Get a string parameter
    250   bool getStrParam(OsiStrParam key, std::string& value) const;
     247  bool getStrParam(OsiStrParam key, std::string &value) const;
    251248  // Set a hint parameter - overrides OsiSolverInterface
    252   virtual bool setHintParam(OsiHintParam key, bool yesNo=true,
    253                             OsiHintStrength strength=OsiHintTry,
    254                             void * otherInformation=NULL);
    255   //@}
    256  
     249  virtual bool setHintParam(OsiHintParam key, bool yesNo = true,
     250    OsiHintStrength strength = OsiHintTry,
     251    void *otherInformation = NULL);
     252  //@}
     253
    257254  //---------------------------------------------------------------------------
    258255  ///@name Methods returning info on how the solution process terminated
     
    273270  virtual bool isIterationLimitReached() const;
    274271  //@}
    275  
     272
    276273  //---------------------------------------------------------------------------
    277274  /**@name WarmStart related methods */
    278275  //@{
    279  
     276
    280277  /*! \brief Get an empty warm start object
    281278   
     
    284281  appropriate type, which can resized and modified as desired.
    285282  */
    286  
    287   virtual CoinWarmStart *getEmptyWarmStart () const;
    288  
     283
     284  virtual CoinWarmStart *getEmptyWarmStart() const;
     285
    289286  /// Get warmstarting information
    290   virtual CoinWarmStart* getWarmStart() const;
     287  virtual CoinWarmStart *getWarmStart() const;
    291288  /// Get warmstarting information
    292   inline CoinWarmStartBasis* getPointerToWarmStart()
    293   { return &basis_;}
     289  inline CoinWarmStartBasis *getPointerToWarmStart()
     290  {
     291    return &basis_;
     292  }
    294293  /// Get warmstarting information
    295   inline const CoinWarmStartBasis* getConstPointerToWarmStart() const
    296   { return &basis_;}
     294  inline const CoinWarmStartBasis *getConstPointerToWarmStart() const
     295  {
     296    return &basis_;
     297  }
    297298  /** Set warmstarting information. Return true/false depending on whether
    298299      the warmstart information was accepted or not. */
    299   virtual bool setWarmStart(const CoinWarmStart* warmstart);
     300  virtual bool setWarmStart(const CoinWarmStart *warmstart);
    300301  /** \brief Get warm start information.
    301302     
     
    307308      OsiClp version always returns pointer and false.
    308309  */
    309   virtual CoinWarmStart* getPointerToWarmStart(bool & mustDelete) ;
     310  virtual CoinWarmStart *getPointerToWarmStart(bool &mustDelete);
    310311
    311312  /// Set column status in ClpSimplex and warmStart
     
    313314
    314315  //@}
    315  
     316
    316317  //---------------------------------------------------------------------------
    317318  /**@name Hotstart related methods (primarily used in strong branching).
     
    339340  void stopFastDual();
    340341  /// Sets integer tolerance and increment
    341   void setStuff(double tolerance,double increment);
     342  void setStuff(double tolerance, double increment);
    342343  /// Return a conflict analysis cut from small model
    343   OsiRowCut * smallModelCut(const double * originalLower, const double * originalUpper,
    344                             int numberRowsAtContinuous,const int * whichGenerator,
    345                             int typeCut=0);
     344  OsiRowCut *smallModelCut(const double *originalLower, const double *originalUpper,
     345    int numberRowsAtContinuous, const int *whichGenerator,
     346    int typeCut = 0);
    346347  /** Return a conflict analysis cut from model
    347348      If type is 0 then genuine cut, if 1 then only partially processed
    348349   */
    349   OsiRowCut * modelCut(const double * originalLower, const double * originalUpper,
    350                        int numberRowsAtContinuous,const int * whichGenerator,
    351                        int typeCut=0);
    352   //@}
    353  
     350  OsiRowCut *modelCut(const double *originalLower, const double *originalUpper,
     351    int numberRowsAtContinuous, const int *whichGenerator,
     352    int typeCut = 0);
     353  //@}
     354
    354355  //---------------------------------------------------------------------------
    355356  /**@name Problem information methods
     
    368369  //@{
    369370  /// Get number of columns
    370   virtual int getNumCols() const {
    371     return modelPtr_->numberColumns(); }
    372  
     371  virtual int getNumCols() const
     372  {
     373    return modelPtr_->numberColumns();
     374  }
     375
    373376  /// Get number of rows
    374   virtual int getNumRows() const {
    375     return modelPtr_->numberRows(); }
    376  
     377  virtual int getNumRows() const
     378  {
     379    return modelPtr_->numberRows();
     380  }
     381
    377382  /// Get number of nonzero elements
    378   virtual CoinBigIndex getNumElements() const {
     383  virtual CoinBigIndex getNumElements() const
     384  {
    379385    CoinBigIndex retVal = 0;
    380     const CoinPackedMatrix * matrix =modelPtr_->matrix();
    381     if ( matrix != NULL ) retVal=matrix->getNumElements();
    382     return retVal; }
    383 
    384     /// Return name of row if one exists or Rnnnnnnn
    385     /// maxLen is currently ignored and only there to match the signature from the base class!
    386     virtual std::string getRowName(int rowIndex,
    387                                    unsigned maxLen = static_cast<unsigned>(std::string::npos)) const;
    388    
    389     /// Return name of column if one exists or Cnnnnnnn
    390     /// maxLen is currently ignored and only there to match the signature from the base class!
    391     virtual std::string getColName(int colIndex,
    392                                    unsigned maxLen = static_cast<unsigned>(std::string::npos)) const;
    393    
    394  
     386    const CoinPackedMatrix *matrix = modelPtr_->matrix();
     387    if (matrix != NULL)
     388      retVal = matrix->getNumElements();
     389    return retVal;
     390  }
     391
     392  /// Return name of row if one exists or Rnnnnnnn
     393  /// maxLen is currently ignored and only there to match the signature from the base class!
     394  virtual std::string getRowName(int rowIndex,
     395    unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
     396
     397  /// Return name of column if one exists or Cnnnnnnn
     398  /// maxLen is currently ignored and only there to match the signature from the base class!
     399  virtual std::string getColName(int colIndex,
     400    unsigned maxLen = static_cast< unsigned >(std::string::npos)) const;
     401
    395402  /// Get pointer to array[getNumCols()] of column lower bounds
    396   virtual const double * getColLower() const { return modelPtr_->columnLower(); }
    397  
     403  virtual const double *getColLower() const { return modelPtr_->columnLower(); }
     404
    398405  /// Get pointer to array[getNumCols()] of column upper bounds
    399   virtual const double * getColUpper() const { return modelPtr_->columnUpper(); }
    400  
     406  virtual const double *getColUpper() const { return modelPtr_->columnUpper(); }
     407
    401408  /** Get pointer to array[getNumRows()] of row constraint senses.
    402409      <ul>
     
    408415      </ul>
    409416  */
    410   virtual const char * getRowSense() const;
    411  
     417  virtual const char *getRowSense() const;
     418
    412419  /** Get pointer to array[getNumRows()] of rows right-hand sides
    413420      <ul>
     
    418425      </ul>
    419426  */
    420   virtual const double * getRightHandSide() const ;
    421  
     427  virtual const double *getRightHandSide() const;
     428
    422429  /** Get pointer to array[getNumRows()] of row ranges.
    423430      <ul>
     
    428435      </ul>
    429436  */
    430   virtual const double * getRowRange() const ;
    431  
     437  virtual const double *getRowRange() const;
     438
    432439  /// Get pointer to array[getNumRows()] of row lower bounds
    433   virtual const double * getRowLower() const { return modelPtr_->rowLower(); }
    434  
     440  virtual const double *getRowLower() const { return modelPtr_->rowLower(); }
     441
    435442  /// Get pointer to array[getNumRows()] of row upper bounds
    436   virtual const double * getRowUpper() const { return modelPtr_->rowUpper(); }
    437  
     443  virtual const double *getRowUpper() const { return modelPtr_->rowUpper(); }
     444
    438445  /// Get pointer to array[getNumCols()] of objective function coefficients
    439   virtual const double * getObjCoefficients() const
    440   { if (fakeMinInSimplex_)
    441       return linearObjective_ ;
     446  virtual const double *getObjCoefficients() const
     447  {
     448    if (fakeMinInSimplex_)
     449      return linearObjective_;
    442450    else
    443       return modelPtr_->objective(); }
    444  
     451      return modelPtr_->objective();
     452  }
     453
    445454  /// Get objective function sense (1 for min (default), -1 for max)
    446   virtual double getObjSense() const
    447   { return ((fakeMinInSimplex_)?-modelPtr_->optimizationDirection():
    448                                  modelPtr_->optimizationDirection()); }
    449  
     455  virtual double getObjSense() const
     456  {
     457    return ((fakeMinInSimplex_) ? -modelPtr_->optimizationDirection() : modelPtr_->optimizationDirection());
     458  }
     459
    450460  /// Return true if column is continuous
    451461  virtual bool isContinuous(int colNumber) const;
    452462  /// Return true if variable is binary
    453463  virtual bool isBinary(int colIndex) const;
    454  
     464
    455465  /** Return true if column is integer.
    456466      Note: This function returns true if the the column
     
    458468  */
    459469  virtual bool isInteger(int colIndex) const;
    460  
     470
    461471  /// Return true if variable is general integer
    462472  virtual bool isIntegerNonBinary(int colIndex) const;
    463  
     473
    464474  /// Return true if variable is binary and not fixed at either bound
    465   virtual bool isFreeBinary(int colIndex) const; 
     475  virtual bool isFreeBinary(int colIndex) const;
    466476  /**  Return array of column length
    467477       0 - continuous
     
    469479       2 - general integer (may get fixed later)
    470480  */
    471   virtual const char * getColType(bool refresh=false) const;
    472  
     481  virtual const char *getColType(bool refresh = false) const;
     482
    473483  /** Return true if column is integer but does not have to
    474484      be declared as such.
     
    481491  /// Return true only if integer and not optional
    482492  inline bool isHeuristicInteger(int colIndex) const
    483   { return ( integerInformation_&& integerInformation_[colIndex]==1 );}
     493  {
     494    return (integerInformation_ && integerInformation_[colIndex] == 1);
     495  }
    484496  /// Return integer type (0,1,2=optional,3=sc,4=scint)
    485497  inline int integerType(int colIndex) const
    486   { return integerInformation_ ? integerInformation_[colIndex] : 0;}
     498  {
     499    return integerInformation_ ? integerInformation_[colIndex] : 0;
     500  }
    487501  /// Set integer type (0,1,2=optional,3=sc,4=scint)
    488   inline void setIntegerType(int colIndex,int value)
    489   { integerInformation_[colIndex] = static_cast<char>(value);}
     502  inline void setIntegerType(int colIndex, int value)
     503  {
     504    integerInformation_[colIndex] = static_cast< char >(value);
     505  }
    490506  /// Get pointer to row-wise copy of matrix
    491   virtual const CoinPackedMatrix * getMatrixByRow() const;
    492  
     507  virtual const CoinPackedMatrix *getMatrixByRow() const;
     508
    493509  /// Get pointer to column-wise copy of matrix
    494   virtual const CoinPackedMatrix * getMatrixByCol() const;
    495  
     510  virtual const CoinPackedMatrix *getMatrixByCol() const;
     511
    496512  /// Get pointer to mutable column-wise copy of matrix
    497   virtual CoinPackedMatrix * getMutableMatrixByCol() const;
    498  
    499     /// Get solver's value for infinity
     513  virtual CoinPackedMatrix *getMutableMatrixByCol() const;
     514
     515  /// Get solver's value for infinity
    500516  virtual double getInfinity() const { return OsiClpInfinity; }
    501517  //@}
    502  
     518
    503519  /**@name Methods related to querying the solution */
    504520  //@{
    505521  /// Get pointer to array[getNumCols()] of primal solution vector
    506   virtual const double * getColSolution() const;
    507  
     522  virtual const double *getColSolution() const;
     523
    508524  /// Get pointer to array[getNumRows()] of dual prices
    509   virtual const double * getRowPrice() const;
    510  
     525  virtual const double *getRowPrice() const;
     526
    511527  /// Get a pointer to array[getNumCols()] of reduced costs
    512   virtual const double * getReducedCost() const;
    513  
     528  virtual const double *getReducedCost() const;
     529
    514530  /** Get pointer to array[getNumRows()] of row activity levels (constraint
    515531      matrix times the solution vector */
    516   virtual const double * getRowActivity() const;
    517  
     532  virtual const double *getRowActivity() const;
     533
    518534  /// Get objective function value
    519535  virtual double getObjValue() const;
    520  
     536
    521537  /** Get how many iterations it took to solve the problem (whatever
    522538      "iteration" mean to the solver. */
    523   virtual int getIterationCount() const
    524   { return modelPtr_->numberIterations(); }
    525  
     539  virtual int getIterationCount() const
     540  {
     541    return modelPtr_->numberIterations();
     542  }
     543
    526544  /** Get as many dual rays as the solver can provide. (In case of proven
    527545      primal infeasibility there should be at least one.)
     
    541559      vector using delete[].
    542560  */
    543   virtual std::vector<double*> getDualRays(int maxNumRays,
    544                                            bool fullRay = false) const;
     561  virtual std::vector< double * > getDualRays(int maxNumRays,
     562    bool fullRay = false) const;
    545563  /** Get as many primal rays as the solver can provide. (In case of proven
    546564      dual infeasibility there should be at least one.)
     
    554572      vector using delete[].
    555573  */
    556   virtual std::vector<double*> getPrimalRays(int maxNumRays) const;
    557  
    558   //@}
    559   //@}
    560  
     574  virtual std::vector< double * > getPrimalRays(int maxNumRays) const;
     575
     576  //@}
     577  //@}
     578
    561579  //---------------------------------------------------------------------------
    562  
     580
    563581  /**@name Problem modifying methods */
    564582  //@{
     
    567585  //@{
    568586  /** Set an objective function coefficient */
    569   virtual void setObjCoeff( int elementIndex, double elementValue );
    570  
     587  virtual void setObjCoeff(int elementIndex, double elementValue);
     588
    571589  /** Set a single column lower bound<br>
    572590      Use -DBL_MAX for -infinity. */
    573   virtual void setColLower( int elementIndex, double elementValue );
    574  
     591  virtual void setColLower(int elementIndex, double elementValue);
     592
    575593  /** Set a single column upper bound<br>
    576594      Use DBL_MAX for infinity. */
    577   virtual void setColUpper( int elementIndex, double elementValue );
    578  
     595  virtual void setColUpper(int elementIndex, double elementValue);
     596
    579597  /** Set a single column lower and upper bound */
    580   virtual void setColBounds( int elementIndex,
    581                              double lower, double upper );
    582  
     598  virtual void setColBounds(int elementIndex,
     599    double lower, double upper);
     600
    583601  /** Set the bounds on a number of columns simultaneously<br>
    584602      The default implementation just invokes setColLower() and
     
    589607      @param boundList the new lower/upper bound pairs for the variables
    590608  */
    591   virtual void setColSetBounds(const int* indexFirst,
    592                                const int* indexLast,
    593                                const double* boundList);
    594  
     609  virtual void setColSetBounds(const int *indexFirst,
     610    const int *indexLast,
     611    const double *boundList);
     612
    595613  /** Set a single row lower bound<br>
    596614      Use -DBL_MAX for -infinity. */
    597   virtual void setRowLower( int elementIndex, double elementValue );
    598  
     615  virtual void setRowLower(int elementIndex, double elementValue);
     616
    599617  /** Set a single row upper bound<br>
    600618      Use DBL_MAX for infinity. */
    601   virtual void setRowUpper( int elementIndex, double elementValue ) ;
    602  
     619  virtual void setRowUpper(int elementIndex, double elementValue);
     620
    603621  /** Set a single row lower and upper bound */
    604   virtual void setRowBounds( int elementIndex,
    605                              double lower, double upper ) ;
    606  
     622  virtual void setRowBounds(int elementIndex,
     623    double lower, double upper);
     624
    607625  /** Set the type of a single row<br> */
    608626  virtual void setRowType(int index, char sense, double rightHandSide,
    609                           double range);
    610  
     627    double range);
     628
    611629  /** Set the bounds on a number of rows simultaneously<br>
    612630      The default implementation just invokes setRowLower() and
     
    617635      @param boundList the new lower/upper bound pairs for the constraints
    618636  */
    619   virtual void setRowSetBounds(const int* indexFirst,
    620                                const int* indexLast,
    621                                const double* boundList);
    622  
     637  virtual void setRowSetBounds(const int *indexFirst,
     638    const int *indexLast,
     639    const double *boundList);
     640
    623641  /** Set the type of a number of rows simultaneously<br>
    624642      The default implementation just invokes setRowType()
     
    631649      @param rangeList the new ranges
    632650  */
    633   virtual void setRowSetTypes(const int* indexFirst,
    634                               const int* indexLast,
    635                               const char* senseList,
    636                               const double* rhsList,
    637                               const double* rangeList);
    638     /** Set the objective coefficients for all columns
     651  virtual void setRowSetTypes(const int *indexFirst,
     652    const int *indexLast,
     653    const char *senseList,
     654    const double *rhsList,
     655    const double *rangeList);
     656  /** Set the objective coefficients for all columns
    639657        array [getNumCols()] is an array of values for the objective.
    640658        This defaults to a series of set operations and is here for speed.
    641659    */
    642     virtual void setObjective(const double * array);
    643 
    644     /** Set the lower bounds for all columns
     660  virtual void setObjective(const double *array);
     661
     662  /** Set the lower bounds for all columns
    645663        array [getNumCols()] is an array of values for the objective.
    646664        This defaults to a series of set operations and is here for speed.
    647665    */
    648     virtual void setColLower(const double * array);
    649 
    650     /** Set the upper bounds for all columns
     666  virtual void setColLower(const double *array);
     667
     668  /** Set the upper bounds for all columns
    651669        array [getNumCols()] is an array of values for the objective.
    652670        This defaults to a series of set operations and is here for speed.
    653671    */
    654     virtual void setColUpper(const double * array);
    655 
    656 //    using OsiSolverInterface::setRowName ;
    657     /// Set name of row
    658 //    virtual void setRowName(int rowIndex, std::string & name) ;
    659     virtual void setRowName(int rowIndex, std::string  name) ;
    660    
    661 //    using OsiSolverInterface::setColName ;
    662     /// Set name of column
    663 //    virtual void setColName(int colIndex, std::string & name) ;
    664     virtual void setColName(int colIndex, std::string  name) ;
    665    
    666   //@}
    667  
     672  virtual void setColUpper(const double *array);
     673
     674  //    using OsiSolverInterface::setRowName ;
     675  /// Set name of row
     676  //    virtual void setRowName(int rowIndex, std::string & name) ;
     677  virtual void setRowName(int rowIndex, std::string name);
     678
     679  //    using OsiSolverInterface::setColName ;
     680  /// Set name of column
     681  //    virtual void setColName(int colIndex, std::string & name) ;
     682  virtual void setColName(int colIndex, std::string name);
     683
     684  //@}
     685
    668686  //-------------------------------------------------------------------------
    669687  /**@name Integrality related changing methods */
     
    675693  /** Set the variables listed in indices (which is of length len) to be
    676694      continuous variables */
    677   virtual void setContinuous(const int* indices, int len);
     695  virtual void setContinuous(const int *indices, int len);
    678696  /** Set the variables listed in indices (which is of length len) to be
    679697      integer variables */
    680   virtual void setInteger(const int* indices, int len);
     698  virtual void setInteger(const int *indices, int len);
    681699  /// Number of SOS sets
    682700  inline int numberSOS() const
    683   { return numberSOS_;}
     701  {
     702    return numberSOS_;
     703  }
    684704  /// SOS set info
    685   inline const CoinSet * setInfo() const
    686   { return setInfo_;}
     705  inline const CoinSet *setInfo() const
     706  {
     707    return setInfo_;
     708  }
    687709  /// Replace setInfo (takes over ownership)
    688   void replaceSetInfo(int numberSOS,CoinSet * setInfo);
     710  void replaceSetInfo(int numberSOS, CoinSet *setInfo);
    689711  /** \brief Identify integer variables and SOS and create corresponding objects.
    690712 
     
    698720  virtual int findIntegersAndSOS(bool justCount);
    699721  //@}
    700  
     722
    701723  //-------------------------------------------------------------------------
    702724  /// Set objective function sense (1 for min (default), -1 for max,)
    703   virtual void setObjSense(double s )
    704   { modelPtr_->setOptimizationDirection( s < 0 ? -1 : 1); }
    705  
     725  virtual void setObjSense(double s)
     726  {
     727    modelPtr_->setOptimizationDirection(s < 0 ? -1 : 1);
     728  }
     729
    706730  /** Set the primal solution column values
    707731     
     
    714738  solver-dependent.
    715739  */
    716   virtual void setColSolution(const double * colsol);
    717  
     740  virtual void setColSolution(const double *colsol);
     741
    718742  /** Set dual solution vector
    719743     
     
    726750  solver-dependent.
    727751  */
    728   virtual void setRowPrice(const double * rowprice);
    729  
     752  virtual void setRowPrice(const double *rowprice);
     753
    730754  //-------------------------------------------------------------------------
    731755  /**@name Methods to expand a problem.<br>
     
    736760  //using OsiSolverInterface::addCol ;
    737761  /** */
    738   virtual void addCol(const CoinPackedVectorBase& vec,
    739                       const double collb, const double colub,   
    740                       const double obj);
     762  virtual void addCol(const CoinPackedVectorBase &vec,
     763    const double collb, const double colub,
     764    const double obj);
    741765  /*! \brief Add a named column (primal variable) to the problem.
    742766  */
    743   virtual void addCol(const CoinPackedVectorBase& vec,
    744                       const double collb, const double colub,   
    745                       const double obj, std::string name) ;
     767  virtual void addCol(const CoinPackedVectorBase &vec,
     768    const double collb, const double colub,
     769    const double obj, std::string name);
    746770  /** Add a column (primal variable) to the problem. */
    747   virtual void addCol(int numberElements, const int * rows, const double * elements,
    748                       const double collb, const double colub,   
    749                       const double obj) ;
     771  virtual void addCol(int numberElements, const int *rows, const double *elements,
     772    const double collb, const double colub,
     773    const double obj);
    750774  /*! \brief Add a named column (primal variable) to the problem.
    751775   */
    752776  virtual void addCol(int numberElements,
    753                       const int* rows, const double* elements,
    754                       const double collb, const double colub,   
    755                       const double obj, std::string name) ;
     777    const int *rows, const double *elements,
     778    const double collb, const double colub,
     779    const double obj, std::string name);
    756780  /** */
    757781  virtual void addCols(const int numcols,
    758                        const CoinPackedVectorBase * const * cols,
    759                        const double* collb, const double* colub,   
    760                        const double* obj);
     782    const CoinPackedVectorBase *const *cols,
     783    const double *collb, const double *colub,
     784    const double *obj);
    761785  /**  */
    762786  virtual void addCols(const int numcols,
    763                        const CoinBigIndex * columnStarts, const int * rows, const double * elements,
    764                        const double* collb, const double* colub,   
    765                        const double* obj);
     787    const CoinBigIndex *columnStarts, const int *rows, const double *elements,
     788    const double *collb, const double *colub,
     789    const double *obj);
    766790  /** */
    767   virtual void deleteCols(const int num, const int * colIndices);
    768  
     791  virtual void deleteCols(const int num, const int *colIndices);
     792
    769793  /** */
    770   virtual void addRow(const CoinPackedVectorBase& vec,
    771                       const double rowlb, const double rowub);
     794  virtual void addRow(const CoinPackedVectorBase &vec,
     795    const double rowlb, const double rowub);
    772796  /** */
    773     /*! \brief Add a named row (constraint) to the problem.
     797  /*! \brief Add a named row (constraint) to the problem.
    774798   
    775799      The default implementation adds the row, then changes the name. This
    776800      can surely be made more efficient within an OsiXXX class.
    777801    */
    778     virtual void addRow(const CoinPackedVectorBase& vec,
    779                         const double rowlb, const double rowub,
    780                         std::string name) ;
    781   virtual void addRow(const CoinPackedVectorBase& vec,
    782                       const char rowsen, const double rowrhs,   
    783                       const double rowrng);
     802  virtual void addRow(const CoinPackedVectorBase &vec,
     803    const double rowlb, const double rowub,
     804    std::string name);
     805  virtual void addRow(const CoinPackedVectorBase &vec,
     806    const char rowsen, const double rowrhs,
     807    const double rowrng);
    784808  /** Add a row (constraint) to the problem. */
    785   virtual void addRow(int numberElements, const int * columns, const double * element,
    786                       const double rowlb, const double rowub) ;
    787     /*! \brief Add a named row (constraint) to the problem.
     809  virtual void addRow(int numberElements, const int *columns, const double *element,
     810    const double rowlb, const double rowub);
     811  /*! \brief Add a named row (constraint) to the problem.
    788812    */
    789     virtual void addRow(const CoinPackedVectorBase& vec,
    790                         const char rowsen, const double rowrhs,   
    791                         const double rowrng, std::string name) ;
     813  virtual void addRow(const CoinPackedVectorBase &vec,
     814    const char rowsen, const double rowrhs,
     815    const double rowrng, std::string name);
    792816  /** */
    793817  virtual void addRows(const int numrows,
    794                        const CoinPackedVectorBase * const * rows,
    795                        const double* rowlb, const double* rowub);
     818    const CoinPackedVectorBase *const *rows,
     819    const double *rowlb, const double *rowub);
    796820  /** */
    797821  virtual void addRows(const int numrows,
    798                        const CoinPackedVectorBase * const * rows,
    799                        const char* rowsen, const double* rowrhs,   
    800                        const double* rowrng);
     822    const CoinPackedVectorBase *const *rows,
     823    const char *rowsen, const double *rowrhs,
     824    const double *rowrng);
    801825
    802826  /** */
    803827  virtual void addRows(const int numrows,
    804                        const CoinBigIndex * rowStarts, const int * columns, const double * element,
    805                        const double* rowlb, const double* rowub);
     828    const CoinBigIndex *rowStarts, const int *columns, const double *element,
     829    const double *rowlb, const double *rowub);
    806830  ///
    807831  void modifyCoefficient(int row, int column, double newElement,
    808                         bool keepZero=false)
    809         {modelPtr_->modifyCoefficient(row,column,newElement, keepZero);}
     832    bool keepZero = false)
     833  {
     834    modelPtr_->modifyCoefficient(row, column, newElement, keepZero);
     835  }
    810836
    811837  /** */
    812   virtual void deleteRows(const int num, const int * rowIndices);
     838  virtual void deleteRows(const int num, const int *rowIndices);
    813839  /**  If solver wants it can save a copy of "base" (continuous) model here
    814840   */
    815   virtual void saveBaseModel() ;
     841  virtual void saveBaseModel();
    816842  /**  Strip off rows to get to this number of rows.
    817843       If solver wants it can restore a copy of "base" (continuous) model here
    818844  */
    819845  virtual void restoreBaseModel(int numberRows);
    820  
     846
    821847  //-----------------------------------------------------------------------
    822848  /** Apply a collection of row cuts which are all effective.
    823849      applyCuts seems to do one at a time which seems inefficient.
    824850  */
    825   virtual void applyRowCuts(int numberCuts, const OsiRowCut * cuts);
     851  virtual void applyRowCuts(int numberCuts, const OsiRowCut *cuts);
    826852  /** Apply a collection of row cuts which are all effective.
    827853      applyCuts seems to do one at a time which seems inefficient.
    828854      This uses array of pointers
    829855  */
    830   virtual void applyRowCuts(int numberCuts, const OsiRowCut ** cuts);
    831     /** Apply a collection of cuts.
     856  virtual void applyRowCuts(int numberCuts, const OsiRowCut **cuts);
     857  /** Apply a collection of cuts.
    832858
    833859        Only cuts which have an <code>effectiveness >= effectivenessLb</code>
     
    851877        </ul>
    852878    */
    853     virtual ApplyCutsReturnCode applyCuts(const OsiCuts & cs,
    854                                           double effectivenessLb = 0.0);
    855 
    856   //@}
    857   //@}
    858  
     879  virtual ApplyCutsReturnCode applyCuts(const OsiCuts &cs,
     880    double effectivenessLb = 0.0);
     881
     882  //@}
     883  //@}
     884
    859885  //---------------------------------------------------------------------------
    860  
     886
    861887public:
    862  
    863888  /**@name Methods to input a problem */
    864889  //@{
     
    874899      </ul>
    875900  */
    876   virtual void loadProblem(const CoinPackedMatrix& matrix,
    877                            const double* collb, const double* colub,   
    878                            const double* obj,
    879                            const double* rowlb, const double* rowub);
    880  
     901  virtual void loadProblem(const CoinPackedMatrix &matrix,
     902    const double *collb, const double *colub,
     903    const double *obj,
     904    const double *rowlb, const double *rowub);
     905
    881906  /** Load in an problem by assuming ownership of the arguments (the
    882907      constraints on the rows are given by lower and upper bounds). For
     
    886911      functions.
    887912  */
    888   virtual void assignProblem(CoinPackedMatrix*& matrix,
    889                              double*& collb, double*& colub, double*& obj,
    890                              double*& rowlb, double*& rowub);
    891  
     913  virtual void assignProblem(CoinPackedMatrix *&matrix,
     914    double *&collb, double *&colub, double *&obj,
     915    double *&rowlb, double *&rowub);
     916
    892917  /** Load in an problem by copying the arguments (the constraints on the
    893918      rows are given by sense/rhs/range triplets). If a pointer is NULL then the
     
    902927      </ul>
    903928  */
    904   virtual void loadProblem(const CoinPackedMatrix& matrix,
    905                            const double* collb, const double* colub,
    906                            const double* obj,
    907                            const char* rowsen, const double* rowrhs,   
    908                            const double* rowrng);
    909  
     929  virtual void loadProblem(const CoinPackedMatrix &matrix,
     930    const double *collb, const double *colub,
     931    const double *obj,
     932    const char *rowsen, const double *rowrhs,
     933    const double *rowrng);
     934
    910935  /** Load in an problem by assuming ownership of the arguments (the
    911936      constraints on the rows are given by sense/rhs/range triplets). For
     
    915940      functions.
    916941  */
    917   virtual void assignProblem(CoinPackedMatrix*& matrix,
    918                              double*& collb, double*& colub, double*& obj,
    919                              char*& rowsen, double*& rowrhs,
    920                              double*& rowrng);
    921  
     942  virtual void assignProblem(CoinPackedMatrix *&matrix,
     943    double *&collb, double *&colub, double *&obj,
     944    char *&rowsen, double *&rowrhs,
     945    double *&rowrng);
     946
    922947  /** Just like the other loadProblem() methods except that the matrix is
    923948      given as a ClpMatrixBase. */
    924   virtual void loadProblem(const ClpMatrixBase& matrix,
    925                            const double* collb, const double* colub,
    926                            const double* obj,
    927                            const double* rowlb, const double* rowub) ;
     949  virtual void loadProblem(const ClpMatrixBase &matrix,
     950    const double *collb, const double *colub,
     951    const double *obj,
     952    const double *rowlb, const double *rowub);
    928953
    929954  /** Just like the other loadProblem() methods except that the matrix is
    930955      given in a standard column major ordered format (without gaps). */
    931956  virtual void loadProblem(const int numcols, const int numrows,
    932                            const CoinBigIndex * start, const int* index,
    933                            const double* value,
    934                            const double* collb, const double* colub,   
    935                            const double* obj,
    936                            const double* rowlb, const double* rowub);
    937  
     957    const CoinBigIndex *start, const int *index,
     958    const double *value,
     959    const double *collb, const double *colub,
     960    const double *obj,
     961    const double *rowlb, const double *rowub);
     962
    938963  /** Just like the other loadProblem() methods except that the matrix is
    939964      given in a standard column major ordered format (without gaps). */
    940965  virtual void loadProblem(const int numcols, const int numrows,
    941                            const CoinBigIndex * start, const int* index,
    942                            const double* value,
    943                            const double* collb, const double* colub,   
    944                            const double* obj,
    945                            const char* rowsen, const double* rowrhs,   
    946                            const double* rowrng);
     966    const CoinBigIndex *start, const int *index,
     967    const double *value,
     968    const double *collb, const double *colub,
     969    const double *obj,
     970    const char *rowsen, const double *rowrhs,
     971    const double *rowrng);
    947972  /// This loads a model from a coinModel object - returns number of errors
    948   virtual int loadFromCoinModel (  CoinModel & modelObject, bool keepSolution=false);
    949 
    950   using OsiSolverInterface::readMps ;
     973  virtual int loadFromCoinModel(CoinModel &modelObject, bool keepSolution = false);
     974
     975  using OsiSolverInterface::readMps;
    951976  /** Read an mps file from the given filename (defaults to Osi reader) - returns
    952977      number of errors (see OsiMpsReader class) */
    953978  virtual int readMps(const char *filename,
    954                       const char *extension = "mps") ;
     979    const char *extension = "mps");
    955980  /** Read an mps file from the given filename returns
    956981      number of errors (see OsiMpsReader class) */
    957   int readMps(const char *filename,bool keepNames,bool allowErrors);
     982  int readMps(const char *filename, bool keepNames, bool allowErrors);
    958983  /// Read an mps file
    959   virtual int readMps (const char *filename, const char*extension,
    960                         int & numberSets, CoinSet ** & sets);
    961  
     984  virtual int readMps(const char *filename, const char *extension,
     985    int &numberSets, CoinSet **&sets);
     986
    962987  /** Write the problem into an mps file of the given filename.
    963988      If objSense is non zero then -1.0 forces the code to write a
     
    965990      If 0.0 then solver can do what it wants */
    966991  virtual void writeMps(const char *filename,
    967                         const char *extension = "mps",
    968                         double objSense=0.0) const;
     992    const char *extension = "mps",
     993    double objSense = 0.0) const;
    969994  /** Write the problem into an mps file of the given filename,
    970995      names may be null.  formatType is
     
    9751000      Returns non-zero on I/O error
    9761001  */
    977   virtual int writeMpsNative(const char *filename, 
    978                              const char ** rowNames, const char ** columnNames,
    979                              int formatType=0,int numberAcross=2,
    980                              double objSense=0.0) const ;
     1002  virtual int writeMpsNative(const char *filename,
     1003    const char **rowNames, const char **columnNames,
     1004    int formatType = 0, int numberAcross = 2,
     1005    double objSense = 0.0) const;
    9811006  /// Read file in LP format (with names)
    9821007  virtual int readLp(const char *filename, const double epsilon = 1e-5);
     
    9871012      This version calls writeLpNative with names */
    9881013  virtual void writeLp(const char *filename,
    989                        const char *extension = "lp",
    990                        double epsilon = 1e-5,
    991                        int numberAcross = 10,
    992                        int decimals = 5,
    993                        double objSense = 0.0,
    994                        bool useRowNames = true) const;
     1014    const char *extension = "lp",
     1015    double epsilon = 1e-5,
     1016    int numberAcross = 10,
     1017    int decimals = 5,
     1018    double objSense = 0.0,
     1019    bool useRowNames = true) const;
    9951020  /** Write the problem into the file pointed to by the parameter fp.
    9961021      Other parameters are similar to
     
    9981023  */
    9991024  virtual void writeLp(FILE *fp,
    1000                double epsilon = 1e-5,
    1001                int numberAcross = 10,
    1002                int decimals = 5,
    1003                double objSense = 0.0,
    1004                bool useRowNames = true) const;
     1025    double epsilon = 1e-5,
     1026    int numberAcross = 10,
     1027    int decimals = 5,
     1028    double objSense = 0.0,
     1029    bool useRowNames = true) const;
    10051030  /**
    10061031     I (JJF) am getting annoyed because I can't just replace a matrix.
     
    10081033     e.g. strengthening a matrix for MIP
    10091034  */
    1010   virtual void replaceMatrixOptional(const CoinPackedMatrix & matrix);
     1035  virtual void replaceMatrixOptional(const CoinPackedMatrix &matrix);
    10111036  /// And if it does matter (not used at present)
    1012   virtual void replaceMatrix(const CoinPackedMatrix & matrix) ;
    1013   //@}
    1014  
     1037  virtual void replaceMatrix(const CoinPackedMatrix &matrix);
     1038  //@}
     1039
    10151040  /**@name Message handling (extra for Clp messages).
    10161041     Normally I presume you would want the same language.
     
    10231048      destroyed.
    10241049  */
    1025   virtual void passInMessageHandler(CoinMessageHandler * handler);
     1050  virtual void passInMessageHandler(CoinMessageHandler *handler);
    10261051  /// Set language
    10271052  void newLanguage(CoinMessages::Language language);
    10281053  void setLanguage(CoinMessages::Language language)
    1029   {newLanguage(language);}
     1054  {
     1055    newLanguage(language);
     1056  }
    10301057  /// Set log level (will also set underlying solver's log level)
    10311058  void setLogLevel(int value);
    10321059  /// Create C++ lines to get to current state
    1033   void generateCpp( FILE * fp);
     1060  void generateCpp(FILE *fp);
    10341061  //@}
    10351062  //---------------------------------------------------------------------------
    1036  
     1063
    10371064  /**@name Clp specific public interfaces */
    10381065  //@{
    10391066  /// Get pointer to Clp model
    1040   ClpSimplex * getModelPtr() const ;
     1067  ClpSimplex *getModelPtr() const;
    10411068  /// Set pointer to Clp model and return old
    1042   inline ClpSimplex * swapModelPtr(ClpSimplex * newModel)
    1043   { ClpSimplex * model = modelPtr_; modelPtr_=newModel;return model;}
     1069  inline ClpSimplex *swapModelPtr(ClpSimplex *newModel)
     1070  {
     1071    ClpSimplex *model = modelPtr_;
     1072    modelPtr_ = newModel;
     1073    return model;
     1074  }
    10441075  /// Get special options
    10451076  inline unsigned int specialOptions() const
    1046   { return specialOptions_;}
     1077  {
     1078    return specialOptions_;
     1079  }
    10471080  void setSpecialOptions(unsigned int value);
    10481081  /// Last algorithm used , 1 = primal, 2 = dual other unknown
    10491082  inline int lastAlgorithm() const
    1050   { return lastAlgorithm_;}
     1083  {
     1084    return lastAlgorithm_;
     1085  }
    10511086  /// Set last algorithm used , 1 = primal, 2 = dual other unknown
    10521087  inline void setLastAlgorithm(int value)
    1053   { lastAlgorithm_ = value;}
     1088  {
     1089    lastAlgorithm_ = value;
     1090  }
    10541091  /// Get scaling action option
    10551092  inline int cleanupScaling() const
    1056   { return cleanupScaling_;}
     1093  {
     1094    return cleanupScaling_;
     1095  }
    10571096  /** Set Scaling option
    10581097      When scaling is on it is possible that the scaled problem
     
    10681107  */
    10691108  inline void setCleanupScaling(int value)
    1070   { cleanupScaling_=value;}
     1109  {
     1110    cleanupScaling_ = value;
     1111  }
    10711112  /** Get smallest allowed element in cut.
    10721113      If smaller than this then ignored */
    10731114  inline double smallestElementInCut() const
    1074   { return smallestElementInCut_;}
     1115  {
     1116    return smallestElementInCut_;
     1117  }
    10751118  /** Set smallest allowed element in cut.
    10761119      If smaller than this then ignored */
    10771120  inline void setSmallestElementInCut(double value)
    1078   { smallestElementInCut_=value;}
     1121  {
     1122    smallestElementInCut_ = value;
     1123  }
    10791124  /** Get smallest change in cut.
    10801125      If (upper-lower)*element < this then element is
     
    10841129  */
    10851130  inline double smallestChangeInCut() const
    1086   { return smallestChangeInCut_;}
     1131  {
     1132    return smallestChangeInCut_;
     1133  }
    10871134  /** Set smallest change in cut.
    10881135      If (upper-lower)*element < this then element is
     
    10921139  */
    10931140  inline void setSmallestChangeInCut(double value)
    1094   { smallestChangeInCut_=value;}
     1141  {
     1142    smallestChangeInCut_ = value;
     1143  }
    10951144  /// Pass in initial solve options
    1096   inline void setSolveOptions(const ClpSolve & options)
    1097   { solveOptions_ = options;}
     1145  inline void setSolveOptions(const ClpSolve &options)
     1146  {
     1147    solveOptions_ = options;
     1148  }
    10981149  /** Tighten bounds - lightweight or very lightweight
    10991150      0 - normal, 1 lightweight but just integers, 2 lightweight and all
    11001151  */
    1101   virtual int tightenBounds(int lightweight=0);
     1152  virtual int tightenBounds(int lightweight = 0);
    11021153  /// See if any integer variables make infeasible other way
    1103   int infeasibleOtherWay(char * whichWay);
     1154  int infeasibleOtherWay(char *whichWay);
    11041155  /// Return number of entries in L part of current factorization
    11051156  virtual CoinBigIndex getSizeL() const;
     
    11071158  virtual CoinBigIndex getSizeU() const;
    11081159  /// Get disaster handler
    1109   const OsiClpDisasterHandler * disasterHandler() const
    1110   { return disasterHandler_;}
     1160  const OsiClpDisasterHandler *disasterHandler() const
     1161  {
     1162    return disasterHandler_;
     1163  }
    11111164  /// Pass in disaster handler
    1112   void passInDisasterHandler(OsiClpDisasterHandler * handler);
     1165  void passInDisasterHandler(OsiClpDisasterHandler *handler);
    11131166  /// Get fake objective
    1114   ClpLinearObjective * fakeObjective() const
    1115   { return fakeObjective_;}
     1167  ClpLinearObjective *fakeObjective() const
     1168  {
     1169    return fakeObjective_;
     1170  }
    11161171  /// Set fake objective (and take ownership)
    1117   void setFakeObjective(ClpLinearObjective * fakeObjective);
     1172  void setFakeObjective(ClpLinearObjective *fakeObjective);
    11181173  /// Set fake objective
    1119   void setFakeObjective(double * fakeObjective);
     1174  void setFakeObjective(double *fakeObjective);
    11201175  /*! \brief Set up solver for repeated use by Osi interface.
    11211176
     
    11371192    -  1 leaves
    11381193  */
    1139   void setupForRepeatedUse(int senseOfAdventure=0, int printOut=0);
     1194  void setupForRepeatedUse(int senseOfAdventure = 0, int printOut = 0);
    11401195  /// Synchronize model (really if no cuts in tree)
    11411196  virtual void synchronizeModel();
     
    11471202
    11481203  //@}
    1149  
     1204
    11501205  //---------------------------------------------------------------------------
    1151  
     1206
    11521207  /**@name Constructors and destructors */
    11531208  //@{
    11541209  /// Default Constructor
    1155   OsiClpSolverInterface ();
    1156  
     1210  OsiClpSolverInterface();
     1211
    11571212  /// Clone
    1158   virtual OsiSolverInterface * clone(bool copyData = true) const;
    1159  
    1160   /// Copy constructor 
    1161   OsiClpSolverInterface (const OsiClpSolverInterface &);
    1162  
     1213  virtual OsiSolverInterface *clone(bool copyData = true) const;
     1214
     1215  /// Copy constructor
     1216  OsiClpSolverInterface(const OsiClpSolverInterface &);
     1217
    11631218  /// Borrow constructor - only delete one copy
    1164   OsiClpSolverInterface (ClpSimplex * rhs, bool reallyOwn=false);
    1165  
     1219  OsiClpSolverInterface(ClpSimplex *rhs, bool reallyOwn = false);
     1220
    11661221  /// Releases so won't error
    11671222  void releaseClp();
    1168  
    1169   /// Assignment operator 
    1170   OsiClpSolverInterface & operator=(const OsiClpSolverInterface& rhs);
    1171  
    1172   /// Destructor 
    1173   virtual ~OsiClpSolverInterface ();
    1174  
     1223
     1224  /// Assignment operator
     1225  OsiClpSolverInterface &operator=(const OsiClpSolverInterface &rhs);
     1226
     1227  /// Destructor
     1228  virtual ~OsiClpSolverInterface();
     1229
    11751230  /// Resets as if default constructor
    11761231  virtual void reset();
    11771232  //@}
    1178  
     1233
    11791234  //---------------------------------------------------------------------------
    1180  
     1235
    11811236protected:
    11821237  ///@name Protected methods
    11831238  //@{
    11841239  /** Apply a row cut (append to constraint matrix). */
    1185   virtual void applyRowCut(const OsiRowCut& rc);
    1186  
     1240  virtual void applyRowCut(const OsiRowCut &rc);
     1241
    11871242  /** Apply a column cut (adjust one or more bounds). */
    1188   virtual void applyColCut(const OsiColCut& cc);
    1189   //@}
    1190  
     1243  virtual void applyColCut(const OsiColCut &cc);
     1244  //@}
     1245
    11911246  //---------------------------------------------------------------------------
    1192  
     1247
    11931248protected:
    11941249  /**@name Protected methods */
     
    11961251  /// The real work of a copy constructor (used by copy and assignment)
    11971252  void gutsOfDestructor();
    1198  
     1253
    11991254  /// Deletes all mutable stuff
    12001255  void freeCachedResults() const;
    1201  
     1256
    12021257  /// Deletes all mutable stuff for row ranges etc
    12031258  void freeCachedResults0() const;
    1204  
     1259
    12051260  /// Deletes all mutable stuff for matrix etc
    12061261  void freeCachedResults1() const;
    1207  
     1262
    12081263  /// A method that fills up the rowsense_, rhs_ and rowrange_ arrays
    12091264  void extractSenseRhsRange() const;
    1210  
     1265
    12111266  ///
    12121267  void fillParamMaps();
     
    12191274  in terms of row activities
    12201275  */
    1221   CoinWarmStartBasis getBasis(ClpSimplex * model) const;
     1276  CoinWarmStartBasis getBasis(ClpSimplex *model) const;
    12221277  /** Sets up working basis as a copy of input
    12231278     
     
    12281283  in terms of row activities
    12291284  */
    1230   void setBasis( const CoinWarmStartBasis & basis, ClpSimplex * model);
     1285  void setBasis(const CoinWarmStartBasis &basis, ClpSimplex *model);
    12311286  /// Crunch down problem a bit
    12321287  void crunch();
    12331288  /// Extend scale factors
    1234   void redoScaleFactors(int numberRows,const CoinBigIndex * starts,
    1235                         const int * indices, const double * elements);
     1289  void redoScaleFactors(int numberRows, const CoinBigIndex *starts,
     1290    const int *indices, const double *elements);
     1291
    12361292public:
    12371293  /** Sets up working basis as a copy of input and puts in as basis
    12381294  */
    1239   void setBasis( const CoinWarmStartBasis & basis);
     1295  void setBasis(const CoinWarmStartBasis &basis);
    12401296  /// Just puts current basis_ into ClpSimplex model
    1241   inline void setBasis( )
    1242   { setBasis(basis_,modelPtr_);}
     1297  inline void setBasis()
     1298  {
     1299    setBasis(basis_, modelPtr_);
     1300  }
    12431301  /// Warm start difference from basis_ to statusArray
    1244   CoinWarmStartDiff * getBasisDiff(const unsigned char * statusArray) const ;
     1302  CoinWarmStartDiff *getBasisDiff(const unsigned char *statusArray) const;
    12451303  /// Warm start from statusArray
    1246   CoinWarmStartBasis * getBasis(const unsigned char * statusArray) const ;
     1304  CoinWarmStartBasis *getBasis(const unsigned char *statusArray) const;
    12471305  /// Delete all scale factor stuff and reset option
    12481306  void deleteScaleFactors();
    12491307  /// If doing fast hot start then ranges are computed
    1250   inline const double * upRange() const
    1251   { return rowActivity_;}
    1252   inline const double * downRange() const
    1253   { return columnActivity_;}
     1308  inline const double *upRange() const
     1309  {
     1310    return rowActivity_;
     1311  }
     1312  inline const double *downRange() const
     1313  {
     1314    return columnActivity_;
     1315  }
    12541316  /// Pass in range array
    1255   inline void passInRanges(int * array)
    1256   { whichRange_=array;}
     1317  inline void passInRanges(int *array)
     1318  {
     1319    whichRange_ = array;
     1320  }
    12571321  /// Pass in sos stuff from AMPl
    1258   void setSOSData(int numberSOS,const char * type,
    1259                   const int * start,const int * indices, const double * weights=NULL);
     1322  void setSOSData(int numberSOS, const char *type,
     1323    const int *start, const int *indices, const double *weights = NULL);
    12601324  /// Compute largest amount any at continuous away from bound
    12611325  void computeLargestAway();
    12621326  /// Get largest amount continuous away from bound
    12631327  inline double largestAway() const
    1264   { return largestAway_;}
     1328  {
     1329    return largestAway_;
     1330  }
    12651331  /// Set largest amount continuous away from bound
    12661332  inline void setLargestAway(double value)
    1267   { largestAway_ = value;}
     1333  {
     1334    largestAway_ = value;
     1335  }
    12681336  /// Sort of lexicographic resolve
    12691337  void lexSolve();
    12701338  /// Get continuous model
    1271   inline ClpSimplex * getContinuousModel() const
    1272   { return continuousModel_;}
     1339  inline ClpSimplex *getContinuousModel() const
     1340  {
     1341    return continuousModel_;
     1342  }
    12731343  /// Set continuous model
    1274   inline void setContinuousModel(ClpSimplex * model)
    1275   { continuousModel_ = model;}
    1276   //@}
    1277  
     1344  inline void setContinuousModel(ClpSimplex *model)
     1345  {
     1346    continuousModel_ = model;
     1347  }
     1348  //@}
     1349
    12781350protected:
    12791351  /**@name Protected member data */
    12801352  //@{
    12811353  /// Clp model represented by this class instance
    1282   mutable ClpSimplex * modelPtr_;
     1354  mutable ClpSimplex *modelPtr_;
    12831355  //@}
    12841356  /**@name Cached information derived from the OSL model */
    12851357  //@{
    12861358  /// Pointer to dense vector of row sense indicators
    1287   mutable char    *rowsense_;
    1288  
     1359  mutable char *rowsense_;
     1360
    12891361  /// Pointer to dense vector of row right-hand side values
    1290   mutable double  *rhs_;
    1291  
     1362  mutable double *rhs_;
     1363
    12921364  /** Pointer to dense vector of slack upper bounds for range
    12931365      constraints (undefined for non-range rows)
    12941366  */
    1295   mutable double  *rowrange_;
    1296  
     1367  mutable double *rowrange_;
     1368
    12971369  /** A pointer to the warmstart information to be used in the hotstarts.
    12981370      This is NOT efficient and more thought should be given to it... */
    1299   mutable CoinWarmStartBasis* ws_;
     1371  mutable CoinWarmStartBasis *ws_;
    13001372  /** also save row and column information for hot starts
    13011373      only used in hotstarts so can be casual */
    1302   mutable double * rowActivity_;
    1303   mutable double * columnActivity_;
     1374  mutable double *rowActivity_;
     1375  mutable double *columnActivity_;
    13041376  /// Stuff for fast dual
    13051377  ClpNodeStuff stuff_;
     
    13071379  int numberSOS_;
    13081380  /// SOS set info
    1309   CoinSet * setInfo_;
     1381  CoinSet *setInfo_;
    13101382  /// Alternate model (hot starts) - but also could be permanent and used for crunch
    1311   ClpSimplex * smallModel_;
     1383  ClpSimplex *smallModel_;
    13121384  /// factorization for hot starts
    1313   ClpFactorization * factorization_;
     1385  ClpFactorization *factorization_;
    13141386  /** Smallest allowed element in cut.
    13151387      If smaller than this then ignored */
     
    13221394  double largestAway_;
    13231395  /// Arrays for hot starts
    1324   char * spareArrays_;
     1396  char *spareArrays_;
    13251397  /** Warmstart information to be used in resolves. */
    13261398  CoinWarmStartBasis basis_;
    13271399  /** The original iteration limit before hotstarts started. */
    13281400  int itlimOrig_;
    1329  
     1401
    13301402  /*! \brief Last algorithm used
    13311403 
     
    13391411  */
    13401412  mutable int lastAlgorithm_;
    1341  
     1413
    13421414  /// To say if destructor should delete underlying model
    13431415  bool notOwned_;
    1344  
     1416
    13451417  /// Pointer to row-wise copy of problem matrix coefficients.
    1346   mutable CoinPackedMatrix *matrixByRow_; 
    1347  
     1418  mutable CoinPackedMatrix *matrixByRow_;
     1419
    13481420  /// Pointer to row-wise copy of continuous problem matrix coefficients.
    1349   CoinPackedMatrix *matrixByRowAtContinuous_; 
    1350  
     1421  CoinPackedMatrix *matrixByRowAtContinuous_;
     1422
    13511423  /// Pointer to integer information
    1352   char * integerInformation_;
    1353  
     1424  char *integerInformation_;
     1425
    13541426  /** Pointer to variables for which we want range information
    13551427      The number is in [0]
    13561428      memory is not owned by OsiClp
    13571429  */
    1358   int * whichRange_;
     1430  int *whichRange_;
    13591431
    13601432  //std::map<OsiIntParam, ClpIntParam> intParamMap_;
    13611433  //std::map<OsiDblParam, ClpDblParam> dblParamMap_;
    13621434  //std::map<OsiStrParam, ClpStrParam> strParamMap_;
    1363  
     1435
    13641436  /*! \brief Faking min to get proper dual solution signs in simplex API */
    1365   mutable bool fakeMinInSimplex_ ;
     1437  mutable bool fakeMinInSimplex_;
    13661438  /*! \brief Linear objective
    13671439 
     
    14191491  mutable unsigned int specialOptions_;
    14201492  /// Copy of model when option 131072 set
    1421   ClpSimplex * baseModel_;
     1493  ClpSimplex *baseModel_;
    14221494  /// Number of rows when last "scaled"
    14231495  int lastNumberRows_;
    14241496  /// Continuous model
    1425   ClpSimplex * continuousModel_;
     1497  ClpSimplex *continuousModel_;
    14261498  /// Possible disaster handler
    1427   OsiClpDisasterHandler * disasterHandler_ ;
     1499  OsiClpDisasterHandler *disasterHandler_;
    14281500  /// Fake objective
    1429   ClpLinearObjective * fakeObjective_;
     1501  ClpLinearObjective *fakeObjective_;
    14301502  /// Row scale factors (has inverse at end)
    1431   CoinDoubleArrayWithLength rowScale_; 
     1503  CoinDoubleArrayWithLength rowScale_;
    14321504  /// Column scale factors (has inverse at end)
    1433   CoinDoubleArrayWithLength columnScale_; 
     1505  CoinDoubleArrayWithLength columnScale_;
    14341506  //@}
    14351507};
    1436  
     1508
    14371509class OsiClpDisasterHandler : public ClpDisasterHandler {
    14381510public:
     
    14431515  virtual void intoSimplex();
    14441516  /// Checks if disaster
    1445   virtual bool check() const ;
     1517  virtual bool check() const;
    14461518  /// saves information for next attempt
    14471519  virtual void saveInfo();
     
    14491521  virtual int typeOfDisaster();
    14501522  //@}
    1451  
    1452  
     1523
    14531524  /**@name Constructors, destructor */
    14541525
    14551526  //@{
    14561527  /** Default constructor. */
    1457   OsiClpDisasterHandler(OsiClpSolverInterface * model = NULL);
     1528  OsiClpDisasterHandler(OsiClpSolverInterface *model = NULL);
    14581529  /** Destructor */
    14591530  virtual ~OsiClpDisasterHandler();
    14601531  // Copy
    1461   OsiClpDisasterHandler(const OsiClpDisasterHandler&);
     1532  OsiClpDisasterHandler(const OsiClpDisasterHandler &);
    14621533  // Assignment
    1463   OsiClpDisasterHandler& operator=(const OsiClpDisasterHandler&);
     1534  OsiClpDisasterHandler &operator=(const OsiClpDisasterHandler &);
    14641535  /// Clone
    1465   virtual ClpDisasterHandler * clone() const;
    1466 
    1467   //@}
    1468  
     1536  virtual ClpDisasterHandler *clone() const;
     1537
     1538  //@}
     1539
    14691540  /**@name Sets/gets */
    14701541
    14711542  //@{
    14721543  /** set model. */
    1473   void setOsiModel(OsiClpSolverInterface * model);
     1544  void setOsiModel(OsiClpSolverInterface *model);
    14741545  /// Get model
    1475   inline OsiClpSolverInterface * osiModel() const
    1476   { return osiModel_;}
     1546  inline OsiClpSolverInterface *osiModel() const
     1547  {
     1548    return osiModel_;
     1549  }
    14771550  /// Set where from
    14781551  inline void setWhereFrom(int value)
    1479   { whereFrom_=value;}
     1552  {
     1553    whereFrom_ = value;
     1554  }
    14801555  /// Get where from
    14811556  inline int whereFrom() const
    1482   { return whereFrom_;}
    1483   /// Set phase
     1557  {
     1558    return whereFrom_;
     1559  }
     1560  /// Set phase
    14841561  inline void setPhase(int value)
    1485   { phase_=value;}
    1486   /// Get phase
     1562  {
     1563    phase_ = value;
     1564  }
     1565  /// Get phase
    14871566  inline int phase() const
    1488   { return phase_;}
     1567  {
     1568    return phase_;
     1569  }
    14891570  /// are we in trouble
    14901571  bool inTrouble() const;
    1491  
    1492   //@}
    1493  
    1494  
     1572
     1573  //@}
     1574
    14951575protected:
    14961576  /**@name Data members
     
    14981578  //@{
    14991579  /// Pointer to model
    1500   OsiClpSolverInterface * osiModel_;
     1580  OsiClpSolverInterface *osiModel_;
    15011581  /** Where from
    15021582      0 dual (resolve)
     
    15231603//#############################################################################
    15241604/** A function that tests the methods in the OsiClpSolverInterface class. */
    1525 void OsiClpSolverInterfaceUnitTest(const std::string & mpsDir, const std::string & netlibDir);
     1605void OsiClpSolverInterfaceUnitTest(const std::string &mpsDir, const std::string &netlibDir);
    15261606#endif
     1607
     1608/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     1609*/
Note: See TracChangeset for help on using the changeset viewer.