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

    r1910 r2385  
    2323#define FACTOR_CPU 1
    2424#endif
    25 #define LARGE_SET COIN_INT_MAX-10
    26 #define LARGE_UNSET (LARGE_SET+1)
    27 
    28 class CoinAbcTypeFactorization  : public
    29 CoinAbcAnyFactorization
    30 {
    31    friend void CoinAbcFactorizationUnitTest( const std::string & mpsDir );
     25#define LARGE_SET COIN_INT_MAX - 10
     26#define LARGE_UNSET (LARGE_SET + 1)
     27
     28class CoinAbcTypeFactorization : public CoinAbcAnyFactorization {
     29  friend void CoinAbcFactorizationUnitTest(const std::string &mpsDir);
    3230
    3331public:
    34 
    3532  /**@name Constructors and destructor and copy */
    3633  //@{
    3734  /// Default constructor
    38     CoinAbcTypeFactorization (  );
    39   /// Copy constructor 
    40   CoinAbcTypeFactorization ( const CoinAbcTypeFactorization &other);
    41   /// Copy constructor 
    42   CoinAbcTypeFactorization ( const CoinFactorization &other);
     35  CoinAbcTypeFactorization();
     36  /// Copy constructor
     37  CoinAbcTypeFactorization(const CoinAbcTypeFactorization &other);
     38  /// Copy constructor
     39  CoinAbcTypeFactorization(const CoinFactorization &other);
    4340
    4441  /// Destructor
    45   virtual ~CoinAbcTypeFactorization (  );
     42  virtual ~CoinAbcTypeFactorization();
    4643  /// Clone
    47   virtual CoinAbcAnyFactorization * clone() const ;
     44  virtual CoinAbcAnyFactorization *clone() const;
    4845  /// Delete all stuff (leaves as after CoinAbcFactorization())
    4946  void almostDestructor();
    5047  /// Debug show object (shows one representation)
    51   void show_self (  ) const;
     48  void show_self() const;
    5249  /// Debug - sort so can compare
    53   void sort (  ) const;
     50  void sort() const;
    5451  /// = copy
    55     CoinAbcTypeFactorization & operator = ( const CoinAbcTypeFactorization & other );
     52  CoinAbcTypeFactorization &operator=(const CoinAbcTypeFactorization &other);
    5653  //@}
    5754
     
    6057  /// Condition number - product of pivots after factorization
    6158  CoinSimplexDouble conditionNumber() const;
    62  
     59
    6360  //@}
    6461
    6562  /**@name general stuff such as permutation or status */
    66   //@{ 
     63  //@{
    6764  /// Returns address of permute region
    68   inline CoinSimplexInt *permute (  ) const {
     65  inline CoinSimplexInt *permute() const
     66  {
    6967    return NULL; //permute_.array();
    7068  }
    7169  /// Returns array to put basis indices in
    72   virtual inline CoinSimplexInt * indices() const
    73   { return indexRowU_.array();}
     70  virtual inline CoinSimplexInt *indices() const
     71  {
     72    return indexRowU_.array();
     73  }
    7474  /// Returns address of pivotColumn region (also used for permuting)
    75   virtual inline CoinSimplexInt *pivotColumn (  ) const {
     75  virtual inline CoinSimplexInt *pivotColumn() const
     76  {
    7677    return pivotColumn_.array();
    7778  }
    7879  /// Returns address of pivot region
    79   virtual inline CoinFactorizationDouble *pivotRegion (  ) const {
     80  virtual inline CoinFactorizationDouble *pivotRegion() const
     81  {
    8082    return pivotRegionAddress_;
    8183  }
    82 #if ABC_SMALL<2
     84#if ABC_SMALL < 2
    8385  /// Start of each row in L
    84   inline CoinBigIndex * startRowL() const
    85   { return startRowL_.array();}
     86  inline CoinBigIndex *startRowL() const
     87  {
     88    return startRowL_.array();
     89  }
    8690#endif
    8791
    8892  /// Start of each column in L
    89   inline CoinBigIndex * startColumnL() const
    90   { return startColumnL_.array();}
    91 
    92 #if ABC_SMALL<2
     93  inline CoinBigIndex *startColumnL() const
     94  {
     95    return startColumnL_.array();
     96  }
     97
     98#if ABC_SMALL < 2
    9399  /// Index of column in row for L
    94   inline CoinSimplexInt * indexColumnL() const
    95   { return indexColumnL_.array();}
     100  inline CoinSimplexInt *indexColumnL() const
     101  {
     102    return indexColumnL_.array();
     103  }
    96104#endif
    97105
    98106  /// Row indices of L
    99   inline CoinSimplexInt * indexRowL() const
    100   { return indexRowL_.array();}
    101 
    102 #if ABC_SMALL<2
     107  inline CoinSimplexInt *indexRowL() const
     108  {
     109    return indexRowL_.array();
     110  }
     111
     112#if ABC_SMALL < 2
    103113  /// Elements in L (row copy)
    104   inline CoinFactorizationDouble * elementByRowL() const
    105   { return elementByRowL_.array();}
     114  inline CoinFactorizationDouble *elementByRowL() const
     115  {
     116    return elementByRowL_.array();
     117  }
    106118#endif
    107119  /**
    108120     Forward and backward linked lists (numberRows_+2)
    109121   **/
    110   inline CoinSimplexInt * pivotLinkedBackwards() const
    111   { return firstCount_.array()+numberRows_+1;}
    112   inline CoinSimplexInt * pivotLinkedForwards() const
    113   { return firstCount_.array()+2*numberRows_+3;}
    114   inline CoinSimplexInt * pivotLOrder() const
    115   { return firstCount_.array();}
    116 #if ABC_SMALL<0
     122  inline CoinSimplexInt *pivotLinkedBackwards() const
     123  {
     124    return firstCount_.array() + numberRows_ + 1;
     125  }
     126  inline CoinSimplexInt *pivotLinkedForwards() const
     127  {
     128    return firstCount_.array() + 2 * numberRows_ + 3;
     129  }
     130  inline CoinSimplexInt *pivotLOrder() const
     131  {
     132    return firstCount_.array();
     133  }
     134#if ABC_SMALL < 0
    117135#define ABC_USE_FUNCTION_POINTERS 0
    118136#define SMALL_PERMUTE
    119137#endif
    120138#ifdef ABC_USE_FUNCTION_POINTERS
    121   typedef void (*scatterUpdate) (int,CoinFactorizationDouble,const CoinFactorizationDouble *, CoinFactorizationDouble *);
     139  typedef void (*scatterUpdate)(int, CoinFactorizationDouble, const CoinFactorizationDouble *, CoinFactorizationDouble *);
    122140#if ABC_USE_FUNCTION_POINTERS
    123141  typedef struct {
     
    133151#endif
    134152  /// Array of function pointers PLUS for U Column
    135   inline scatterStruct * scatterUColumn() const
    136   { return scatterPointersUColumnAddress_;}
     153  inline scatterStruct *scatterUColumn() const
     154  {
     155    return scatterPointersUColumnAddress_;
     156  }
    137157#endif
    138158
     
    141161      can tell which by offset - Rows then Columns
    142162      actually comes before nextCount*/
    143   inline CoinSimplexInt * firstCount() const
    144   { return firstCount_.array();}
     163  inline CoinSimplexInt *firstCount() const
     164  {
     165    return firstCount_.array();
     166  }
    145167
    146168  /// Next Row/Column with count
    147   inline CoinSimplexInt * nextCount() const
    148   { return firstCount_.array()+numberRows_+2;}
     169  inline CoinSimplexInt *nextCount() const
     170  {
     171    return firstCount_.array() + numberRows_ + 2;
     172  }
    149173
    150174  /// Previous Row/Column with count
    151   inline CoinSimplexInt * lastCount() const
    152   { return firstCount_.array()+3*numberRows_+2;}
     175  inline CoinSimplexInt *lastCount() const
     176  {
     177    return firstCount_.array() + 3 * numberRows_ + 2;
     178  }
    153179
    154180  /// Number of Rows after iterating
    155   inline CoinSimplexInt numberRowsExtra (  ) const {
     181  inline CoinSimplexInt numberRowsExtra() const
     182  {
    156183    return numberRowsExtra_;
    157184  }
    158185  /// Number in L
    159186  inline CoinBigIndex numberL() const
    160   { return numberL_;}
     187  {
     188    return numberL_;
     189  }
    161190
    162191  /// Base of L
    163192  inline CoinBigIndex baseL() const
    164   { return baseL_;}
     193  {
     194    return baseL_;
     195  }
    165196  /// Maximum of Rows after iterating
    166   inline CoinSimplexInt maximumRowsExtra (  ) const {
     197  inline CoinSimplexInt maximumRowsExtra() const
     198  {
    167199    return maximumRowsExtra_;
    168200  }
    169201  /// Total number of elements in factorization
    170   virtual inline CoinBigIndex numberElements (  ) const {
     202  virtual inline CoinBigIndex numberElements() const
     203  {
    171204    return totalElements_;
    172205  }
    173206  /// Length of FT vector
    174   inline CoinSimplexInt numberForrestTomlin (  ) const {
     207  inline CoinSimplexInt numberForrestTomlin() const
     208  {
    175209    return numberInColumn_.array()[numberRowsExtra_];
    176210  }
     
    178212  CoinSimplexDouble adjustedAreaFactor() const;
    179213  /// Level of detail of messages
    180   inline CoinSimplexInt messageLevel (  ) const {
    181     return messageLevel_ ;
    182   }
    183   void messageLevel (  CoinSimplexInt value );
     214  inline CoinSimplexInt messageLevel() const
     215  {
     216    return messageLevel_;
     217  }
     218  void messageLevel(CoinSimplexInt value);
    184219  /// Set maximum pivots
    185   virtual void maximumPivots (  CoinSimplexInt value );
    186 
    187 #if ABC_SMALL<4
     220  virtual void maximumPivots(CoinSimplexInt value);
     221
     222#if ABC_SMALL < 4
    188223  /// Gets dense threshold
    189   inline CoinSimplexInt denseThreshold() const
    190     { return denseThreshold_;}
     224  inline CoinSimplexInt denseThreshold() const
     225  {
     226    return denseThreshold_;
     227  }
    191228  /// Sets dense threshold
    192229  inline void setDenseThreshold(CoinSimplexInt value)
    193     { denseThreshold_ = value;}
     230  {
     231    denseThreshold_ = value;
     232  }
    194233#endif
    195234  /// Returns maximum absolute value in factorization
     
    206245  {
    207246    CoinBigIndex start = lastEntryByColumnU_;
    208     CoinBigIndex space = lengthAreaU_ - ( start + numberRowsExtra_ );
    209     return (space>=0); //&&doForrestTomlin_;
     247    CoinBigIndex space = lengthAreaU_ - (start + numberRowsExtra_);
     248    return (space >= 0); //&&doForrestTomlin_;
    210249  }
    211250  //@}
     
    214253  //@{
    215254
    216 
    217255  /// Returns number in U area
    218   inline CoinBigIndex numberElementsU (  ) const {
     256  inline CoinBigIndex numberElementsU() const
     257  {
    219258    return lengthU_;
    220259  }
    221260  /// Setss number in U area
    222261  inline void setNumberElementsU(CoinBigIndex value)
    223   { lengthU_ = value; }
     262  {
     263    lengthU_ = value;
     264  }
    224265  /// Returns length of U area
    225   inline CoinBigIndex lengthAreaU (  ) const {
     266  inline CoinBigIndex lengthAreaU() const
     267  {
    226268    return lengthAreaU_;
    227269  }
    228270  /// Returns number in L area
    229   inline CoinBigIndex numberElementsL (  ) const {
     271  inline CoinBigIndex numberElementsL() const
     272  {
    230273    return lengthL_;
    231274  }
    232275  /// Returns length of L area
    233   inline CoinBigIndex lengthAreaL (  ) const {
     276  inline CoinBigIndex lengthAreaL() const
     277  {
    234278    return lengthAreaL_;
    235279  }
    236280  /// Returns number in R area
    237   inline CoinBigIndex numberElementsR (  ) const {
     281  inline CoinBigIndex numberElementsR() const
     282  {
    238283    return lengthR_;
    239284  }
    240285  /// Number of compressions done
    241286  inline CoinBigIndex numberCompressions() const
    242   { return numberCompressions_;}
    243   /// Returns pivot row
     287  {
     288    return numberCompressions_;
     289  }
     290  /// Returns pivot row
    244291  //virtual CoinSimplexInt * pivotRow() const;
    245292  /// Returns work area
     
    248295  //virtual CoinSimplexInt * intWorkArea() const;
    249296  /// Returns array to put basis starts in
    250   virtual inline CoinBigIndex * starts() const
    251   { return startColumnU_.array();}
     297  virtual inline CoinBigIndex *starts() const
     298  {
     299    return startColumnU_.array();
     300  }
    252301  /// Number of entries in each row
    253   virtual inline CoinSimplexInt * numberInRow() const
    254   { return numberInRow_.array();}
     302  virtual inline CoinSimplexInt *numberInRow() const
     303  {
     304    return numberInRow_.array();
     305  }
    255306  /// Number of entries in each column
    256   virtual inline CoinSimplexInt * numberInColumn() const
    257   { return numberInColumn_.array();}
     307  virtual inline CoinSimplexInt *numberInColumn() const
     308  {
     309    return numberInColumn_.array();
     310  }
    258311  /// Returns array to put basis elements in
    259   virtual inline CoinFactorizationDouble * elements() const
    260   { return elementU_.array();}
     312  virtual inline CoinFactorizationDouble *elements() const
     313  {
     314    return elementU_.array();
     315  }
    261316  /// Start of columns for R
    262   inline CoinBigIndex * startColumnR() const
    263   {return reinterpret_cast<CoinBigIndex *>(firstCount_.array()+3*numberRows_+4);}
     317  inline CoinBigIndex *startColumnR() const
     318  {
     319    return reinterpret_cast< CoinBigIndex * >(firstCount_.array() + 3 * numberRows_ + 4);
     320  }
    264321  /// Elements of U
    265   inline CoinFactorizationDouble * elementU() const
    266   { return elementU_.array();}
     322  inline CoinFactorizationDouble *elementU() const
     323  {
     324    return elementU_.array();
     325  }
    267326  /// Row indices of U
    268   inline CoinSimplexInt * indexRowU() const
    269   { return indexRowU_.array();}
     327  inline CoinSimplexInt *indexRowU() const
     328  {
     329    return indexRowU_.array();
     330  }
    270331  /// Start of each column in U
    271   inline CoinBigIndex * startColumnU() const
    272   { return startColumnU_.array();}
    273 #if COIN_BIG_DOUBLE==1
     332  inline CoinBigIndex *startColumnU() const
     333  {
     334    return startColumnU_.array();
     335  }
     336#if COIN_BIG_DOUBLE == 1
    274337  /// To a work array and associate vector
    275   void toLongArray(CoinIndexedVector * vector,int which) const;
     338  void toLongArray(CoinIndexedVector *vector, int which) const;
    276339  /// From a work array and dis-associate vector
    277   void fromLongArray(CoinIndexedVector * vector) const;
     340  void fromLongArray(CoinIndexedVector *vector) const;
    278341  /// From a work array and dis-associate vector
    279342  void fromLongArray(int which) const;
    280343  /// Returns long double * associated with vector
    281   long double * denseVector(CoinIndexedVector * vector) const;
     344  long double *denseVector(CoinIndexedVector *vector) const;
    282345  /// Returns long double * associated with vector
    283   long double * denseVector(CoinIndexedVector & vector) const;
     346  long double *denseVector(CoinIndexedVector &vector) const;
    284347  /// Returns long double * associated with vector
    285   const long double * denseVector(const CoinIndexedVector * vector) const;
     348  const long double *denseVector(const CoinIndexedVector *vector) const;
    286349  /// Returns long double * associated with vector
    287   const long double * denseVector(const CoinIndexedVector & vector) const;
     350  const long double *denseVector(const CoinIndexedVector &vector) const;
    288351  /// Scans region to find nonzeros
    289   void scan(CoinIndexedVector * vector) const;
     352  void scan(CoinIndexedVector *vector) const;
    290353  /// Clear all hidden arrays
    291354  void clearHiddenArrays();
    292355#else
    293356  /// Returns double * associated with vector
    294   inline double * denseVector(CoinIndexedVector * vector) const
    295   {return vector->denseVector();}
    296   inline double * denseVector(CoinIndexedVector & vector) const
    297   {return vector.denseVector();}
     357  inline double *denseVector(CoinIndexedVector *vector) const
     358  {
     359    return vector->denseVector();
     360  }
     361  inline double *denseVector(CoinIndexedVector &vector) const
     362  {
     363    return vector.denseVector();
     364  }
    298365  /// Returns double * associated with vector
    299   inline const double * denseVector(const CoinIndexedVector * vector) const
    300   {return vector->denseVector();}
    301   inline const double * denseVector(const CoinIndexedVector & vector) const
    302   {return vector.denseVector();}
     366  inline const double *denseVector(const CoinIndexedVector *vector) const
     367  {
     368    return vector->denseVector();
     369  }
     370  inline const double *denseVector(const CoinIndexedVector &vector) const
     371  {
     372    return vector.denseVector();
     373  }
    303374  /// To a work array and associate vector
    304   inline void toLongArray(CoinIndexedVector * vector,int which) const {}
     375  inline void toLongArray(CoinIndexedVector *vector, int which) const {}
    305376  /// From a work array and dis-associate vector
    306   inline void fromLongArray(CoinIndexedVector * vector) const {}
     377  inline void fromLongArray(CoinIndexedVector *vector) const {}
    307378  /// From a work array and dis-associate vector
    308379  inline void fromLongArray(int which) const {}
    309380  /// Scans region to find nonzeros
    310   inline void scan(CoinIndexedVector * vector) const
    311   {vector->scan(0,numberRows_,zeroTolerance_);}
     381  inline void scan(CoinIndexedVector *vector) const
     382  {
     383    vector->scan(0, numberRows_, zeroTolerance_);
     384  }
    312385#endif
    313386#ifdef ABC_ORDERED_FACTORIZATION
    314387  /// Permute in for Ftran
    315   void permuteInForFtran(CoinIndexedVector & regionSparse,bool full=false) const ;
     388  void permuteInForFtran(CoinIndexedVector &regionSparse, bool full = false) const;
    316389  /// Permute in for Btran and multiply by pivot Region
    317   void permuteInForBtranAndMultiply(CoinIndexedVector & regionSparse, bool full=false) const ;
     390  void permuteInForBtranAndMultiply(CoinIndexedVector &regionSparse, bool full = false) const;
    318391  /// Permute out for Btran
    319   void permuteOutForBtran(CoinIndexedVector & regionSparse) const ;
     392  void permuteOutForBtran(CoinIndexedVector &regionSparse) const;
    320393#endif
    321394  /** Array persistence flag
     
    354427      Fills in region for use later
    355428      partial update already in U */
    356   virtual
    357 #ifdef ABC_LONG_FACTORIZATION
    358   long
    359 #endif
    360   double checkReplacePart1 (  CoinIndexedVector * regionSparse,
    361                                      int pivotRow);
     429  virtual
     430#ifdef ABC_LONG_FACTORIZATION
     431    long
     432#endif
     433    double
     434    checkReplacePart1(CoinIndexedVector *regionSparse,
     435      int pivotRow);
    362436  /** Checks if can replace one Column to basis,
    363437      returns update alpha
    364438      Fills in region for use later
    365439      partial update in vector */
    366   virtual
    367 #ifdef ABC_LONG_FACTORIZATION
    368   long
    369 #endif
    370   double checkReplacePart1 (  CoinIndexedVector * regionSparse,
    371                                       CoinIndexedVector * partialUpdate,
    372                                      int pivotRow);
     440  virtual
     441#ifdef ABC_LONG_FACTORIZATION
     442    long
     443#endif
     444    double
     445    checkReplacePart1(CoinIndexedVector *regionSparse,
     446      CoinIndexedVector *partialUpdate,
     447      int pivotRow);
    373448#ifdef MOVE_REPLACE_PART1A
    374449  /** Checks if can replace one Column to basis,
     
    376451      Fills in region for use later
    377452      partial update already in U */
    378   virtual void checkReplacePart1a (  CoinIndexedVector * regionSparse,
    379                                      int pivotRow);
    380   virtual
    381 #ifdef ABC_LONG_FACTORIZATION
    382   long
    383 #endif
    384   double checkReplacePart1b (  CoinIndexedVector * regionSparse,
    385                                      int pivotRow);
     453  virtual void checkReplacePart1a(CoinIndexedVector *regionSparse,
     454    int pivotRow);
     455  virtual
     456#ifdef ABC_LONG_FACTORIZATION
     457    long
     458#endif
     459    double
     460    checkReplacePart1b(CoinIndexedVector *regionSparse,
     461      int pivotRow);
    386462#endif
    387463  /** Checks if can replace one Column to basis,
    388464      returns 0=OK, 1=Probably OK, 2=singular, 3=no room, 5 max pivots */
    389   virtual int checkReplacePart2 ( int pivotRow,
    390                                   CoinSimplexDouble btranAlpha,
    391                                   double ftranAlpha,
    392 #ifdef ABC_LONG_FACTORIZATION 
    393                                   long
    394 #endif
    395                                   double ftAlpha,
    396                                   double acceptablePivot = 1.0e-8);
     465  virtual int checkReplacePart2(int pivotRow,
     466    CoinSimplexDouble btranAlpha,
     467    double ftranAlpha,
     468#ifdef ABC_LONG_FACTORIZATION
     469    long
     470#endif
     471    double ftAlpha,
     472    double acceptablePivot = 1.0e-8);
    397473  /** Replaces one Column to basis,
    398474      partial update already in U */
    399   virtual void replaceColumnPart3 ( const AbcSimplex * model,
    400                       CoinIndexedVector * regionSparse,
    401                       CoinIndexedVector * tableauColumn,
    402                       int pivotRow,
    403 #ifdef ABC_LONG_FACTORIZATION 
    404                                     long
    405 #endif
    406                        double alpha );
     475  virtual void replaceColumnPart3(const AbcSimplex *model,
     476    CoinIndexedVector *regionSparse,
     477    CoinIndexedVector *tableauColumn,
     478    int pivotRow,
     479#ifdef ABC_LONG_FACTORIZATION
     480    long
     481#endif
     482    double alpha);
    407483  /** Replaces one Column to basis,
    408484      partial update in vector */
    409   virtual void replaceColumnPart3 ( const AbcSimplex * model,
    410                                     CoinIndexedVector * regionSparse,
    411                                     CoinIndexedVector * tableauColumn,
    412                                     CoinIndexedVector * partialUpdate,
    413                                     int pivotRow,
    414 #ifdef ABC_LONG_FACTORIZATION 
    415                                   long
    416 #endif
    417                                     double alpha );
     485  virtual void replaceColumnPart3(const AbcSimplex *model,
     486    CoinIndexedVector *regionSparse,
     487    CoinIndexedVector *tableauColumn,
     488    CoinIndexedVector *partialUpdate,
     489    int pivotRow,
     490#ifdef ABC_LONG_FACTORIZATION
     491    long
     492#endif
     493    double alpha);
    418494#ifdef EARLY_FACTORIZE
    419495  /// 0 success, -1 can't +1 accuracy problems
    420   virtual int replaceColumns ( const AbcSimplex * model,
    421                                CoinIndexedVector & stuff,
    422                                int firstPivot,int lastPivot,bool cleanUp);
     496  virtual int replaceColumns(const AbcSimplex *model,
     497    CoinIndexedVector &stuff,
     498    int firstPivot, int lastPivot, bool cleanUp);
    423499#endif
    424500  /// Update partial Ftran by R update
    425   void updatePartialUpdate(CoinIndexedVector & partialUpdate);
     501  void updatePartialUpdate(CoinIndexedVector &partialUpdate);
    426502  /// Returns true if wants tableauColumn in replaceColumn
    427503  inline virtual bool wantsTableauColumn() const
    428   {return false;}
     504  {
     505    return false;
     506  }
    429507  /** Combines BtranU and store which elements are to be deleted
    430508      returns number to be deleted
    431509  */
    432   int replaceColumnU ( CoinIndexedVector * regionSparse,
    433                        CoinBigIndex * deletedPosition,
    434                        CoinSimplexInt * deletedColumns,
    435                        CoinSimplexInt pivotRow);
     510  int replaceColumnU(CoinIndexedVector *regionSparse,
     511    CoinBigIndex *deletedPosition,
     512    CoinSimplexInt *deletedColumns,
     513    CoinSimplexInt pivotRow);
    436514  //@}
    437515
    438516  /**@name various uses of factorization (return code number elements)
    439517   which user may want to know about */
    440   /// Later take out return codes (apart from +- 1 on FT) 
     518  /// Later take out return codes (apart from +- 1 on FT)
    441519  //@{
    442520  /** Updates one column (FTRAN) from regionSparse2
     
    446524      Note - if regionSparse2 packed on input - will be packed on output
    447525  */
    448   virtual CoinSimplexInt updateColumnFT ( CoinIndexedVector & regionSparse);
    449   virtual int updateColumnFTPart1 ( CoinIndexedVector & regionSparse) ;
    450   virtual void updateColumnFTPart2 ( CoinIndexedVector & regionSparse) ;
     526  virtual CoinSimplexInt updateColumnFT(CoinIndexedVector &regionSparse);
     527  virtual int updateColumnFTPart1(CoinIndexedVector &regionSparse);
     528  virtual void updateColumnFTPart2(CoinIndexedVector &regionSparse);
    451529  /** Updates one column (FTRAN)
    452530      Tries to do FT update
    453531      puts partial update in vector */
    454   virtual void updateColumnFT ( CoinIndexedVector & regionSparseFT,
    455                                 CoinIndexedVector & partialUpdate,
    456                                 int which);
     532  virtual void updateColumnFT(CoinIndexedVector &regionSparseFT,
     533    CoinIndexedVector &partialUpdate,
     534    int which);
    457535  /** This version has same effect as above with FTUpdate==false
    458536      so number returned is always >=0 */
    459   virtual CoinSimplexInt updateColumn ( CoinIndexedVector & regionSparse) const;
     537  virtual CoinSimplexInt updateColumn(CoinIndexedVector &regionSparse) const;
    460538  /** Updates one column (FTRAN) from region2
    461539      Tries to do FT update
     
    463541      Also updates region3
    464542      region1 starts as zero and is zero at end */
    465  virtual CoinSimplexInt updateTwoColumnsFT ( CoinIndexedVector & regionFT,
    466                                      CoinIndexedVector & regionOther);
     543  virtual CoinSimplexInt updateTwoColumnsFT(CoinIndexedVector &regionFT,
     544    CoinIndexedVector &regionOther);
    467545  /** Updates one column (BTRAN) from regionSparse2
    468546      regionSparse starts as zero and is zero at end
    469547      Note - if regionSparse2 packed on input - will be packed on output
    470548  */
    471   virtual CoinSimplexInt updateColumnTranspose ( CoinIndexedVector & regionSparse) const;
     549  virtual CoinSimplexInt updateColumnTranspose(CoinIndexedVector &regionSparse) const;
    472550  /** Updates one full column (FTRAN) */
    473   virtual void updateFullColumn ( CoinIndexedVector & regionSparse) const;
     551  virtual void updateFullColumn(CoinIndexedVector &regionSparse) const;
    474552  /** Updates one full column (BTRAN) */
    475   virtual void updateFullColumnTranspose ( CoinIndexedVector & regionSparse) const;
     553  virtual void updateFullColumnTranspose(CoinIndexedVector &regionSparse) const;
    476554  /** Updates one column for dual steepest edge weights (FTRAN) */
    477   virtual void updateWeights ( CoinIndexedVector & regionSparse) const;
     555  virtual void updateWeights(CoinIndexedVector &regionSparse) const;
    478556  /** Updates one column (FTRAN) */
    479   virtual void updateColumnCpu ( CoinIndexedVector & regionSparse,int whichCpu) const;
     557  virtual void updateColumnCpu(CoinIndexedVector &regionSparse, int whichCpu) const;
    480558  /** Updates one column (BTRAN) */
    481   virtual void updateColumnTransposeCpu ( CoinIndexedVector & regionSparse,int whichCpu) const;
    482   void unpack ( CoinIndexedVector * regionFrom,
    483                 CoinIndexedVector * regionTo) const;
    484   void pack ( CoinIndexedVector * regionFrom,
    485                 CoinIndexedVector * regionTo) const;
     559  virtual void updateColumnTransposeCpu(CoinIndexedVector &regionSparse, int whichCpu) const;
     560  void unpack(CoinIndexedVector *regionFrom,
     561    CoinIndexedVector *regionTo) const;
     562  void pack(CoinIndexedVector *regionFrom,
     563    CoinIndexedVector *regionTo) const;
    486564  /** makes a row copy of L for speed and to allow very sparse problems */
    487565  inline void goSparse() {}
     
    490568  virtual void checkMarkArrays() const;
    491569#endif
    492 #if ABC_SMALL<2
     570#if ABC_SMALL < 2
    493571  /**  get sparse threshold */
    494   inline CoinSimplexInt sparseThreshold ( ) const
    495   { return sparseThreshold_;}
     572  inline CoinSimplexInt sparseThreshold() const
     573  {
     574    return sparseThreshold_;
     575  }
    496576#endif
    497577  /**  set sparse threshold */
    498   void sparseThreshold ( CoinSimplexInt value );
     578  void sparseThreshold(CoinSimplexInt value);
    499579  //@}
    500580  /// *** Below this user may not want to know about
     
    505585  /// Get rid of all memory
    506586  inline void clearArrays()
    507   { gutsOfDestructor();}
     587  {
     588    gutsOfDestructor();
     589  }
    508590  //@}
    509591  /**@name used by ClpFactorization */
    510592  /// See if worth going sparse
    511593  void checkSparse();
    512   /// The real work of constructors etc 0 just scalars, 1 bit normal 
    513   void gutsOfDestructor(CoinSimplexInt type=1);
     594  /// The real work of constructors etc 0 just scalars, 1 bit normal
     595  void gutsOfDestructor(CoinSimplexInt type = 1);
    514596  /// 1 bit - tolerances etc, 2 more, 4 dummy arrays
    515597  void gutsOfInitialize(CoinSimplexInt type);
     
    518600  /// Reset all sparsity etc statistics
    519601  void resetStatistics();
    520   void printRegion(const CoinIndexedVector & vector, const char * where) const;
     602  void printRegion(const CoinIndexedVector &vector, const char *where) const;
    521603
    522604  //@}
     
    524606  /**@name used by factorization */
    525607  /// Gets space for a factorization, called by constructors
    526   virtual void getAreas ( CoinSimplexInt numberRows,
    527                   CoinSimplexInt numberColumns,
    528                   CoinBigIndex maximumL,
    529                   CoinBigIndex maximumU );
     608  virtual void getAreas(CoinSimplexInt numberRows,
     609    CoinSimplexInt numberColumns,
     610    CoinBigIndex maximumL,
     611    CoinBigIndex maximumU);
    530612
    531613  /// PreProcesses column ordered copy of basis
    532   virtual void preProcess ( );
    533   void preProcess (CoinSimplexInt );
     614  virtual void preProcess();
     615  void preProcess(CoinSimplexInt);
    534616  /// Return largest element
    535   double preProcess3 ( );
    536   void preProcess4 ( );
     617  double preProcess3();
     618  void preProcess4();
    537619  /// Does most of factorization
    538   virtual CoinSimplexInt factor (AbcSimplex * model);
     620  virtual CoinSimplexInt factor(AbcSimplex *model);
    539621#ifdef EARLY_FACTORIZE
    540622  /// Returns -2 if can't, -1 if singular, -99 memory, 0 OK
    541   virtual int factorize (AbcSimplex * model, CoinIndexedVector & stuff);
     623  virtual int factorize(AbcSimplex *model, CoinIndexedVector &stuff);
    542624#endif
    543625  /// Does post processing on valid factorization - putting variables on correct rows
    544   virtual void postProcess(const CoinSimplexInt * sequence, CoinSimplexInt * pivotVariable);
     626  virtual void postProcess(const CoinSimplexInt *sequence, CoinSimplexInt *pivotVariable);
    545627  /// Makes a non-singular basis by replacing variables
    546   virtual void makeNonSingular(CoinSimplexInt * sequence);
     628  virtual void makeNonSingular(CoinSimplexInt *sequence);
     629
    547630protected:
    548631  /** Does sparse phase of factorization
    549632      return code is <0 error, 0= finished */
    550   CoinSimplexInt factorSparse (  );
     633  CoinSimplexInt factorSparse();
    551634  /** Does dense phase of factorization
    552635      return code is <0 error, 0= finished */
    553   CoinSimplexInt factorDense (  );
     636  CoinSimplexInt factorDense();
    554637
    555638  /// Pivots when just one other row so faster?
    556   bool pivotOneOtherRow ( CoinSimplexInt pivotRow,
    557                           CoinSimplexInt pivotColumn );
     639  bool pivotOneOtherRow(CoinSimplexInt pivotRow,
     640    CoinSimplexInt pivotColumn);
    558641  /// Does one pivot on Row Singleton in factorization
    559   bool pivotRowSingleton ( CoinSimplexInt pivotRow,
    560                            CoinSimplexInt pivotColumn );
     642  bool pivotRowSingleton(CoinSimplexInt pivotRow,
     643    CoinSimplexInt pivotColumn);
    561644  /// Does one pivot on Column Singleton in factorization (can't return false)
    562   void pivotColumnSingleton ( CoinSimplexInt pivotRow,
    563                               CoinSimplexInt pivotColumn );
     645  void pivotColumnSingleton(CoinSimplexInt pivotRow,
     646    CoinSimplexInt pivotColumn);
    564647  /// After pivoting
    565   void afterPivot( CoinSimplexInt pivotRow,
    566                               CoinSimplexInt pivotColumn );
     648  void afterPivot(CoinSimplexInt pivotRow,
     649    CoinSimplexInt pivotColumn);
    567650  /// After pivoting - returns true if need to go dense
    568651  int wantToGoDense();
     
    572655   also moves existing vector,
    573656   extraNeeded is over and above present */
    574   bool getColumnSpace ( CoinSimplexInt iColumn,
    575                         CoinSimplexInt extraNeeded );
     657  bool getColumnSpace(CoinSimplexInt iColumn,
     658    CoinSimplexInt extraNeeded);
    576659
    577660  /** Reorders U so contiguous and in order (if there is space)
     
    581664       may have to do compression  (returns true)
    582665       also moves existing vector */
    583   bool getColumnSpaceIterateR ( CoinSimplexInt iColumn, CoinFactorizationDouble value,
    584                                CoinSimplexInt iRow);
     666  bool getColumnSpaceIterateR(CoinSimplexInt iColumn, CoinFactorizationDouble value,
     667    CoinSimplexInt iRow);
    585668  /**  getColumnSpaceIterate.  Gets space for one extra U element in Column
    586669       may have to do compression  (returns true)
     
    588671       Returns -1 if no memory or where element was put
    589672       Used by replaceRow (turns off R version) */
    590   CoinBigIndex getColumnSpaceIterate ( CoinSimplexInt iColumn, CoinFactorizationDouble value,
    591                                CoinSimplexInt iRow);
     673  CoinBigIndex getColumnSpaceIterate(CoinSimplexInt iColumn, CoinFactorizationDouble value,
     674    CoinSimplexInt iRow);
    592675  /** Gets space for one Row with given length,
    593676  may have to do compression  (returns True if successful),
    594677  also moves existing vector */
    595   bool getRowSpace ( CoinSimplexInt iRow, CoinSimplexInt extraNeeded );
     678  bool getRowSpace(CoinSimplexInt iRow, CoinSimplexInt extraNeeded);
    596679
    597680  /** Gets space for one Row with given length while iterating,
    598681  may have to do compression  (returns True if successful),
    599682  also moves existing vector */
    600   bool getRowSpaceIterate ( CoinSimplexInt iRow,
    601                             CoinSimplexInt extraNeeded );
     683  bool getRowSpaceIterate(CoinSimplexInt iRow,
     684    CoinSimplexInt extraNeeded);
    602685  /// Checks that row and column copies look OK
    603   void checkConsistency (  );
     686  void checkConsistency();
    604687//#define CHECK_LINKS
    605688#ifdef CHECK_LINKS
    606   void checkLinks(int x=0);
     689  void checkLinks(int x = 0);
    607690#else
    608 #  define checkLinks(x)
     691#define checkLinks(x)
    609692#endif
    610693  /// Adds a link in chain of equal counts
    611   inline void addLink ( CoinSimplexInt index, CoinSimplexInt count ) {
    612     CoinSimplexInt * COIN_RESTRICT nextCount = nextCountAddress_;
    613     CoinSimplexInt * COIN_RESTRICT firstCount = this->firstCount();
    614     CoinSimplexInt * COIN_RESTRICT lastCount = lastCountAddress_;
     694  inline void addLink(CoinSimplexInt index, CoinSimplexInt count)
     695  {
     696    CoinSimplexInt *COIN_RESTRICT nextCount = nextCountAddress_;
     697    CoinSimplexInt *COIN_RESTRICT firstCount = this->firstCount();
     698    CoinSimplexInt *COIN_RESTRICT lastCount = lastCountAddress_;
    615699    CoinSimplexInt next = firstCount[count];
    616700    firstCount[count] = index;
    617701    nextCount[index] = next;
    618     lastCount[index] = count-numberRows_-2; // points to firstCount[count]
    619     if (next>=0)
     702    lastCount[index] = count - numberRows_ - 2; // points to firstCount[count]
     703    if (next >= 0)
    620704      lastCount[next] = index;
    621705  }
    622706  /// Deletes a link in chain of equal counts
    623   inline void deleteLink ( CoinSimplexInt index ) {
    624     CoinSimplexInt * COIN_RESTRICT nextCount = nextCountAddress_;
    625     CoinSimplexInt * COIN_RESTRICT lastCount = lastCountAddress_;
     707  inline void deleteLink(CoinSimplexInt index)
     708  {
     709    CoinSimplexInt *COIN_RESTRICT nextCount = nextCountAddress_;
     710    CoinSimplexInt *COIN_RESTRICT lastCount = lastCountAddress_;
    626711    CoinSimplexInt next = nextCount[index];
    627712    CoinSimplexInt last = lastCount[index];
    628     assert (next!=index);
    629     assert (last!=index);
    630     if (next>=0)
     713    assert(next != index);
     714    assert(last != index);
     715    if (next >= 0)
    631716      lastCount[next] = last;
    632     if (last>=0) {
     717    if (last >= 0) {
    633718      nextCount[last] = next;
    634719    } else {
    635       int count=last+numberRows_+2;
    636       CoinSimplexInt * COIN_RESTRICT firstCount = this->firstCount();
    637       firstCount[count]=next;
     720      int count = last + numberRows_ + 2;
     721      CoinSimplexInt *COIN_RESTRICT firstCount = this->firstCount();
     722      firstCount[count] = next;
    638723    }
    639724  }
    640725  /// Modifies links in chain of equal counts
    641   inline void modifyLink ( CoinSimplexInt index, CoinSimplexInt count ) {
    642     CoinSimplexInt * COIN_RESTRICT nextCount = nextCountAddress_;
    643     CoinSimplexInt * COIN_RESTRICT lastCount = lastCountAddress_;
    644     CoinSimplexInt * COIN_RESTRICT firstCount = this->firstCount();
     726  inline void modifyLink(CoinSimplexInt index, CoinSimplexInt count)
     727  {
     728    CoinSimplexInt *COIN_RESTRICT nextCount = nextCountAddress_;
     729    CoinSimplexInt *COIN_RESTRICT lastCount = lastCountAddress_;
     730    CoinSimplexInt *COIN_RESTRICT firstCount = this->firstCount();
    645731    CoinSimplexInt next2 = firstCount[count];
    646     if (next2==index)
     732    if (next2 == index)
    647733      return;
    648734    firstCount[count] = index;
    649735    CoinSimplexInt next = nextCount[index];
    650736    CoinSimplexInt last = lastCount[index];
    651     assert (next!=index);
    652     assert (last!=index);
     737    assert(next != index);
     738    assert(last != index);
    653739    nextCount[index] = next2;
    654     lastCount[index] = count-numberRows_-2; // points to firstCount[count]
    655     if (next>=0)
     740    lastCount[index] = count - numberRows_ - 2; // points to firstCount[count]
     741    if (next >= 0)
    656742      lastCount[next] = last;
    657     if (next2>=0)
     743    if (next2 >= 0)
    658744      lastCount[next2] = index;
    659     if (last>=0) {
     745    if (last >= 0) {
    660746      nextCount[last] = next;
    661747    } else {
    662       int count=last+numberRows_+2;
    663       firstCount[count]=next;
     748      int count = last + numberRows_ + 2;
     749      firstCount[count] = next;
    664750    }
    665751  }
    666752  /// Separate out links with same row/column count
    667753  void separateLinks();
    668   void separateLinks(CoinSimplexInt,CoinSimplexInt);
     754  void separateLinks(CoinSimplexInt, CoinSimplexInt);
    669755  /// Cleans up at end of factorization
    670   void cleanup (  );
     756  void cleanup();
    671757  /// Set up addresses from arrays
    672758  void doAddresses();
    673759
    674760  /// Updates part of column (FTRANL)
    675   void updateColumnL ( CoinIndexedVector * region
    676 #if ABC_SMALL<2
    677                        , CoinAbcStatistics & statistics
     761  void updateColumnL(CoinIndexedVector *region
     762#if ABC_SMALL < 2
     763    ,
     764    CoinAbcStatistics &statistics
    678765#endif
    679766#if ABC_PARALLEL
    680                        ,int whichSparse=0
    681 #endif
    682                        ) const;
     767    ,
     768    int whichSparse = 0
     769#endif
     770    ) const;
    683771  /// Updates part of column (FTRANL) when densish
    684   void updateColumnLDensish ( CoinIndexedVector * region ) const;
     772  void updateColumnLDensish(CoinIndexedVector *region) const;
    685773  /// Updates part of column (FTRANL) when dense (i.e. do as inner products)
    686   void updateColumnLDense ( CoinIndexedVector * region ) const;
     774  void updateColumnLDense(CoinIndexedVector *region) const;
    687775  /// Updates part of column (FTRANL) when sparse
    688   void updateColumnLSparse ( CoinIndexedVector * region
     776  void updateColumnLSparse(CoinIndexedVector *region
    689777#if ABC_PARALLEL
    690                              ,int whichSparse
    691 #endif
    692                              ) const;
     778    ,
     779    int whichSparse
     780#endif
     781    ) const;
    693782
    694783  /// Updates part of column (FTRANR) without FT update
    695   void updateColumnR ( CoinIndexedVector * region
    696 #if ABC_SMALL<2
    697                        , CoinAbcStatistics & statistics
     784  void updateColumnR(CoinIndexedVector *region
     785#if ABC_SMALL < 2
     786    ,
     787    CoinAbcStatistics &statistics
    698788#endif
    699789#if ABC_PARALLEL
    700                        ,int whichSparse=0
    701 #endif
    702                        ) const;
     790    ,
     791    int whichSparse = 0
     792#endif
     793    ) const;
    703794  /// Store update after doing L and R - retuns false if no room
    704795  bool storeFT(
    705 #if ABC_SMALL<3
    706                const
    707 #endif
    708                CoinIndexedVector * regionFT);
     796#if ABC_SMALL < 3
     797    const
     798#endif
     799    CoinIndexedVector *regionFT);
    709800  /// Updates part of column (FTRANU)
    710   void updateColumnU ( CoinIndexedVector * region
    711 #if ABC_SMALL<2
    712                        , CoinAbcStatistics & statistics
     801  void updateColumnU(CoinIndexedVector *region
     802#if ABC_SMALL < 2
     803    ,
     804    CoinAbcStatistics &statistics
    713805#endif
    714806#if ABC_PARALLEL
    715                        ,int whichSparse=0
    716 #endif
    717                        ) const;
     807    ,
     808    int whichSparse = 0
     809#endif
     810    ) const;
    718811
    719812  /// Updates part of column (FTRANU) when sparse
    720   void updateColumnUSparse ( CoinIndexedVector * regionSparse
     813  void updateColumnUSparse(CoinIndexedVector *regionSparse
    721814#if ABC_PARALLEL
    722                              ,int whichSparse
    723 #endif
    724                              ) const;
     815    ,
     816    int whichSparse
     817#endif
     818    ) const;
    725819  /// Updates part of column (FTRANU)
    726   void updateColumnUDensish (  CoinIndexedVector * regionSparse) const;
     820  void updateColumnUDensish(CoinIndexedVector *regionSparse) const;
    727821  /// Updates part of column (FTRANU) when dense (i.e. do as inner products)
    728   void updateColumnUDense (  CoinIndexedVector * regionSparse) const;
     822  void updateColumnUDense(CoinIndexedVector *regionSparse) const;
    729823  /// Updates part of 2 columns (FTRANU) real work
    730   void updateTwoColumnsUDensish (
    731                                  CoinSimplexInt & numberNonZero1,
    732                                  CoinFactorizationDouble * COIN_RESTRICT region1,
    733                                  CoinSimplexInt * COIN_RESTRICT index1,
    734                                  CoinSimplexInt & numberNonZero2,
    735                                  CoinFactorizationDouble * COIN_RESTRICT region2,
    736                                  CoinSimplexInt * COIN_RESTRICT index2) const;
     824  void updateTwoColumnsUDensish(
     825    CoinSimplexInt &numberNonZero1,
     826    CoinFactorizationDouble *COIN_RESTRICT region1,
     827    CoinSimplexInt *COIN_RESTRICT index1,
     828    CoinSimplexInt &numberNonZero2,
     829    CoinFactorizationDouble *COIN_RESTRICT region2,
     830    CoinSimplexInt *COIN_RESTRICT index2) const;
    737831  /// Updates part of column PFI (FTRAN) (after rest)
    738   void updateColumnPFI ( CoinIndexedVector * regionSparse) const;
     832  void updateColumnPFI(CoinIndexedVector *regionSparse) const;
    739833  /// Updates part of column transpose PFI (BTRAN) (before rest)
    740   void updateColumnTransposePFI ( CoinIndexedVector * region) const;
     834  void updateColumnTransposePFI(CoinIndexedVector *region) const;
    741835  /** Updates part of column transpose (BTRANU),
    742836      assumes index is sorted i.e. region is correct */
    743   void updateColumnTransposeU ( CoinIndexedVector * region,
    744                                 CoinSimplexInt smallestIndex
    745 #if ABC_SMALL<2
    746                        , CoinAbcStatistics & statistics
     837  void updateColumnTransposeU(CoinIndexedVector *region,
     838    CoinSimplexInt smallestIndex
     839#if ABC_SMALL < 2
     840    ,
     841    CoinAbcStatistics &statistics
    747842#endif
    748843#if ABC_PARALLEL
    749                   ,int whichCpu
    750 #endif
    751                                 ) const;
     844    ,
     845    int whichCpu
     846#endif
     847    ) const;
    752848  /** Updates part of column transpose (BTRANU) when densish,
    753849      assumes index is sorted i.e. region is correct */
    754   void updateColumnTransposeUDensish ( CoinIndexedVector * region,
    755                                        CoinSimplexInt smallestIndex) const;
     850  void updateColumnTransposeUDensish(CoinIndexedVector *region,
     851    CoinSimplexInt smallestIndex) const;
    756852  /** Updates part of column transpose (BTRANU) when sparse,
    757853      assumes index is sorted i.e. region is correct */
    758   void updateColumnTransposeUSparse ( CoinIndexedVector * region
     854  void updateColumnTransposeUSparse(CoinIndexedVector *region
    759855#if ABC_PARALLEL
    760                                                 ,int whichSparse
    761 #endif
    762                                       ) const;
     856    ,
     857    int whichSparse
     858#endif
     859    ) const;
    763860  /** Updates part of column transpose (BTRANU) by column
    764861      assumes index is sorted i.e. region is correct */
    765   void updateColumnTransposeUByColumn ( CoinIndexedVector * region,
    766                                         CoinSimplexInt smallestIndex) const;
     862  void updateColumnTransposeUByColumn(CoinIndexedVector *region,
     863    CoinSimplexInt smallestIndex) const;
    767864
    768865  /// Updates part of column transpose (BTRANR)
    769   void updateColumnTransposeR ( CoinIndexedVector * region
    770 #if ABC_SMALL<2
    771                        , CoinAbcStatistics & statistics
    772 #endif
    773                                 ) const;
     866  void updateColumnTransposeR(CoinIndexedVector *region
     867#if ABC_SMALL < 2
     868    ,
     869    CoinAbcStatistics &statistics
     870#endif
     871    ) const;
    774872  /// Updates part of column transpose (BTRANR) when dense
    775   void updateColumnTransposeRDensish ( CoinIndexedVector * region ) const;
     873  void updateColumnTransposeRDensish(CoinIndexedVector *region) const;
    776874  /// Updates part of column transpose (BTRANR) when sparse
    777   void updateColumnTransposeRSparse ( CoinIndexedVector * region ) const;
     875  void updateColumnTransposeRSparse(CoinIndexedVector *region) const;
    778876
    779877  /// Updates part of column transpose (BTRANL)
    780   void updateColumnTransposeL ( CoinIndexedVector * region
    781 #if ABC_SMALL<2
    782                        , CoinAbcStatistics & statistics
     878  void updateColumnTransposeL(CoinIndexedVector *region
     879#if ABC_SMALL < 2
     880    ,
     881    CoinAbcStatistics &statistics
    783882#endif
    784883#if ABC_PARALLEL
    785                                       ,int whichSparse
    786 #endif
    787                                 ) const;
     884    ,
     885    int whichSparse
     886#endif
     887    ) const;
    788888  /// Updates part of column transpose (BTRANL) when densish by column
    789   void updateColumnTransposeLDensish ( CoinIndexedVector * region ) const;
     889  void updateColumnTransposeLDensish(CoinIndexedVector *region) const;
    790890  /// Updates part of column transpose (BTRANL) when densish by row
    791   void updateColumnTransposeLByRow ( CoinIndexedVector * region ) const;
     891  void updateColumnTransposeLByRow(CoinIndexedVector *region) const;
    792892  /// Updates part of column transpose (BTRANL) when sparse (by Row)
    793   void updateColumnTransposeLSparse ( CoinIndexedVector * region
     893  void updateColumnTransposeLSparse(CoinIndexedVector *region
    794894#if ABC_PARALLEL
    795                                                 ,int whichSparse
    796 #endif
    797                                       ) const;
     895    ,
     896    int whichSparse
     897#endif
     898    ) const;
    798899public:
    799900  /** Replaces one Column to basis for PFI
     
    801902   In this case region is not empty - it is incoming variable (updated)
    802903  */
    803   CoinSimplexInt replaceColumnPFI ( CoinIndexedVector * regionSparse,
    804                          CoinSimplexInt pivotRow, CoinSimplexDouble alpha);
     904  CoinSimplexInt replaceColumnPFI(CoinIndexedVector *regionSparse,
     905    CoinSimplexInt pivotRow, CoinSimplexDouble alpha);
     906
    805907protected:
    806908  /** Returns accuracy status of replaceColumn
     
    808910  CoinSimplexInt checkPivot(CoinSimplexDouble saveFromU, CoinSimplexDouble oldPivot) const;
    809911  /// 0 fine, -99 singular, 2 dense
    810   int pivot ( CoinSimplexInt pivotRow,
    811                CoinSimplexInt pivotColumn,
    812                CoinBigIndex pivotRowPosition,
    813                CoinBigIndex pivotColumnPosition,
    814                CoinFactorizationDouble * COIN_RESTRICT work,
    815                CoinSimplexUnsignedInt * COIN_RESTRICT workArea2,
    816                CoinSimplexInt increment2,
    817                int * COIN_RESTRICT markRow );
    818   int pivot ( CoinSimplexInt & pivotRow,
    819                CoinSimplexInt & pivotColumn,
    820                CoinBigIndex pivotRowPosition,
    821                CoinBigIndex pivotColumnPosition,
    822                int * COIN_RESTRICT markRow );
    823 #if ABC_SMALL<2
     912  int pivot(CoinSimplexInt pivotRow,
     913    CoinSimplexInt pivotColumn,
     914    CoinBigIndex pivotRowPosition,
     915    CoinBigIndex pivotColumnPosition,
     916    CoinFactorizationDouble *COIN_RESTRICT work,
     917    CoinSimplexUnsignedInt *COIN_RESTRICT workArea2,
     918    CoinSimplexInt increment2,
     919    int *COIN_RESTRICT markRow);
     920  int pivot(CoinSimplexInt &pivotRow,
     921    CoinSimplexInt &pivotColumn,
     922    CoinBigIndex pivotRowPosition,
     923    CoinBigIndex pivotColumnPosition,
     924    int *COIN_RESTRICT markRow);
     925#if ABC_SMALL < 2
    824926#define CONVERTROW 2
    825 #elif ABC_SMALL<4
     927#elif ABC_SMALL < 4
    826928#else
    827929#undef ABC_DENSE_CODE
     
    830932
    831933  //@}
    832 ////////////////// data //////////////////
     934  ////////////////// data //////////////////
    833935protected:
    834 
    835936  /**@name data */
    836937  //@{
    837   CoinSimplexInt * pivotColumnAddress_;
    838   CoinSimplexInt * permuteAddress_;
    839   CoinFactorizationDouble * pivotRegionAddress_;
    840   CoinFactorizationDouble * elementUAddress_;
    841   CoinSimplexInt * indexRowUAddress_;
    842   CoinSimplexInt * numberInColumnAddress_;
    843   CoinSimplexInt * numberInColumnPlusAddress_;
     938  CoinSimplexInt *pivotColumnAddress_;
     939  CoinSimplexInt *permuteAddress_;
     940  CoinFactorizationDouble *pivotRegionAddress_;
     941  CoinFactorizationDouble *elementUAddress_;
     942  CoinSimplexInt *indexRowUAddress_;
     943  CoinSimplexInt *numberInColumnAddress_;
     944  CoinSimplexInt *numberInColumnPlusAddress_;
    844945#ifdef ABC_USE_FUNCTION_POINTERS
    845946  /// Array of function pointers
    846   scatterStruct * scatterPointersUColumnAddress_;
    847   CoinFactorizationDouble * elementUColumnPlusAddress_;
    848 #endif
    849   CoinBigIndex * startColumnUAddress_;
     947  scatterStruct *scatterPointersUColumnAddress_;
     948  CoinFactorizationDouble *elementUColumnPlusAddress_;
     949#endif
     950  CoinBigIndex *startColumnUAddress_;
    850951#if CONVERTROW
    851   CoinBigIndex * convertRowToColumnUAddress_;
    852 #if CONVERTROW>1
    853   CoinBigIndex * convertColumnToRowUAddress_;
    854 #endif
    855 #endif
    856 #if ABC_SMALL<2
    857   CoinFactorizationDouble * elementRowUAddress_;
    858 #endif
    859   CoinBigIndex * startRowUAddress_;
    860   CoinSimplexInt * numberInRowAddress_;
    861   CoinSimplexInt * indexColumnUAddress_;
    862   CoinSimplexInt * firstCountAddress_;
     952  CoinBigIndex *convertRowToColumnUAddress_;
     953#if CONVERTROW > 1
     954  CoinBigIndex *convertColumnToRowUAddress_;
     955#endif
     956#endif
     957#if ABC_SMALL < 2
     958  CoinFactorizationDouble *elementRowUAddress_;
     959#endif
     960  CoinBigIndex *startRowUAddress_;
     961  CoinSimplexInt *numberInRowAddress_;
     962  CoinSimplexInt *indexColumnUAddress_;
     963  CoinSimplexInt *firstCountAddress_;
    863964  /// Next Row/Column with count
    864   CoinSimplexInt * nextCountAddress_;
     965  CoinSimplexInt *nextCountAddress_;
    865966  /// Previous Row/Column with count
    866   CoinSimplexInt * lastCountAddress_;
    867   CoinSimplexInt * nextColumnAddress_;
    868   CoinSimplexInt * lastColumnAddress_;
    869   CoinSimplexInt * nextRowAddress_;
    870   CoinSimplexInt * lastRowAddress_;
    871   CoinSimplexInt * saveColumnAddress_;
     967  CoinSimplexInt *lastCountAddress_;
     968  CoinSimplexInt *nextColumnAddress_;
     969  CoinSimplexInt *lastColumnAddress_;
     970  CoinSimplexInt *nextRowAddress_;
     971  CoinSimplexInt *lastRowAddress_;
     972  CoinSimplexInt *saveColumnAddress_;
    872973  //CoinSimplexInt * saveColumnAddress2_;
    873   CoinCheckZero * markRowAddress_;
    874   CoinSimplexInt * listAddress_;
    875   CoinFactorizationDouble * elementLAddress_;
    876   CoinSimplexInt * indexRowLAddress_;
    877   CoinBigIndex * startColumnLAddress_;
    878 #if ABC_SMALL<2
    879   CoinBigIndex * startRowLAddress_;
    880 #endif
    881   CoinSimplexInt * pivotLinkedBackwardsAddress_;
    882   CoinSimplexInt * pivotLinkedForwardsAddress_;
    883   CoinSimplexInt * pivotLOrderAddress_;
    884   CoinBigIndex * startColumnRAddress_;
     974  CoinCheckZero *markRowAddress_;
     975  CoinSimplexInt *listAddress_;
     976  CoinFactorizationDouble *elementLAddress_;
     977  CoinSimplexInt *indexRowLAddress_;
     978  CoinBigIndex *startColumnLAddress_;
     979#if ABC_SMALL < 2
     980  CoinBigIndex *startRowLAddress_;
     981#endif
     982  CoinSimplexInt *pivotLinkedBackwardsAddress_;
     983  CoinSimplexInt *pivotLinkedForwardsAddress_;
     984  CoinSimplexInt *pivotLOrderAddress_;
     985  CoinBigIndex *startColumnRAddress_;
    885986  /// Elements of R
    886987  CoinFactorizationDouble *elementRAddress_;
    887988  /// Row indices for R
    888989  CoinSimplexInt *indexRowRAddress_;
    889   CoinSimplexInt * indexColumnLAddress_;
    890   CoinFactorizationDouble * elementByRowLAddress_;
    891 #if ABC_SMALL<4
    892   CoinFactorizationDouble * denseAreaAddress_;
    893 #endif
    894   CoinFactorizationDouble * workAreaAddress_;
    895   CoinSimplexUnsignedInt * workArea2Address_;
    896   mutable CoinSimplexInt * sparseAddress_;
     990  CoinSimplexInt *indexColumnLAddress_;
     991  CoinFactorizationDouble *elementByRowLAddress_;
     992#if ABC_SMALL < 4
     993  CoinFactorizationDouble *denseAreaAddress_;
     994#endif
     995  CoinFactorizationDouble *workAreaAddress_;
     996  CoinSimplexUnsignedInt *workArea2Address_;
     997  mutable CoinSimplexInt *sparseAddress_;
    897998#ifdef SMALL_PERMUTE
    898   CoinSimplexInt * fromSmallToBigRow_;
    899   CoinSimplexInt * fromSmallToBigColumn_;
    900 #endif   
     999  CoinSimplexInt *fromSmallToBigRow_;
     1000  CoinSimplexInt *fromSmallToBigColumn_;
     1001#endif
    9011002  /// Number of Rows after iterating
    9021003  CoinSimplexInt numberRowsExtra_;
     
    9141015  /// First place in funny copy zeroed out
    9151016  CoinBigIndex firstZeroed_;
    916 #if ABC_SMALL<2
     1017#if ABC_SMALL < 2
    9171018  /// Below this use sparse technology - if 0 then no L row copy
    9181019  CoinSimplexInt sparseThreshold_;
     
    9521053  /// Number of trials before rejection
    9531054  CoinSimplexInt numberTrials_;
    954 #if ABC_SMALL<4
     1055#if ABC_SMALL < 4
    9551056  /// Leading dimension for dense
    9561057  CoinSimplexInt leadingDimension_;
    9571058#endif
    958 #if COIN_BIG_DOUBLE==1
     1059#if COIN_BIG_DOUBLE == 1
    9591060  /// Work arrays
    9601061  mutable CoinFactorizationLongDoubleArrayWithLength longArray_[FACTOR_CPU];
    9611062  /// Associated CoinIndexedVector
    962   mutable CoinIndexedVector * associatedVector_[FACTOR_CPU];
     1063  mutable CoinIndexedVector *associatedVector_[FACTOR_CPU];
    9631064#endif
    9641065  /// Pivot order for each Column
     
    10041105#endif
    10051106#if CONVERTROW
    1006   /// Converts rows to columns in U 
     1107  /// Converts rows to columns in U
    10071108  CoinBigIndexArrayWithLength convertRowToColumnU_;
    1008 #if CONVERTROW>1
    1009   /// Converts columns to rows in U 
     1109#if CONVERTROW > 1
     1110  /// Converts columns to rows in U
    10101111  CoinBigIndexArrayWithLength convertColumnToRowU_;
    10111112#endif
    10121113#endif
    1013 #if ABC_SMALL<2
     1114#if ABC_SMALL < 2
    10141115  /// Elements of U by row
    10151116  CoinFactorizationDoubleArrayWithLength elementRowU_;
     
    10211122  /// Start of each column in L
    10221123  CoinBigIndexArrayWithLength startColumnL_;
    1023 #if ABC_SMALL<4
     1124#if ABC_SMALL < 4
    10241125  /// Dense area
    10251126  CoinFactorizationDoubleArrayWithLength denseArea_;
     
    10291130  /// Second work area
    10301131  CoinUnsignedIntArrayWithLength workArea2_;
    1031 #if ABC_SMALL<2
     1132#if ABC_SMALL < 2
    10321133  /// Start of each row in L
    10331134  CoinBigIndexArrayWithLength startRowL_;
     
    10451146  // last slack pivot row
    10461147  CoinSimplexInt lastSlack_;
    1047 #if ABC_SMALL<2
     1148#if ABC_SMALL < 2
    10481149  /// To decide how to solve
    10491150  mutable double ftranCountInput_;
     
    10571158  double ftranTwiddleFactor1_;
    10581159  double ftranTwiddleFactor2_;
    1059 #endif 
     1160#endif
    10601161  mutable CoinSimplexInt numberFtranCounts_;
    10611162#endif
    10621163  /// Maximum rows (ever) (here to use double alignment)
    10631164  CoinSimplexInt maximumRows_;
    1064 #if ABC_SMALL<2
     1165#if ABC_SMALL < 2
    10651166  mutable double ftranFTCountInput_;
    10661167  mutable double ftranFTCountAfterL_;
     
    10731174  double ftranFTTwiddleFactor1_;
    10741175  double ftranFTTwiddleFactor2_;
    1075 #endif 
     1176#endif
    10761177  mutable CoinSimplexInt numberFtranFTCounts_;
    10771178#endif
    1078 #if ABC_SMALL<4
     1179#if ABC_SMALL < 4
    10791180  /// Dense threshold (here to use double alignment)
    10801181  CoinSimplexInt denseThreshold_;
    10811182#endif
    1082 #if ABC_SMALL<2
     1183#if ABC_SMALL < 2
    10831184  mutable double btranCountInput_;
    10841185  mutable double btranCountAfterU_;
     
    10911192  double btranTwiddleFactor1_;
    10921193  double btranTwiddleFactor2_;
    1093 #endif 
     1194#endif
    10941195  mutable CoinSimplexInt numberBtranCounts_;
    10951196#endif
    10961197  /// Maximum maximum pivots
    10971198  CoinSimplexInt maximumMaximumPivots_;
    1098 #if ABC_SMALL<2
     1199#if ABC_SMALL < 2
    10991200  /// To decide how to solve
    11001201  mutable double ftranFullCountInput_;
     
    11081209  double ftranFullTwiddleFactor1_;
    11091210  double ftranFullTwiddleFactor2_;
    1110 #endif 
     1211#endif
    11111212  mutable CoinSimplexInt numberFtranFullCounts_;
    11121213#endif
    11131214  /// Rows first time nonzero
    11141215  CoinSimplexInt initialNumberRows_;
    1115 #if ABC_SMALL<2
     1216#if ABC_SMALL < 2
    11161217  /// To decide how to solve
    11171218  mutable double btranFullCountInput_;
     
    11251226  double btranFullTwiddleFactor1_;
    11261227  double btranFullTwiddleFactor2_;
    1127 #endif 
     1228#endif
    11281229  mutable CoinSimplexInt numberBtranFullCounts_;
    11291230#endif
     
    11371238  /// Size in bytes of a sparseArray
    11381239  CoinBigIndex sizeSparseArray_;
     1240
    11391241public:
    1140 #if ABC_SMALL<2
    1141 #if ABC_SMALL>=0
    1142   inline bool gotLCopy() const {return ((state_&ABC_FAC_GOT_LCOPY)!=0);}
    1143   inline void setNoGotLCopy() {state_ &= ~ABC_FAC_GOT_LCOPY;}
    1144   inline void setYesGotLCopy() {state_ |= ABC_FAC_GOT_LCOPY;}
    1145   inline bool gotRCopy() const {return ((state_&ABC_FAC_GOT_RCOPY)!=0);}
    1146   inline void setNoGotRCopy() {state_ &= ~ABC_FAC_GOT_RCOPY;}
    1147   inline void setYesGotRCopy() {state_ |= ABC_FAC_GOT_RCOPY;}
    1148   inline bool gotUCopy() const {return ((state_&ABC_FAC_GOT_UCOPY)!=0);}
    1149   inline void setNoGotUCopy() {state_ &= ~ABC_FAC_GOT_UCOPY;}
    1150   inline void setYesGotUCopy() {state_ |= ABC_FAC_GOT_UCOPY;}
    1151   inline bool gotSparse() const {return ((state_&ABC_FAC_GOT_SPARSE)!=0);}
    1152   inline void setNoGotSparse() {state_ &= ~ABC_FAC_GOT_SPARSE;}
    1153   inline void setYesGotSparse() {state_ |= ABC_FAC_GOT_SPARSE;}
     1242#if ABC_SMALL < 2
     1243#if ABC_SMALL >= 0
     1244  inline bool gotLCopy() const
     1245  {
     1246    return ((state_ & ABC_FAC_GOT_LCOPY) != 0);
     1247  }
     1248  inline void setNoGotLCopy() { state_ &= ~ABC_FAC_GOT_LCOPY; }
     1249  inline void setYesGotLCopy() { state_ |= ABC_FAC_GOT_LCOPY; }
     1250  inline bool gotRCopy() const { return ((state_ & ABC_FAC_GOT_RCOPY) != 0); }
     1251  inline void setNoGotRCopy() { state_ &= ~ABC_FAC_GOT_RCOPY; }
     1252  inline void setYesGotRCopy() { state_ |= ABC_FAC_GOT_RCOPY; }
     1253  inline bool gotUCopy() const { return ((state_ & ABC_FAC_GOT_UCOPY) != 0); }
     1254  inline void setNoGotUCopy() { state_ &= ~ABC_FAC_GOT_UCOPY; }
     1255  inline void setYesGotUCopy() { state_ |= ABC_FAC_GOT_UCOPY; }
     1256  inline bool gotSparse() const { return ((state_ & ABC_FAC_GOT_SPARSE) != 0); }
     1257  inline void setNoGotSparse() { state_ &= ~ABC_FAC_GOT_SPARSE; }
     1258  inline void setYesGotSparse() { state_ |= ABC_FAC_GOT_SPARSE; }
    11541259#else
    11551260  // force use of copies
    1156   inline bool gotLCopy() const {return true;}
     1261  inline bool gotLCopy() const { return true; }
    11571262  inline void setNoGotLCopy() {}
    11581263  inline void setYesGotLCopy() {}
    1159   inline bool gotRCopy() const {return true;}
     1264  inline bool gotRCopy() const { return true; }
    11601265  inline void setNoGotRCopy() {}
    11611266  inline void setYesGotRCopy() {}
    1162   inline bool gotUCopy() const {return true;}
     1267  inline bool gotUCopy() const { return true; }
    11631268  inline void setNoGotUCopy() {}
    11641269  inline void setYesGotUCopy() {}
    1165   inline bool gotSparse() const {return true;}
     1270  inline bool gotSparse() const { return true; }
    11661271  inline void setNoGotSparse() {}
    11671272  inline void setYesGotSparse() {}
     
    11691274#else
    11701275  // force no use of copies
    1171   inline bool gotLCopy() const {return false;}
     1276  inline bool gotLCopy() const { return false; }
    11721277  inline void setNoGotLCopy() {}
    11731278  inline void setYesGotLCopy() {}
    1174   inline bool gotRCopy() const {return false;}
     1279  inline bool gotRCopy() const { return false; }
    11751280  inline void setNoGotRCopy() {}
    11761281  inline void setYesGotRCopy() {}
    1177   inline bool gotUCopy() const {return false;}
     1282  inline bool gotUCopy() const { return false; }
    11781283  inline void setNoGotUCopy() {}
    11791284  inline void setYesGotUCopy() {}
    1180   inline bool gotSparse() const {return false;}
     1285  inline bool gotSparse() const { return false; }
    11811286  inline void setNoGotSparse() {}
    11821287  inline void setYesGotSparse() {}
     
    11911296};
    11921297
    1193 
     1298/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     1299*/
Note: See TracChangeset for help on using the changeset viewer.