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/AbcSimplex.hpp

    r2070 r2385  
    5151*/
    5252#define PAN
    53 #if ABC_NORMAL_DEBUG>0
     53#if ABC_NORMAL_DEBUG > 0
    5454#define PRINT_PAN 1
    5555#endif
    5656#define TRY_ABC_GUS
    5757#define HEAVY_PERTURBATION 57
    58 #if ABC_PARALLEL==1
     58#if ABC_PARALLEL == 1
    5959// Use pthreads
    6060#include <pthread.h>
    6161#endif
    6262class AbcSimplex : public ClpSimplex {
    63   friend void AbcSimplexUnitTest(const std::string & mpsDir);
    64  
     63  friend void AbcSimplexUnitTest(const std::string &mpsDir);
     64
    6565public:
    6666  /** enums for status of various sorts.
     
    8787    bothFake = 0x03
    8888  };
    89  
     89
    9090  /**@name Constructors and destructor and copy */
    9191  //@{
    9292  /// Default constructor
    93   AbcSimplex (bool emptyMessages = false  );
    94  
     93  AbcSimplex(bool emptyMessages = false);
     94
    9595  /** Copy constructor.
    9696  */
    97   AbcSimplex(const AbcSimplex & rhs);
     97  AbcSimplex(const AbcSimplex &rhs);
    9898  /** Copy constructor from model.
    9999  */
    100   AbcSimplex(const ClpSimplex & rhs);
     100  AbcSimplex(const ClpSimplex &rhs);
    101101  /** Subproblem constructor.  A subset of whole model is created from the
    102102      row and column lists given.  The new order is given by list order and
     
    105105      in this case duplicates are not allowed (also see getbackSolution)
    106106  */
    107   AbcSimplex (const ClpSimplex * wholeModel,
    108               int numberRows, const int * whichRows,
    109               int numberColumns, const int * whichColumns,
    110               bool dropNames = true, bool dropIntegers = true,
    111               bool fixOthers = false);
     107  AbcSimplex(const ClpSimplex *wholeModel,
     108    int numberRows, const int *whichRows,
     109    int numberColumns, const int *whichColumns,
     110    bool dropNames = true, bool dropIntegers = true,
     111    bool fixOthers = false);
    112112  /** Subproblem constructor.  A subset of whole model is created from the
    113113      row and column lists given.  The new order is given by list order and
     
    116116      in this case duplicates are not allowed (also see getbackSolution)
    117117  */
    118   AbcSimplex (const AbcSimplex * wholeModel,
    119               int numberRows, const int * whichRows,
    120               int numberColumns, const int * whichColumns,
    121               bool dropNames = true, bool dropIntegers = true,
    122               bool fixOthers = false);
     118  AbcSimplex(const AbcSimplex *wholeModel,
     119    int numberRows, const int *whichRows,
     120    int numberColumns, const int *whichColumns,
     121    bool dropNames = true, bool dropIntegers = true,
     122    bool fixOthers = false);
    123123  /** This constructor modifies original AbcSimplex and stores
    124124      original stuff in created AbcSimplex.  It is only to be used in
    125125      conjunction with originalModel */
    126   AbcSimplex (AbcSimplex * wholeModel,
    127               int numberColumns, const int * whichColumns);
     126  AbcSimplex(AbcSimplex *wholeModel,
     127    int numberColumns, const int *whichColumns);
    128128  /** This copies back stuff from miniModel and then deletes miniModel.
    129129      Only to be used with mini constructor */
    130   void originalModel(AbcSimplex * miniModel);
     130  void originalModel(AbcSimplex *miniModel);
    131131  /** This constructor copies from ClpSimplex */
    132   AbcSimplex (const ClpSimplex * clpSimplex);
     132  AbcSimplex(const ClpSimplex *clpSimplex);
    133133  /// Put back solution into ClpSimplex
    134   void putBackSolution(ClpSimplex * simplex);
     134  void putBackSolution(ClpSimplex *simplex);
    135135  /** Array persistence flag
    136136      If 0 then as now (delete/new)
     
    144144  void deleteBaseModel();
    145145  /// See if we have base model
    146   inline AbcSimplex *  baseModel() const {
     146  inline AbcSimplex *baseModel() const
     147  {
    147148    return abcBaseModel_;
    148149  }
     
    150151      If model NULL use internal copy
    151152  */
    152   void setToBaseModel(AbcSimplex * model = NULL);
     153  void setToBaseModel(AbcSimplex *model = NULL);
    153154  /// Assignment operator. This copies the data
    154   AbcSimplex & operator=(const AbcSimplex & rhs);
     155  AbcSimplex &operator=(const AbcSimplex &rhs);
    155156  /// Destructor
    156   ~AbcSimplex (  );
     157  ~AbcSimplex();
    157158  //@}
    158  
     159
    159160  /**@name Functions most useful to user */
    160161  //@{
     
    168169  int doAbcPrimal(int ifValuesPass);
    169170  /// Returns a basis (to be deleted by user)
    170   CoinWarmStartBasis * getBasis() const;
     171  CoinWarmStartBasis *getBasis() const;
    171172  /// Passes in factorization
    172   void setFactorization( AbcSimplexFactorization & factorization);
     173  void setFactorization(AbcSimplexFactorization &factorization);
    173174  /// Swaps factorization
    174   AbcSimplexFactorization * swapFactorization( AbcSimplexFactorization * factorization);
     175  AbcSimplexFactorization *swapFactorization(AbcSimplexFactorization *factorization);
    175176  /// Gets clean and emptyish factorization
    176   AbcSimplexFactorization * getEmptyFactorization();
     177  AbcSimplexFactorization *getEmptyFactorization();
    177178  /** Tightens primal bounds to make dual faster.  Unless
    178179      fixed or doTight>10, bounds are slightly looser than they could be.
     
    186187  int tightenPrimalBounds();
    187188  /// Sets row pivot choice algorithm in dual
    188   void setDualRowPivotAlgorithm(AbcDualRowPivot & choice);
     189  void setDualRowPivotAlgorithm(AbcDualRowPivot &choice);
    189190  /// Sets column pivot choice algorithm in primal
    190   void setPrimalColumnPivotAlgorithm(AbcPrimalColumnPivot & choice);
     191  void setPrimalColumnPivotAlgorithm(AbcPrimalColumnPivot &choice);
    191192  //@}
    192193  /// If user left factorization frequency then compute
    193194  void defaultFactorizationFrequency();
    194195  //@}
    195  
     196
    196197  /**@name most useful gets and sets */
    197198  //@{
    198199  /// factorization
    199   inline AbcSimplexFactorization * factorization() const {
    200     return reinterpret_cast<AbcSimplexFactorization *>(abcFactorization_);
     200  inline AbcSimplexFactorization *factorization() const
     201  {
     202    return reinterpret_cast< AbcSimplexFactorization * >(abcFactorization_);
    201203  }
    202204#ifdef EARLY_FACTORIZE
    203205  /// Early factorization
    204   inline AbcSimplexFactorization * earlyFactorization() const {
    205     return reinterpret_cast<AbcSimplexFactorization *>(abcEarlyFactorization_);
     206  inline AbcSimplexFactorization *earlyFactorization() const
     207  {
     208    return reinterpret_cast< AbcSimplexFactorization * >(abcEarlyFactorization_);
    206209  }
    207210#endif
     
    211214  /// Maximum rows
    212215  inline int maximumAbcNumberRows() const
    213   { return maximumAbcNumberRows_;}
     216  {
     217    return maximumAbcNumberRows_;
     218  }
    214219  /// Maximum Total
    215220  inline int maximumNumberTotal() const
    216   { return maximumNumberTotal_;}
     221  {
     222    return maximumNumberTotal_;
     223  }
    217224  inline int maximumTotal() const
    218   { return maximumNumberTotal_;}
     225  {
     226    return maximumNumberTotal_;
     227  }
    219228  /// Return true if the objective limit test can be relied upon
    220   bool isObjectiveLimitTestValid() const ;
     229  bool isObjectiveLimitTestValid() const;
    221230  /// Number of variables (includes spare rows)
    222231  inline int numberTotal() const
    223   { return numberTotal_;}
     232  {
     233    return numberTotal_;
     234  }
    224235  /// Number of variables without fixed to zero (includes spare rows)
    225236  inline int numberTotalWithoutFixed() const
    226   { return numberTotalWithoutFixed_;}
     237  {
     238    return numberTotalWithoutFixed_;
     239  }
    227240  /// Useful arrays (0,1,2,3,4,5,6,7)
    228   inline CoinPartitionedVector * usefulArray(int index) {
    229     return & usefulArray_[index];
    230   }
    231   inline CoinPartitionedVector * usefulArray(int index) const {
    232     return const_cast<CoinPartitionedVector *>(&usefulArray_[index]);
     241  inline CoinPartitionedVector *usefulArray(int index)
     242  {
     243    return &usefulArray_[index];
     244  }
     245  inline CoinPartitionedVector *usefulArray(int index) const
     246  {
     247    return const_cast< CoinPartitionedVector * >(&usefulArray_[index]);
    233248  }
    234249  //@}
    235  
     250
    236251  /******************** End of most useful part **************/
    237252  /**@name Functions less likely to be useful to casual user */
     
    240255      primal and dual solutions.  Uses current problem arrays for
    241256      bounds.  Returns feasibility states */
    242   int getSolution ();
     257  int getSolution();
    243258  /// Sets objectiveValue_ from rawObjectiveValue_
    244259  void setClpSimplexObjectiveValue();
     
    248263      type 3 - as 2 but crash
    249264  */
    250   void setupDualValuesPass(const double * fakeDuals,
    251                            const double * fakePrimals,
    252                            int type);
     265  void setupDualValuesPass(const double *fakeDuals,
     266    const double *fakePrimals,
     267    int type);
    253268  /// Gets objective value with all offsets but as for minimization
    254269  inline double minimizationObjectiveValue() const
    255   { return objectiveValue_-dblParam_[ClpObjOffset];}
     270  {
     271    return objectiveValue_ - dblParam_[ClpObjOffset];
     272  }
    256273  /// Current dualTolerance (will end up as dualTolerance_)
    257274  inline double currentDualTolerance() const
    258   { return currentDualTolerance_;}
    259   inline void setCurrentDualTolerance(double value) {
     275  {
     276    return currentDualTolerance_;
     277  }
     278  inline void setCurrentDualTolerance(double value)
     279  {
    260280    currentDualTolerance_ = value;
    261281  }
    262282  /// Return pointer to details of costs
    263   inline AbcNonLinearCost * abcNonLinearCost() const {
     283  inline AbcNonLinearCost *abcNonLinearCost() const
     284  {
    264285    return abcNonLinearCost_;
    265286  }
    266287  /// Perturbation (fixed) - is just scaled random numbers
    267   double * perturbationSaved() const
    268   { return perturbationSaved_;}
     288  double *perturbationSaved() const
     289  {
     290    return perturbationSaved_;
     291  }
    269292  /// Acceptable pivot for this iteration
    270293  inline double acceptablePivot() const
    271   { return acceptablePivot_;}
     294  {
     295    return acceptablePivot_;
     296  }
    272297  /// Set to 1 if no free or super basic
    273298  inline int ordinaryVariables() const
    274   { return ordinaryVariables_;}
     299  {
     300    return ordinaryVariables_;
     301  }
    275302  /// Number of ordinary (lo/up) in tableau row
    276303  inline int numberOrdinary() const
    277   { return numberOrdinary_;}
     304  {
     305    return numberOrdinary_;
     306  }
    278307  /// Set number of ordinary (lo/up) in tableau row
    279308  inline void setNumberOrdinary(int number)
    280   { numberOrdinary_=number;}
     309  {
     310    numberOrdinary_ = number;
     311  }
    281312  /// Current dualBound (will end up as dualBound_)
    282313  inline double currentDualBound() const
    283   { return currentDualBound_;}
     314  {
     315    return currentDualBound_;
     316  }
    284317  /// dual row pivot choice
    285   inline AbcDualRowPivot * dualRowPivot() const {
     318  inline AbcDualRowPivot *dualRowPivot() const
     319  {
    286320    return abcDualRowPivot_;
    287321  }
    288322  /// primal column pivot choice
    289   inline AbcPrimalColumnPivot * primalColumnPivot() const {
     323  inline AbcPrimalColumnPivot *primalColumnPivot() const
     324  {
    290325    return abcPrimalColumnPivot_;
    291326  }
    292327  /// Abc Matrix
    293   inline AbcMatrix * abcMatrix() const     {
     328  inline AbcMatrix *abcMatrix() const
     329  {
    294330    return abcMatrix_;
    295331  }
     
    325361  void permuteOut(int whatsWanted);
    326362  /// Save data
    327   ClpDataSave saveData() ;
     363  ClpDataSave saveData();
    328364  /// Restore data
    329365  void restoreData(ClpDataSave saved);
    330366  /// Clean up status - make sure no superbasic etc
    331   void cleanStatus(bool valuesPass=false);
     367  void cleanStatus(bool valuesPass = false);
    332368  /** Computes duals from scratch. If givenDjs then
    333369      allows for nonzero basic djs.  Returns number of refinements  */
    334   int computeDuals(double * givenDjs, CoinIndexedVector * array1, CoinIndexedVector * array2);
     370  int computeDuals(double *givenDjs, CoinIndexedVector *array1, CoinIndexedVector *array2);
    335371  /// Computes primals from scratch.  Returns number of refinements
    336   int computePrimals (CoinIndexedVector * array1, CoinIndexedVector * array2);
     372  int computePrimals(CoinIndexedVector *array1, CoinIndexedVector *array2);
    337373  /// Computes nonbasic cost and total cost
    338   void computeObjective ();
     374  void computeObjective();
    339375  /// set multiple sequence in
    340376  void setMultipleSequenceIn(int sequenceIn[4]);
     
    343379     Uses sequenceIn_
    344380  */
    345   inline void unpack(CoinIndexedVector & rowArray) const
    346   {unpack(rowArray,sequenceIn_);}
     381  inline void unpack(CoinIndexedVector &rowArray) const
     382  {
     383    unpack(rowArray, sequenceIn_);
     384  }
    347385  /**
    348386     Unpacks one column of the matrix into indexed array
    349387  */
    350   void unpack(CoinIndexedVector & rowArray, int sequence) const;
     388  void unpack(CoinIndexedVector &rowArray, int sequence) const;
    351389  /**
    352390     This does basis housekeeping and does values for in/out variables.
     
    369407  /// Computes solutions - 1 do duals, 2 do primals, 3 both (returns number of refinements)
    370408  int gutsOfPrimalSolution(int type);
    371   /// Saves good status etc 
     409  /// Saves good status etc
    372410  void saveGoodStatus();
    373411  /// Restores previous good status and says trouble
     
    377415  /// After modifying first copy refreshes second copy and marks as updated
    378416  void refreshCosts();
    379   void refreshLower(unsigned int type=~(ROW_LOWER_SAME|COLUMN_UPPER_SAME));
    380   void refreshUpper(unsigned int type=~(ROW_LOWER_SAME|COLUMN_LOWER_SAME));
     417  void refreshLower(unsigned int type = ~(ROW_LOWER_SAME | COLUMN_UPPER_SAME));
     418  void refreshUpper(unsigned int type = ~(ROW_LOWER_SAME | COLUMN_LOWER_SAME));
    381419  /// Sets up all extra pointers
    382   void setupPointers(int maxRows,int maxColumns);
     420  void setupPointers(int maxRows, int maxColumns);
    383421  /// Copies all saved versions to working versions and may do something for perturbation
    384   void copyFromSaved(int type=31);
     422  void copyFromSaved(int type = 31);
    385423  /// fills in perturbationSaved_ from start with 0.5+random
    386424  void fillPerturbation(int start, int number);
    387425  /// For debug - prints summary of arrays which are out of kilter
    388   void checkArrays(int ignoreEmpty=0) const;
     426  void checkArrays(int ignoreEmpty = 0) const;
    389427  /// For debug - summarizes dj situation (1 recomputes duals first, 2 checks duals as well)
    390   void checkDjs(int type=1) const;
     428  void checkDjs(int type = 1) const;
    391429  /// For debug - checks solutionBasic
    392430  void checkSolutionBasic() const;
    393431  /// For debug - moves solution back to external and computes stuff (always checks djs)
    394432  void checkMoveBack(bool checkDuals);
     433
    395434public:
    396435  /** For advanced use.  When doing iterative solves things can get
     
    405444  */
    406445  void setValuesPassAction(double incomingInfeasibility,
    407                            double allowedInfeasibility);
     446    double allowedInfeasibility);
    408447  /** Get a clean factorization - i.e. throw out singularities
    409448      may do more later */
    410449  int cleanFactorization(int ifValuesPass);
    411450  /// Move status and solution to ClpSimplex
    412   void moveStatusToClp(ClpSimplex * clpModel);
     451  void moveStatusToClp(ClpSimplex *clpModel);
    413452  /// Move status and solution from ClpSimplex
    414   void moveStatusFromClp(ClpSimplex * clpModel);
     453  void moveStatusFromClp(ClpSimplex *clpModel);
    415454  //@}
    416455  /**@name most useful gets and sets */
    417456  //@{
    418457public:
    419 
    420458  /// Objective value
    421   inline double clpObjectiveValue() const {
    422   return (objectiveValue_+objectiveOffset_-bestPossibleImprovement_)*optimizationDirection_ - dblParam_[ClpObjOffset];
     459  inline double clpObjectiveValue() const
     460  {
     461    return (objectiveValue_ + objectiveOffset_ - bestPossibleImprovement_) * optimizationDirection_ - dblParam_[ClpObjOffset];
    423462  }
    424463  /** Basic variables pivoting on which rows
    425464      may be same as toExternal but may be as at invert */
    426   inline int * pivotVariable() const {
     465  inline int *pivotVariable() const
     466  {
    427467    return abcPivotVariable_;
    428468  }
    429469  /// State of problem
    430470  inline int stateOfProblem() const
    431   { return stateOfProblem_;}
     471  {
     472    return stateOfProblem_;
     473  }
    432474  /// State of problem
    433475  inline void setStateOfProblem(int value)
    434   { stateOfProblem_=value;}
     476  {
     477    stateOfProblem_ = value;
     478  }
    435479  /// Points from external to internal
    436480  //inline int * fromExternal() const
     
    441485  /** Scale from primal external to internal (in external order) Or other way for dual
    442486   */
    443   inline double * scaleFromExternal() const
    444   {return scaleFromExternal_;}
     487  inline double *scaleFromExternal() const
     488  {
     489    return scaleFromExternal_;
     490  }
    445491  /** Scale from primal internal to external (in external order) Or other way for dual
    446492   */
    447   inline double * scaleToExternal() const
    448   {return scaleToExternal_;}
     493  inline double *scaleToExternal() const
     494  {
     495    return scaleToExternal_;
     496  }
    449497  /// corresponds to rowScale etc
    450   inline double * rowScale2() const
    451   {return rowUseScale_;}
    452   inline double * inverseRowScale2() const
    453   {return inverseRowUseScale_;}
    454   inline double * inverseColumnScale2() const
    455   {return inverseColumnUseScale_;}
    456   inline double * columnScale2() const
    457   {return columnUseScale_;}
     498  inline double *rowScale2() const
     499  {
     500    return rowUseScale_;
     501  }
     502  inline double *inverseRowScale2() const
     503  {
     504    return inverseRowUseScale_;
     505  }
     506  inline double *inverseColumnScale2() const
     507  {
     508    return inverseColumnUseScale_;
     509  }
     510  inline double *columnScale2() const
     511  {
     512    return columnUseScale_;
     513  }
    458514  inline int arrayForDualColumn() const
    459   {return arrayForDualColumn_;}
     515  {
     516    return arrayForDualColumn_;
     517  }
    460518  /// upper theta from dual column
    461519  inline double upperTheta() const
    462   {return upperTheta_;}
     520  {
     521    return upperTheta_;
     522  }
    463523  inline int arrayForReplaceColumn() const
    464   { return arrayForReplaceColumn_;}
     524  {
     525    return arrayForReplaceColumn_;
     526  }
    465527  inline int arrayForFlipBounds() const
    466   { return arrayForFlipBounds_;}
     528  {
     529    return arrayForFlipBounds_;
     530  }
    467531  inline int arrayForFlipRhs() const
    468   { return arrayForFlipRhs_;}
     532  {
     533    return arrayForFlipRhs_;
     534  }
    469535  inline int arrayForBtran() const
    470   { return arrayForBtran_;}
     536  {
     537    return arrayForBtran_;
     538  }
    471539  inline int arrayForFtran() const
    472   { return arrayForFtran_;}
     540  {
     541    return arrayForFtran_;
     542  }
    473543  inline int arrayForTableauRow() const
    474   { return arrayForTableauRow_;}
     544  {
     545    return arrayForTableauRow_;
     546  }
    475547  /// value of incoming variable (in Dual)
    476548  double valueIncomingDual() const;
    477549  /// Get pointer to array[getNumCols()] of primal solution vector
    478   const double * getColSolution() const;
    479  
     550  const double *getColSolution() const;
     551
    480552  /// Get pointer to array[getNumRows()] of dual prices
    481   const double * getRowPrice() const;
    482  
     553  const double *getRowPrice() const;
     554
    483555  /// Get a pointer to array[getNumCols()] of reduced costs
    484   const double * getReducedCost() const;
    485  
     556  const double *getReducedCost() const;
     557
    486558  /** Get pointer to array[getNumRows()] of row activity levels (constraint
    487559      matrix times the solution vector */
    488   const double * getRowActivity() const;
     560  const double *getRowActivity() const;
    489561  //@}
    490  
     562
    491563  /**@name protected methods */
    492564  //@{
     
    494566      Computation of solutions may be overriden by given pi and solution
    495567  */
    496   int gutsOfSolution ( double * givenDuals,
    497                        const double * givenPrimals,
    498                        bool valuesPass = false);
     568  int gutsOfSolution(double *givenDuals,
     569    const double *givenPrimals,
     570    bool valuesPass = false);
    499571  /// Does most of deletion for arrays etc(0 just null arrays, 1 delete first)
    500572  void gutsOfDelete(int type);
    501573  /// Does most of copying
    502   void gutsOfCopy(const AbcSimplex & rhs);
     574  void gutsOfCopy(const AbcSimplex &rhs);
    503575  /// Initializes arrays
    504   void gutsOfInitialize(int numberRows,int numberColumns,bool doMore);
     576  void gutsOfInitialize(int numberRows, int numberColumns, bool doMore);
    505577  /// resizes arrays
    506   void gutsOfResize(int numberRows,int numberColumns);
     578  void gutsOfResize(int numberRows, int numberColumns);
    507579  /** Translates ClpModel to AbcSimplex
    508580      See DO_ bits in stateOfProblem_ for type e.g. DO_BASIS_AND_ORDER
     
    510582  void translate(int type);
    511583  /// Moves basic stuff to basic area
    512   void moveToBasic(int which=15);
     584  void moveToBasic(int which = 15);
    513585  //@}
    514586public:
     
    516588  //@{
    517589  /// Return region
    518   inline double * solutionRegion() const {
     590  inline double *solutionRegion() const
     591  {
    519592    return abcSolution_;
    520593  }
    521   inline double * djRegion() const {
     594  inline double *djRegion() const
     595  {
    522596    return abcDj_;
    523597  }
    524   inline double * lowerRegion() const {
     598  inline double *lowerRegion() const
     599  {
    525600    return abcLower_;
    526601  }
    527   inline double * upperRegion() const {
     602  inline double *upperRegion() const
     603  {
    528604    return abcUpper_;
    529605  }
    530   inline double * costRegion() const {
     606  inline double *costRegion() const
     607  {
    531608    return abcCost_;
    532609  }
    533610  /// Return region
    534   inline double * solutionRegion(int which) const {
    535     return abcSolution_+which*maximumAbcNumberRows_;
    536   }
    537   inline double * djRegion(int which) const {
    538     return abcDj_+which*maximumAbcNumberRows_;
    539   }
    540   inline double * lowerRegion(int which) const {
    541     return abcLower_+which*maximumAbcNumberRows_;
    542   }
    543   inline double * upperRegion(int which) const {
    544     return abcUpper_+which*maximumAbcNumberRows_;
    545   }
    546   inline double * costRegion(int which) const {
    547     return abcCost_+which*maximumAbcNumberRows_;
     611  inline double *solutionRegion(int which) const
     612  {
     613    return abcSolution_ + which * maximumAbcNumberRows_;
     614  }
     615  inline double *djRegion(int which) const
     616  {
     617    return abcDj_ + which * maximumAbcNumberRows_;
     618  }
     619  inline double *lowerRegion(int which) const
     620  {
     621    return abcLower_ + which * maximumAbcNumberRows_;
     622  }
     623  inline double *upperRegion(int which) const
     624  {
     625    return abcUpper_ + which * maximumAbcNumberRows_;
     626  }
     627  inline double *costRegion(int which) const
     628  {
     629    return abcCost_ + which * maximumAbcNumberRows_;
    548630  }
    549631  /// Return region
    550   inline double * solutionBasic() const {
     632  inline double *solutionBasic() const
     633  {
    551634    return solutionBasic_;
    552635  }
    553   inline double * djBasic() const {
     636  inline double *djBasic() const
     637  {
    554638    return djBasic_;
    555639  }
    556   inline double * lowerBasic() const {
     640  inline double *lowerBasic() const
     641  {
    557642    return lowerBasic_;
    558643  }
    559   inline double * upperBasic() const {
     644  inline double *upperBasic() const
     645  {
    560646    return upperBasic_;
    561647  }
    562   inline double * costBasic() const {
     648  inline double *costBasic() const
     649  {
    563650    return costBasic_;
    564651  }
    565652  /// Perturbation
    566   inline double * abcPerturbation() const
    567   { return abcPerturbation_;}
     653  inline double *abcPerturbation() const
     654  {
     655    return abcPerturbation_;
     656  }
    568657  /// Fake djs
    569   inline double * fakeDjs() const
    570   { return djSaved_;}
    571   inline unsigned char * internalStatus() const
    572   { return internalStatus_;}
    573   inline AbcSimplex::Status getInternalStatus(int sequence) const {
    574     return static_cast<Status> (internalStatus_[sequence] & 7);
    575   }
    576   inline AbcSimplex::Status getInternalColumnStatus(int sequence) const {
    577     return static_cast<Status> (internalStatus_[sequence+maximumAbcNumberRows_] & 7);
    578   }
    579   inline void setInternalStatus(int sequence, AbcSimplex::Status newstatus) {
    580     unsigned char & st_byte = internalStatus_[sequence];
    581     st_byte = static_cast<unsigned char>(st_byte & ~7);
    582     st_byte = static_cast<unsigned char>(st_byte | newstatus);
    583   }
    584   inline void setInternalColumnStatus(int sequence, AbcSimplex::Status newstatus) {
    585     unsigned char & st_byte = internalStatus_[sequence+maximumAbcNumberRows_];
    586     st_byte = static_cast<unsigned char>(st_byte & ~7);
    587     st_byte = static_cast<unsigned char>(st_byte | newstatus);
     658  inline double *fakeDjs() const
     659  {
     660    return djSaved_;
     661  }
     662  inline unsigned char *internalStatus() const
     663  {
     664    return internalStatus_;
     665  }
     666  inline AbcSimplex::Status getInternalStatus(int sequence) const
     667  {
     668    return static_cast< Status >(internalStatus_[sequence] & 7);
     669  }
     670  inline AbcSimplex::Status getInternalColumnStatus(int sequence) const
     671  {
     672    return static_cast< Status >(internalStatus_[sequence + maximumAbcNumberRows_] & 7);
     673  }
     674  inline void setInternalStatus(int sequence, AbcSimplex::Status newstatus)
     675  {
     676    unsigned char &st_byte = internalStatus_[sequence];
     677    st_byte = static_cast< unsigned char >(st_byte & ~7);
     678    st_byte = static_cast< unsigned char >(st_byte | newstatus);
     679  }
     680  inline void setInternalColumnStatus(int sequence, AbcSimplex::Status newstatus)
     681  {
     682    unsigned char &st_byte = internalStatus_[sequence + maximumAbcNumberRows_];
     683    st_byte = static_cast< unsigned char >(st_byte & ~7);
     684    st_byte = static_cast< unsigned char >(st_byte | newstatus);
    588685  }
    589686  /** Normally the first factorization does sparse coding because
     
    592689  */
    593690  void setInitialDenseFactorization(bool onOff);
    594   bool  initialDenseFactorization() const;
     691  bool initialDenseFactorization() const;
    595692  /** Return sequence In or Out */
    596   inline int sequenceIn() const {
     693  inline int sequenceIn() const
     694  {
    597695    return sequenceIn_;
    598696  }
    599   inline int sequenceOut() const {
     697  inline int sequenceOut() const
     698  {
    600699    return sequenceOut_;
    601700  }
    602701  /** Set sequenceIn or Out */
    603   inline void  setSequenceIn(int sequence) {
     702  inline void setSequenceIn(int sequence)
     703  {
    604704    sequenceIn_ = sequence;
    605705  }
    606   inline void  setSequenceOut(int sequence) {
     706  inline void setSequenceOut(int sequence)
     707  {
    607708    sequenceOut_ = sequence;
    608709  }
     
    624725#endif
    625726  /// Returns 1 if sequence indicates column
    626   inline int isColumn(int sequence) const {
     727  inline int isColumn(int sequence) const
     728  {
    627729    return sequence >= maximumAbcNumberRows_ ? 1 : 0;
    628730  }
    629731  /// Returns sequence number within section
    630   inline int sequenceWithin(int sequence) const {
     732  inline int sequenceWithin(int sequence) const
     733  {
    631734    return sequence < maximumAbcNumberRows_ ? sequence : sequence - maximumAbcNumberRows_;
    632735  }
    633736  /// Current/last pivot row (set after END of choosing pivot row in dual)
    634737  inline int lastPivotRow() const
    635   { return lastPivotRow_;}
     738  {
     739    return lastPivotRow_;
     740  }
    636741  /// First Free_
    637742  inline int firstFree() const
    638   { return firstFree_;}
     743  {
     744    return firstFree_;
     745  }
    639746  /// Last firstFree_
    640747  inline int lastFirstFree() const
    641   { return lastFirstFree_;}
     748  {
     749    return lastFirstFree_;
     750  }
    642751  /// Free chosen vector
    643752  inline int freeSequenceIn() const
    644   { return freeSequenceIn_;}
     753  {
     754    return freeSequenceIn_;
     755  }
    645756  /// Acceptable pivot for this iteration
    646757  inline double currentAcceptablePivot() const
    647   { return currentAcceptablePivot_;}
     758  {
     759    return currentAcceptablePivot_;
     760  }
    648761#ifdef PAN
    649762  /** Returns
     
    653766      -2 if wasn't fake
    654767   */
    655   inline int fakeSuperBasic(int iSequence) {
    656     if ((internalStatus_[iSequence]&7)==4)
     768  inline int fakeSuperBasic(int iSequence)
     769  {
     770    if ((internalStatus_[iSequence] & 7) == 4)
    657771      return 0; // free
    658     if ((internalStatus_[iSequence]&7)!=5)
     772    if ((internalStatus_[iSequence] & 7) != 5)
    659773      return -2;
    660     double value=abcSolution_[iSequence];
    661     if (value<abcLower_[iSequence]+primalTolerance_) {
    662       if(abcDj_[iSequence]>=-currentDualTolerance_) {
    663         setInternalStatus(iSequence,atLowerBound);
    664 #if PRINT_PAN>1
    665         printf("Pansetting %d to lb\n",iSequence);
    666 #endif
    667         return -1;
     774    double value = abcSolution_[iSequence];
     775    if (value < abcLower_[iSequence] + primalTolerance_) {
     776      if (abcDj_[iSequence] >= -currentDualTolerance_) {
     777        setInternalStatus(iSequence, atLowerBound);
     778#if PRINT_PAN > 1
     779        printf("Pansetting %d to lb\n", iSequence);
     780#endif
     781        return -1;
    668782      } else {
    669         return 1;
     783        return 1;
    670784      }
    671     } else if (value>abcUpper_[iSequence]-primalTolerance_) {
    672       if (abcDj_[iSequence]<=currentDualTolerance_) {
    673         setInternalStatus(iSequence,atUpperBound);
    674 #if PRINT_PAN>1
    675         printf("Pansetting %d to ub\n",iSequence);
    676 #endif
    677         return -1;
     785    } else if (value > abcUpper_[iSequence] - primalTolerance_) {
     786      if (abcDj_[iSequence] <= currentDualTolerance_) {
     787        setInternalStatus(iSequence, atUpperBound);
     788#if PRINT_PAN > 1
     789        printf("Pansetting %d to ub\n", iSequence);
     790#endif
     791        return -1;
    678792      } else {
    679         return 1;
     793        return 1;
    680794      }
    681795    } else {
     
    685799#endif
    686800  /// Return row or column values
    687   inline double solution(int sequence) {
     801  inline double solution(int sequence)
     802  {
    688803    return abcSolution_[sequence];
    689804  }
    690805  /// Return address of row or column values
    691   inline double & solutionAddress(int sequence) {
     806  inline double &solutionAddress(int sequence)
     807  {
    692808    return abcSolution_[sequence];
    693809  }
    694   inline double reducedCost(int sequence) {
     810  inline double reducedCost(int sequence)
     811  {
    695812    return abcDj_[sequence];
    696813  }
    697   inline double & reducedCostAddress(int sequence) {
     814  inline double &reducedCostAddress(int sequence)
     815  {
    698816    return abcDj_[sequence];
    699817  }
    700   inline double lower(int sequence) {
     818  inline double lower(int sequence)
     819  {
    701820    return abcLower_[sequence];
    702821  }
    703822  /// Return address of row or column lower bound
    704   inline double & lowerAddress(int sequence) {
     823  inline double &lowerAddress(int sequence)
     824  {
    705825    return abcLower_[sequence];
    706826  }
    707   inline double upper(int sequence) {
     827  inline double upper(int sequence)
     828  {
    708829    return abcUpper_[sequence];
    709830  }
    710831  /// Return address of row or column upper bound
    711   inline double & upperAddress(int sequence) {
     832  inline double &upperAddress(int sequence)
     833  {
    712834    return abcUpper_[sequence];
    713835  }
    714   inline double cost(int sequence) {
     836  inline double cost(int sequence)
     837  {
    715838    return abcCost_[sequence];
    716839  }
    717840  /// Return address of row or column cost
    718   inline double & costAddress(int sequence) {
     841  inline double &costAddress(int sequence)
     842  {
    719843    return abcCost_[sequence];
    720844  }
    721845  /// Return original lower bound
    722   inline double originalLower(int iSequence) const {
    723     if (iSequence < numberColumns_) return columnLower_[iSequence];
     846  inline double originalLower(int iSequence) const
     847  {
     848    if (iSequence < numberColumns_)
     849      return columnLower_[iSequence];
    724850    else
    725       return rowLower_[iSequence-numberColumns_];
     851      return rowLower_[iSequence - numberColumns_];
    726852  }
    727853  /// Return original lower bound
    728   inline double originalUpper(int iSequence) const {
    729     if (iSequence < numberColumns_) return columnUpper_[iSequence];
     854  inline double originalUpper(int iSequence) const
     855  {
     856    if (iSequence < numberColumns_)
     857      return columnUpper_[iSequence];
    730858    else
    731       return rowUpper_[iSequence-numberColumns_];
     859      return rowUpper_[iSequence - numberColumns_];
    732860  }
    733861  /// For dealing with all issues of cycling etc
    734   inline AbcSimplexProgress * abcProgress()
    735   { return &abcProgress_;}
     862  inline AbcSimplexProgress *abcProgress()
     863  {
     864    return &abcProgress_;
     865  }
    736866#ifdef ABC_SPRINT
    737867  /// Overwrite to create sub problem (just internal arrays) - save full stuff
    738   AbcSimplex * createSubProblem(int numberColumns,const int * whichColumn);
     868  AbcSimplex *createSubProblem(int numberColumns, const int *whichColumn);
    739869  /// Restore stuff from sub problem (and delete sub problem)
    740   void restoreFromSubProblem(AbcSimplex * fullProblem, const int * whichColumn);
     870  void restoreFromSubProblem(AbcSimplex *fullProblem, const int *whichColumn);
    741871#endif
    742872public:
     
    744874      when no possibility of going parallel */
    745875  inline void clearArraysPublic(int which)
    746   { clearArrays(which);}
     876  {
     877    clearArrays(which);
     878  }
    747879  /** Returns first available empty array (and sets flag)
    748880      when no possibility of going parallel */
    749881  inline int getAvailableArrayPublic() const
    750   { return getAvailableArray();}
     882  {
     883    return getAvailableArray();
     884  }
    751885#if ABC_PARALLEL
    752886  /// get parallel mode
    753887  inline int parallelMode() const
    754   { return parallelMode_;}
     888  {
     889    return parallelMode_;
     890  }
    755891  /// set parallel mode
    756892  inline void setParallelMode(int value)
    757   { parallelMode_=value;}
     893  {
     894    parallelMode_ = value;
     895  }
    758896  /// Number of cpus
    759897  inline int numberCpus() const
    760   { return parallelMode_+1;}
    761 #if ABC_PARALLEL==1
     898  {
     899    return parallelMode_ + 1;
     900  }
     901#if ABC_PARALLEL == 1
    762902  /// set stop start
    763903  inline void setStopStart(int value)
    764   { stopStart_=value;}
     904  {
     905    stopStart_ = value;
     906  }
    765907#endif
    766908#endif
     
    769911  void clearArrays(int which);
    770912  /// Clears an array and says available
    771   void clearArrays(CoinPartitionedVector * which);
     913  void clearArrays(CoinPartitionedVector *which);
    772914  /// Returns first available empty array (and sets flag)
    773915  int getAvailableArray() const;
    774916  /// Say array going to be used
    775   inline void setUsedArray(int which) const
    776   {int check=1<<which;assert ((stateOfProblem_&check)==0);stateOfProblem_|=check;}
     917  inline void setUsedArray(int which) const
     918  {
     919    int check = 1 << which;
     920    assert((stateOfProblem_ & check) == 0);
     921    stateOfProblem_ |= check;
     922  }
    777923  /// Say array going available
    778924  inline void setAvailableArray(int which) const
    779   {int check=1<<which;assert ((stateOfProblem_&check)!=0);
    780     assert (!usefulArray_[which].getNumElements());stateOfProblem_&=~check;}
    781   /// Swaps primal stuff
     925  {
     926    int check = 1 << which;
     927    assert((stateOfProblem_ & check) != 0);
     928    assert(!usefulArray_[which].getNumElements());
     929    stateOfProblem_ &= ~check;
     930  }
     931  /// Swaps primal stuff
    782932  void swapPrimalStuff();
    783933  /// Swaps dual stuff
    784   void swapDualStuff(int lastSequenceOut,int lastDirectionOut);
     934  void swapDualStuff(int lastSequenceOut, int lastDirectionOut);
     935
    785936protected:
    786937  //@}
     
    788939  //@{
    789940  /// Swaps two variables and does status
    790   void swap(int pivotRow,int nonBasicPosition,Status newStatus);
    791   inline void setFakeBound(int sequence, FakeBound fakeBound) {
    792     unsigned char & st_byte = internalStatus_[sequence];
    793     st_byte = static_cast<unsigned char>(st_byte & ~24);
    794     st_byte = static_cast<unsigned char>(st_byte | (fakeBound << 3));
    795   }
    796   inline FakeBound getFakeBound(int sequence) const {
    797     return static_cast<FakeBound> ((internalStatus_[sequence] >> 3) & 3);
     941  void swap(int pivotRow, int nonBasicPosition, Status newStatus);
     942  inline void setFakeBound(int sequence, FakeBound fakeBound)
     943  {
     944    unsigned char &st_byte = internalStatus_[sequence];
     945    st_byte = static_cast< unsigned char >(st_byte & ~24);
     946    st_byte = static_cast< unsigned char >(st_byte | (fakeBound << 3));
     947  }
     948  inline FakeBound getFakeBound(int sequence) const
     949  {
     950    return static_cast< FakeBound >((internalStatus_[sequence] >> 3) & 3);
    798951  }
    799952  bool atFakeBound(int sequence) const;
    800   inline void setPivoted( int sequence) {
    801     internalStatus_[sequence] = static_cast<unsigned char>(internalStatus_[sequence] | 32);
    802   }
    803   inline void clearPivoted( int sequence) {
    804     internalStatus_[sequence] = static_cast<unsigned char>(internalStatus_[sequence] & ~32);
    805   }
    806   inline bool pivoted(int sequence) const {
     953  inline void setPivoted(int sequence)
     954  {
     955    internalStatus_[sequence] = static_cast< unsigned char >(internalStatus_[sequence] | 32);
     956  }
     957  inline void clearPivoted(int sequence)
     958  {
     959    internalStatus_[sequence] = static_cast< unsigned char >(internalStatus_[sequence] & ~32);
     960  }
     961  inline bool pivoted(int sequence) const
     962  {
    807963    return (((internalStatus_[sequence] >> 5) & 1) != 0);
    808964  }
     965
    809966public:
    810967  /// Swaps two variables
    811   void swap(int pivotRow,int nonBasicPosition);
     968  void swap(int pivotRow, int nonBasicPosition);
    812969  /// To flag a variable
    813   void setFlagged( int sequence);
    814   inline void clearFlagged( int sequence) {
    815     internalStatus_[sequence] = static_cast<unsigned char>(internalStatus_[sequence] & ~64);
    816   }
    817   inline bool flagged(int sequence) const {
     970  void setFlagged(int sequence);
     971  inline void clearFlagged(int sequence)
     972  {
     973    internalStatus_[sequence] = static_cast< unsigned char >(internalStatus_[sequence] & ~64);
     974  }
     975  inline bool flagged(int sequence) const
     976  {
    818977    return ((internalStatus_[sequence] & 64) != 0);
    819978  }
     979
    820980protected:
    821981  /// To say row active in primal pivot row choice
    822   inline void setActive( int iRow) {
    823     internalStatus_[iRow] = static_cast<unsigned char>(internalStatus_[iRow] | 128);
    824   }
    825   inline void clearActive( int iRow) {
    826     internalStatus_[iRow] = static_cast<unsigned char>(internalStatus_[iRow] & ~128);
    827   }
    828   inline bool active(int iRow) const {
     982  inline void setActive(int iRow)
     983  {
     984    internalStatus_[iRow] = static_cast< unsigned char >(internalStatus_[iRow] | 128);
     985  }
     986  inline void clearActive(int iRow)
     987  {
     988    internalStatus_[iRow] = static_cast< unsigned char >(internalStatus_[iRow] & ~128);
     989  }
     990  inline bool active(int iRow) const
     991  {
    829992    return ((internalStatus_[iRow] & 128) != 0);
    830993  }
     994
    831995public:
    832996  /** Set up status array (can be used by OsiAbc).
    833997      Also can be used to set up all slack basis */
    834   void createStatus() ;
     998  void createStatus();
    835999  /// Does sort of crash
    8361000  void crash(int type);
     
    8491013  /// Common bits of coding for dual and primal
    8501014  int startup(int ifValuesPass);
    851  
     1015
    8521016  /// Raw objective value (so always minimize in primal)
    853   inline double rawObjectiveValue() const {
     1017  inline double rawObjectiveValue() const
     1018  {
    8541019    return objectiveValue_;
    8551020  }
     
    8591024  double computeInternalObjectiveValue();
    8601025  /// Move status and solution across
    861   void moveInfo(const AbcSimplex & rhs, bool justStatus = false);
    862 #ifndef NUMBER_THREADS 
     1026  void moveInfo(const AbcSimplex &rhs, bool justStatus = false);
     1027#ifndef NUMBER_THREADS
    8631028#define NUMBER_THREADS 3
    8641029#endif
    865 #if ABC_PARALLEL==1
     1030#if ABC_PARALLEL == 1
    8661031  // For waking up thread
    867   inline pthread_mutex_t * mutexPointer(int which,int thread=0)
    868   { return mutex_+which+3*thread;}
    869   inline pthread_barrier_t * barrierPointer()
    870   { return &barrier_;}
    871   inline int whichLocked(int thread=0) const
    872   { return locked_[thread];}
    873   inline CoinThreadInfo * threadInfoPointer(int thread=0)
    874   { return threadInfo_+thread;}
     1032  inline pthread_mutex_t *mutexPointer(int which, int thread = 0)
     1033  {
     1034    return mutex_ + which + 3 * thread;
     1035  }
     1036  inline pthread_barrier_t *barrierPointer()
     1037  {
     1038    return &barrier_;
     1039  }
     1040  inline int whichLocked(int thread = 0) const
     1041  {
     1042    return locked_[thread];
     1043  }
     1044  inline CoinThreadInfo *threadInfoPointer(int thread = 0)
     1045  {
     1046    return threadInfo_ + thread;
     1047  }
    8751048  void startParallelStuff(int type);
    8761049  int stopParallelStuff(int type);
    877   /// so thread can find out which one it is 
    878   int whichThread() const; 
    879 #elif ABC_PARALLEL==2
    880   //inline CoinThreadInfo * threadInfoPointer(int thread=0) 
     1050  /// so thread can find out which one it is
     1051  int whichThread() const;
     1052#elif ABC_PARALLEL == 2
     1053  //inline CoinThreadInfo * threadInfoPointer(int thread=0)
    8811054  //{ return threadInfo_+thread;}
    8821055#endif
    8831056  //@}
    884  
     1057
    8851058  //-------------------------------------------------------------------------
    8861059  /**@name Changing bounds on variables and constraints */
    8871060  //@{
    8881061  /** Set an objective function coefficient */
    889   void setObjectiveCoefficient( int elementIndex, double elementValue );
     1062  void setObjectiveCoefficient(int elementIndex, double elementValue);
    8901063  /** Set an objective function coefficient */
    891   inline void setObjCoeff( int elementIndex, double elementValue ) {
    892     setObjectiveCoefficient( elementIndex, elementValue);
    893   }
    894  
     1064  inline void setObjCoeff(int elementIndex, double elementValue)
     1065  {
     1066    setObjectiveCoefficient(elementIndex, elementValue);
     1067  }
     1068
    8951069  /** Set a single column lower bound<br>
    8961070      Use -DBL_MAX for -infinity. */
    897   void setColumnLower( int elementIndex, double elementValue );
    898  
     1071  void setColumnLower(int elementIndex, double elementValue);
     1072
    8991073  /** Set a single column upper bound<br>
    9001074      Use DBL_MAX for infinity. */
    901   void setColumnUpper( int elementIndex, double elementValue );
    902  
     1075  void setColumnUpper(int elementIndex, double elementValue);
     1076
    9031077  /** Set a single column lower and upper bound */
    904   void setColumnBounds( int elementIndex,
    905                         double lower, double upper );
    906  
     1078  void setColumnBounds(int elementIndex,
     1079    double lower, double upper);
     1080
    9071081  /** Set the bounds on a number of columns simultaneously<br>
    9081082      The default implementation just invokes setColLower() and
     
    9131087      @param boundList the new lower/upper bound pairs for the variables
    9141088  */
    915   void setColumnSetBounds(const int* indexFirst,
    916                           const int* indexLast,
    917                           const double* boundList);
    918  
     1089  void setColumnSetBounds(const int *indexFirst,
     1090    const int *indexLast,
     1091    const double *boundList);
     1092
    9191093  /** Set a single column lower bound<br>
    9201094      Use -DBL_MAX for -infinity. */
    921   inline void setColLower( int elementIndex, double elementValue ) {
     1095  inline void setColLower(int elementIndex, double elementValue)
     1096  {
    9221097    setColumnLower(elementIndex, elementValue);
    9231098  }
    9241099  /** Set a single column upper bound<br>
    9251100      Use DBL_MAX for infinity. */
    926   inline void setColUpper( int elementIndex, double elementValue ) {
     1101  inline void setColUpper(int elementIndex, double elementValue)
     1102  {
    9271103    setColumnUpper(elementIndex, elementValue);
    9281104  }
    929  
     1105
    9301106  /** Set a single column lower and upper bound */
    931   inline void setColBounds( int elementIndex,
    932                             double newlower, double newupper ) {
     1107  inline void setColBounds(int elementIndex,
     1108    double newlower, double newupper)
     1109  {
    9331110    setColumnBounds(elementIndex, newlower, newupper);
    9341111  }
    935  
     1112
    9361113  /** Set the bounds on a number of columns simultaneously<br>
    9371114      @param indexFirst,indexLast pointers to the beginning and after the
     
    9401117      @param boundList the new lower/upper bound pairs for the variables
    9411118  */
    942   inline void setColSetBounds(const int* indexFirst,
    943                               const int* indexLast,
    944                               const double* boundList) {
     1119  inline void setColSetBounds(const int *indexFirst,
     1120    const int *indexLast,
     1121    const double *boundList)
     1122  {
    9451123    setColumnSetBounds(indexFirst, indexLast, boundList);
    9461124  }
    947  
     1125
    9481126  /** Set a single row lower bound<br>
    9491127      Use -DBL_MAX for -infinity. */
    950   void setRowLower( int elementIndex, double elementValue );
    951  
     1128  void setRowLower(int elementIndex, double elementValue);
     1129
    9521130  /** Set a single row upper bound<br>
    9531131      Use DBL_MAX for infinity. */
    954   void setRowUpper( int elementIndex, double elementValue ) ;
    955  
     1132  void setRowUpper(int elementIndex, double elementValue);
     1133
    9561134  /** Set a single row lower and upper bound */
    957   void setRowBounds( int elementIndex,
    958                      double lower, double upper ) ;
    959  
     1135  void setRowBounds(int elementIndex,
     1136    double lower, double upper);
     1137
    9601138  /** Set the bounds on a number of rows simultaneously<br>
    9611139      @param indexFirst,indexLast pointers to the beginning and after the
     
    9641142      @param boundList the new lower/upper bound pairs for the constraints
    9651143  */
    966   void setRowSetBounds(const int* indexFirst,
    967                        const int* indexLast,
    968                        const double* boundList);
     1144  void setRowSetBounds(const int *indexFirst,
     1145    const int *indexLast,
     1146    const double *boundList);
    9691147  /// Resizes rim part of model
    970   void resize (int newNumberRows, int newNumberColumns);
    971  
     1148  void resize(int newNumberRows, int newNumberColumns);
     1149
    9721150  //@}
    973  
     1151
    9741152  ////////////////// data //////////////////
    9751153protected:
    976  
    9771154  /**@name data.  Many arrays have a row part and a column part.
    9781155     There is a single array with both - columns then rows and
     
    9811158  */
    9821159  //@{
    983   /// Sum of nonbasic costs 
     1160  /// Sum of nonbasic costs
    9841161  double sumNonBasicCosts_;
    985   /// Sum of costs (raw objective value) 
     1162  /// Sum of costs (raw objective value)
    9861163  double rawObjectiveValue_;
    9871164  /// Objective offset (from offset_)
     
    10151192  double btranAlpha_;
    10161193  /// FT alpha
    1017 #ifdef ABC_LONG_FACTORIZATION 
     1194#ifdef ABC_LONG_FACTORIZATION
    10181195  long
    10191196#endif
    1020   double ftAlpha_;
     1197    double ftAlpha_;
    10211198  /// Minimum theta movement
    10221199  double minimumThetaMovement_;
    10231200  /// Initial sum of infeasibilities
    10241201  double initialSumInfeasibilities_;
     1202
    10251203public:
    10261204  /// Where we are in iteration
    10271205  int stateOfIteration_;
     1206
    10281207protected:
    10291208  /// Last firstFree_
     
    10581237  /// Start of variables at lower bound with no upper
    10591238#define startAtLowerNoOther_ maximumAbcNumberRows_
    1060   /// Start of variables at lower bound with upper 
     1239  /// Start of variables at lower bound with upper
    10611240  int startAtLowerOther_;
    10621241  /// Start of variables at upper bound with no lower
     
    11101289  /// parallel mode
    11111290  int parallelMode_;
     1291
    11121292protected:
    11131293#endif
     
    11321312  /** Scale from primal external to internal (in external order) Or other way for dual
    11331313   */
    1134   double * scaleFromExternal_;
     1314  double *scaleFromExternal_;
    11351315  /** Scale from primal internal to external (in external order) Or other way for dual
    11361316   */
    1137   double * scaleToExternal_;
     1317  double *scaleToExternal_;
    11381318  /// use this instead of columnScale
    1139   double * columnUseScale_;
     1319  double *columnUseScale_;
    11401320  /// use this instead of inverseColumnScale
    1141   double * inverseColumnUseScale_;
     1321  double *inverseColumnUseScale_;
    11421322  /** Primal offset (in external order)
    11431323      So internal value is (external-offset)*scaleFromExternal
    11441324   */
    1145   double * offset_;
     1325  double *offset_;
    11461326  /// Offset for accumulated offsets*matrix
    1147   double * offsetRhs_;
     1327  double *offsetRhs_;
    11481328  /// Useful array of numberTotal length
    1149   double * tempArray_;
     1329  double *tempArray_;
    11501330  /** Working status
    11511331      ? may be signed
    11521332      ? link pi_ to an indexed array?
    11531333      may have saved from last factorization at end */
    1154   unsigned char * internalStatus_;
     1334  unsigned char *internalStatus_;
    11551335  /// Saved status
    1156   unsigned char * internalStatusSaved_;
     1336  unsigned char *internalStatusSaved_;
    11571337  /** Perturbation (fixed) - is just scaled random numbers
    11581338      If perturbationFactor_<0 then virtual perturbation */
    1159   double * abcPerturbation_;
     1339  double *abcPerturbation_;
    11601340  /// saved perturbation
    1161   double * perturbationSaved_;
     1341  double *perturbationSaved_;
    11621342  /// basic perturbation
    1163   double * perturbationBasic_;
     1343  double *perturbationBasic_;
    11641344  /// Working matrix
    1165   AbcMatrix * abcMatrix_;
     1345  AbcMatrix *abcMatrix_;
    11661346  /** Working scaled copy of lower bounds
    11671347      has original scaled copy at end */
    1168   double * abcLower_;
     1348  double *abcLower_;
    11691349  /** Working scaled copy of upper bounds
    11701350      has original scaled copy at end */
    1171   double * abcUpper_;
     1351  double *abcUpper_;
    11721352  /** Working scaled copy of objective
    11731353      ? where perturbed copy or can we
     
    11751355      ? should we save a fixed perturbation offset array
    11761356      has original scaled copy at end */
    1177   double * abcCost_;
     1357  double *abcCost_;
    11781358  /** Working scaled primal solution
    11791359      may have saved from last factorization at end */
    1180   double * abcSolution_;
     1360  double *abcSolution_;
    11811361  /** Working scaled dual solution
    11821362      may have saved from last factorization at end */
    1183   double * abcDj_;
    1184   /// Saved scaled copy of  lower bounds 
    1185   double * lowerSaved_;
    1186   /// Saved scaled copy of  upper bounds 
    1187   double * upperSaved_;
     1363  double *abcDj_;
     1364  /// Saved scaled copy of  lower bounds
     1365  double *lowerSaved_;
     1366  /// Saved scaled copy of  upper bounds
     1367  double *upperSaved_;
    11881368  /// Saved scaled copy of  objective
    1189   double * costSaved_;
     1369  double *costSaved_;
    11901370  /// Saved scaled  primal solution
    1191   double * solutionSaved_;
     1371  double *solutionSaved_;
    11921372  /// Saved scaled  dual solution
    1193   double * djSaved_;
    1194   /// Working scaled copy of basic lower bounds 
    1195   double * lowerBasic_;
    1196   /// Working scaled copy of basic upper bounds 
    1197   double * upperBasic_;
     1373  double *djSaved_;
     1374  /// Working scaled copy of basic lower bounds
     1375  double *lowerBasic_;
     1376  /// Working scaled copy of basic upper bounds
     1377  double *upperBasic_;
    11981378  /// Working scaled copy of basic objective
    1199   double * costBasic_;
     1379  double *costBasic_;
    12001380  /// Working scaled basic primal solution
    1201   double * solutionBasic_;
     1381  double *solutionBasic_;
    12021382  /// Working scaled basic dual solution (want it to be zero)
    1203   double * djBasic_;
     1383  double *djBasic_;
    12041384  /// dual row pivot choice
    1205   AbcDualRowPivot * abcDualRowPivot_;
     1385  AbcDualRowPivot *abcDualRowPivot_;
    12061386  /// primal column pivot choice
    1207   AbcPrimalColumnPivot * abcPrimalColumnPivot_;
     1387  AbcPrimalColumnPivot *abcPrimalColumnPivot_;
    12081388  /** Basic variables pivoting on which rows
    12091389      followed by atLo/atUp then free/superbasic then fixed
    12101390  */
    1211   int * abcPivotVariable_;
     1391  int *abcPivotVariable_;
    12121392  /// Reverse abcPivotVariable_ for moving around
    1213   int * reversePivotVariable_;
     1393  int *reversePivotVariable_;
    12141394  /// factorization
    1215   AbcSimplexFactorization * abcFactorization_;
     1395  AbcSimplexFactorization *abcFactorization_;
    12161396#ifdef EARLY_FACTORIZE
    12171397  /// Alternative factorization
    1218   AbcSimplexFactorization * abcEarlyFactorization_;
     1398  AbcSimplexFactorization *abcEarlyFactorization_;
    12191399#endif
    12201400#ifdef TEMPORARY_FACTORIZATION
    12211401  /// Alternative factorization
    1222   AbcSimplexFactorization * abcOtherFactorization_;
     1402  AbcSimplexFactorization *abcOtherFactorization_;
    12231403#endif
    12241404  /// Saved version of solution
    12251405  //double * savedSolution_;
    12261406  /// A copy of model with certain state - normally without cuts
    1227   AbcSimplex * abcBaseModel_;
     1407  AbcSimplex *abcBaseModel_;
    12281408  /// A copy of model as ClpSimplex with certain state
    1229   ClpSimplex * clpModel_;
     1409  ClpSimplex *clpModel_;
    12301410  /** Very wasteful way of dealing with infeasibilities in primal.
    12311411      However it will allow non-linearities and use of dual
    12321412      analysis.  If it doesn't work it can easily be replaced.
    12331413  */
    1234   AbcNonLinearCost * abcNonLinearCost_;
     1414  AbcNonLinearCost *abcNonLinearCost_;
    12351415  /// Useful arrays (all of row+column+2 length)
    12361416  /* has secondary offset and counts so row goes first then column
     
    12471427  /// Multiple sequence in
    12481428  int multipleSequenceIn_[4];
     1429
    12491430public:
    12501431  int arrayForDualColumn_;
     
    12591440  int numberDisasters_;
    12601441  //int nextCleanNonBasicIteration_;
    1261 #if ABC_PARALLEL==1
     1442#if ABC_PARALLEL == 1
    12621443  // For waking up thread
    1263   pthread_mutex_t mutex_[3*NUMBER_THREADS];
    1264   pthread_barrier_t barrier_; 
     1444  pthread_mutex_t mutex_[3 * NUMBER_THREADS];
     1445  pthread_barrier_t barrier_;
    12651446  CoinThreadInfo threadInfo_[NUMBER_THREADS];
    12661447  pthread_t abcThread_[NUMBER_THREADS];
    12671448  int locked_[NUMBER_THREADS];
    12681449  int stopStart_;
    1269 #elif ABC_PARALLEL==2
     1450#elif ABC_PARALLEL == 2
    12701451  //CoinThreadInfo threadInfo_[NUMBER_THREADS];
    12711452#endif
     
    12811462    It also does some testing of AbcSimplexFactorization class
    12821463*/
    1283 void
    1284 AbcSimplexUnitTest(const std::string & mpsDir);
    1285 #endif
     1464void AbcSimplexUnitTest(const std::string &mpsDir);
     1465#endif
     1466
     1467/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     1468*/
Note: See TracChangeset for help on using the changeset viewer.