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/CoinAbcBaseFactorization1.cpp

    r2146 r2385  
    1515#include "CoinPackedMatrix.hpp"
    1616#include "CoinFinite.hpp"
    17 #define _mm256_broadcast_sd(x) static_cast<__m256d> (__builtin_ia32_vbroadcastsd256 (x))
     17#define _mm256_broadcast_sd(x) static_cast< __m256d >(__builtin_ia32_vbroadcastsd256(x))
    1818#define _mm256_load_pd(x) *(__m256d *)(x)
    19 #define _mm256_store_pd (s, x)  *((__m256d *)s)=x
     19#define _mm256_store_pd (s, x) * ((__m256d *)s) = x
    2020//:class CoinAbcTypeFactorization.  Deals with Factorization and Updates
    2121//  CoinAbcTypeFactorization.  Constructor
    22 CoinAbcTypeFactorization::CoinAbcTypeFactorization (  )
     22CoinAbcTypeFactorization::CoinAbcTypeFactorization()
    2323  : CoinAbcAnyFactorization()
    2424{
     
    2626}
    2727
    28 /// Copy constructor 
    29 CoinAbcTypeFactorization::CoinAbcTypeFactorization ( const CoinAbcTypeFactorization &other)
     28/// Copy constructor
     29CoinAbcTypeFactorization::CoinAbcTypeFactorization(const CoinAbcTypeFactorization &other)
    3030  : CoinAbcAnyFactorization(other)
    3131{
     
    3434}
    3535/// Clone
    36 CoinAbcAnyFactorization * 
    37 CoinAbcTypeFactorization::clone() const 
     36CoinAbcAnyFactorization *
     37CoinAbcTypeFactorization::clone() const
    3838{
    3939  return new CoinAbcTypeFactorization(*this);
    4040}
    41 /// Copy constructor 
    42 CoinAbcTypeFactorization::CoinAbcTypeFactorization ( const CoinFactorization & /*other*/)
     41/// Copy constructor
     42CoinAbcTypeFactorization::CoinAbcTypeFactorization(const CoinFactorization & /*other*/)
    4343  : CoinAbcAnyFactorization()
    4444{
     
    4848}
    4949/// The real work of constructors etc
    50 void CoinAbcTypeFactorization::gutsOfDestructor(CoinSimplexInt )
     50void CoinAbcTypeFactorization::gutsOfDestructor(CoinSimplexInt)
    5151{
    5252  numberCompressions_ = 0;
     
    6262  lastSlack_ = 0;
    6363  numberU_ = 0;
    64   maximumU_=0;
     64  maximumU_ = 0;
    6565  lengthU_ = 0;
    66   lastEntryByColumnU_=0;
    67   lastEntryByRowU_=0;
     66  lastEntryByColumnU_ = 0;
     67  lastEntryByRowU_ = 0;
    6868  lengthAreaU_ = 0;
    6969  numberL_ = 0;
     
    7474  lengthR_ = 0;
    7575  lengthAreaR_ = 0;
    76 #if ABC_SMALL<4
    77   numberDense_=0;
    78 #endif 
     76#if ABC_SMALL < 4
     77  numberDense_ = 0;
     78#endif
    7979}
    8080#if FACTORIZATION_STATISTICS
     
    8484void CoinAbcTypeFactorization::gutsOfInitialize(CoinSimplexInt type)
    8585{
    86   if ((type&2)!=0) {
     86  if ((type & 2) != 0) {
    8787    numberCompressions_ = 0;
    8888    numberRows_ = 0;
     
    9898    lastSlack_ = 0;
    9999    numberU_ = 0;
    100     maximumU_=0;
     100    maximumU_ = 0;
    101101    lengthU_ = 0;
    102     lastEntryByColumnU_=0;
    103     lastEntryByRowU_=0;
     102    lastEntryByColumnU_ = 0;
     103    lastEntryByRowU_ = 0;
    104104    lengthAreaU_ = 0;
    105105#ifdef ABC_USE_FUNCTION_POINTERS
     
    115115    elementRAddress_ = NULL;
    116116    indexRowRAddress_ = NULL;
    117 #if ABC_SMALL<2
     117#if ABC_SMALL < 2
    118118    // always switch off sparse
    119     sparseThreshold_=0;
    120 #endif
    121     state_= 0;
     119    sparseThreshold_ = 0;
     120#endif
     121    state_ = 0;
    122122    // Maximum rows (ever)
    123     maximumRows_=0;
     123    maximumRows_ = 0;
    124124    // Rows first time nonzero
    125     initialNumberRows_=0;
     125    initialNumberRows_ = 0;
    126126    // Maximum maximum pivots
    127     maximumMaximumPivots_=0;
    128 #if ABC_SMALL<4
    129     numberDense_=0;
    130 #endif
    131   }
    132   // after 2 
    133   if ((type&1)!=0) {
     127    maximumMaximumPivots_ = 0;
     128#if ABC_SMALL < 4
     129    numberDense_ = 0;
     130#endif
     131  }
     132  // after 2
     133  if ((type & 1) != 0) {
    134134    areaFactor_ = 0.0;
    135135    pivotTolerance_ = 1.0e-1;
    136     numberDense_=0;
     136    numberDense_ = 0;
    137137#ifndef USE_FIXED_ZERO_TOLERANCE
    138138    zeroTolerance_ = 1.0e-13;
    139139#else
    140     zeroTolerance_ = pow(0.5,43);
    141 #endif
    142     messageLevel_=0;
    143     maximumPivots_=200;
    144     maximumMaximumPivots_=200;
     140    zeroTolerance_ = pow(0.5, 43);
     141#endif
     142    messageLevel_ = 0;
     143    maximumPivots_ = 200;
     144    maximumMaximumPivots_ = 200;
    145145    numberTrials_ = 4;
    146     relaxCheck_=1.0;
    147 #if ABC_SMALL<4
    148 #if ABC_DENSE_CODE>0
     146    relaxCheck_ = 1.0;
     147#if ABC_SMALL < 4
     148#if ABC_DENSE_CODE > 0
    149149    //denseThreshold_=4;//16; //31;
    150     denseThreshold_=71;
     150    denseThreshold_ = 71;
    151151#else
    152     denseThreshold_=-16;
     152    denseThreshold_ = -16;
    153153#endif
    154154#if FACTORIZATION_STATISTICS
    155     denseThreshold_=denseThresholdX;
     155    denseThreshold_ = denseThresholdX;
    156156#endif
    157157    //denseThreshold_=0; // temp (? ABC_PARALLEL)
    158158#endif
    159159  }
    160 #if ABC_SMALL<4
     160#if ABC_SMALL < 4
    161161  //denseThreshold_=10000;
    162162#endif
    163   if ((type&4)!=0) {
    164 #if COIN_BIG_DOUBLE==1
    165     for (int i=0;i<FACTOR_CPU;i++) {
     163  if ((type & 4) != 0) {
     164#if COIN_BIG_DOUBLE == 1
     165    for (int i = 0; i < FACTOR_CPU; i++) {
    166166      longArray_[i].switchOn(4);
    167       associatedVector_[i]=NULL;
     167      associatedVector_[i] = NULL;
    168168    }
    169169#endif
     
    191191#if CONVERTROW
    192192    convertRowToColumnU_.switchOn();
    193 #if CONVERTROW>1
     193#if CONVERTROW > 1
    194194    convertColumnToRowU_.switchOn();
    195195#endif
    196196#endif
    197 #if ABC_SMALL<2
     197#if ABC_SMALL < 2
    198198    elementRowU_.switchOn();
    199199#endif
     
    201201    indexRowL_.switchOn();
    202202    startColumnL_.switchOn();
    203 #if ABC_SMALL<4
     203#if ABC_SMALL < 4
    204204    denseArea_.switchOn(7);
    205205#endif
    206206    workArea_.switchOn();
    207207    workArea2_.switchOn();
    208 #if ABC_SMALL<2
     208#if ABC_SMALL < 2
    209209    startRowL_.switchOn();
    210210    indexColumnL_.switchOn();
    211211    elementByRowL_.switchOn();
    212212    sparse_.switchOn();
    213    
     213
    214214    // Below are all to collect
    215     ftranCountInput_=0.0;
    216     ftranCountAfterL_=0.0;
    217     ftranCountAfterR_=0.0;
    218     ftranCountAfterU_=0.0;
    219     ftranFTCountInput_=0.0;
    220     ftranFTCountAfterL_=0.0;
    221     ftranFTCountAfterR_=0.0;
    222     ftranFTCountAfterU_=0.0;
    223     btranCountInput_=0.0;
    224     btranCountAfterU_=0.0;
    225     btranCountAfterR_=0.0;
    226     btranCountAfterL_=0.0;
    227     ftranFullCountInput_=0.0;
    228     ftranFullCountAfterL_=0.0;
    229     ftranFullCountAfterR_=0.0;
    230     ftranFullCountAfterU_=0.0;
    231     btranFullCountInput_=0.0;
    232     btranFullCountAfterL_=0.0;
    233     btranFullCountAfterR_=0.0;
    234     btranFullCountAfterU_=0.0;
     215    ftranCountInput_ = 0.0;
     216    ftranCountAfterL_ = 0.0;
     217    ftranCountAfterR_ = 0.0;
     218    ftranCountAfterU_ = 0.0;
     219    ftranFTCountInput_ = 0.0;
     220    ftranFTCountAfterL_ = 0.0;
     221    ftranFTCountAfterR_ = 0.0;
     222    ftranFTCountAfterU_ = 0.0;
     223    btranCountInput_ = 0.0;
     224    btranCountAfterU_ = 0.0;
     225    btranCountAfterR_ = 0.0;
     226    btranCountAfterL_ = 0.0;
     227    ftranFullCountInput_ = 0.0;
     228    ftranFullCountAfterL_ = 0.0;
     229    ftranFullCountAfterR_ = 0.0;
     230    ftranFullCountAfterU_ = 0.0;
     231    btranFullCountInput_ = 0.0;
     232    btranFullCountAfterL_ = 0.0;
     233    btranFullCountAfterR_ = 0.0;
     234    btranFullCountAfterU_ = 0.0;
    235235#if FACTORIZATION_STATISTICS
    236     ftranTwiddleFactor1_=1.0;
    237     ftranFTTwiddleFactor1_=1.0;
    238     btranTwiddleFactor1_=1.0;
    239     ftranFullTwiddleFactor1_=1.0;
    240     btranFullTwiddleFactor1_=1.0;
    241     ftranTwiddleFactor2_=1.0;
    242     ftranFTTwiddleFactor2_=1.0;
    243     btranTwiddleFactor2_=1.0;
    244     ftranFullTwiddleFactor2_=1.0;
    245     btranFullTwiddleFactor2_=1.0;
    246 #endif   
     236    ftranTwiddleFactor1_ = 1.0;
     237    ftranFTTwiddleFactor1_ = 1.0;
     238    btranTwiddleFactor1_ = 1.0;
     239    ftranFullTwiddleFactor1_ = 1.0;
     240    btranFullTwiddleFactor1_ = 1.0;
     241    ftranTwiddleFactor2_ = 1.0;
     242    ftranFTTwiddleFactor2_ = 1.0;
     243    btranTwiddleFactor2_ = 1.0;
     244    ftranFullTwiddleFactor2_ = 1.0;
     245    btranFullTwiddleFactor2_ = 1.0;
     246#endif
    247247    // We can roll over factorizations
    248     numberFtranCounts_=0;
    249     numberFtranFTCounts_=0;
    250     numberBtranCounts_=0;
    251     numberFtranFullCounts_=0;
    252     numberFtranFullCounts_=0;
    253    
    254     // While these are averages collected over last 
    255     ftranAverageAfterL_=INITIAL_AVERAGE;
    256     ftranAverageAfterR_=INITIAL_AVERAGE;
    257     ftranAverageAfterU_=INITIAL_AVERAGE;
    258     ftranFTAverageAfterL_=INITIAL_AVERAGE;
    259     ftranFTAverageAfterR_=INITIAL_AVERAGE;
    260     ftranFTAverageAfterU_=INITIAL_AVERAGE;
    261     btranAverageAfterU_=INITIAL_AVERAGE;
    262     btranAverageAfterR_=INITIAL_AVERAGE;
    263     btranAverageAfterL_=INITIAL_AVERAGE;
    264     ftranFullAverageAfterL_=INITIAL_AVERAGE;
    265     ftranFullAverageAfterR_=INITIAL_AVERAGE;
    266     ftranFullAverageAfterU_=INITIAL_AVERAGE;
    267     btranFullAverageAfterL_=INITIAL_AVERAGE;
    268     btranFullAverageAfterR_=INITIAL_AVERAGE;
    269     btranFullAverageAfterU_=INITIAL_AVERAGE;
     248    numberFtranCounts_ = 0;
     249    numberFtranFTCounts_ = 0;
     250    numberBtranCounts_ = 0;
     251    numberFtranFullCounts_ = 0;
     252    numberFtranFullCounts_ = 0;
     253
     254    // While these are averages collected over last
     255    ftranAverageAfterL_ = INITIAL_AVERAGE;
     256    ftranAverageAfterR_ = INITIAL_AVERAGE;
     257    ftranAverageAfterU_ = INITIAL_AVERAGE;
     258    ftranFTAverageAfterL_ = INITIAL_AVERAGE;
     259    ftranFTAverageAfterR_ = INITIAL_AVERAGE;
     260    ftranFTAverageAfterU_ = INITIAL_AVERAGE;
     261    btranAverageAfterU_ = INITIAL_AVERAGE;
     262    btranAverageAfterR_ = INITIAL_AVERAGE;
     263    btranAverageAfterL_ = INITIAL_AVERAGE;
     264    ftranFullAverageAfterL_ = INITIAL_AVERAGE;
     265    ftranFullAverageAfterR_ = INITIAL_AVERAGE;
     266    ftranFullAverageAfterU_ = INITIAL_AVERAGE;
     267    btranFullAverageAfterL_ = INITIAL_AVERAGE;
     268    btranFullAverageAfterR_ = INITIAL_AVERAGE;
     269    btranFullAverageAfterU_ = INITIAL_AVERAGE;
    270270#endif
    271271  }
     
    273273
    274274//  ~CoinAbcTypeFactorization.  Destructor
    275 CoinAbcTypeFactorization::~CoinAbcTypeFactorization (  )
     275CoinAbcTypeFactorization::~CoinAbcTypeFactorization()
    276276{
    277277  gutsOfDestructor();
    278278}
    279279//  =
    280 CoinAbcTypeFactorization & CoinAbcTypeFactorization::operator = ( const CoinAbcTypeFactorization & other ) {
    281   if (this != &other) {   
     280CoinAbcTypeFactorization &CoinAbcTypeFactorization::operator=(const CoinAbcTypeFactorization &other)
     281{
     282  if (this != &other) {
    282283    gutsOfDestructor();
    283284    CoinAbcAnyFactorization::operator=(other);
     
    290291{
    291292#ifdef ABC_USE_FUNCTION_POINTERS
    292   elementU_.allocate(other.elementU_, other.lengthAreaUPlus_ *CoinSizeofAsInt(CoinFactorizationDouble));
     293  elementU_.allocate(other.elementU_, other.lengthAreaUPlus_ * CoinSizeofAsInt(CoinFactorizationDouble));
    293294#else
    294   elementU_.allocate(other.elementU_, other.lengthAreaU_ *CoinSizeofAsInt(CoinFactorizationDouble));
    295 #endif
    296   indexRowU_.allocate(other.indexRowU_, (other.lengthAreaU_+1)*CoinSizeofAsInt(CoinSimplexInt) );
    297   elementL_.allocate(other.elementL_, other.lengthAreaL_*CoinSizeofAsInt(CoinFactorizationDouble) );
    298   indexRowL_.allocate(other.indexRowL_, other.lengthAreaL_*CoinSizeofAsInt(CoinSimplexInt) );
    299   startColumnL_.allocate(other.startColumnL_,(other.numberRows_ + 1)*CoinSizeofAsInt(CoinBigIndex) );
    300   pivotRegion_.allocate(other.pivotRegion_, (other.numberRows_+2 )*CoinSizeofAsInt(CoinFactorizationDouble));
     295  elementU_.allocate(other.elementU_, other.lengthAreaU_ * CoinSizeofAsInt(CoinFactorizationDouble));
     296#endif
     297  indexRowU_.allocate(other.indexRowU_, (other.lengthAreaU_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
     298  elementL_.allocate(other.elementL_, other.lengthAreaL_ * CoinSizeofAsInt(CoinFactorizationDouble));
     299  indexRowL_.allocate(other.indexRowL_, other.lengthAreaL_ * CoinSizeofAsInt(CoinSimplexInt));
     300  startColumnL_.allocate(other.startColumnL_, (other.numberRows_ + 1) * CoinSizeofAsInt(CoinBigIndex));
     301  pivotRegion_.allocate(other.pivotRegion_, (other.numberRows_ + 2) * CoinSizeofAsInt(CoinFactorizationDouble));
    301302#ifndef ABC_ORDERED_FACTORIZATION
    302   permute_.allocate(other.permute_,(other.maximumRowsExtra_ + 1)*CoinSizeofAsInt(CoinSimplexInt));
     303  permute_.allocate(other.permute_, (other.maximumRowsExtra_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
    303304#else
    304305  //temp
    305   permute_.allocate(other.permute_,(other.maximumRowsExtra_+2*numberRows_ + 1)*CoinSizeofAsInt(CoinSimplexInt));
     306  permute_.allocate(other.permute_, (other.maximumRowsExtra_ + 2 * numberRows_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
    306307#endif
    307308  firstCount_.allocate(other.firstCount_,
    308                        ( CoinMax(5*numberRows_,4*numberRows_+2*maximumPivots_+4)+2)
    309                        *CoinSizeofAsInt(CoinSimplexInt));
    310   nextCountAddress_=nextCount();
    311   lastCountAddress_=lastCount();
    312   startColumnU_.allocate(other.startColumnU_, (other.numberRows_ + 1 )*CoinSizeofAsInt(CoinBigIndex));
    313   numberInColumn_.allocate(other.numberInColumn_, (other.numberRows_ + 1 )*CoinSizeofAsInt(CoinSimplexInt));
    314 #if COIN_BIG_DOUBLE==1
    315   for (int i=0;i<FACTOR_CPU;i++)
    316     longArray_[i].allocate(other.longArray_[i],(other.maximumRowsExtra_ + 1)*CoinSizeofAsInt(long double));
    317 #endif
    318   pivotColumn_.allocate(other.pivotColumn_,(other.maximumRowsExtra_ + 1)*CoinSizeofAsInt(CoinSimplexInt));
    319   nextColumn_.allocate(other.nextColumn_, (other.maximumRowsExtra_ + 1 )*CoinSizeofAsInt(CoinSimplexInt));
    320   lastColumn_.allocate(other.lastColumn_, (other.maximumRowsExtra_ + 1 )*CoinSizeofAsInt(CoinSimplexInt));
    321   nextRow_.allocate(other.nextRow_, (other.numberRows_ + 1 )*CoinSizeofAsInt(CoinSimplexInt));
    322   lastRow_.allocate(other.lastRow_, (other.numberRows_ + 1 )*CoinSizeofAsInt(CoinSimplexInt));
    323   indexColumnU_.allocate(other.indexColumnU_, (other.lengthAreaU_+1)*CoinSizeofAsInt(CoinSimplexInt) );
     309    (CoinMax(5 * numberRows_, 4 * numberRows_ + 2 * maximumPivots_ + 4) + 2)
     310      * CoinSizeofAsInt(CoinSimplexInt));
     311  nextCountAddress_ = nextCount();
     312  lastCountAddress_ = lastCount();
     313  startColumnU_.allocate(other.startColumnU_, (other.numberRows_ + 1) * CoinSizeofAsInt(CoinBigIndex));
     314  numberInColumn_.allocate(other.numberInColumn_, (other.numberRows_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
     315#if COIN_BIG_DOUBLE == 1
     316  for (int i = 0; i < FACTOR_CPU; i++)
     317    longArray_[i].allocate(other.longArray_[i], (other.maximumRowsExtra_ + 1) * CoinSizeofAsInt(long double));
     318#endif
     319  pivotColumn_.allocate(other.pivotColumn_, (other.maximumRowsExtra_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
     320  nextColumn_.allocate(other.nextColumn_, (other.maximumRowsExtra_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
     321  lastColumn_.allocate(other.lastColumn_, (other.maximumRowsExtra_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
     322  nextRow_.allocate(other.nextRow_, (other.numberRows_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
     323  lastRow_.allocate(other.lastRow_, (other.numberRows_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
     324  indexColumnU_.allocate(other.indexColumnU_, (other.lengthAreaU_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
    324325#if CONVERTROW
    325   convertRowToColumnU_.allocate(other.convertRowToColumnU_, other.lengthAreaU_*CoinSizeofAsInt(CoinBigIndex) );
    326   const CoinBigIndex * convertUOther = other.convertRowToColumnUAddress_;
    327 #if CONVERTROW>1
    328   convertColumnToRowU_.allocate(other.convertColumnToRowU_, other.lengthAreaU_*CoinSizeofAsInt(CoinBigIndex) );
    329 #if CONVERTROW>2
    330   const CoinBigIndex * convertUOther2 = other.convertColumnToRowUAddress_;
    331 #endif
    332 #endif
    333 #endif
    334 #if ABC_SMALL<2
    335   const CoinFactorizationDouble * elementRowUOther = other.elementRowUAddress_;
     326  convertRowToColumnU_.allocate(other.convertRowToColumnU_, other.lengthAreaU_ * CoinSizeofAsInt(CoinBigIndex));
     327  const CoinBigIndex *convertUOther = other.convertRowToColumnUAddress_;
     328#if CONVERTROW > 1
     329  convertColumnToRowU_.allocate(other.convertColumnToRowU_, other.lengthAreaU_ * CoinSizeofAsInt(CoinBigIndex));
     330#if CONVERTROW > 2
     331  const CoinBigIndex *convertUOther2 = other.convertColumnToRowUAddress_;
     332#endif
     333#endif
     334#endif
     335#if ABC_SMALL < 2
     336  const CoinFactorizationDouble *elementRowUOther = other.elementRowUAddress_;
    336337#if COIN_ONE_ETA_COPY
    337338  if (elementRowUOther) {
    338339#endif
    339340#ifdef ABC_USE_FUNCTION_POINTERS
    340     elementRowU_.allocate(other.elementRowU_, other.lengthAreaUPlus_*CoinSizeofAsInt(CoinFactorizationDouble) );
     341    elementRowU_.allocate(other.elementRowU_, other.lengthAreaUPlus_ * CoinSizeofAsInt(CoinFactorizationDouble));
    341342#else
    342     elementRowU_.allocate(other.elementRowU_, other.lengthAreaU_*CoinSizeofAsInt(CoinFactorizationDouble) );
    343 #endif
    344     startRowU_.allocate(other.startRowU_,(other.numberRows_ + 1)*CoinSizeofAsInt(CoinBigIndex));
    345     numberInRow_.allocate(other.numberInRow_, (other.numberRows_ + 1 )*CoinSizeofAsInt(CoinSimplexInt));
     343  elementRowU_.allocate(other.elementRowU_, other.lengthAreaU_ * CoinSizeofAsInt(CoinFactorizationDouble));
     344#endif
     345    startRowU_.allocate(other.startRowU_, (other.numberRows_ + 1) * CoinSizeofAsInt(CoinBigIndex));
     346    numberInRow_.allocate(other.numberInRow_, (other.numberRows_ + 1) * CoinSizeofAsInt(CoinSimplexInt));
    346347#if COIN_ONE_ETA_COPY
    347348  }
    348349#endif
    349350  if (other.sparseThreshold_) {
    350     elementByRowL_.allocate(other.elementByRowL_, other.lengthAreaL_ );
    351     indexColumnL_.allocate(other.indexColumnL_, other.lengthAreaL_ );
    352     startRowL_.allocate(other.startRowL_,other.numberRows_+1);
     351    elementByRowL_.allocate(other.elementByRowL_, other.lengthAreaL_);
     352    indexColumnL_.allocate(other.indexColumnL_, other.lengthAreaL_);
     353    startRowL_.allocate(other.startRowL_, other.numberRows_ + 1);
    353354  }
    354355#endif
     
    358359  lastSlack_ = other.lastSlack_;
    359360  numberU_ = other.numberU_;
    360   maximumU_=other.maximumU_;
     361  maximumU_ = other.maximumU_;
    361362  lengthU_ = other.lengthU_;
    362   lastEntryByColumnU_=other.lastEntryByColumnU_;
    363   lastEntryByRowU_=other.lastEntryByRowU_;
     363  lastEntryByColumnU_ = other.lastEntryByColumnU_;
     364  lastEntryByRowU_ = other.lastEntryByRowU_;
    364365  lengthAreaU_ = other.lengthAreaU_;
    365366#ifdef ABC_USE_FUNCTION_POINTERS
     
    379380  numberRowsExtra_ = other.numberRowsExtra_;
    380381  maximumRowsExtra_ = other.maximumRowsExtra_;
    381   maximumPivots_=other.maximumPivots_;
     382  maximumPivots_ = other.maximumPivots_;
    382383  numberGoodU_ = other.numberGoodU_;
    383384  numberGoodL_ = other.numberGoodL_;
     
    387388  factorElements_ = other.factorElements_;
    388389  status_ = other.status_;
    389 #if ABC_SMALL<2
     390#if ABC_SMALL < 2
    390391  //doForrestTomlin_ = other.doForrestTomlin_;
    391   ftranCountInput_=other.ftranCountInput_;
    392   ftranCountAfterL_=other.ftranCountAfterL_;
    393   ftranCountAfterR_=other.ftranCountAfterR_;
    394   ftranCountAfterU_=other.ftranCountAfterU_;
    395   ftranFTCountInput_=other.ftranFTCountInput_;
    396   ftranFTCountAfterL_=other.ftranFTCountAfterL_;
    397   ftranFTCountAfterR_=other.ftranFTCountAfterR_;
    398   ftranFTCountAfterU_=other.ftranFTCountAfterU_;
    399   btranCountInput_=other.btranCountInput_;
    400   btranCountAfterU_=other.btranCountAfterU_;
    401   btranCountAfterR_=other.btranCountAfterR_;
    402   btranCountAfterL_=other.btranCountAfterL_;
    403   ftranFullCountInput_=other.ftranFullCountInput_;
    404   ftranFullCountAfterL_=other.ftranFullCountAfterL_;
    405   ftranFullCountAfterR_=other.ftranFullCountAfterR_;
    406   ftranFullCountAfterU_=other.ftranFullCountAfterU_;
    407   btranFullCountInput_=other.btranFullCountInput_;
    408   btranFullCountAfterL_=other.btranFullCountAfterL_;
    409   btranFullCountAfterR_=other.btranFullCountAfterR_;
    410   btranFullCountAfterU_=other.btranFullCountAfterU_;
    411   numberFtranCounts_=other.numberFtranCounts_;
    412   numberFtranFTCounts_=other.numberFtranFTCounts_;
    413   numberBtranCounts_=other.numberBtranCounts_;
    414   numberFtranFullCounts_=other.numberFtranFullCounts_;
    415   numberFtranFullCounts_=other.numberFtranFullCounts_;
    416   ftranAverageAfterL_=other.ftranAverageAfterL_;
    417   ftranAverageAfterR_=other.ftranAverageAfterR_;
    418   ftranAverageAfterU_=other.ftranAverageAfterU_;
    419   ftranFTAverageAfterL_=other.ftranFTAverageAfterL_;
    420   ftranFTAverageAfterR_=other.ftranFTAverageAfterR_;
    421   ftranFTAverageAfterU_=other.ftranFTAverageAfterU_;
    422   btranAverageAfterU_=other.btranAverageAfterU_;
    423   btranAverageAfterR_=other.btranAverageAfterR_;
    424   btranAverageAfterL_=other.btranAverageAfterL_;
    425   ftranFullAverageAfterL_=other.ftranFullAverageAfterL_;
    426   ftranFullAverageAfterR_=other.ftranFullAverageAfterR_;
    427   ftranFullAverageAfterU_=other.ftranFullAverageAfterU_;
    428   btranFullAverageAfterL_=other.btranFullAverageAfterL_;
    429   btranFullAverageAfterR_=other.btranFullAverageAfterR_;
    430   btranFullAverageAfterU_=other.btranFullAverageAfterU_;
     392  ftranCountInput_ = other.ftranCountInput_;
     393  ftranCountAfterL_ = other.ftranCountAfterL_;
     394  ftranCountAfterR_ = other.ftranCountAfterR_;
     395  ftranCountAfterU_ = other.ftranCountAfterU_;
     396  ftranFTCountInput_ = other.ftranFTCountInput_;
     397  ftranFTCountAfterL_ = other.ftranFTCountAfterL_;
     398  ftranFTCountAfterR_ = other.ftranFTCountAfterR_;
     399  ftranFTCountAfterU_ = other.ftranFTCountAfterU_;
     400  btranCountInput_ = other.btranCountInput_;
     401  btranCountAfterU_ = other.btranCountAfterU_;
     402  btranCountAfterR_ = other.btranCountAfterR_;
     403  btranCountAfterL_ = other.btranCountAfterL_;
     404  ftranFullCountInput_ = other.ftranFullCountInput_;
     405  ftranFullCountAfterL_ = other.ftranFullCountAfterL_;
     406  ftranFullCountAfterR_ = other.ftranFullCountAfterR_;
     407  ftranFullCountAfterU_ = other.ftranFullCountAfterU_;
     408  btranFullCountInput_ = other.btranFullCountInput_;
     409  btranFullCountAfterL_ = other.btranFullCountAfterL_;
     410  btranFullCountAfterR_ = other.btranFullCountAfterR_;
     411  btranFullCountAfterU_ = other.btranFullCountAfterU_;
     412  numberFtranCounts_ = other.numberFtranCounts_;
     413  numberFtranFTCounts_ = other.numberFtranFTCounts_;
     414  numberBtranCounts_ = other.numberBtranCounts_;
     415  numberFtranFullCounts_ = other.numberFtranFullCounts_;
     416  numberFtranFullCounts_ = other.numberFtranFullCounts_;
     417  ftranAverageAfterL_ = other.ftranAverageAfterL_;
     418  ftranAverageAfterR_ = other.ftranAverageAfterR_;
     419  ftranAverageAfterU_ = other.ftranAverageAfterU_;
     420  ftranFTAverageAfterL_ = other.ftranFTAverageAfterL_;
     421  ftranFTAverageAfterR_ = other.ftranFTAverageAfterR_;
     422  ftranFTAverageAfterU_ = other.ftranFTAverageAfterU_;
     423  btranAverageAfterU_ = other.btranAverageAfterU_;
     424  btranAverageAfterR_ = other.btranAverageAfterR_;
     425  btranAverageAfterL_ = other.btranAverageAfterL_;
     426  ftranFullAverageAfterL_ = other.ftranFullAverageAfterL_;
     427  ftranFullAverageAfterR_ = other.ftranFullAverageAfterR_;
     428  ftranFullAverageAfterU_ = other.ftranFullAverageAfterU_;
     429  btranFullAverageAfterL_ = other.btranFullAverageAfterL_;
     430  btranFullAverageAfterR_ = other.btranFullAverageAfterR_;
     431  btranFullAverageAfterU_ = other.btranFullAverageAfterU_;
    431432#if FACTORIZATION_STATISTICS
    432   ftranTwiddleFactor1_=other.ftranTwiddleFactor1_;
    433   ftranFTTwiddleFactor1_=other.ftranFTTwiddleFactor1_;
    434   btranTwiddleFactor1_=other.btranTwiddleFactor1_;
    435   ftranFullTwiddleFactor1_=other.ftranFullTwiddleFactor1_;
    436   btranFullTwiddleFactor1_=other.btranFullTwiddleFactor1_;
    437   ftranTwiddleFactor2_=other.ftranTwiddleFactor2_;
    438   ftranFTTwiddleFactor2_=other.ftranFTTwiddleFactor2_;
    439   btranTwiddleFactor2_=other.btranTwiddleFactor2_;
    440   ftranFullTwiddleFactor2_=other.ftranFullTwiddleFactor2_;
    441   btranFullTwiddleFactor2_=other.btranFullTwiddleFactor2_;
    442 #endif   
    443   sparseThreshold_=other.sparseThreshold_;
    444 #endif
    445   state_=other.state_;
     433  ftranTwiddleFactor1_ = other.ftranTwiddleFactor1_;
     434  ftranFTTwiddleFactor1_ = other.ftranFTTwiddleFactor1_;
     435  btranTwiddleFactor1_ = other.btranTwiddleFactor1_;
     436  ftranFullTwiddleFactor1_ = other.ftranFullTwiddleFactor1_;
     437  btranFullTwiddleFactor1_ = other.btranFullTwiddleFactor1_;
     438  ftranTwiddleFactor2_ = other.ftranTwiddleFactor2_;
     439  ftranFTTwiddleFactor2_ = other.ftranFTTwiddleFactor2_;
     440  btranTwiddleFactor2_ = other.btranTwiddleFactor2_;
     441  ftranFullTwiddleFactor2_ = other.ftranFullTwiddleFactor2_;
     442  btranFullTwiddleFactor2_ = other.btranFullTwiddleFactor2_;
     443#endif
     444  sparseThreshold_ = other.sparseThreshold_;
     445#endif
     446  state_ = other.state_;
    446447  // Maximum rows (ever)
    447   maximumRows_=other.maximumRows_;
     448  maximumRows_ = other.maximumRows_;
    448449  // Rows first time nonzero
    449   initialNumberRows_=other.initialNumberRows_;
     450  initialNumberRows_ = other.initialNumberRows_;
    450451  // Maximum maximum pivots
    451   maximumMaximumPivots_=other.maximumMaximumPivots_;
     452  maximumMaximumPivots_ = other.maximumMaximumPivots_;
    452453  CoinBigIndex space = lengthAreaL_ - lengthL_;
    453454
    454 #if ABC_SMALL<4
     455#if ABC_SMALL < 4
    455456  numberDense_ = other.numberDense_;
    456   denseThreshold_=other.denseThreshold_;
     457  denseThreshold_ = other.denseThreshold_;
    457458#endif
    458459  lengthAreaR_ = space;
     
    465466  if (numberRowsExtra_) {
    466467    if (startRowU_.array()) {
    467       CoinAbcMemcpy( startRowU_.array() , other.startRowU_.array(), numberRows_ + 1);
    468       CoinAbcMemcpy( numberInRow_.array() , other.numberInRow_.array(), numberRows_ + 1);
     468      CoinAbcMemcpy(startRowU_.array(), other.startRowU_.array(), numberRows_ + 1);
     469      CoinAbcMemcpy(numberInRow_.array(), other.numberInRow_.array(), numberRows_ + 1);
    469470      //startRowU_.array()[maximumRowsExtra_] = other.startRowU_.array()[maximumRowsExtra_];
    470471    }
    471     CoinAbcMemcpy( pivotRegion_.array() , other.pivotRegion_.array(), numberRows_+2 );
     472    CoinAbcMemcpy(pivotRegion_.array(), other.pivotRegion_.array(), numberRows_ + 2);
    472473#ifndef ABC_ORDERED_FACTORIZATION
    473     CoinAbcMemcpy( permute_.array() , other.permute_.array(), numberRowsExtra_ + 1);
     474    CoinAbcMemcpy(permute_.array(), other.permute_.array(), numberRowsExtra_ + 1);
    474475#else
    475   //temp
    476     CoinAbcMemcpy( permute_.array() , other.permute_.array(), maximumRowsExtra_+2*numberRows_ + 1);
    477 #endif
    478     CoinAbcMemcpy( firstCount_.array() , other.firstCount_.array(),CoinMax(5*numberRows_,4*numberRows_+2*maximumPivots_+4)+2);
    479     CoinAbcMemcpy( startColumnU_.array() , other.startColumnU_.array(), numberRows_ + 1);
    480     CoinAbcMemcpy( numberInColumn_.array() , other.numberInColumn_.array(), numberRows_ + 1);
    481     CoinAbcMemcpy( pivotColumn_.array() , other.pivotColumn_.array(), numberRowsExtra_ + 1);
    482     CoinAbcMemcpy( nextColumn_.array() , other.nextColumn_.array(), numberRowsExtra_ + 1);
    483     CoinAbcMemcpy( lastColumn_.array() , other.lastColumn_.array(), numberRowsExtra_ + 1);
    484     CoinAbcMemcpy (startColumnR() , other.startColumnR() , numberRowsExtra_ - numberRows_ + 1);
    485                          
     476    //temp
     477    CoinAbcMemcpy(permute_.array(), other.permute_.array(), maximumRowsExtra_ + 2 * numberRows_ + 1);
     478#endif
     479    CoinAbcMemcpy(firstCount_.array(), other.firstCount_.array(), CoinMax(5 * numberRows_, 4 * numberRows_ + 2 * maximumPivots_ + 4) + 2);
     480    CoinAbcMemcpy(startColumnU_.array(), other.startColumnU_.array(), numberRows_ + 1);
     481    CoinAbcMemcpy(numberInColumn_.array(), other.numberInColumn_.array(), numberRows_ + 1);
     482    CoinAbcMemcpy(pivotColumn_.array(), other.pivotColumn_.array(), numberRowsExtra_ + 1);
     483    CoinAbcMemcpy(nextColumn_.array(), other.nextColumn_.array(), numberRowsExtra_ + 1);
     484    CoinAbcMemcpy(lastColumn_.array(), other.lastColumn_.array(), numberRowsExtra_ + 1);
     485    CoinAbcMemcpy(startColumnR(), other.startColumnR(), numberRowsExtra_ - numberRows_ + 1);
     486
    486487    //extra one at end
    487488    //startColumnU_.array()[maximumRowsExtra_] =
     
    489490    nextColumn_.array()[maximumRowsExtra_] = other.nextColumn_.array()[maximumRowsExtra_];
    490491    lastColumn_.array()[maximumRowsExtra_] = other.lastColumn_.array()[maximumRowsExtra_];
    491     CoinAbcMemcpy( nextRow_.array() , other.nextRow_.array(), numberRows_ + 1);
    492     CoinAbcMemcpy( lastRow_.array() , other.lastRow_.array(), numberRows_ + 1);
     492    CoinAbcMemcpy(nextRow_.array(), other.nextRow_.array(), numberRows_ + 1);
     493    CoinAbcMemcpy(lastRow_.array(), other.lastRow_.array(), numberRows_ + 1);
    493494    nextRow_.array()[numberRows_] = other.nextRow_.array()[numberRows_];
    494495    lastRow_.array()[numberRows_] = other.lastRow_.array()[numberRows_];
    495496  }
    496   CoinAbcMemcpy( elementRAddress_ , other.elementRAddress_, lengthR_);
    497   CoinAbcMemcpy( indexRowRAddress_ , other.indexRowRAddress_, lengthR_);
     497  CoinAbcMemcpy(elementRAddress_, other.elementRAddress_, lengthR_);
     498  CoinAbcMemcpy(indexRowRAddress_, other.indexRowRAddress_, lengthR_);
    498499  //row and column copies of U
    499500  /* as elements of U may have been zeroed but column counts zero
    500501     copy all elements */
    501   const CoinBigIndex *  COIN_RESTRICT startColumnU = startColumnU_.array();
    502   const CoinSimplexInt *  COIN_RESTRICT numberInColumn = numberInColumn_.array();
     502  const CoinBigIndex *COIN_RESTRICT startColumnU = startColumnU_.array();
     503  const CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumn_.array();
    503504#ifndef NDEBUG
    504   CoinSimplexInt maxU=0;
    505   for (CoinSimplexInt iRow = 0; iRow < numberRows_; iRow++ ) {
     505  CoinSimplexInt maxU = 0;
     506  for (CoinSimplexInt iRow = 0; iRow < numberRows_; iRow++) {
    506507    CoinBigIndex start = startColumnU[iRow];
    507508    CoinSimplexInt numberIn = numberInColumn[iRow];
    508     maxU = CoinMax(maxU,start+numberIn);
     509    maxU = CoinMax(maxU, start + numberIn);
    509510  }
    510511  //assert (maximumU_>=maxU);
    511512#endif
    512   CoinAbcMemcpy( elementU_.array() , other.elementU_.array() , maximumU_);
    513 #if ABC_SMALL<2
     513  CoinAbcMemcpy(elementU_.array(), other.elementU_.array(), maximumU_);
     514#if ABC_SMALL < 2
    514515#if COIN_ONE_ETA_COPY
    515516  if (elementRowUOther) {
    516517#endif
    517     const CoinSimplexInt *  COIN_RESTRICT indexColumnUOther = other.indexColumnU_.array();
     518    const CoinSimplexInt *COIN_RESTRICT indexColumnUOther = other.indexColumnU_.array();
    518519#if CONVERTROW
    519     CoinBigIndex *  COIN_RESTRICT convertU = convertRowToColumnU_.array();
    520 #if CONVERTROW>2
    521     CoinBigIndex *  COIN_RESTRICT convertU2 = convertColumnToRowU_.array();
    522 #endif
    523 #endif
    524     CoinFactorizationDouble *  COIN_RESTRICT elementRowU = elementRowU_.array();
    525     CoinSimplexInt *  COIN_RESTRICT indexColumnU = indexColumnU_.array();
    526     const CoinBigIndex *  COIN_RESTRICT startRowU = startRowU_.array();
    527     const CoinSimplexInt *  COIN_RESTRICT numberInRow = numberInRow_.array();
    528     for (CoinSimplexInt iRow = 0; iRow < numberRows_; iRow++ ) {
     520    CoinBigIndex *COIN_RESTRICT convertU = convertRowToColumnU_.array();
     521#if CONVERTROW > 2
     522    CoinBigIndex *COIN_RESTRICT convertU2 = convertColumnToRowU_.array();
     523#endif
     524#endif
     525    CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowU_.array();
     526    CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnU_.array();
     527    const CoinBigIndex *COIN_RESTRICT startRowU = startRowU_.array();
     528    const CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRow_.array();
     529    for (CoinSimplexInt iRow = 0; iRow < numberRows_; iRow++) {
    529530      //row
    530531      CoinBigIndex start = startRowU[iRow];
    531532      CoinSimplexInt numberIn = numberInRow[iRow];
    532      
    533       CoinAbcMemcpy( indexColumnU + start , indexColumnUOther + start, numberIn);
     533
     534      CoinAbcMemcpy(indexColumnU + start, indexColumnUOther + start, numberIn);
    534535#if CONVERTROW
    535       CoinAbcMemcpy(   convertU + start ,convertUOther + start , numberIn);
    536 #if CONVERTROW>2
    537       CoinAbcMemcpy(   convertU2 + start ,convertUOther2 + start , numberIn);
    538 #endif
    539 #endif
    540       CoinAbcMemcpy(   elementRowU + start ,elementRowUOther + start , numberIn);
     536      CoinAbcMemcpy(convertU + start, convertUOther + start, numberIn);
     537#if CONVERTROW > 2
     538      CoinAbcMemcpy(convertU2 + start, convertUOther2 + start, numberIn);
     539#endif
     540#endif
     541      CoinAbcMemcpy(elementRowU + start, elementRowUOther + start, numberIn);
    541542    }
    542543#if COIN_ONE_ETA_COPY
     
    544545#endif
    545546#endif
    546   const CoinSimplexInt *  COIN_RESTRICT indexRowUOther = other.indexRowU_.array();
    547   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowU_.array();
    548   for (CoinSimplexInt iRow = 0; iRow < numberRows_; iRow++ ) {
     547  const CoinSimplexInt *COIN_RESTRICT indexRowUOther = other.indexRowU_.array();
     548  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowU_.array();
     549  for (CoinSimplexInt iRow = 0; iRow < numberRows_; iRow++) {
    549550    //column
    550551    CoinBigIndex start = startColumnU[iRow];
    551552    CoinSimplexInt numberIn = numberInColumn[iRow];
    552     if (numberIn>0)
    553       CoinAbcMemcpy( indexRowU + start , indexRowUOther + start, numberIn);
     553    if (numberIn > 0)
     554      CoinAbcMemcpy(indexRowU + start, indexRowUOther + start, numberIn);
    554555  }
    555556  // L is contiguous
    556557  if (numberRows_)
    557     CoinAbcMemcpy( startColumnL_.array() , other.startColumnL_.array(), numberRows_ + 1);
    558   CoinAbcMemcpy( elementL_.array() , other.elementL_.array(), lengthL_);
    559   CoinAbcMemcpy( indexRowL_.array() , other.indexRowL_.array(), lengthL_);
    560 #if ABC_SMALL<2
     558    CoinAbcMemcpy(startColumnL_.array(), other.startColumnL_.array(), numberRows_ + 1);
     559  CoinAbcMemcpy(elementL_.array(), other.elementL_.array(), lengthL_);
     560  CoinAbcMemcpy(indexRowL_.array(), other.indexRowL_.array(), lengthL_);
     561#if ABC_SMALL < 2
    561562  if (other.sparseThreshold_) {
    562563    goSparse();
     
    568569//  getAreas.  Gets space for a factorization
    569570//called by constructors
    570 void
    571 CoinAbcTypeFactorization::getAreas ( CoinSimplexInt numberOfRows,
    572                              CoinSimplexInt /*numberOfColumns*/,
    573                          CoinBigIndex maximumL,
    574                          CoinBigIndex maximumU )
     571void CoinAbcTypeFactorization::getAreas(CoinSimplexInt numberOfRows,
     572  CoinSimplexInt /*numberOfColumns*/,
     573  CoinBigIndex maximumL,
     574  CoinBigIndex maximumU)
    575575{
    576576  gutsOfInitialize(2);
    577  
     577
    578578  numberRows_ = numberOfRows;
    579579  numberRowsSmall_ = numberOfRows;
    580   maximumRows_ = CoinMax(maximumRows_,numberRows_);
     580  maximumRows_ = CoinMax(maximumRows_, numberRows_);
    581581  maximumRowsExtra_ = numberRows_ + maximumPivots_;
    582582  numberRowsExtra_ = numberRows_;
    583583  lengthAreaU_ = maximumU;
    584584  lengthAreaL_ = maximumL;
    585   if ( !areaFactor_ ) {
     585  if (!areaFactor_) {
    586586    areaFactor_ = 1.0;
    587587  }
    588   if ( areaFactor_ != 1.0 ) {
    589     if ((messageLevel_&16)!=0)
    590       printf("Increasing factorization areas by %g\n",areaFactor_);
    591     lengthAreaU_ =  static_cast<CoinBigIndex> (areaFactor_*lengthAreaU_);
    592     lengthAreaL_ =  static_cast<CoinBigIndex> (areaFactor_*lengthAreaL_);
     588  if (areaFactor_ != 1.0) {
     589    if ((messageLevel_ & 16) != 0)
     590      printf("Increasing factorization areas by %g\n", areaFactor_);
     591    lengthAreaU_ = static_cast< CoinBigIndex >(areaFactor_ * lengthAreaU_);
     592    lengthAreaL_ = static_cast< CoinBigIndex >(areaFactor_ * lengthAreaL_);
    593593  }
    594594#ifdef ABC_USE_FUNCTION_POINTERS
    595   lengthAreaUPlus_ = (lengthAreaU_*3)/2+maximumRowsExtra_ ;
    596   elementU_.conditionalNew( lengthAreaUPlus_ );
     595  lengthAreaUPlus_ = (lengthAreaU_ * 3) / 2 + maximumRowsExtra_;
     596  elementU_.conditionalNew(lengthAreaUPlus_);
    597597#else
    598   elementU_.conditionalNew( lengthAreaU_ );
    599 #endif
    600   indexRowU_.conditionalNew( lengthAreaU_+1 );
    601   indexColumnU_.conditionalNew( lengthAreaU_+1 );
    602   elementL_.conditionalNew( lengthAreaL_ );
    603   indexRowL_.conditionalNew( lengthAreaL_ );
     598  elementU_.conditionalNew(lengthAreaU_);
     599#endif
     600  indexRowU_.conditionalNew(lengthAreaU_ + 1);
     601  indexColumnU_.conditionalNew(lengthAreaU_ + 1);
     602  elementL_.conditionalNew(lengthAreaL_);
     603  indexRowL_.conditionalNew(lengthAreaL_);
    604604  // But we can use all we have if bigger
    605605  CoinBigIndex length;
    606   length = CoinMin(elementU_.getSize(),indexRowU_.getSize());
    607   if (length>lengthAreaU_) {
    608     lengthAreaU_=length;
    609     assert (indexColumnU_.getSize()==indexRowU_.getSize());
    610   }
    611   length = CoinMin(elementL_.getSize(),indexRowL_.getSize());
    612   if (length>lengthAreaL_) {
    613     lengthAreaL_=length;
    614   }
    615   startColumnL_.conditionalNew( numberRows_ + 1 );
     606  length = CoinMin(elementU_.getSize(), indexRowU_.getSize());
     607  if (length > lengthAreaU_) {
     608    lengthAreaU_ = length;
     609    assert(indexColumnU_.getSize() == indexRowU_.getSize());
     610  }
     611  length = CoinMin(elementL_.getSize(), indexRowL_.getSize());
     612  if (length > lengthAreaL_) {
     613    lengthAreaL_ = length;
     614  }
     615  startColumnL_.conditionalNew(numberRows_ + 1);
    616616  startColumnL_.array()[0] = 0;
    617   startRowU_.conditionalNew( maximumRowsExtra_ + 1);
     617  startRowU_.conditionalNew(maximumRowsExtra_ + 1);
    618618  // make sure this is valid (Needed for row links????)
    619   startRowU_.array()[maximumRowsExtra_]=0;
     619  startRowU_.array()[maximumRowsExtra_] = 0;
    620620  lastEntryByRowU_ = 0;
    621   numberInRow_.conditionalNew( maximumRowsExtra_ + 1 );
    622   markRow_.conditionalNew( numberRows_ );
    623   nextRow_.conditionalNew( maximumRowsExtra_ + 1 );
    624   lastRow_.conditionalNew( maximumRowsExtra_ + 1 );
     621  numberInRow_.conditionalNew(maximumRowsExtra_ + 1);
     622  markRow_.conditionalNew(numberRows_);
     623  nextRow_.conditionalNew(maximumRowsExtra_ + 1);
     624  lastRow_.conditionalNew(maximumRowsExtra_ + 1);
    625625#ifndef ABC_ORDERED_FACTORIZATION
    626   permute_.conditionalNew( maximumRowsExtra_ + 1 );
     626  permute_.conditionalNew(maximumRowsExtra_ + 1);
    627627#else
    628628  //temp
    629   permute_.conditionalNew( maximumRowsExtra_+2*numberRows_ + 1 );
     629  permute_.conditionalNew(maximumRowsExtra_ + 2 * numberRows_ + 1);
    630630#endif
    631631  permuteAddress_ = permute_.array();
    632   pivotRegion_.conditionalNew( maximumRows_ + 2 );
    633   startColumnU_.conditionalNew( maximumRowsExtra_ + 1 );
    634   numberInColumn_.conditionalNew( maximumRowsExtra_ + 1 );
    635   numberInColumnPlus_.conditionalNew( maximumRowsExtra_ + 1 );
     632  pivotRegion_.conditionalNew(maximumRows_ + 2);
     633  startColumnU_.conditionalNew(maximumRowsExtra_ + 1);
     634  numberInColumn_.conditionalNew(maximumRowsExtra_ + 1);
     635  numberInColumnPlus_.conditionalNew(maximumRowsExtra_ + 1);
    636636#ifdef ABC_USE_FUNCTION_POINTERS
    637637  scatterUColumn_.conditionalNew(sizeof(scatterStruct), maximumRowsExtra_ + 1);
    638   elementRowU_.conditionalNew( lengthAreaUPlus_ );
    639   elementRowUAddress_=elementRowU_.array();
    640   firstZeroed_=0;
    641 #elif ABC_SMALL<2
    642   elementRowU_.conditionalNew( lengthAreaU_ );
    643   elementRowUAddress_=elementRowU_.array();
    644 #endif
    645 #if COIN_BIG_DOUBLE==1
    646   for (int i=0;i<FACTOR_CPU;i++) {
    647       longArray_[i].conditionalNew( maximumRowsExtra_ + 1 );
    648       longArray_[i].clear();
    649   }
    650 #endif
    651   pivotColumn_.conditionalNew( maximumRowsExtra_ + 1 );
    652   nextColumn_.conditionalNew( maximumRowsExtra_ + 1 );
    653   lastColumn_.conditionalNew( maximumRowsExtra_ + 1 );
    654   saveColumn_.conditionalNew( /*2*  */ numberRows_);
    655   assert (sizeof(CoinSimplexInt)==sizeof(CoinBigIndex)); // would need to redo
    656   firstCount_.conditionalNew( CoinMax(5*numberRows_,4*numberRows_+2*maximumPivots_+4)+2 );
     638  elementRowU_.conditionalNew(lengthAreaUPlus_);
     639  elementRowUAddress_ = elementRowU_.array();
     640  firstZeroed_ = 0;
     641#elif ABC_SMALL < 2
     642  elementRowU_.conditionalNew(lengthAreaU_);
     643  elementRowUAddress_ = elementRowU_.array();
     644#endif
     645#if COIN_BIG_DOUBLE == 1
     646  for (int i = 0; i < FACTOR_CPU; i++) {
     647    longArray_[i].conditionalNew(maximumRowsExtra_ + 1);
     648    longArray_[i].clear();
     649  }
     650#endif
     651  pivotColumn_.conditionalNew(maximumRowsExtra_ + 1);
     652  nextColumn_.conditionalNew(maximumRowsExtra_ + 1);
     653  lastColumn_.conditionalNew(maximumRowsExtra_ + 1);
     654  saveColumn_.conditionalNew(/*2*  */ numberRows_);
     655  assert(sizeof(CoinSimplexInt) == sizeof(CoinBigIndex)); // would need to redo
     656  firstCount_.conditionalNew(CoinMax(5 * numberRows_, 4 * numberRows_ + 2 * maximumPivots_ + 4) + 2);
    657657#if CONVERTROW
    658658  //space for cross reference
    659   convertRowToColumnU_.conditionalNew( lengthAreaU_ );
    660   convertRowToColumnUAddress_=convertRowToColumnU_.array();
    661 #if CONVERTROW>1
    662   convertColumnToRowU_.conditionalNew( lengthAreaU_ );
    663   convertColumnToRowUAddress_=convertColumnToRowU_.array();
     659  convertRowToColumnU_.conditionalNew(lengthAreaU_);
     660  convertRowToColumnUAddress_ = convertRowToColumnU_.array();
     661#if CONVERTROW > 1
     662  convertColumnToRowU_.conditionalNew(lengthAreaU_);
     663  convertColumnToRowUAddress_ = convertColumnToRowU_.array();
    664664#endif
    665665#endif
    666666#ifdef SMALL_PERMUTE
    667   assert (sizeof(CoinFactorizationDouble)>=2*sizeof(int));
    668   denseArea_.conditionalNew(numberRows_+maximumRowsExtra_+2);
    669   fromSmallToBigRow_=reinterpret_cast<CoinSimplexInt *>(denseArea_.array());
    670   fromSmallToBigColumn_=fromSmallToBigRow_+numberRows_;
     667  assert(sizeof(CoinFactorizationDouble) >= 2 * sizeof(int));
     668  denseArea_.conditionalNew(numberRows_ + maximumRowsExtra_ + 2);
     669  fromSmallToBigRow_ = reinterpret_cast< CoinSimplexInt * >(denseArea_.array());
     670  fromSmallToBigColumn_ = fromSmallToBigRow_ + numberRows_;
    671671#endif
    672672  doAddresses();
    673 #if ABC_SMALL<2
     673#if ABC_SMALL < 2
    674674  // temp - use as marker for valid row/column lookup
    675   sparseThreshold_=0;
     675  sparseThreshold_ = 0;
    676676#endif
    677677}
     
    682682//Does most of factorization
    683683CoinSimplexInt
    684 CoinAbcTypeFactorization::factor (AbcSimplex * model)
     684CoinAbcTypeFactorization::factor(AbcSimplex *model)
    685685{
    686686#if ABC_DENSE_CODE
    687687  int saveDense = denseThreshold_;
    688   if ((solveMode_&1)==0)
    689     denseThreshold_=0;
     688  if ((solveMode_ & 1) == 0)
     689    denseThreshold_ = 0;
    690690#endif
    691691  //sparse
    692   status_ = factorSparse (  );
    693   switch ( status_ ) {
    694   case 0:                       //finished
     692  status_ = factorSparse();
     693  switch (status_) {
     694  case 0: //finished
    695695    totalElements_ = 0;
    696     if ( numberGoodU_ < numberRows_ )
    697       status_ = -1; 
    698     break; 
     696    if (numberGoodU_ < numberRows_)
     697      status_ = -1;
     698    break;
    699699#if ABC_DENSE_CODE
    700 #if ABC_SMALL<4
     700#if ABC_SMALL < 4
    701701    // dense
    702   case 2: 
    703     status_=factorDense();
    704     if(!status_)
     702  case 2:
     703    status_ = factorDense();
     704    if (!status_)
    705705      break;
    706706#endif
     
    708708  default:
    709709    //singular ? or some error
    710     if ((messageLevel_&4)!=0)
     710    if ((messageLevel_ & 4) != 0)
    711711      std::cout << "Error " << status_ << std::endl;
    712     if (status_==-99) {
    713       if (numberRows_-numberGoodU_<1000) {
    714         areaFactor_ *= 1.5;
     712    if (status_ == -99) {
     713      if (numberRows_ - numberGoodU_ < 1000) {
     714        areaFactor_ *= 1.5;
    715715      } else {
    716         double denseArea=(numberRows_-numberGoodU_)*(numberRows_-numberGoodU_);
    717         if (denseArea>1.5*lengthAreaU_) {
    718           areaFactor_ *= CoinMin(2.5,denseArea/1.5);
    719         } else {
    720           areaFactor_ *= 1.5;
    721         }
    722       }
    723       if (model->logLevel()>1) {
    724         char line[100];
    725         sprintf(line,"need more memory lengthArea %d number %d done %d areaFactor %g",
    726                 lengthAreaL_+lengthAreaU_,lengthU_+lengthL_,numberGoodU_,areaFactor_);
    727         model->messageHandler()->message(CLP_GENERAL2,*model->messagesPointer())
    728           << line << CoinMessageEol;
    729       }
    730     } else if (status_==-97) {
     716        double denseArea = (numberRows_ - numberGoodU_) * (numberRows_ - numberGoodU_);
     717        if (denseArea > 1.5 * lengthAreaU_) {
     718          areaFactor_ *= CoinMin(2.5, denseArea / 1.5);
     719        } else {
     720          areaFactor_ *= 1.5;
     721        }
     722      }
     723      if (model->logLevel() > 1) {
     724        char line[100];
     725        sprintf(line, "need more memory lengthArea %d number %d done %d areaFactor %g",
     726          lengthAreaL_ + lengthAreaU_, lengthU_ + lengthL_, numberGoodU_, areaFactor_);
     727        model->messageHandler()->message(CLP_GENERAL2, *model->messagesPointer())
     728          << line << CoinMessageEol;
     729      }
     730    } else if (status_ == -97) {
    731731      // just pivot tolerance issue
    732       status_=-99;
     732      status_ = -99;
    733733      char line[100];
    734       sprintf(line,"Bad pivot values - increasing pivot tolerance to %g",
    735               pivotTolerance_);
    736       model->messageHandler()->message(CLP_GENERAL2,*model->messagesPointer())
    737         << line << CoinMessageEol;
     734      sprintf(line, "Bad pivot values - increasing pivot tolerance to %g",
     735        pivotTolerance_);
     736      model->messageHandler()->message(CLP_GENERAL2, *model->messagesPointer())
     737        << line << CoinMessageEol;
    738738    }
    739739    break;
    740   }                             /* endswitch */
     740  } /* endswitch */
    741741  //clean up
    742   if ( !status_ ) {
    743     if ( (messageLevel_ & 16)&&numberCompressions_)
    744       std::cout<<"        Factorization did "<<numberCompressions_
    745                <<" compressions"<<std::endl;
    746     if ( numberCompressions_ > 10 ) {
     742  if (!status_) {
     743    if ((messageLevel_ & 16) && numberCompressions_)
     744      std::cout << "        Factorization did " << numberCompressions_
     745                << " compressions" << std::endl;
     746    if (numberCompressions_ > 10) {
    747747      // but not more than 5 times final
    748       if (lengthAreaL_+lengthAreaU_<10*(lengthU_+lengthL_)) {
    749         areaFactor_ *= 1.1;
    750         if (model->logLevel()>1) {
    751           char line[100];
    752           sprintf(line,"%d factorization compressions, lengthArea %d number %d new areaFactor %g",
    753                   numberCompressions_,lengthAreaL_+lengthAreaU_,lengthU_+lengthL_,areaFactor_);
    754           model->messageHandler()->message(CLP_GENERAL2,*model->messagesPointer())
    755             << line << CoinMessageEol;
    756         }
    757       }
    758     }
    759     numberCompressions_=0;
    760     cleanup (  );
    761   }
    762   numberPivots_=0;
     748      if (lengthAreaL_ + lengthAreaU_ < 10 * (lengthU_ + lengthL_)) {
     749        areaFactor_ *= 1.1;
     750        if (model->logLevel() > 1) {
     751          char line[100];
     752          sprintf(line, "%d factorization compressions, lengthArea %d number %d new areaFactor %g",
     753            numberCompressions_, lengthAreaL_ + lengthAreaU_, lengthU_ + lengthL_, areaFactor_);
     754          model->messageHandler()->message(CLP_GENERAL2, *model->messagesPointer())
     755            << line << CoinMessageEol;
     756        }
     757      }
     758    }
     759    numberCompressions_ = 0;
     760    cleanup();
     761  }
     762  numberPivots_ = 0;
    763763#if ABC_DENSE_CODE
    764   denseThreshold_=saveDense;
     764  denseThreshold_ = saveDense;
    765765#endif
    766766  return status_;
    767767}
    768768#define ALWAYS_GIVE_UP 0 //1
    769 #ifdef ABC_USE_FUNCTION_POINTERS 
     769#ifdef ABC_USE_FUNCTION_POINTERS
    770770#define DENSE_TRY
    771771#ifdef DENSE_TRY
    772 static void pivotStartup(int first, int last, int numberInPivotColumn, int lengthArea,int giveUp,
    773                          CoinFactorizationDouble * COIN_RESTRICT eArea,const int * COIN_RESTRICT saveColumn,
    774                          const int * COIN_RESTRICT startColumnU,int * COIN_RESTRICT tempColumnCount,
    775                          const CoinFactorizationDouble * COIN_RESTRICT elementU,
    776                          const int * COIN_RESTRICT numberInColumn,
    777                          const int * COIN_RESTRICT indexRowU)
     772static void pivotStartup(int first, int last, int numberInPivotColumn, int lengthArea, int giveUp,
     773  CoinFactorizationDouble *COIN_RESTRICT eArea, const int *COIN_RESTRICT saveColumn,
     774  const int *COIN_RESTRICT startColumnU, int *COIN_RESTRICT tempColumnCount,
     775  const CoinFactorizationDouble *COIN_RESTRICT elementU,
     776  const int *COIN_RESTRICT numberInColumn,
     777  const int *COIN_RESTRICT indexRowU)
    778778{
    779   if (last-first>giveUp && !ALWAYS_GIVE_UP) {
    780     int mid=(last+first)>>1;
    781     cilk_spawn pivotStartup(first,mid,numberInPivotColumn,lengthArea,giveUp,
    782                             eArea,saveColumn,startColumnU,tempColumnCount,
    783                             elementU,numberInColumn,indexRowU);
    784     pivotStartup(mid,last,numberInPivotColumn,lengthArea,giveUp,
    785                  eArea,saveColumn,startColumnU,tempColumnCount,
    786                  elementU,numberInColumn,indexRowU);
     779  if (last - first > giveUp && !ALWAYS_GIVE_UP) {
     780    int mid = (last + first) >> 1;
     781    cilk_spawn pivotStartup(first, mid, numberInPivotColumn, lengthArea, giveUp,
     782      eArea, saveColumn, startColumnU, tempColumnCount,
     783      elementU, numberInColumn, indexRowU);
     784    pivotStartup(mid, last, numberInPivotColumn, lengthArea, giveUp,
     785      eArea, saveColumn, startColumnU, tempColumnCount,
     786      elementU, numberInColumn, indexRowU);
    787787    cilk_sync;
    788788  } else {
    789     CoinFactorizationDouble * COIN_RESTRICT area =eArea+first*lengthArea;
    790     for (int jColumn = first; jColumn < last; jColumn++ ) {
     789    CoinFactorizationDouble *COIN_RESTRICT area = eArea + first * lengthArea;
     790    for (int jColumn = first; jColumn < last; jColumn++) {
    791791      CoinSimplexInt iColumn = saveColumn[jColumn];
    792792      CoinBigIndex startColumn = startColumnU[iColumn];
    793       int numberNow=tempColumnCount[jColumn];
    794       int start=startColumn+numberNow;
    795       int end=startColumn+numberInColumn[iColumn];
    796       CoinFactorizationDouble thisPivotValue = elementU[startColumn-1];
    797       for (CoinBigIndex j=start;j<end;j++) {
    798         CoinFactorizationDouble value=elementU[j];
    799         int iPut=indexRowU[j];
    800         assert (iPut<lengthArea);
    801         area[iPut]=value;
    802       }
    803       area[numberInPivotColumn]=thisPivotValue;
    804       area+=lengthArea;
     793      int numberNow = tempColumnCount[jColumn];
     794      int start = startColumn + numberNow;
     795      int end = startColumn + numberInColumn[iColumn];
     796      CoinFactorizationDouble thisPivotValue = elementU[startColumn - 1];
     797      for (CoinBigIndex j = start; j < end; j++) {
     798        CoinFactorizationDouble value = elementU[j];
     799        int iPut = indexRowU[j];
     800        assert(iPut < lengthArea);
     801        area[iPut] = value;
     802      }
     803      area[numberInPivotColumn] = thisPivotValue;
     804      area += lengthArea;
    805805    }
    806806  }
    807807}
    808 static void pivotWhile(int first, int last, int numberInPivotColumn,int lengthArea,int giveUp,
    809                        CoinFactorizationDouble * COIN_RESTRICT eArea,const CoinFactorizationDouble * COIN_RESTRICT multipliersL)
     808static void pivotWhile(int first, int last, int numberInPivotColumn, int lengthArea, int giveUp,
     809  CoinFactorizationDouble *COIN_RESTRICT eArea, const CoinFactorizationDouble *COIN_RESTRICT multipliersL)
    810810{
    811   if (last-first>giveUp && !ALWAYS_GIVE_UP) {
    812     int mid=(last+first)>>1;
    813     cilk_spawn pivotWhile(first,mid,numberInPivotColumn,lengthArea,giveUp,
    814                           eArea,multipliersL);
    815     pivotWhile(mid,last,numberInPivotColumn,lengthArea,giveUp,
    816                eArea,multipliersL);
     811  if (last - first > giveUp && !ALWAYS_GIVE_UP) {
     812    int mid = (last + first) >> 1;
     813    cilk_spawn pivotWhile(first, mid, numberInPivotColumn, lengthArea, giveUp,
     814      eArea, multipliersL);
     815    pivotWhile(mid, last, numberInPivotColumn, lengthArea, giveUp,
     816      eArea, multipliersL);
    817817    cilk_sync;
    818818  } else {
    819     CoinFactorizationDouble * COIN_RESTRICT area =eArea+first*lengthArea;
    820     int nDo=last-first;
    821 #if AVX2==0
    822     for (int jColumn = 0; jColumn < nDo; jColumn++ ) {
     819    CoinFactorizationDouble *COIN_RESTRICT area = eArea + first * lengthArea;
     820    int nDo = last - first;
     821#if AVX2 == 0
     822    for (int jColumn = 0; jColumn < nDo; jColumn++) {
    823823      CoinFactorizationDouble thisPivotValue = area[numberInPivotColumn];
    824       area[numberInPivotColumn]=0.0;
    825       for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++ ) {
    826         area[j] -= thisPivotValue * multipliersL[j];
    827       }
    828       area+=lengthArea;
     824      area[numberInPivotColumn] = 0.0;
     825      for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++) {
     826        area[j] -= thisPivotValue * multipliersL[j];
     827      }
     828      area += lengthArea;
    829829    }
    830830#else
    831     int n=(numberInPivotColumn+3)&(~3);
     831    int n = (numberInPivotColumn + 3) & (~3);
    832832    // for compiler error
    833     CoinFactorizationDouble * multipliers = const_cast<CoinFactorizationDouble *>(multipliersL);
    834     for (int jColumn = 0; jColumn < nDo; jColumn++ ) {
     833    CoinFactorizationDouble *multipliers = const_cast< CoinFactorizationDouble * >(multipliersL);
     834    for (int jColumn = 0; jColumn < nDo; jColumn++) {
    835835      //CoinFactorizationDouble thisPivotValue = area[numberInPivotColumn];
    836       __m256d pivot = _mm256_broadcast_sd(area+numberInPivotColumn);
    837       area[numberInPivotColumn]=0.0;
    838       for (CoinSimplexInt j = 0; j < n; j+=4 ) {
    839         __m256d a=_mm256_load_pd(area+j);
    840         __m256d m=_mm256_load_pd(multipliers+j);
    841         a -= pivot*m;
    842         *reinterpret_cast<__m256d *>(area+j)=a; //_mm256_store_pd ((area+j), a);
    843         //area[j] -= thisPivotValue * multipliersL[j];
    844         //area[j+1] -= thisPivotValue * multipliersL[j+1];
    845         //area[j+2] -= thisPivotValue * multipliersL[j+2];
    846         //area[j+3] -= thisPivotValue * multipliersL[j+3];
    847       }
    848       area+=lengthArea;
     836      __m256d pivot = _mm256_broadcast_sd(area + numberInPivotColumn);
     837      area[numberInPivotColumn] = 0.0;
     838      for (CoinSimplexInt j = 0; j < n; j += 4) {
     839        __m256d a = _mm256_load_pd(area + j);
     840        __m256d m = _mm256_load_pd(multipliers + j);
     841        a -= pivot * m;
     842        *reinterpret_cast< __m256d * >(area + j) = a; //_mm256_store_pd ((area+j), a);
     843        //area[j] -= thisPivotValue * multipliersL[j];
     844        //area[j+1] -= thisPivotValue * multipliersL[j+1];
     845        //area[j+2] -= thisPivotValue * multipliersL[j+2];
     846        //area[j+3] -= thisPivotValue * multipliersL[j+3];
     847      }
     848      area += lengthArea;
    849849    }
    850850#endif
    851851  }
    852852}
    853 static void pivotSomeAfter(int first, int last, int numberInPivotColumn,int lengthArea,int giveUp,
    854                       CoinFactorizationDouble * COIN_RESTRICT eArea,const int * COIN_RESTRICT saveColumn,
    855                       const int * COIN_RESTRICT startColumnU,int * COIN_RESTRICT tempColumnCount,
    856                       CoinFactorizationDouble * COIN_RESTRICT elementU, int * COIN_RESTRICT numberInColumn,
    857                       int * COIN_RESTRICT indexRowU, unsigned int * aBits,
    858                       const int * COIN_RESTRICT indexL,
    859                       const CoinFactorizationDouble * COIN_RESTRICT multipliersL, double tolerance)
     853static void pivotSomeAfter(int first, int last, int numberInPivotColumn, int lengthArea, int giveUp,
     854  CoinFactorizationDouble *COIN_RESTRICT eArea, const int *COIN_RESTRICT saveColumn,
     855  const int *COIN_RESTRICT startColumnU, int *COIN_RESTRICT tempColumnCount,
     856  CoinFactorizationDouble *COIN_RESTRICT elementU, int *COIN_RESTRICT numberInColumn,
     857  int *COIN_RESTRICT indexRowU, unsigned int *aBits,
     858  const int *COIN_RESTRICT indexL,
     859  const CoinFactorizationDouble *COIN_RESTRICT multipliersL, double tolerance)
    860860{
    861   if (last-first>giveUp && !ALWAYS_GIVE_UP) {
    862     int mid=(last+first)>>1;
    863     cilk_spawn pivotSomeAfter(first,mid,numberInPivotColumn,lengthArea,giveUp,
    864             eArea,saveColumn,startColumnU,tempColumnCount,
    865             elementU,numberInColumn,indexRowU,aBits,indexL,
    866             multipliersL,tolerance);
    867     pivotSomeAfter(mid,last,numberInPivotColumn,lengthArea,giveUp,
    868             eArea,saveColumn,startColumnU,tempColumnCount,
    869             elementU,numberInColumn,indexRowU,aBits,indexL,
    870             multipliersL,tolerance);
     861  if (last - first > giveUp && !ALWAYS_GIVE_UP) {
     862    int mid = (last + first) >> 1;
     863    cilk_spawn pivotSomeAfter(first, mid, numberInPivotColumn, lengthArea, giveUp,
     864      eArea, saveColumn, startColumnU, tempColumnCount,
     865      elementU, numberInColumn, indexRowU, aBits, indexL,
     866      multipliersL, tolerance);
     867    pivotSomeAfter(mid, last, numberInPivotColumn, lengthArea, giveUp,
     868      eArea, saveColumn, startColumnU, tempColumnCount,
     869      elementU, numberInColumn, indexRowU, aBits, indexL,
     870      multipliersL, tolerance);
    871871    cilk_sync;
    872872  } else {
    873   int intsPerColumn = (lengthArea+31)>>5;
    874   CoinFactorizationDouble * COIN_RESTRICT area =eArea+first*lengthArea;
    875   for (int jColumn = first; jColumn < last; jColumn++ ) {
    876     CoinSimplexInt iColumn = saveColumn[jColumn];
    877     CoinBigIndex startColumn = startColumnU[iColumn];
    878     int numberNow=tempColumnCount[jColumn];
    879     CoinFactorizationDouble thisPivotValue = area[numberInPivotColumn];
    880     area[numberInPivotColumn]=0.0;
    881     int n=0;
    882     int positionLargest=-1;
    883     double largest=numberNow ? fabs(elementU[startColumn]) : 0.0;
    884     unsigned int * aBitsThis = aBits+jColumn*intsPerColumn;
    885 #if AVX2==0
    886     for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++ ) {
    887       CoinFactorizationDouble value = area[j] - thisPivotValue * multipliersL[j];
    888       CoinSimplexDouble absValue = fabs ( value );
    889       area[j]=0.0;
    890       if ( absValue > tolerance ) {
    891         area[n] = value;
    892         if (absValue>largest) {
    893           largest=absValue;
    894           positionLargest=n;
    895         }
    896         n++;
    897       } else {
    898         // say zero
    899         int word = j>>5;
    900         int unsetBit=j-(word<<5);
    901         aBitsThis[word]&= ~(1<<unsetBit);
    902       }
    903     }
     873    int intsPerColumn = (lengthArea + 31) >> 5;
     874    CoinFactorizationDouble *COIN_RESTRICT area = eArea + first * lengthArea;
     875    for (int jColumn = first; jColumn < last; jColumn++) {
     876      CoinSimplexInt iColumn = saveColumn[jColumn];
     877      CoinBigIndex startColumn = startColumnU[iColumn];
     878      int numberNow = tempColumnCount[jColumn];
     879      CoinFactorizationDouble thisPivotValue = area[numberInPivotColumn];
     880      area[numberInPivotColumn] = 0.0;
     881      int n = 0;
     882      int positionLargest = -1;
     883      double largest = numberNow ? fabs(elementU[startColumn]) : 0.0;
     884      unsigned int *aBitsThis = aBits + jColumn * intsPerColumn;
     885#if AVX2 == 0
     886      for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++) {
     887        CoinFactorizationDouble value = area[j] - thisPivotValue * multipliersL[j];
     888        CoinSimplexDouble absValue = fabs(value);
     889        area[j] = 0.0;
     890        if (absValue > tolerance) {
     891          area[n] = value;
     892          if (absValue > largest) {
     893            largest = absValue;
     894            positionLargest = n;
     895          }
     896          n++;
     897        } else {
     898          // say zero
     899          int word = j >> 5;
     900          int unsetBit = j - (word << 5);
     901          aBitsThis[word] &= ~(1 << unsetBit);
     902        }
     903      }
    904904#else
    905     // for compiler error
    906     CoinFactorizationDouble * multipliers = const_cast<CoinFactorizationDouble *>(multipliersL);
    907     int nDo=(numberInPivotColumn+3)&(~3);
    908     //double temp[4] __attribute__ ((aligned (32)));
    909     __m256d pivot = _mm256_broadcast_sd(&thisPivotValue);
    910     for (CoinSimplexInt j = 0; j < nDo; j+=4 ) {
    911       __m256d a=_mm256_load_pd(area+j);
    912       __m256d m=_mm256_load_pd(multipliers+j);
    913       a -= pivot*m;
    914       *reinterpret_cast<__m256d *>(area+j)=a; //_mm256_store_pd ((area+j), a);
    915     }
    916     for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++ ) {
    917       CoinFactorizationDouble value = area[j];
    918       CoinSimplexDouble absValue = fabs ( value );
    919       area[j]=0.0;
    920       if ( absValue > tolerance ) {
    921         area[n] = value;
    922         if (absValue>largest) {
    923           largest=absValue;
    924           positionLargest=n;
    925         }
    926         n++;
    927       } else {
    928         // say zero
    929         int word = j>>5;
    930         int unsetBit=j-(word<<5);
    931         aBitsThis[word]&= ~(1<<unsetBit);
    932       }
    933     }
    934 #endif
    935     int put = startColumn;
    936     if (positionLargest>=0)
    937       positionLargest+=put+numberNow;
    938     put+=numberNow;
    939     int iA=0;
    940     for (int jj=0;jj<numberInPivotColumn;jj+=32) {
    941       unsigned int aThis=*aBitsThis;
    942       aBitsThis++;
    943       for (int i=jj;i<CoinMin(jj+32,numberInPivotColumn);i++) {
    944         if ((aThis&1)!=0) {
    945           indexRowU[put]=indexL[i];
    946           elementU[put++]=area[iA];
    947           area[iA++]=0.0;
    948         }
    949         aThis=aThis>>1;
    950       }
    951     }
    952     int numberNeeded=put-startColumn;
    953     if (positionLargest>=0) {
    954       //swap first and largest
    955       CoinBigIndex start=startColumn;
    956       int firstIndex=indexRowU[start];
    957       CoinFactorizationDouble firstValue=elementU[start];
    958       indexRowU[start]=indexRowU[positionLargest];
    959       elementU[start]=elementU[positionLargest];
    960       indexRowU[positionLargest]=firstIndex;
    961       elementU[positionLargest]=firstValue;
    962     }
    963     tempColumnCount[jColumn]=numberNeeded-numberInColumn[iColumn];
    964     assert (numberNeeded>=0);
    965     numberInColumn[iColumn]=numberNeeded;
    966     area += lengthArea;
    967   }
     905      // for compiler error
     906      CoinFactorizationDouble *multipliers = const_cast< CoinFactorizationDouble * >(multipliersL);
     907      int nDo = (numberInPivotColumn + 3) & (~3);
     908      //double temp[4] __attribute__ ((aligned (32)));
     909      __m256d pivot = _mm256_broadcast_sd(&thisPivotValue);
     910      for (CoinSimplexInt j = 0; j < nDo; j += 4) {
     911        __m256d a = _mm256_load_pd(area + j);
     912        __m256d m = _mm256_load_pd(multipliers + j);
     913        a -= pivot * m;
     914        *reinterpret_cast< __m256d * >(area + j) = a; //_mm256_store_pd ((area+j), a);
     915      }
     916      for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++) {
     917        CoinFactorizationDouble value = area[j];
     918        CoinSimplexDouble absValue = fabs(value);
     919        area[j] = 0.0;
     920        if (absValue > tolerance) {
     921          area[n] = value;
     922          if (absValue > largest) {
     923            largest = absValue;
     924            positionLargest = n;
     925          }
     926          n++;
     927        } else {
     928          // say zero
     929          int word = j >> 5;
     930          int unsetBit = j - (word << 5);
     931          aBitsThis[word] &= ~(1 << unsetBit);
     932        }
     933      }
     934#endif
     935      int put = startColumn;
     936      if (positionLargest >= 0)
     937        positionLargest += put + numberNow;
     938      put += numberNow;
     939      int iA = 0;
     940      for (int jj = 0; jj < numberInPivotColumn; jj += 32) {
     941        unsigned int aThis = *aBitsThis;
     942        aBitsThis++;
     943        for (int i = jj; i < CoinMin(jj + 32, numberInPivotColumn); i++) {
     944          if ((aThis & 1) != 0) {
     945            indexRowU[put] = indexL[i];
     946            elementU[put++] = area[iA];
     947            area[iA++] = 0.0;
     948          }
     949          aThis = aThis >> 1;
     950        }
     951      }
     952      int numberNeeded = put - startColumn;
     953      if (positionLargest >= 0) {
     954        //swap first and largest
     955        CoinBigIndex start = startColumn;
     956        int firstIndex = indexRowU[start];
     957        CoinFactorizationDouble firstValue = elementU[start];
     958        indexRowU[start] = indexRowU[positionLargest];
     959        elementU[start] = elementU[positionLargest];
     960        indexRowU[positionLargest] = firstIndex;
     961        elementU[positionLargest] = firstValue;
     962      }
     963      tempColumnCount[jColumn] = numberNeeded - numberInColumn[iColumn];
     964      assert(numberNeeded >= 0);
     965      numberInColumn[iColumn] = numberNeeded;
     966      area += lengthArea;
     967    }
    968968  }
    969969}
    970970#endif
    971 static void pivotSome(int first, int last, int numberInPivotColumn,int lengthArea,int giveUp,
    972                       CoinFactorizationDouble * COIN_RESTRICT eArea,const int * COIN_RESTRICT saveColumn,
    973                       const int * COIN_RESTRICT startColumnU,int * COIN_RESTRICT tempColumnCount,
    974                       CoinFactorizationDouble * COIN_RESTRICT elementU, int * COIN_RESTRICT numberInColumn,
    975                       int * COIN_RESTRICT indexRowU, unsigned int * aBits,
    976                       const int * COIN_RESTRICT indexL,
    977                       const CoinFactorizationDouble * COIN_RESTRICT multipliersL, double tolerance)
     971static void pivotSome(int first, int last, int numberInPivotColumn, int lengthArea, int giveUp,
     972  CoinFactorizationDouble *COIN_RESTRICT eArea, const int *COIN_RESTRICT saveColumn,
     973  const int *COIN_RESTRICT startColumnU, int *COIN_RESTRICT tempColumnCount,
     974  CoinFactorizationDouble *COIN_RESTRICT elementU, int *COIN_RESTRICT numberInColumn,
     975  int *COIN_RESTRICT indexRowU, unsigned int *aBits,
     976  const int *COIN_RESTRICT indexL,
     977  const CoinFactorizationDouble *COIN_RESTRICT multipliersL, double tolerance)
    978978{
    979   if (last-first>giveUp && !ALWAYS_GIVE_UP) {
    980     int mid=(last+first)>>1;
    981     cilk_spawn pivotSome(first,mid,numberInPivotColumn,lengthArea,giveUp,
    982             eArea,saveColumn,startColumnU,tempColumnCount,
    983             elementU,numberInColumn,indexRowU,aBits,indexL,
    984             multipliersL,tolerance);
    985     pivotSome(mid,last,numberInPivotColumn,lengthArea,giveUp,
    986             eArea,saveColumn,startColumnU,tempColumnCount,
    987             elementU,numberInColumn,indexRowU,aBits,indexL,
    988             multipliersL,tolerance);
     979  if (last - first > giveUp && !ALWAYS_GIVE_UP) {
     980    int mid = (last + first) >> 1;
     981    cilk_spawn pivotSome(first, mid, numberInPivotColumn, lengthArea, giveUp,
     982      eArea, saveColumn, startColumnU, tempColumnCount,
     983      elementU, numberInColumn, indexRowU, aBits, indexL,
     984      multipliersL, tolerance);
     985    pivotSome(mid, last, numberInPivotColumn, lengthArea, giveUp,
     986      eArea, saveColumn, startColumnU, tempColumnCount,
     987      elementU, numberInColumn, indexRowU, aBits, indexL,
     988      multipliersL, tolerance);
    989989    cilk_sync;
    990990  } else {
    991     int intsPerColumn = (lengthArea+31)>>5;
    992     CoinFactorizationDouble * COIN_RESTRICT area =eArea+first*lengthArea;
    993     for (int jColumn = first; jColumn < last; jColumn++ ) {
     991    int intsPerColumn = (lengthArea + 31) >> 5;
     992    CoinFactorizationDouble *COIN_RESTRICT area = eArea + first * lengthArea;
     993    for (int jColumn = first; jColumn < last; jColumn++) {
    994994      CoinSimplexInt iColumn = saveColumn[jColumn];
    995995      CoinBigIndex startColumn = startColumnU[iColumn];
    996       int numberNow=tempColumnCount[jColumn];
    997       CoinFactorizationDouble thisPivotValue = elementU[startColumn-1];
    998       int start=startColumn+numberNow;
    999       int end=startColumn+numberInColumn[iColumn];
    1000       for (CoinBigIndex j=start;j<end;j++) {
    1001         CoinFactorizationDouble value=elementU[j];
    1002         int iPut=indexRowU[j];
    1003         assert (iPut<lengthArea);
    1004         area[iPut]=value;
    1005       }
    1006       int n=0;
    1007       int positionLargest=-1;
    1008       double largest=numberNow ? fabs(elementU[startColumn]) : 0.0;
    1009       unsigned int * aBitsThis = aBits+jColumn*intsPerColumn;
    1010 #if AVX2==0
    1011       for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++ ) {
    1012         CoinFactorizationDouble value = area[j] - thisPivotValue * multipliersL[j];
    1013         CoinSimplexDouble absValue = fabs ( value );
    1014         area[j]=0.0;
    1015         if ( absValue > tolerance ) {
    1016           area[n] = value;
    1017           if (absValue>largest) {
    1018             largest=absValue;
    1019             positionLargest=n;
    1020           }
    1021           n++;
    1022         } else {
    1023           // say zero
    1024           int word = j>>5;
    1025           int unsetBit=j-(word<<5);
    1026           aBitsThis[word]&= ~(1<<unsetBit);
    1027         }
     996      int numberNow = tempColumnCount[jColumn];
     997      CoinFactorizationDouble thisPivotValue = elementU[startColumn - 1];
     998      int start = startColumn + numberNow;
     999      int end = startColumn + numberInColumn[iColumn];
     1000      for (CoinBigIndex j = start; j < end; j++) {
     1001        CoinFactorizationDouble value = elementU[j];
     1002        int iPut = indexRowU[j];
     1003        assert(iPut < lengthArea);
     1004        area[iPut] = value;
     1005      }
     1006      int n = 0;
     1007      int positionLargest = -1;
     1008      double largest = numberNow ? fabs(elementU[startColumn]) : 0.0;
     1009      unsigned int *aBitsThis = aBits + jColumn * intsPerColumn;
     1010#if AVX2 == 0
     1011      for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++) {
     1012        CoinFactorizationDouble value = area[j] - thisPivotValue * multipliersL[j];
     1013        CoinSimplexDouble absValue = fabs(value);
     1014        area[j] = 0.0;
     1015        if (absValue > tolerance) {
     1016          area[n] = value;
     1017          if (absValue > largest) {
     1018            largest = absValue;
     1019            positionLargest = n;
     1020          }
     1021          n++;
     1022        } else {
     1023          // say zero
     1024          int word = j >> 5;
     1025          int unsetBit = j - (word << 5);
     1026          aBitsThis[word] &= ~(1 << unsetBit);
     1027        }
    10281028      }
    10291029#else
    1030       int nDo=(numberInPivotColumn+3)&(~3);
     1030      int nDo = (numberInPivotColumn + 3) & (~3);
    10311031      // for compiler error
    1032       CoinFactorizationDouble * multipliers = const_cast<CoinFactorizationDouble *>(multipliersL);
     1032      CoinFactorizationDouble *multipliers = const_cast< CoinFactorizationDouble * >(multipliersL);
    10331033      //double temp[4] __attribute__ ((aligned (32)));
    10341034      __m256d pivot = _mm256_broadcast_sd(&thisPivotValue);
    1035       for (CoinSimplexInt j = 0; j < nDo; j+=4 ) {
    1036         __m256d a=_mm256_load_pd(area+j);
    1037         __m256d m=_mm256_load_pd(multipliers+j);
    1038         a -= pivot*m;
    1039         *reinterpret_cast<__m256d *>(area+j)=a; //_mm256_store_pd ((area+j), a);
    1040       }
    1041       for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++ ) {
    1042         CoinFactorizationDouble value = area[j];
    1043         CoinSimplexDouble absValue = fabs ( value );
    1044         area[j]=0.0;
    1045         if ( absValue > tolerance ) {
    1046           area[n] = value;
    1047           if (absValue>largest) {
    1048             largest=absValue;
    1049             positionLargest=n;
    1050           }
    1051           n++;
    1052         } else {
    1053           // say zero
    1054           int word = j>>5;
    1055           int unsetBit=j-(word<<5);
    1056           aBitsThis[word]&= ~(1<<unsetBit);
    1057         }
     1035      for (CoinSimplexInt j = 0; j < nDo; j += 4) {
     1036        __m256d a = _mm256_load_pd(area + j);
     1037        __m256d m = _mm256_load_pd(multipliers + j);
     1038        a -= pivot * m;
     1039        *reinterpret_cast< __m256d * >(area + j) = a; //_mm256_store_pd ((area+j), a);
     1040      }
     1041      for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++) {
     1042        CoinFactorizationDouble value = area[j];
     1043        CoinSimplexDouble absValue = fabs(value);
     1044        area[j] = 0.0;
     1045        if (absValue > tolerance) {
     1046          area[n] = value;
     1047          if (absValue > largest) {
     1048            largest = absValue;
     1049            positionLargest = n;
     1050          }
     1051          n++;
     1052        } else {
     1053          // say zero
     1054          int word = j >> 5;
     1055          int unsetBit = j - (word << 5);
     1056          aBitsThis[word] &= ~(1 << unsetBit);
     1057        }
    10581058      }
    10591059#endif
    10601060      int put = startColumn;
    1061       if (positionLargest>=0)
    1062         positionLargest+=put+numberNow;
    1063       put+=numberNow;
    1064       int iA=0;
    1065       for (int jj=0;jj<numberInPivotColumn;jj+=32) {
    1066         unsigned int aThis=*aBitsThis;
    1067         aBitsThis++;
    1068         for (int i=jj;i<CoinMin(jj+32,numberInPivotColumn);i++) {
    1069           if ((aThis&1)!=0) {
    1070             indexRowU[put]=indexL[i];
    1071             elementU[put++]=area[iA];
    1072             area[iA++]=0.0;
    1073           }
    1074           aThis=aThis>>1;
    1075         }
    1076       }
    1077       int numberNeeded=put-startColumn;
    1078       if (positionLargest>=0) {
    1079         //swap first and largest
    1080         CoinBigIndex start=startColumn;
    1081         int firstIndex=indexRowU[start];
    1082         CoinFactorizationDouble firstValue=elementU[start];
    1083         indexRowU[start]=indexRowU[positionLargest];    elementU[start]=elementU[positionLargest];
    1084         indexRowU[positionLargest]=firstIndex;
    1085         elementU[positionLargest]=firstValue;
    1086       }
    1087       tempColumnCount[jColumn]=numberNeeded-numberInColumn[iColumn];
    1088       assert (numberNeeded>=0);
    1089       numberInColumn[iColumn]=numberNeeded;
     1061      if (positionLargest >= 0)
     1062        positionLargest += put + numberNow;
     1063      put += numberNow;
     1064      int iA = 0;
     1065      for (int jj = 0; jj < numberInPivotColumn; jj += 32) {
     1066        unsigned int aThis = *aBitsThis;
     1067        aBitsThis++;
     1068        for (int i = jj; i < CoinMin(jj + 32, numberInPivotColumn); i++) {
     1069          if ((aThis & 1) != 0) {
     1070            indexRowU[put] = indexL[i];
     1071            elementU[put++] = area[iA];
     1072            area[iA++] = 0.0;
     1073          }
     1074          aThis = aThis >> 1;
     1075        }
     1076      }
     1077      int numberNeeded = put - startColumn;
     1078      if (positionLargest >= 0) {
     1079        //swap first and largest
     1080        CoinBigIndex start = startColumn;
     1081        int firstIndex = indexRowU[start];
     1082        CoinFactorizationDouble firstValue = elementU[start];
     1083        indexRowU[start] = indexRowU[positionLargest];
     1084        elementU[start] = elementU[positionLargest];
     1085        indexRowU[positionLargest] = firstIndex;
     1086        elementU[positionLargest] = firstValue;
     1087      }
     1088      tempColumnCount[jColumn] = numberNeeded - numberInColumn[iColumn];
     1089      assert(numberNeeded >= 0);
     1090      numberInColumn[iColumn] = numberNeeded;
    10901091    }
    10911092  }
    10921093}
    1093 int
    1094 CoinAbcTypeFactorization::pivot ( CoinSimplexInt & pivotRow,
    1095                                   CoinSimplexInt & pivotColumn,
    1096                                   CoinBigIndex pivotRowPosition,
    1097                                   CoinBigIndex pivotColumnPosition,
    1098                                   int * COIN_RESTRICT markRow)
     1094int CoinAbcTypeFactorization::pivot(CoinSimplexInt &pivotRow,
     1095  CoinSimplexInt &pivotColumn,
     1096  CoinBigIndex pivotRowPosition,
     1097  CoinBigIndex pivotColumnPosition,
     1098  int *COIN_RESTRICT markRow)
    10991099{
    1100   CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnU_.array();
    1101   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnU_.array();
    1102   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumn_.array();
    1103   CoinFactorizationDouble * COIN_RESTRICT elementU = elementU_.array();
    1104   CoinSimplexInt * COIN_RESTRICT indexRowU = indexRowU_.array();
    1105   CoinBigIndex * COIN_RESTRICT startRowU = startRowU_.array();
    1106   CoinSimplexInt * COIN_RESTRICT numberInRow = numberInRow_.array();
    1107   CoinFactorizationDouble * COIN_RESTRICT elementL = elementL_.array();
    1108   CoinSimplexInt * COIN_RESTRICT indexRowL = indexRowL_.array();
    1109   CoinSimplexInt * COIN_RESTRICT saveColumn = saveColumn_.array();
    1110   CoinSimplexInt * COIN_RESTRICT nextRow = nextRow_.array();
    1111   CoinSimplexInt * COIN_RESTRICT lastRow = lastRow_.array() ;
    1112   int realPivotRow=fromSmallToBigRow_[pivotRow];
     1100  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnU_.array();
     1101  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnU_.array();
     1102  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumn_.array();
     1103  CoinFactorizationDouble *COIN_RESTRICT elementU = elementU_.array();
     1104  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowU_.array();
     1105  CoinBigIndex *COIN_RESTRICT startRowU = startRowU_.array();
     1106  CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRow_.array();
     1107  CoinFactorizationDouble *COIN_RESTRICT elementL = elementL_.array();
     1108  CoinSimplexInt *COIN_RESTRICT indexRowL = indexRowL_.array();
     1109  CoinSimplexInt *COIN_RESTRICT saveColumn = saveColumn_.array();
     1110  CoinSimplexInt *COIN_RESTRICT nextRow = nextRow_.array();
     1111  CoinSimplexInt *COIN_RESTRICT lastRow = lastRow_.array();
     1112  int realPivotRow = fromSmallToBigRow_[pivotRow];
    11131113  //int realPivotColumn=fromSmallToBigColumn[pivotColumn];
    11141114  //store pivot columns (so can easily compress)
     
    11211121  CoinBigIndex startRow = startRowU[pivotRow];
    11221122  CoinBigIndex endRow = startRow + numberInPivotRow + 1;
    1123 #if ABC_SMALL<2
     1123#if ABC_SMALL < 2
    11241124  // temp - switch off marker for valid row/column lookup
    1125   sparseThreshold_=-1;
    1126 #endif
    1127 
    1128   if ( pivotColumnPosition < 0 ) {
    1129     for ( pivotColumnPosition = startRow; pivotColumnPosition < endRow; pivotColumnPosition++ ) {
     1125  sparseThreshold_ = -1;
     1126#endif
     1127
     1128  if (pivotColumnPosition < 0) {
     1129    for (pivotColumnPosition = startRow; pivotColumnPosition < endRow; pivotColumnPosition++) {
    11301130      CoinSimplexInt iColumn = indexColumnU[pivotColumnPosition];
    1131       if ( iColumn != pivotColumn ) {
    1132         saveColumn[put++] = iColumn;
     1131      if (iColumn != pivotColumn) {
     1132        saveColumn[put++] = iColumn;
    11331133      } else {
    11341134        break;
     
    11361136    }
    11371137  } else {
    1138     for (CoinBigIndex i = startRow ; i < pivotColumnPosition ; i++ ) {
     1138    for (CoinBigIndex i = startRow; i < pivotColumnPosition; i++) {
    11391139      saveColumn[put++] = indexColumnU[i];
    11401140    }
    11411141  }
    1142   assert (pivotColumnPosition<endRow);
    1143   assert (indexColumnU[pivotColumnPosition]==pivotColumn);
     1142  assert(pivotColumnPosition < endRow);
     1143  assert(indexColumnU[pivotColumnPosition] == pivotColumn);
    11441144  pivotColumnPosition++;
    1145   for ( ; pivotColumnPosition < endRow; pivotColumnPosition++ ) {
     1145  for (; pivotColumnPosition < endRow; pivotColumnPosition++) {
    11461146    saveColumn[put++] = indexColumnU[pivotColumnPosition];
    11471147  }
     
    11531153  lastRow[next] = last;
    11541154#ifdef SMALL_PERMUTE
    1155   permuteAddress_[realPivotRow] = numberGoodU_; //use for permute
     1155  permuteAddress_[realPivotRow] = numberGoodU_; //use for permute
    11561156#else
    1157   permuteAddress_[pivotRow] = numberGoodU_;     //use for permute
     1157  permuteAddress_[pivotRow] = numberGoodU_; //use for permute
    11581158#endif
    11591159  lastRow[pivotRow] = -2;
     
    11621162  CoinBigIndex l = lengthL_;
    11631163
    1164   if ( l + numberInPivotColumn > lengthAreaL_ ) {
     1164  if (l + numberInPivotColumn > lengthAreaL_) {
    11651165    //need more memory
    1166     if ((messageLevel_&4)!=0)
     1166    if ((messageLevel_ & 4) != 0)
    11671167      printf("more memory needed in middle of invert\n");
    11681168    return -99;
     
    11701170  //l+=currentAreaL_->elementByColumn-elementL;
    11711171  CoinBigIndex lSave = l;
    1172   CoinSimplexInt saveGoodL=numberGoodL_;
    1173   CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnL_.array();
    1174   startColumnL[numberGoodL_] = l;       //for luck and first time
     1172  CoinSimplexInt saveGoodL = numberGoodL_;
     1173  CoinBigIndex *COIN_RESTRICT startColumnL = startColumnL_.array();
     1174  startColumnL[numberGoodL_] = l; //for luck and first time
    11751175  numberGoodL_++;
    1176   if ( pivotRowPosition < 0 ) {
    1177     for ( pivotRowPosition = startColumn; pivotRowPosition < endColumn; pivotRowPosition++ ) {
     1176  if (pivotRowPosition < 0) {
     1177    for (pivotRowPosition = startColumn; pivotRowPosition < endColumn; pivotRowPosition++) {
    11781178      CoinSimplexInt iRow = indexRowU[pivotRowPosition];
    1179       if ( iRow == pivotRow )
    1180         break;
    1181     }
    1182   }
    1183   assert (pivotRowPosition<endColumn);
    1184   assert (indexRowU[pivotRowPosition]==pivotRow);
     1179      if (iRow == pivotRow)
     1180        break;
     1181    }
     1182  }
     1183  assert(pivotRowPosition < endColumn);
     1184  assert(indexRowU[pivotRowPosition] == pivotRow);
    11851185  CoinFactorizationDouble pivotElement = elementU[pivotRowPosition];
    11861186  CoinFactorizationDouble pivotMultiplier = 1.0 / pivotElement;
    11871187  endColumn--;
    1188   indexRowU[pivotRowPosition]=indexRowU[endColumn];
    1189   elementU[pivotRowPosition]=elementU[endColumn];
    1190   double tolerance=zeroTolerance_;
    1191   numberInPivotColumn=endColumn-startColumn;
     1188  indexRowU[pivotRowPosition] = indexRowU[endColumn];
     1189  elementU[pivotRowPosition] = elementU[endColumn];
     1190  double tolerance = zeroTolerance_;
     1191  numberInPivotColumn = endColumn - startColumn;
    11921192  pivotRegionAddress_[numberGoodU_] = pivotMultiplier;
    11931193  markRow[pivotRow] = LARGE_SET;
     
    11961196  // modify so eArea aligned on 256 bytes boundary
    11971197  // also allow for numberInPivotColumn rounded to multiple of four
    1198   CoinBigIndex added = numberInPivotRow * (numberInPivotColumn+4);
    1199   CoinBigIndex spaceZeroed=added+((numberRowsSmall_+3)>>2);
    1200   spaceZeroed=CoinMax(spaceZeroed,firstZeroed_);
    1201   int maxBoth=CoinMax(numberInPivotRow,numberInPivotColumn);
    1202   CoinBigIndex spaceOther=numberInPivotRow+maxBoth+numberInPivotRow*((numberInPivotColumn+31)>>5);
     1198  CoinBigIndex added = numberInPivotRow * (numberInPivotColumn + 4);
     1199  CoinBigIndex spaceZeroed = added + ((numberRowsSmall_ + 3) >> 2);
     1200  spaceZeroed = CoinMax(spaceZeroed, firstZeroed_);
     1201  int maxBoth = CoinMax(numberInPivotRow, numberInPivotColumn);
     1202  CoinBigIndex spaceOther = numberInPivotRow + maxBoth + numberInPivotRow * ((numberInPivotColumn + 31) >> 5);
    12031203  // allow for new multipliersL
    1204   spaceOther += 2*numberInPivotColumn+8; // 32 byte alignment wanted
    1205   CoinBigIndex spaceNeeded=spaceZeroed+((spaceOther+1)>>1)+32;
     1204  spaceOther += 2 * numberInPivotColumn + 8; // 32 byte alignment wanted
     1205  CoinBigIndex spaceNeeded = spaceZeroed + ((spaceOther + 1) >> 1) + 32;
    12061206#ifdef INT_IS_8
    12071207  abort();
    12081208#endif
    1209   if (spaceNeeded>=lengthAreaUPlus_-lastEntryByColumnUPlus_)
     1209  if (spaceNeeded >= lengthAreaUPlus_ - lastEntryByColumnUPlus_)
    12101210    return -99;
    12111211  // see if need to zero out
    1212   CoinFactorizationDouble * COIN_RESTRICT eArea = elementUColumnPlusAddress_+lengthAreaUPlus_-spaceZeroed;
    1213   CoinInt64 xx = reinterpret_cast<CoinInt64>(eArea);
    1214   int iBottom = static_cast<int>(xx & 255);
    1215   int offset = iBottom>>3;
     1212  CoinFactorizationDouble *COIN_RESTRICT eArea = elementUColumnPlusAddress_ + lengthAreaUPlus_ - spaceZeroed;
     1213  CoinInt64 xx = reinterpret_cast< CoinInt64 >(eArea);
     1214  int iBottom = static_cast< int >(xx & 255);
     1215  int offset = iBottom >> 3;
    12161216  eArea -= offset;
    1217   spaceZeroed=(elementUColumnPlusAddress_+lengthAreaUPlus_)-eArea;
    1218   char * COIN_RESTRICT mark = reinterpret_cast<char *>(eArea+added);
    1219   CoinFactorizationDouble * COIN_RESTRICT multipliersL = eArea-numberInPivotColumn;
     1217  spaceZeroed = (elementUColumnPlusAddress_ + lengthAreaUPlus_) - eArea;
     1218  char *COIN_RESTRICT mark = reinterpret_cast< char * >(eArea + added);
     1219  CoinFactorizationDouble *COIN_RESTRICT multipliersL = eArea - numberInPivotColumn;
    12201220  // adjust
    1221   xx = reinterpret_cast<CoinInt64>(multipliersL);
    1222   iBottom = static_cast<int>(xx & 31);
    1223   offset = iBottom>>3;
     1221  xx = reinterpret_cast< CoinInt64 >(multipliersL);
     1222  iBottom = static_cast< int >(xx & 31);
     1223  offset = iBottom >> 3;
    12241224  multipliersL -= offset;
    1225   int * COIN_RESTRICT tempColumnCount = reinterpret_cast<int *>(multipliersL)-numberInPivotRow;
    1226   int * COIN_RESTRICT tempCount = tempColumnCount-maxBoth;
    1227   int * COIN_RESTRICT others = tempCount-numberInPivotRow;
    1228   for (CoinBigIndex i = startColumn; i < endColumn; i++ ) {
     1225  int *COIN_RESTRICT tempColumnCount = reinterpret_cast< int * >(multipliersL) - numberInPivotRow;
     1226  int *COIN_RESTRICT tempCount = tempColumnCount - maxBoth;
     1227  int *COIN_RESTRICT others = tempCount - numberInPivotRow;
     1228  for (CoinBigIndex i = startColumn; i < endColumn; i++) {
    12291229    CoinSimplexInt iRow = indexRowU[i];
    12301230    //double value=elementU[i]*pivotMultiplier;
    12311231    markRow[iRow] = l - lSave;
    12321232    indexRowL[l] = iRow;
    1233     multipliersL[l-lSave] = elementU[i];
     1233    multipliersL[l - lSave] = elementU[i];
    12341234    l++;
    12351235  }
     
    12371237  lengthL_ = l;
    12381238  //use end of L for temporary space BUT AVX
    1239   CoinSimplexInt * COIN_RESTRICT indexL = &indexRowL[lSave];
     1239  CoinSimplexInt *COIN_RESTRICT indexL = &indexRowL[lSave];
    12401240  //CoinFactorizationDouble * COIN_RESTRICT multipliersL = &elementL[lSave];
    1241   for (int i=0;i<numberInPivotColumn;i++)
     1241  for (int i = 0; i < numberInPivotColumn; i++)
    12421242    multipliersL[i] *= pivotMultiplier;
    12431243  // could make multiple of 4 for AVX (then adjust previous computation)
    1244   int lengthArea=((numberInPivotColumn+4)>>2)<<2;
     1244  int lengthArea = ((numberInPivotColumn + 4) >> 2) << 2;
    12451245  // zero out rest
    1246   memset(multipliersL+numberInPivotColumn,0,(lengthArea-numberInPivotColumn)*sizeof(CoinFactorizationDouble));
    1247   int intsPerColumn = (lengthArea+31)>>5;
    1248   unsigned int * COIN_RESTRICT aBits = reinterpret_cast<unsigned int *>(others-intsPerColumn*numberInPivotRow);
    1249   memset(aBits,0xff,intsPerColumn*4*numberInPivotRow);
    1250   if (spaceZeroed>firstZeroed_) {
    1251     CoinAbcMemset0(eArea,spaceZeroed-firstZeroed_);
    1252     firstZeroed_=spaceZeroed;
     1246  memset(multipliersL + numberInPivotColumn, 0, (lengthArea - numberInPivotColumn) * sizeof(CoinFactorizationDouble));
     1247  int intsPerColumn = (lengthArea + 31) >> 5;
     1248  unsigned int *COIN_RESTRICT aBits = reinterpret_cast< unsigned int * >(others - intsPerColumn * numberInPivotRow);
     1249  memset(aBits, 0xff, intsPerColumn * 4 * numberInPivotRow);
     1250  if (spaceZeroed > firstZeroed_) {
     1251    CoinAbcMemset0(eArea, spaceZeroed - firstZeroed_);
     1252    firstZeroed_ = spaceZeroed;
    12531253  }
    12541254#ifndef NDEBUG
    1255   for (int i=0;i<added;i++)
    1256     assert (!eArea[i]);
    1257   for (int i=0;i<firstZeroed_;i++)
    1258     assert (!elementUColumnPlusAddress_[lengthAreaUPlus_-firstZeroed_+i]);
    1259   for (int i=0;i<numberRowsSmall_;i++)
    1260     assert (!mark[i]);
     1255  for (int i = 0; i < added; i++)
     1256    assert(!eArea[i]);
     1257  for (int i = 0; i < firstZeroed_; i++)
     1258    assert(!elementUColumnPlusAddress_[lengthAreaUPlus_ - firstZeroed_ + i]);
     1259  for (int i = 0; i < numberRowsSmall_; i++)
     1260    assert(!mark[i]);
    12611261#endif
    12621262  // could be 2 if dense
    1263   int status=0;
    1264   CoinSimplexInt *  COIN_RESTRICT numberInColumnPlus = numberInColumnPlus_.array();
    1265   for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     1263  int status = 0;
     1264  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlus_.array();
     1265  for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    12661266    CoinSimplexInt iColumn = saveColumn[jColumn];
    1267     mark[iColumn]=1;
     1267    mark[iColumn] = 1;
    12681268  }
    12691269  // can go parallel
    12701270  // make two versions (or use other way for one) and choose serial if small added?
    1271   CoinSimplexInt *  COIN_RESTRICT nextColumn = nextColumn_.array();
     1271  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumn_.array();
    12721272#define ABC_PARALLEL_PIVOT
    12731273#ifdef ABC_PARALLEL_PIVOT
     
    12801280    assert (numberInColumn[i]>=0);
    12811281#endif
    1282   cilk_for_query (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     1282  cilk_for_query(int jColumn = 0; jColumn < numberInPivotRow; jColumn++)
     1283  {
    12831284    CoinSimplexInt iColumn = saveColumn[jColumn];
    12841285    CoinBigIndex startColumn = startColumnU[iColumn];
     
    12871288    CoinBigIndex put = startColumn;
    12881289    CoinBigIndex positionLargest = -1;
    1289     double largest=0.0;
     1290    double largest = 0.0;
    12901291    CoinBigIndex position = startColumn;
    12911292    int iRow = indexRowU[position];
    12921293    CoinFactorizationDouble value = elementU[position];
    12931294    CoinSimplexInt mark = markRow[iRow];
    1294     CoinBigIndex end=endColumn-1;
    1295     while ( position < end) {
    1296       if ( mark == LARGE_UNSET ) {
    1297         //keep
    1298         if (fabs(value)>largest) {
    1299           positionLargest=put;
    1300           largest=fabs(value);
    1301         }
    1302         indexRowU[put] = iRow;
    1303         elementU[put++] = value;
    1304       } else if ( mark != LARGE_SET ) {
    1305         //will be updated - move to end
    1306         CoinFactorizationDouble value2=value;
    1307         int mark2=mark;
    1308         iRow = indexRowU[end];
    1309         value = elementU[end];
    1310         mark = markRow[iRow];
    1311         indexRowU[end]=mark2;
    1312         elementU[end]=value2;
    1313         end--;
    1314         continue;
     1295    CoinBigIndex end = endColumn - 1;
     1296    while (position < end) {
     1297      if (mark == LARGE_UNSET) {
     1298        //keep
     1299        if (fabs(value) > largest) {
     1300          positionLargest = put;
     1301          largest = fabs(value);
     1302        }
     1303        indexRowU[put] = iRow;
     1304        elementU[put++] = value;
     1305      } else if (mark != LARGE_SET) {
     1306        //will be updated - move to end
     1307        CoinFactorizationDouble value2 = value;
     1308        int mark2 = mark;
     1309        iRow = indexRowU[end];
     1310        value = elementU[end];
     1311        mark = markRow[iRow];
     1312        indexRowU[end] = mark2;
     1313        elementU[end] = value2;
     1314        end--;
     1315        continue;
    13151316      } else {
    1316         thisPivotValue = value;
     1317        thisPivotValue = value;
    13171318      }
    13181319      position++;
     
    13221323    }
    13231324    // now last in column
    1324     if ( mark == LARGE_UNSET ) {
     1325    if (mark == LARGE_UNSET) {
    13251326      //keep
    1326       if (fabs(value)>largest) {
    1327         positionLargest=put;
    1328         largest=fabs(value);
     1327      if (fabs(value) > largest) {
     1328        positionLargest = put;
     1329        largest = fabs(value);
    13291330      }
    13301331      indexRowU[put] = iRow;
    13311332      elementU[put++] = value;
    1332     } else if ( mark != LARGE_SET ) {
     1333    } else if (mark != LARGE_SET) {
    13331334      //will be updated - move to end
    1334       indexRowU[end]=mark;
    1335       elementU[end]=value;
     1335      indexRowU[end] = mark;
     1336      elementU[end] = value;
    13361337    } else {
    13371338      thisPivotValue = value;
    13381339    }
    13391340    //swap largest
    1340     if (positionLargest>=0) {
    1341       double largestValue=elementU[positionLargest];
    1342       int largestIndex=indexRowU[positionLargest];
    1343       if (positionLargest!=startColumn+1&&put>startColumn+1) {
    1344         elementU[positionLargest]=elementU[startColumn+1];
    1345         indexRowU[positionLargest]=indexRowU[startColumn+1];
    1346         elementU[startColumn+1] = largestValue;
    1347         indexRowU[startColumn+1] = largestIndex;
    1348       }
    1349       int firstIndex=indexRowU[startColumn];
    1350       CoinFactorizationDouble firstValue=elementU[startColumn];
     1341    if (positionLargest >= 0) {
     1342      double largestValue = elementU[positionLargest];
     1343      int largestIndex = indexRowU[positionLargest];
     1344      if (positionLargest != startColumn + 1 && put > startColumn + 1) {
     1345        elementU[positionLargest] = elementU[startColumn + 1];
     1346        indexRowU[positionLargest] = indexRowU[startColumn + 1];
     1347        elementU[startColumn + 1] = largestValue;
     1348        indexRowU[startColumn + 1] = largestIndex;
     1349      }
     1350      int firstIndex = indexRowU[startColumn];
     1351      CoinFactorizationDouble firstValue = elementU[startColumn];
    13511352      // move first to end
    13521353      elementU[put] = firstValue;
     
    13581359    indexRowU[startColumn] = realPivotRow;
    13591360    startColumn++;
    1360     startColumnU[iColumn]=startColumn;
     1361    startColumnU[iColumn] = startColumn;
    13611362    numberInColumnPlus[iColumn]++;
    1362     int numberNow=put-startColumn;
    1363     tempColumnCount[jColumn]=numberNow;
     1363    int numberNow = put - startColumn;
     1364    tempColumnCount[jColumn] = numberNow;
    13641365    numberInColumn[iColumn]--;
    13651366#ifndef NDEBUG
    1366         for (int i=startColumn+numberNow;i<startColumn+numberInColumn[iColumn];i++)
    1367           assert (indexRowU[i]<numberInPivotColumn);
     1367    for (int i = startColumn + numberNow; i < startColumn + numberInColumn[iColumn]; i++)
     1368      assert(indexRowU[i] < numberInPivotColumn);
    13681369#endif
    13691370  }
     
    13751376#endif
    13761377  //parallel
    1377   mark[pivotColumn]=1;
    1378   cilk_for_query (int jRow = 0; jRow < numberInPivotColumn; jRow++ ) {
     1378  mark[pivotColumn] = 1;
     1379  cilk_for_query(int jRow = 0; jRow < numberInPivotColumn; jRow++)
     1380  {
    13791381    CoinSimplexInt iRow = indexL[jRow];
    13801382    CoinBigIndex startRow = startRowU[iRow];
    13811383    CoinBigIndex endRow = startRow + numberInRow[iRow];
    1382     CoinBigIndex put=startRow;
     1384    CoinBigIndex put = startRow;
    13831385    // move earlier but set numberInRow to final
    1384     for (CoinBigIndex i = startRow ; i < endRow; i++ ) {
     1386    for (CoinBigIndex i = startRow; i < endRow; i++) {
    13851387      int iColumn = indexColumnU[i];
    1386       if (!mark[iColumn]) 
    1387         indexColumnU[put++]=iColumn;
    1388     }
    1389     numberInRow[iRow]=put-startRow;
    1390   }
    1391   mark[pivotColumn]=0;
     1388      if (!mark[iColumn])
     1389        indexColumnU[put++] = iColumn;
     1390    }
     1391    numberInRow[iRow] = put - startRow;
     1392  }
     1393  mark[pivotColumn] = 0;
    13921394#ifdef DENSE_TRY
    1393   int numberZeroOther=0;
    1394   for (int jRow = 0; jRow < numberInPivotColumn; jRow++ ) {
     1395  int numberZeroOther = 0;
     1396  for (int jRow = 0; jRow < numberInPivotColumn; jRow++) {
    13951397    CoinSimplexInt iRow = indexL[jRow];
    13961398    if (numberInRow[iRow]) {
    13971399      //printf("Cantdo INrow %d incolumn %d nother %d\n",
    13981400      //     numberInPivotRow,numberInPivotColumn,numberZeroOther);
    1399       numberZeroOther=-1;
     1401      numberZeroOther = -1;
    14001402      break;
    14011403    }
    14021404  }
    14031405  if (!numberZeroOther) {
    1404     for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     1406    for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    14051407      if (!tempColumnCount[jColumn])
    1406         others[numberZeroOther++]=jColumn;
     1408        others[numberZeroOther++] = jColumn;
    14071409    }
    14081410  }
    14091411#endif
    14101412  // serial
    1411   for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     1413  for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    14121414    CoinSimplexInt iColumn = saveColumn[jColumn];
    14131415    CoinBigIndex startColumn = startColumnU[iColumn];
    1414     int numberNow=tempColumnCount[jColumn];
    1415     int numberNeeded=numberNow+numberInPivotColumn;
    1416     tempCount[jColumn]=numberInColumn[iColumn];
     1416    int numberNow = tempColumnCount[jColumn];
     1417    int numberNeeded = numberNow + numberInPivotColumn;
     1418    tempCount[jColumn] = numberInColumn[iColumn];
    14171419    //how much space have we got
    14181420    CoinSimplexInt next = nextColumn[iColumn];
    14191421    CoinBigIndex space = startColumnU[next] - startColumn - numberInColumnPlus[next];
    14201422    // do moves serially but fill in in parallel!
    1421     if ( numberNeeded > space ) {
     1423    if (numberNeeded > space) {
    14221424      //getColumnSpace also moves fixed part
    1423       if ( !getColumnSpace ( iColumn, numberNeeded ) ) {
    1424         return -99;
    1425       }
    1426     }
    1427     numberInColumn[iColumn]=numberNeeded;
     1425      if (!getColumnSpace(iColumn, numberNeeded)) {
     1426        return -99;
     1427      }
     1428    }
     1429    numberInColumn[iColumn] = numberNeeded;
    14281430  }
    14291431  // move counts back
    1430   for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     1432  for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    14311433    CoinSimplexInt iColumn = saveColumn[jColumn];
    1432     numberInColumn[iColumn]=tempCount[jColumn];
     1434    numberInColumn[iColumn] = tempCount[jColumn];
    14331435  }
    14341436  // giveUp should be more sophisticated and also vary in next three
    1435 #if ABC_PARALLEL==2
    1436   int giveUp=CoinMax(numberInPivotRow/(parallelMode_+1+(parallelMode_>>1)),16);
     1437#if ABC_PARALLEL == 2
     1438  int giveUp = CoinMax(numberInPivotRow / (parallelMode_ + 1 + (parallelMode_ >> 1)), 16);
    14371439#else
    1438   int giveUp=numberInPivotRow;
     1440  int giveUp = numberInPivotRow;
    14391441#endif
    14401442#ifdef DENSE_TRY
    14411443  // If we keep full area - then can try doing many pivots in this function
    14421444  // Go round if there are any others just in this block
    1443   bool inAreaAlready=false;
    1444   if (numberZeroOther>4) {
     1445  bool inAreaAlready = false;
     1446  if (numberZeroOther > 4) {
    14451447    //printf("Cando INrow %d incolumn %d nother %d\n",
    14461448    //     numberInPivotRow,numberInPivotColumn,numberZeroOther);
    1447     int numberRowsTest=(numberRowsLeft_-numberZeroOther+0)&~7;
    1448     if (numberRowsLeft_-numberZeroOther<=numberRowsTest) {
     1449    int numberRowsTest = (numberRowsLeft_ - numberZeroOther + 0) & ~7;
     1450    if (numberRowsLeft_ - numberZeroOther <= numberRowsTest) {
    14491451      //see if would go dense
    1450       int numberSubtracted=0;
     1452      int numberSubtracted = 0;
    14511453      // would have to be very big for parallel
    1452       for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
    1453         CoinSimplexInt iColumn = saveColumn[jColumn];
    1454         numberSubtracted += numberInColumn[iColumn]-tempColumnCount[jColumn];
     1454      for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
     1455        CoinSimplexInt iColumn = saveColumn[jColumn];
     1456        numberSubtracted += numberInColumn[iColumn] - tempColumnCount[jColumn];
    14551457      }
    14561458      // could do formula? - work backwards
    1457       CoinBigIndex saveTotalElements=totalElements_;
    1458       int saveNumberRowsLeft=numberRowsLeft_;
    1459       int numberOut=numberRowsLeft_-numberRowsTest-1;
    1460       numberRowsLeft_=numberRowsTest;
    1461       CoinBigIndex total= totalElements_-numberSubtracted;
    1462       int bestGoDense=-1;
    1463       for (;numberRowsLeft_<saveNumberRowsLeft;numberRowsLeft_+=8) {
    1464         totalElements_ = total + (numberInPivotColumn-numberOut)*(numberInPivotRow-numberOut);
    1465         int goDense=wantToGoDense();
    1466         if (goDense==2)
    1467           bestGoDense=numberRowsLeft_;
    1468         else
    1469           break;
    1470         numberOut-=8;
    1471       }
    1472       totalElements_=saveTotalElements;
    1473       numberRowsLeft_=saveNumberRowsLeft;
     1459      CoinBigIndex saveTotalElements = totalElements_;
     1460      int saveNumberRowsLeft = numberRowsLeft_;
     1461      int numberOut = numberRowsLeft_ - numberRowsTest - 1;
     1462      numberRowsLeft_ = numberRowsTest;
     1463      CoinBigIndex total = totalElements_ - numberSubtracted;
     1464      int bestGoDense = -1;
     1465      for (; numberRowsLeft_ < saveNumberRowsLeft; numberRowsLeft_ += 8) {
     1466        totalElements_ = total + (numberInPivotColumn - numberOut) * (numberInPivotRow - numberOut);
     1467        int goDense = wantToGoDense();
     1468        if (goDense == 2)
     1469          bestGoDense = numberRowsLeft_;
     1470        else
     1471          break;
     1472        numberOut -= 8;
     1473      }
     1474      totalElements_ = saveTotalElements;
     1475      numberRowsLeft_ = saveNumberRowsLeft;
    14741476      // see if we need to stop early
    1475       if (bestGoDense>numberRowsLeft_-numberZeroOther)
    1476         numberZeroOther=numberRowsLeft_-bestGoDense;;
     1477      if (bestGoDense > numberRowsLeft_ - numberZeroOther)
     1478        numberZeroOther = numberRowsLeft_ - bestGoDense;
     1479      ;
    14771480    }
    14781481  } else {
    1479     numberZeroOther=-1;
    1480   }
    1481   if (numberZeroOther>0) {
     1482    numberZeroOther = -1;
     1483  }
     1484  if (numberZeroOther > 0) {
    14821485    // do all except last
    1483     pivotStartup(0,numberInPivotRow,numberInPivotColumn,lengthArea,giveUp,
    1484                  eArea,saveColumn,startColumnU,tempColumnCount,
    1485                  elementU,numberInColumn,indexRowU);
    1486     assert (tempColumnCount[0]>=0);
    1487     for (int iTry=numberZeroOther-1;iTry>=0;iTry--) {
    1488       pivotWhile(0,numberInPivotRow,numberInPivotColumn,lengthArea,giveUp,
    1489                  eArea,multipliersL);
    1490     assert (tempColumnCount[0]>=0);
     1486    pivotStartup(0, numberInPivotRow, numberInPivotColumn, lengthArea, giveUp,
     1487      eArea, saveColumn, startColumnU, tempColumnCount,
     1488      elementU, numberInColumn, indexRowU);
     1489    assert(tempColumnCount[0] >= 0);
     1490    for (int iTry = numberZeroOther - 1; iTry >= 0; iTry--) {
     1491      pivotWhile(0, numberInPivotRow, numberInPivotColumn, lengthArea, giveUp,
     1492        eArea, multipliersL);
     1493      assert(tempColumnCount[0] >= 0);
    14911494      // find new pivot row
    1492       int jPivotColumn=others[iTry];
    1493       CoinFactorizationDouble * COIN_RESTRICT area =eArea+jPivotColumn*lengthArea;
    1494       double largest=tolerance;
    1495       int jPivotRow=-1;
    1496       for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++ ) {
    1497         CoinFactorizationDouble value = area[j];
    1498         CoinSimplexDouble absValue = fabs ( value );
    1499         if (absValue>largest) {
    1500           largest=absValue;
    1501           jPivotRow=j;
    1502         }
    1503       }
    1504       if (jPivotRow>=0) {
    1505         markRow[pivotRow] = LARGE_UNSET;
    1506         //modify linked list for pivots
    1507         deleteLink ( pivotRow );
    1508         deleteLink ( pivotColumn + numberRows_ );
    1509         // put away last
    1510         afterPivot(pivotRow,pivotColumn);
    1511         if (reinterpret_cast<unsigned int *>(elementUColumnPlusAddress_+lastEntryByColumnUPlus_)>aBits) {
     1495      int jPivotColumn = others[iTry];
     1496      CoinFactorizationDouble *COIN_RESTRICT area = eArea + jPivotColumn * lengthArea;
     1497      double largest = tolerance;
     1498      int jPivotRow = -1;
     1499      for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++) {
     1500        CoinFactorizationDouble value = area[j];
     1501        CoinSimplexDouble absValue = fabs(value);
     1502        if (absValue > largest) {
     1503          largest = absValue;
     1504          jPivotRow = j;
     1505        }
     1506      }
     1507      if (jPivotRow >= 0) {
     1508        markRow[pivotRow] = LARGE_UNSET;
     1509        //modify linked list for pivots
     1510        deleteLink(pivotRow);
     1511        deleteLink(pivotColumn + numberRows_);
     1512        // put away last
     1513        afterPivot(pivotRow, pivotColumn);
     1514        if (reinterpret_cast< unsigned int * >(elementUColumnPlusAddress_ + lastEntryByColumnUPlus_) > aBits) {
    15121515#ifndef NDEBUG
    1513           printf("? dense\n");
    1514 #endif
    1515           return -99;
    1516         }
    1517         // new ones
    1518         pivotRow=indexL[jPivotRow];
    1519         pivotColumn=saveColumn[jPivotColumn];
    1520         // now do stuff for pivot
    1521         realPivotRow=fromSmallToBigRow_[pivotRow];
    1522         //int realPivotColumn=fromSmallToBigColumn[pivotColumn];
    1523         //store pivot columns (so can easily compress)
    1524         CoinBigIndex startColumn = startColumnU[pivotColumn];
    1525         CoinBigIndex endColumn = startColumn + tempColumnCount[jPivotColumn];
    1526         CoinSimplexInt next = nextRow[pivotRow];
    1527         CoinSimplexInt last = lastRow[pivotRow];
    1528 
    1529         nextRow[last] = next;
    1530         lastRow[next] = last;
     1516          printf("? dense\n");
     1517#endif
     1518          return -99;
     1519        }
     1520        // new ones
     1521        pivotRow = indexL[jPivotRow];
     1522        pivotColumn = saveColumn[jPivotColumn];
     1523        // now do stuff for pivot
     1524        realPivotRow = fromSmallToBigRow_[pivotRow];
     1525        //int realPivotColumn=fromSmallToBigColumn[pivotColumn];
     1526        //store pivot columns (so can easily compress)
     1527        CoinBigIndex startColumn = startColumnU[pivotColumn];
     1528        CoinBigIndex endColumn = startColumn + tempColumnCount[jPivotColumn];
     1529        CoinSimplexInt next = nextRow[pivotRow];
     1530        CoinSimplexInt last = lastRow[pivotRow];
     1531
     1532        nextRow[last] = next;
     1533        lastRow[next] = last;
    15311534#ifdef SMALL_PERMUTE
    1532         permuteAddress_[realPivotRow] = numberGoodU_;   //use for permute
     1535        permuteAddress_[realPivotRow] = numberGoodU_; //use for permute
    15331536#else
    1534         permuteAddress_[pivotRow] = numberGoodU_;       //use for permute
    1535 #endif
    1536         lastRow[pivotRow] = -2;
    1537         numberInRow[pivotRow] = 0;
    1538     assert (tempColumnCount[0]>=0);
    1539         //store column in L, compress in U and take column out
    1540         CoinBigIndex l = lengthL_;
    1541         if ( l + numberInPivotColumn > lengthAreaL_ ) {
    1542           //need more memory
    1543           if ((messageLevel_&4)!=0)
    1544             printf("more memory needed in middle of invert\n");
    1545           return -99;
    1546         }
    1547         //CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnL_.array();
    1548         numberGoodL_++;
    1549         // move to L and move last
    1550         numberInPivotColumn--;
    1551     assert (tempColumnCount[0]>=0);
    1552         if (jPivotRow!=numberInPivotColumn) {
    1553           // swap
    1554           for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
    1555             CoinFactorizationDouble * COIN_RESTRICT area =eArea+jColumn*lengthArea;
    1556             CoinFactorizationDouble thisValue = area[jPivotRow];
    1557             area[jPivotRow]=area[numberInPivotColumn];
    1558             area[numberInPivotColumn]=thisValue;
    1559           }
    1560           // do indexL in last one
    1561           int tempI=indexL[numberInPivotColumn];
    1562           CoinFactorizationDouble tempD=multipliersL[numberInPivotColumn];
    1563           indexL[numberInPivotColumn]=indexL[jPivotRow];
    1564           multipliersL[numberInPivotColumn]=multipliersL[jPivotRow];
    1565           indexL[jPivotRow]=tempI;
    1566           multipliersL[jPivotRow]=tempD;
    1567           jPivotRow=numberInPivotColumn;
    1568         }
    1569     assert (tempColumnCount[0]>=0);
    1570         numberInPivotRow--;
    1571         CoinFactorizationDouble pivotElement = area[numberInPivotColumn];
    1572         area[numberInPivotColumn]=0.0;
    1573         // put last one in now
    1574         CoinFactorizationDouble * COIN_RESTRICT areaLast =eArea+numberInPivotRow*lengthArea;
    1575         // swap columns
    1576         saveColumn[jPivotColumn]=saveColumn[numberInPivotRow];
    1577         saveColumn[numberInPivotRow]=pivotColumn;
    1578         //int temp=tempColumnCount[jPivotColumn];
    1579         tempColumnCount[jPivotColumn]=tempColumnCount[numberInPivotRow];
    1580         totalElements_-=numberInColumn[pivotColumn];
    1581         mark[pivotColumn]=0;
    1582     assert (tempColumnCount[0]>=0);
    1583         for (int jRow=0;jRow<numberInPivotColumn+1;jRow++) {
    1584           CoinFactorizationDouble temp=areaLast[jRow];
    1585           areaLast[jRow]=area[jRow];
    1586           area[jRow]=temp;
    1587         }
    1588         areaLast[numberInPivotColumn]=0.0;
    1589         // swap rows in area and save
    1590         for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
    1591           CoinFactorizationDouble * COIN_RESTRICT area =eArea+jColumn*lengthArea;
    1592           CoinFactorizationDouble thisPivotValue = area[numberInPivotColumn];
    1593     assert (tempColumnCount[0]>=0);
    1594           area[numberInPivotColumn]=thisPivotValue;
    1595           if (fabs(thisPivotValue)>tolerance) {
    1596             CoinSimplexInt iColumn = saveColumn[jColumn];
    1597             CoinBigIndex startColumn = startColumnU[iColumn];
    1598             int nKeep=tempColumnCount[jColumn];
    1599             if (nKeep) {
    1600               if (nKeep>1) {
    1601                 // need to move one to end
    1602                 elementU[startColumn+nKeep]=elementU[startColumn+1];
    1603                 indexRowU[startColumn+nKeep]=indexRowU[startColumn+1];
    1604               }
    1605               // move largest
    1606               elementU[startColumn+1]=elementU[startColumn];
    1607               indexRowU[startColumn+1]=indexRowU[startColumn];
    1608             }
    1609             elementU[startColumn] = thisPivotValue;
    1610             indexRowU[startColumn] = realPivotRow;
    1611             startColumn++;
    1612             startColumnU[iColumn]=startColumn;
    1613             numberInColumnPlus[iColumn]++;
    1614             //numberInColumn[iColumn]--;
    1615           }
    1616         }
    1617     assert (tempColumnCount[0]>=0);
    1618         // put away last (but remember count is one out)
    1619         CoinAbcMemcpy(elementL+lSave,multipliersL,numberInPivotColumn+1);
    1620         lSave=l;
    1621         for (int i=0;i<numberInPivotColumn;i++) {
    1622           CoinFactorizationDouble value=areaLast[i];
    1623           areaLast[i]=0.0;
    1624           int iRow=indexL[i];
    1625           indexRowL[l] = iRow;
    1626           assert (iRow>=0);
    1627           multipliersL[l-lSave] = value;
    1628           l++;
    1629         }
    1630         startColumnL[numberGoodL_] = l;
    1631         lengthL_ = l;
    1632         CoinFactorizationDouble pivotMultiplier = 1.0 / pivotElement;
    1633         pivotRegionAddress_[numberGoodU_] = pivotMultiplier;
    1634         numberInColumn[pivotColumn] = 0;
    1635         indexL = &indexRowL[lSave];
    1636         //adjust
    1637         for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++ ) {
    1638           multipliersL[j] *= pivotMultiplier;
    1639         }
    1640         // zero out last
    1641         multipliersL[numberInPivotColumn]=0.0;
     1537        permuteAddress_[pivotRow] = numberGoodU_; //use for permute
     1538#endif
     1539        lastRow[pivotRow] = -2;
     1540        numberInRow[pivotRow] = 0;
     1541        assert(tempColumnCount[0] >= 0);
     1542        //store column in L, compress in U and take column out
     1543        CoinBigIndex l = lengthL_;
     1544        if (l + numberInPivotColumn > lengthAreaL_) {
     1545          //need more memory
     1546          if ((messageLevel_ & 4) != 0)
     1547            printf("more memory needed in middle of invert\n");
     1548          return -99;
     1549        }
     1550        //CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnL_.array();
     1551        numberGoodL_++;
     1552        // move to L and move last
     1553        numberInPivotColumn--;
     1554        assert(tempColumnCount[0] >= 0);
     1555        if (jPivotRow != numberInPivotColumn) {
     1556          // swap
     1557          for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
     1558            CoinFactorizationDouble *COIN_RESTRICT area = eArea + jColumn * lengthArea;
     1559            CoinFactorizationDouble thisValue = area[jPivotRow];
     1560            area[jPivotRow] = area[numberInPivotColumn];
     1561            area[numberInPivotColumn] = thisValue;
     1562          }
     1563          // do indexL in last one
     1564          int tempI = indexL[numberInPivotColumn];
     1565          CoinFactorizationDouble tempD = multipliersL[numberInPivotColumn];
     1566          indexL[numberInPivotColumn] = indexL[jPivotRow];
     1567          multipliersL[numberInPivotColumn] = multipliersL[jPivotRow];
     1568          indexL[jPivotRow] = tempI;
     1569          multipliersL[jPivotRow] = tempD;
     1570          jPivotRow = numberInPivotColumn;
     1571        }
     1572        assert(tempColumnCount[0] >= 0);
     1573        numberInPivotRow--;
     1574        CoinFactorizationDouble pivotElement = area[numberInPivotColumn];
     1575        area[numberInPivotColumn] = 0.0;
     1576        // put last one in now
     1577        CoinFactorizationDouble *COIN_RESTRICT areaLast = eArea + numberInPivotRow * lengthArea;
     1578        // swap columns
     1579        saveColumn[jPivotColumn] = saveColumn[numberInPivotRow];
     1580        saveColumn[numberInPivotRow] = pivotColumn;
     1581        //int temp=tempColumnCount[jPivotColumn];
     1582        tempColumnCount[jPivotColumn] = tempColumnCount[numberInPivotRow];
     1583        totalElements_ -= numberInColumn[pivotColumn];
     1584        mark[pivotColumn] = 0;
     1585        assert(tempColumnCount[0] >= 0);
     1586        for (int jRow = 0; jRow < numberInPivotColumn + 1; jRow++) {
     1587          CoinFactorizationDouble temp = areaLast[jRow];
     1588          areaLast[jRow] = area[jRow];
     1589          area[jRow] = temp;
     1590        }
     1591        areaLast[numberInPivotColumn] = 0.0;
     1592        // swap rows in area and save
     1593        for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
     1594          CoinFactorizationDouble *COIN_RESTRICT area = eArea + jColumn * lengthArea;
     1595          CoinFactorizationDouble thisPivotValue = area[numberInPivotColumn];
     1596          assert(tempColumnCount[0] >= 0);
     1597          area[numberInPivotColumn] = thisPivotValue;
     1598          if (fabs(thisPivotValue) > tolerance) {
     1599            CoinSimplexInt iColumn = saveColumn[jColumn];
     1600            CoinBigIndex startColumn = startColumnU[iColumn];
     1601            int nKeep = tempColumnCount[jColumn];
     1602            if (nKeep) {
     1603              if (nKeep > 1) {
     1604                // need to move one to end
     1605                elementU[startColumn + nKeep] = elementU[startColumn + 1];
     1606                indexRowU[startColumn + nKeep] = indexRowU[startColumn + 1];
     1607              }
     1608              // move largest
     1609              elementU[startColumn + 1] = elementU[startColumn];
     1610              indexRowU[startColumn + 1] = indexRowU[startColumn];
     1611            }
     1612            elementU[startColumn] = thisPivotValue;
     1613            indexRowU[startColumn] = realPivotRow;
     1614            startColumn++;
     1615            startColumnU[iColumn] = startColumn;
     1616            numberInColumnPlus[iColumn]++;
     1617            //numberInColumn[iColumn]--;
     1618          }
     1619        }
     1620        assert(tempColumnCount[0] >= 0);
     1621        // put away last (but remember count is one out)
     1622        CoinAbcMemcpy(elementL + lSave, multipliersL, numberInPivotColumn + 1);
     1623        lSave = l;
     1624        for (int i = 0; i < numberInPivotColumn; i++) {
     1625          CoinFactorizationDouble value = areaLast[i];
     1626          areaLast[i] = 0.0;
     1627          int iRow = indexL[i];
     1628          indexRowL[l] = iRow;
     1629          assert(iRow >= 0);
     1630          multipliersL[l - lSave] = value;
     1631          l++;
     1632        }
     1633        startColumnL[numberGoodL_] = l;
     1634        lengthL_ = l;
     1635        CoinFactorizationDouble pivotMultiplier = 1.0 / pivotElement;
     1636        pivotRegionAddress_[numberGoodU_] = pivotMultiplier;
     1637        numberInColumn[pivotColumn] = 0;
     1638        indexL = &indexRowL[lSave];
     1639        //adjust
     1640        for (CoinSimplexInt j = 0; j < numberInPivotColumn; j++) {
     1641          multipliersL[j] *= pivotMultiplier;
     1642        }
     1643        // zero out last
     1644        multipliersL[numberInPivotColumn] = 0.0;
    16421645      } else {
    1643         // singular
    1644         // give up
    1645         break;
    1646       }
    1647     }
    1648     assert (tempColumnCount[0]>=0);
     1646        // singular
     1647        // give up
     1648        break;
     1649      }
     1650    }
     1651    assert(tempColumnCount[0] >= 0);
    16491652#if 0
    16501653    // zero out extra bits
     
    16651668#endif
    16661669    // last bit
    1667     inAreaAlready=true;
    1668   }
    1669 #endif 
     1670    inAreaAlready = true;
     1671  }
     1672#endif
    16701673#if 0
    16711674  for (int i=0;i<numberRowsSmall_;i++)
     
    16771680  if (!inAreaAlready) {
    16781681#endif
    1679     pivotSome(0,numberInPivotRow,numberInPivotColumn,lengthArea,giveUp,
    1680               eArea,saveColumn,startColumnU,tempColumnCount,
    1681               elementU,numberInColumn,indexRowU,aBits,indexL,
    1682               multipliersL,tolerance);
     1682    pivotSome(0, numberInPivotRow, numberInPivotColumn, lengthArea, giveUp,
     1683      eArea, saveColumn, startColumnU, tempColumnCount,
     1684      elementU, numberInColumn, indexRowU, aBits, indexL,
     1685      multipliersL, tolerance);
    16831686#ifdef DENSE_TRY
    16841687  } else {
    1685     pivotSomeAfter(0,numberInPivotRow,numberInPivotColumn,lengthArea,giveUp,
    1686               eArea,saveColumn,startColumnU,tempColumnCount,
    1687               elementU,numberInColumn,indexRowU,aBits,indexL,
    1688               multipliersL,tolerance);
     1688    pivotSomeAfter(0, numberInPivotRow, numberInPivotColumn, lengthArea, giveUp,
     1689      eArea, saveColumn, startColumnU, tempColumnCount,
     1690      elementU, numberInColumn, indexRowU, aBits, indexL,
     1691      multipliersL, tolerance);
    16891692  }
    16901693#endif
     
    16941697#endif
    16951698  //serial
    1696   for (int jRow = 0; jRow < numberInPivotColumn; jRow++ ) {
     1699  for (int jRow = 0; jRow < numberInPivotColumn; jRow++) {
    16971700    CoinSimplexInt iRow = indexL[jRow];
    16981701    CoinSimplexInt next = nextRow[iRow];
    16991702    CoinBigIndex space = startRowU[next] - startRowU[iRow];
    17001703    // assume full
    1701     int numberNeeded = numberInPivotRow+numberInRow[iRow];
    1702     tempCount[jRow]=numberInRow[iRow];
    1703     numberInRow[iRow]=numberNeeded;
    1704     if ( space < numberNeeded ) {
    1705       if ( !getRowSpace ( iRow, numberNeeded ) ) {
    1706         return -99;
    1707       }
    1708     }
    1709     lastEntryByRowU_ = CoinMax(startRowU[iRow]+numberNeeded,lastEntryByRowU_);
     1704    int numberNeeded = numberInPivotRow + numberInRow[iRow];
     1705    tempCount[jRow] = numberInRow[iRow];
     1706    numberInRow[iRow] = numberNeeded;
     1707    if (space < numberNeeded) {
     1708      if (!getRowSpace(iRow, numberNeeded)) {
     1709        return -99;
     1710      }
     1711    }
     1712    lastEntryByRowU_ = CoinMax(startRowU[iRow] + numberNeeded, lastEntryByRowU_);
    17101713    // in case I got it wrong!
    1711     if (lastEntryByRowU_>lengthAreaU_) {
     1714    if (lastEntryByRowU_ > lengthAreaU_) {
    17121715      return -99;
    17131716    }
    17141717  }
    17151718  // move counts back
    1716   for (int jRow = 0; jRow < numberInPivotColumn; jRow++ ) {
     1719  for (int jRow = 0; jRow < numberInPivotColumn; jRow++) {
    17171720    CoinSimplexInt iRow = indexL[jRow];
    1718     numberInRow[iRow]=tempCount[jRow];
     1721    numberInRow[iRow] = tempCount[jRow];
    17191722  }
    17201723  // parallel
    1721   cilk_for_query (int jRow = 0; jRow < numberInPivotColumn; jRow++ ) {
     1724  cilk_for_query(int jRow = 0; jRow < numberInPivotColumn; jRow++)
     1725  {
    17221726    CoinSimplexInt iRow = indexL[jRow];
    17231727    CoinBigIndex startRow = startRowU[iRow];
    17241728    CoinBigIndex put = startRow + numberInRow[iRow];
    1725     int iWord = jRow>>5;
    1726     unsigned int setBit=1<<(jRow&31);
    1727     unsigned int * aBitsThis = aBits+iWord;
    1728     for (int i=0;i<numberInPivotRow;i++) {
    1729       if ((aBitsThis[0]&setBit)!=0) {
    1730         indexColumnU[put++]=saveColumn[i];
     1729    int iWord = jRow >> 5;
     1730    unsigned int setBit = 1 << (jRow & 31);
     1731    unsigned int *aBitsThis = aBits + iWord;
     1732    for (int i = 0; i < numberInPivotRow; i++) {
     1733      if ((aBitsThis[0] & setBit) != 0) {
     1734        indexColumnU[put++] = saveColumn[i];
    17311735      }
    17321736      aBitsThis += intsPerColumn;
    17331737    }
    17341738    markRow[iRow] = LARGE_UNSET;
    1735     numberInRow[iRow] = put-startRow;
     1739    numberInRow[iRow] = put - startRow;
    17361740  }
    17371741  //memset(aBits,0x00,intsPerColumn*4*(numberInPivotRow+numberZeroOther));
    1738   added=0;
     1742  added = 0;
    17391743  //int addedX=0;
    1740   for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     1744  for (int jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    17411745    CoinSimplexInt iColumn = saveColumn[jColumn];
    1742     for (int i=startColumnU[iColumn];i<startColumnU[iColumn]+numberInColumn[iColumn];i++)
    1743       assert (indexRowU[i]>=0&&indexRowU[i]<numberRowsSmall_);
    1744     mark[iColumn]=0;
     1746    for (int i = startColumnU[iColumn]; i < startColumnU[iColumn] + numberInColumn[iColumn]; i++)
     1747      assert(indexRowU[i] >= 0 && indexRowU[i] < numberRowsSmall_);
     1748    mark[iColumn] = 0;
    17451749    added += tempColumnCount[jColumn];
    1746     modifyLink ( iColumn + numberRows_, numberInColumn[iColumn] );
     1750    modifyLink(iColumn + numberRows_, numberInColumn[iColumn]);
    17471751    //addedX += numberInColumn[iColumn]-tempxx[jColumn];
    17481752  }
    17491753#ifndef NDEBUG
    1750   for (int i=0;i<added;i++)
    1751     assert (!eArea[i]);
    1752   for (int i=0;i<firstZeroed_;i++)
    1753     assert (!elementUColumnPlusAddress_[lengthAreaUPlus_-firstZeroed_+i]);
    1754   for (int i=0;i<numberRowsSmall_;i++)
    1755     assert (!mark[i]);
    1756 #endif
    1757   //double ratio=((double)addedX)/((double)(numberInPivotRow*numberInPivotColumn));
     1754  for (int i = 0; i < added; i++)
     1755    assert(!eArea[i]);
     1756  for (int i = 0; i < firstZeroed_; i++)
     1757    assert(!elementUColumnPlusAddress_[lengthAreaUPlus_ - firstZeroed_ + i]);
     1758  for (int i = 0; i < numberRowsSmall_; i++)
     1759    assert(!mark[i]);
     1760#endif
     1761    //double ratio=((double)addedX)/((double)(numberInPivotRow*numberInPivotColumn));
    17581762#if 0 //def DENSE_TRY
    17591763  if (numberZeroOther>10000)
     
    17631767  //printf("INrow %d incolumn %d nzero %d ratio %g\n",
    17641768  //     numberInPivotRow,numberInPivotColumn,numberZeroOther,ratio);
    1765   for (int i=0;i<numberInPivotColumn;i++) {
    1766     int iRow=indexL[i];
    1767     modifyLink(iRow,numberInRow[iRow]);
    1768   }
    1769   CoinAbcMemcpy(elementL+lSave,multipliersL,numberInPivotColumn);
     1769  for (int i = 0; i < numberInPivotColumn; i++) {
     1770    int iRow = indexL[i];
     1771    modifyLink(iRow, numberInRow[iRow]);
     1772  }
     1773  CoinAbcMemcpy(elementL + lSave, multipliersL, numberInPivotColumn);
    17701774#ifdef DENSE_TRY
    1771   int iLBad=saveGoodL;
    1772   put=startColumnL[iLBad];
    1773   for (int iL=iLBad;iL<numberGoodL_;iL++) {
    1774     CoinBigIndex start=startColumnL[iL];
    1775     startColumnL[iL]=put;
    1776     for (CoinBigIndex j=start;j<startColumnL[iL+1];j++) {
     1775  int iLBad = saveGoodL;
     1776  put = startColumnL[iLBad];
     1777  for (int iL = iLBad; iL < numberGoodL_; iL++) {
     1778    CoinBigIndex start = startColumnL[iL];
     1779    startColumnL[iL] = put;
     1780    for (CoinBigIndex j = start; j < startColumnL[iL + 1]; j++) {
    17771781      if (elementL[j]) {
    1778         elementL[put]=elementL[j];
    1779         indexRowL[put++]=fromSmallToBigRow_[indexRowL[j]];
    1780       }
    1781     }
    1782   }
    1783   startColumnL[numberGoodL_]=put;
    1784   lengthL_=put;
     1782        elementL[put] = elementL[j];
     1783        indexRowL[put++] = fromSmallToBigRow_[indexRowL[j]];
     1784      }
     1785    }
     1786  }
     1787  startColumnL[numberGoodL_] = put;
     1788  lengthL_ = put;
    17851789#else
    17861790  // redo L indices
    1787   for (CoinBigIndex j=lSave;j<startColumnL[numberGoodL_];j++) {
     1791  for (CoinBigIndex j = lSave; j < startColumnL[numberGoodL_]; j++) {
    17881792    //assert (fabs(elementL[j])>=tolerance) ;
    1789     int iRow=indexRowL[j];
     1793    int iRow = indexRowL[j];
    17901794    indexRowL[j] = fromSmallToBigRow_[iRow];
    17911795  }
     
    17931797  markRow[pivotRow] = LARGE_UNSET;
    17941798  //modify linked list for pivots
    1795   deleteLink ( pivotRow );
    1796   deleteLink ( pivotColumn + numberRows_ );
     1799  deleteLink(pivotRow);
     1800  deleteLink(pivotColumn + numberRows_);
    17971801  totalElements_ += added;
    17981802  return status;
     
    18001804#endif
    18011805// nonparallel pivot
    1802 int
    1803 CoinAbcTypeFactorization::pivot ( CoinSimplexInt pivotRow,
    1804                                   CoinSimplexInt pivotColumn,
    1805                                   CoinBigIndex pivotRowPosition,
    1806                                   CoinBigIndex pivotColumnPosition,
    1807                                   CoinFactorizationDouble * COIN_RESTRICT work,
    1808                                   CoinSimplexUnsignedInt * COIN_RESTRICT workArea2,
    1809                                   CoinSimplexInt increment2,
    1810                                   int * COIN_RESTRICT markRow)
     1806int CoinAbcTypeFactorization::pivot(CoinSimplexInt pivotRow,
     1807  CoinSimplexInt pivotColumn,
     1808  CoinBigIndex pivotRowPosition,
     1809  CoinBigIndex pivotColumnPosition,
     1810  CoinFactorizationDouble *COIN_RESTRICT work,
     1811  CoinSimplexUnsignedInt *COIN_RESTRICT workArea2,
     1812  CoinSimplexInt increment2,
     1813  int *COIN_RESTRICT markRow)
    18111814{
    1812   CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnU_.array();
    1813   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnU_.array();
    1814   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumn_.array();
    1815   CoinFactorizationDouble * COIN_RESTRICT elementU = elementU_.array();
    1816   CoinSimplexInt * COIN_RESTRICT indexRowU = indexRowU_.array();
    1817   CoinBigIndex * COIN_RESTRICT startRowU = startRowU_.array();
    1818   CoinSimplexInt * COIN_RESTRICT numberInRow = numberInRow_.array();
    1819   CoinFactorizationDouble * COIN_RESTRICT elementL = elementL_.array();
    1820   CoinSimplexInt * COIN_RESTRICT indexRowL = indexRowL_.array();
    1821   CoinSimplexInt * COIN_RESTRICT saveColumn = saveColumn_.array();
    1822   CoinSimplexInt * COIN_RESTRICT nextRow = nextRow_.array();
    1823   CoinSimplexInt * COIN_RESTRICT lastRow = lastRow_.array() ;
     1815  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnU_.array();
     1816  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnU_.array();
     1817  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumn_.array();
     1818  CoinFactorizationDouble *COIN_RESTRICT elementU = elementU_.array();
     1819  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowU_.array();
     1820  CoinBigIndex *COIN_RESTRICT startRowU = startRowU_.array();
     1821  CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRow_.array();
     1822  CoinFactorizationDouble *COIN_RESTRICT elementL = elementL_.array();
     1823  CoinSimplexInt *COIN_RESTRICT indexRowL = indexRowL_.array();
     1824  CoinSimplexInt *COIN_RESTRICT saveColumn = saveColumn_.array();
     1825  CoinSimplexInt *COIN_RESTRICT nextRow = nextRow_.array();
     1826  CoinSimplexInt *COIN_RESTRICT lastRow = lastRow_.array();
    18241827#ifdef SMALL_PERMUTE
    1825   int realPivotRow=fromSmallToBigRow_[pivotRow];
     1828  int realPivotRow = fromSmallToBigRow_[pivotRow];
    18261829  //int realPivotColumn=fromSmallToBigColumn[pivotColumn];
    18271830#endif
     
    18351838  CoinBigIndex startRow = startRowU[pivotRow];
    18361839  CoinBigIndex endRow = startRow + numberInPivotRow + 1;
    1837 #if ABC_SMALL<2
     1840#if ABC_SMALL < 2
    18381841  // temp - switch off marker for valid row/column lookup
    1839   sparseThreshold_=-1;
    1840 #endif
    1841 
    1842   if ( pivotColumnPosition < 0 ) {
    1843     for ( pivotColumnPosition = startRow; pivotColumnPosition < endRow; pivotColumnPosition++ ) {
     1842  sparseThreshold_ = -1;
     1843#endif
     1844
     1845  if (pivotColumnPosition < 0) {
     1846    for (pivotColumnPosition = startRow; pivotColumnPosition < endRow; pivotColumnPosition++) {
    18441847      CoinSimplexInt iColumn = indexColumnU[pivotColumnPosition];
    1845       if ( iColumn != pivotColumn ) {
    1846         saveColumn[put++] = iColumn;
     1848      if (iColumn != pivotColumn) {
     1849        saveColumn[put++] = iColumn;
    18471850      } else {
    18481851#if BOTH_WAYS
     
    18521855    }
    18531856  } else {
    1854     for (CoinBigIndex i = startRow ; i < pivotColumnPosition ; i++ ) {
     1857    for (CoinBigIndex i = startRow; i < pivotColumnPosition; i++) {
    18551858      saveColumn[put++] = indexColumnU[i];
    18561859    }
    18571860  }
    1858   assert (pivotColumnPosition<endRow);
    1859   assert (indexColumnU[pivotColumnPosition]==pivotColumn);
     1861  assert(pivotColumnPosition < endRow);
     1862  assert(indexColumnU[pivotColumnPosition] == pivotColumn);
    18601863  pivotColumnPosition++;
    1861   for ( ; pivotColumnPosition < endRow; pivotColumnPosition++ ) {
     1864  for (; pivotColumnPosition < endRow; pivotColumnPosition++) {
    18621865    saveColumn[put++] = indexColumnU[pivotColumnPosition];
    18631866  }
     
    18691872  lastRow[next] = last;
    18701873#ifdef SMALL_PERMUTE
    1871   permuteAddress_[realPivotRow] = numberGoodU_; //use for permute
     1874  permuteAddress_[realPivotRow] = numberGoodU_; //use for permute
    18721875#else
    1873   permuteAddress_[pivotRow] = numberGoodU_;     //use for permute
     1876  permuteAddress_[pivotRow] = numberGoodU_; //use for permute
    18741877#endif
    18751878  lastRow[pivotRow] = -2;
     
    18781881  CoinBigIndex l = lengthL_;
    18791882
    1880   if ( l + numberInPivotColumn > lengthAreaL_ ) {
     1883  if (l + numberInPivotColumn > lengthAreaL_) {
    18811884    //need more memory
    1882     if ((messageLevel_&4)!=0)
     1885    if ((messageLevel_ & 4) != 0)
    18831886      printf("more memory needed in middle of invert\n");
    18841887    return -99;
     
    18871890  CoinBigIndex lSave = l;
    18881891
    1889   CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnL_.array();
    1890   startColumnL[numberGoodL_] = l;       //for luck and first time
     1892  CoinBigIndex *COIN_RESTRICT startColumnL = startColumnL_.array();
     1893  startColumnL[numberGoodL_] = l; //for luck and first time
    18911894  numberGoodL_++;
    18921895  startColumnL[numberGoodL_] = l + numberInPivotColumn;
    18931896  lengthL_ += numberInPivotColumn;
    1894   if ( pivotRowPosition < 0 ) {
    1895     for ( pivotRowPosition = startColumn; pivotRowPosition < endColumn; pivotRowPosition++ ) {
     1897  if (pivotRowPosition < 0) {
     1898    for (pivotRowPosition = startColumn; pivotRowPosition < endColumn; pivotRowPosition++) {
    18961899      CoinSimplexInt iRow = indexRowU[pivotRowPosition];
    1897       if ( iRow != pivotRow ) {
    1898         indexRowL[l] = iRow;
    1899         elementL[l] = elementU[pivotRowPosition];
    1900         markRow[iRow] = l - lSave;
    1901         l++;
    1902         //take out of row list
    1903         CoinBigIndex start = startRowU[iRow];
    1904         CoinBigIndex end = start + numberInRow[iRow];
    1905         CoinBigIndex where = start;
    1906 
    1907         while ( indexColumnU[where] != pivotColumn ) {
    1908           where++;
    1909         }                       /* endwhile */
     1900      if (iRow != pivotRow) {
     1901        indexRowL[l] = iRow;
     1902        elementL[l] = elementU[pivotRowPosition];
     1903        markRow[iRow] = l - lSave;
     1904        l++;
     1905        //take out of row list
     1906        CoinBigIndex start = startRowU[iRow];
     1907        CoinBigIndex end = start + numberInRow[iRow];
     1908        CoinBigIndex where = start;
     1909
     1910        while (indexColumnU[where] != pivotColumn) {
     1911          where++;
     1912        } /* endwhile */
    19101913#if DEBUG_COIN
    1911         if ( where >= end ) {
    1912           abort (  );
    1913         }
     1914        if (where >= end) {
     1915          abort();
     1916        }
    19141917#endif
    19151918#if BOTH_WAYS
    19161919#endif
    1917         indexColumnU[where] = indexColumnU[end - 1];
    1918         numberInRow[iRow]--;
     1920        indexColumnU[where] = indexColumnU[end - 1];
     1921        numberInRow[iRow]--;
    19191922      } else {
    1920         break;
     1923        break;
    19211924      }
    19221925    }
     
    19241927    CoinBigIndex i;
    19251928
    1926     for ( i = startColumn; i < pivotRowPosition; i++ ) {
     1929    for (i = startColumn; i < pivotRowPosition; i++) {
    19271930      CoinSimplexInt iRow = indexRowU[i];
    19281931
     
    19361939      CoinBigIndex where = start;
    19371940
    1938       while ( indexColumnU[where] != pivotColumn ) {
    1939         where++;
    1940       }                         /* endwhile */
     1941      while (indexColumnU[where] != pivotColumn) {
     1942        where++;
     1943      } /* endwhile */
    19411944#if DEBUG_COIN
    1942       if ( where >= end ) {
    1943         abort (  );
     1945      if (where >= end) {
     1946        abort();
    19441947      }
    19451948#endif
     
    19481951      indexColumnU[where] = indexColumnU[end - 1];
    19491952      numberInRow[iRow]--;
    1950       assert (numberInRow[iRow]>=0);
    1951     }
    1952   }
    1953   assert (pivotRowPosition<endColumn);
    1954   assert (indexRowU[pivotRowPosition]==pivotRow);
     1953      assert(numberInRow[iRow] >= 0);
     1954    }
     1955  }
     1956  assert(pivotRowPosition < endColumn);
     1957  assert(indexRowU[pivotRowPosition] == pivotRow);
    19551958  CoinFactorizationDouble pivotElement = elementU[pivotRowPosition];
    19561959  CoinFactorizationDouble pivotMultiplier = 1.0 / pivotElement;
     
    19581961  pivotRegionAddress_[numberGoodU_] = pivotMultiplier;
    19591962  pivotRowPosition++;
    1960   for ( ; pivotRowPosition < endColumn; pivotRowPosition++ ) {
     1963  for (; pivotRowPosition < endColumn; pivotRowPosition++) {
    19611964    CoinSimplexInt iRow = indexRowU[pivotRowPosition];
    1962    
     1965
    19631966    markRow[iRow] = l - lSave;
    19641967    indexRowL[l] = iRow;
     
    19701973    CoinBigIndex where = start;
    19711974    // could vectorize?
    1972     while ( indexColumnU[where] != pivotColumn ) {
     1975    while (indexColumnU[where] != pivotColumn) {
    19731976      where++;
    1974     }                           /* endwhile */
     1977    } /* endwhile */
    19751978#if DEBUG_COIN
    1976     if ( where >= end ) {
    1977       abort (  );
     1979    if (where >= end) {
     1980      abort();
    19781981    }
    19791982#endif
     
    19821985    indexColumnU[where] = indexColumnU[end - 1];
    19831986    numberInRow[iRow]--;
    1984     assert (numberInRow[iRow]>=0);
     1987    assert(numberInRow[iRow] >= 0);
    19851988  }
    19861989  markRow[pivotRow] = LARGE_SET;
     
    19881991  numberInColumn[pivotColumn] = 0;
    19891992  //use end of L for temporary space
    1990   CoinSimplexInt * COIN_RESTRICT indexL = &indexRowL[lSave];
    1991   CoinFactorizationDouble * COIN_RESTRICT multipliersL = &elementL[lSave];
     1993  CoinSimplexInt *COIN_RESTRICT indexL = &indexRowL[lSave];
     1994  CoinFactorizationDouble *COIN_RESTRICT multipliersL = &elementL[lSave];
    19921995
    19931996  //adjust
    19941997  CoinSimplexInt j;
    19951998
    1996   for ( j = 0; j < numberInPivotColumn; j++ ) {
     1999  for (j = 0; j < numberInPivotColumn; j++) {
    19972000    multipliersL[j] *= pivotMultiplier;
    19982001  }
     
    20002003  //zero out fill
    20012004  CoinBigIndex iErase;
    2002   for ( iErase = 0; iErase < increment2 * numberInPivotRow;
    2003         iErase++ ) {
     2005  for (iErase = 0; iErase < increment2 * numberInPivotRow;
     2006       iErase++) {
    20042007    workArea2[iErase] = 0;
    20052008  }
    2006   CoinSimplexUnsignedInt * COIN_RESTRICT temp2 = workArea2;
    2007   CoinSimplexInt *  COIN_RESTRICT nextColumn = nextColumn_.array();
     2009  CoinSimplexUnsignedInt *COIN_RESTRICT temp2 = workArea2;
     2010  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumn_.array();
    20082011
    20092012  //pack down and move to work
    20102013  CoinSimplexInt jColumn;
    2011   for ( jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     2014  for (jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    20122015    CoinSimplexInt iColumn = saveColumn[jColumn];
    20132016    CoinBigIndex startColumn = startColumnU[iColumn];
     
    20242027    CoinSimplexInt mark = markRow[iRow];
    20252028
    2026     if ( mark == LARGE_UNSET ) {
    2027       largest = fabs ( value );
     2029    if (mark == LARGE_UNSET) {
     2030      largest = fabs(value);
    20282031      positionLargest = put;
    20292032      put++;
     
    20332036      largest = 0.0;
    20342037      checkLargest = true;
    2035       if ( mark != LARGE_SET ) {
    2036         //will be updated
    2037         work[mark] = value;
    2038         CoinSimplexInt word = mark >> COINFACTORIZATION_SHIFT_PER_INT;
    2039         CoinSimplexInt bit = mark & COINFACTORIZATION_MASK_PER_INT;
    2040 
    2041         temp2[word] = temp2[word] | ( 1 << bit );       //say already in counts
    2042         added--;
     2038      if (mark != LARGE_SET) {
     2039        //will be updated
     2040        work[mark] = value;
     2041        CoinSimplexInt word = mark >> COINFACTORIZATION_SHIFT_PER_INT;
     2042        CoinSimplexInt bit = mark & COINFACTORIZATION_MASK_PER_INT;
     2043
     2044        temp2[word] = temp2[word] | (1 << bit); //say already in counts
     2045        added--;
    20432046      } else {
    2044         thisPivotValue = value;
     2047        thisPivotValue = value;
    20452048      }
    20462049    }
    20472050    CoinBigIndex i;
    2048     for ( i = startColumn + 1; i < endColumn; i++ ) {
     2051    for (i = startColumn + 1; i < endColumn; i++) {
    20492052      iRow = indexRowU[i];
    20502053      value = elementU[i];
    20512054      CoinSimplexInt mark = markRow[iRow];
    20522055
    2053       if ( mark == LARGE_UNSET ) {
    2054         //keep
    2055         indexRowU[put] = iRow;
     2056      if (mark == LARGE_UNSET) {
     2057        //keep
     2058        indexRowU[put] = iRow;
    20562059#if BOTH_WAYS
    20572060#endif
    2058         elementU[put] = value;
    2059         if ( checkLargest ) {
    2060           CoinSimplexDouble absValue = fabs ( value );
    2061 
    2062           if ( absValue > largest ) {
    2063             largest = absValue;
    2064             positionLargest = put;
    2065           }
    2066         }
    2067         put++;
    2068       } else if ( mark != LARGE_SET ) {
    2069         //will be updated
    2070         work[mark] = value;
    2071         CoinSimplexInt word = mark >> COINFACTORIZATION_SHIFT_PER_INT;
    2072         CoinSimplexInt bit = mark & COINFACTORIZATION_MASK_PER_INT;
    2073 
    2074         temp2[word] = temp2[word] | ( 1 << bit );       //say already in counts
    2075         added--;
     2061        elementU[put] = value;
     2062        if (checkLargest) {
     2063          CoinSimplexDouble absValue = fabs(value);
     2064
     2065          if (absValue > largest) {
     2066            largest = absValue;
     2067            positionLargest = put;
     2068          }
     2069        }
     2070        put++;
     2071      } else if (mark != LARGE_SET) {
     2072        //will be updated
     2073        work[mark] = value;
     2074        CoinSimplexInt word = mark >> COINFACTORIZATION_SHIFT_PER_INT;
     2075        CoinSimplexInt bit = mark & COINFACTORIZATION_MASK_PER_INT;
     2076
     2077        temp2[word] = temp2[word] | (1 << bit); //say already in counts
     2078        added--;
    20762079      } else {
    2077         thisPivotValue = value;
     2080        thisPivotValue = value;
    20782081      }
    20792082    }
     
    20832086#if BOTH_WAYS
    20842087#endif
    2085     if ( positionLargest == startColumn ) {
    2086       positionLargest = put;    //follow if was largest
     2088    if (positionLargest == startColumn) {
     2089      positionLargest = put; //follow if was largest
    20872090    }
    20882091    put++;
     
    20982101    startColumn++;
    20992102    numberInColumn[iColumn] = put - startColumn;
    2100     CoinSimplexInt *  COIN_RESTRICT numberInColumnPlus = numberInColumnPlus_.array();
     2103    CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlus_.array();
    21012104    numberInColumnPlus[iColumn]++;
    21022105    startColumnU[iColumn]++;
     
    21072110    space = startColumnU[next] - put - numberInColumnPlus[next];
    21082111    //assume no zero elements
    2109     if ( numberInPivotColumn > space ) {
     2112    if (numberInPivotColumn > space) {
    21102113      //getColumnSpace also moves fixed part
    2111       if ( !getColumnSpace ( iColumn, numberInPivotColumn ) ) {
    2112         return -99;
     2114      if (!getColumnSpace(iColumn, numberInPivotColumn)) {
     2115        return -99;
    21132116      }
    21142117      //redo starts
     
    21202123
    21212124    //CoinSimplexInt * COIN_RESTRICT nextCount = this->nextCount();
    2122     for ( j = 0; j < numberInPivotColumn; j++ ) {
     2125    for (j = 0; j < numberInPivotColumn; j++) {
    21232126      value = work[j] - thisPivotValue * multipliersL[j];
    2124       CoinSimplexDouble absValue = fabs ( value );
    2125 
    2126       if ( absValue > tolerance ) {
    2127         work[j] = 0.0;
    2128         assert (put<lengthAreaU_);
    2129         elementU[put] = value;
    2130         indexRowU[put] = indexL[j];
     2127      CoinSimplexDouble absValue = fabs(value);
     2128
     2129      if (absValue > tolerance) {
     2130        work[j] = 0.0;
     2131        assert(put < lengthAreaU_);
     2132        elementU[put] = value;
     2133        indexRowU[put] = indexL[j];
    21312134#if BOTH_WAYS
    21322135#endif
    2133         if ( absValue > largest ) {
    2134           largest = absValue;
    2135           positionLargest = put;
    2136         }
    2137         put++;
     2136        if (absValue > largest) {
     2137          largest = absValue;
     2138          positionLargest = put;
     2139        }
     2140        put++;
    21382141      } else {
    2139         work[j] = 0.0;
    2140         added--;
    2141         CoinSimplexInt word = j >> COINFACTORIZATION_SHIFT_PER_INT;
    2142         CoinSimplexInt bit = j & COINFACTORIZATION_MASK_PER_INT;
    2143 
    2144         if ( temp2[word] & ( 1 << bit ) ) {
    2145           //take out of row list
    2146           iRow = indexL[j];
    2147           CoinBigIndex start = startRowU[iRow];
    2148           CoinBigIndex end = start + numberInRow[iRow];
    2149           CoinBigIndex where = start;
    2150 
    2151           while ( indexColumnU[where] != iColumn ) {
    2152             where++;
    2153           }                     /* endwhile */
     2142        work[j] = 0.0;
     2143        added--;
     2144        CoinSimplexInt word = j >> COINFACTORIZATION_SHIFT_PER_INT;
     2145        CoinSimplexInt bit = j & COINFACTORIZATION_MASK_PER_INT;
     2146
     2147        if (temp2[word] & (1 << bit)) {
     2148          //take out of row list
     2149          iRow = indexL[j];
     2150          CoinBigIndex start = startRowU[iRow];
     2151          CoinBigIndex end = start + numberInRow[iRow];
     2152          CoinBigIndex where = start;
     2153
     2154          while (indexColumnU[where] != iColumn) {
     2155            where++;
     2156          } /* endwhile */
    21542157#if DEBUG_COIN
    2155           if ( where >= end ) {
    2156             abort (  );
    2157           }
     2158          if (where >= end) {
     2159            abort();
     2160          }
    21582161#endif
    21592162#if BOTH_WAYS
    21602163#endif
    2161           indexColumnU[where] = indexColumnU[end - 1];
    2162           numberInRow[iRow]--;
    2163         } else {
    2164           //make sure won't be added
    2165           CoinSimplexInt word = j >> COINFACTORIZATION_SHIFT_PER_INT;
    2166           CoinSimplexInt bit = j & COINFACTORIZATION_MASK_PER_INT;
    2167 
    2168           temp2[word] = temp2[word] | ( 1 << bit );     //say already in counts
    2169         }
     2164          indexColumnU[where] = indexColumnU[end - 1];
     2165          numberInRow[iRow]--;
     2166        } else {
     2167          //make sure won't be added
     2168          CoinSimplexInt word = j >> COINFACTORIZATION_SHIFT_PER_INT;
     2169          CoinSimplexInt bit = j & COINFACTORIZATION_MASK_PER_INT;
     2170
     2171          temp2[word] = temp2[word] | (1 << bit); //say already in counts
     2172        }
    21702173      }
    21712174    }
    21722175    numberInColumn[iColumn] = put - startColumn;
    21732176    //move largest
    2174     if ( positionLargest >= 0 ) {
     2177    if (positionLargest >= 0) {
    21752178      value = elementU[positionLargest];
    21762179      iRow = indexRowU[positionLargest];
     
    21842187    //linked list for column
    21852188    //if ( nextCount[iColumn + numberRows_] != -2 ) {
    2186       //modify linked list
    2187       //deleteLink ( iColumn + numberRows_ );
    2188       //modifyLink ( iColumn + numberRows_, numberInColumn[iColumn] );
    2189       //}
     2189    //modify linked list
     2190    //deleteLink ( iColumn + numberRows_ );
     2191    //modifyLink ( iColumn + numberRows_, numberInColumn[iColumn] );
     2192    //}
    21902193    temp2 += increment2;
    21912194  }
    21922195  //get space for row list
    2193   CoinSimplexUnsignedInt * COIN_RESTRICT putBase = workArea2;
     2196  CoinSimplexUnsignedInt *COIN_RESTRICT putBase = workArea2;
    21942197  CoinSimplexInt bigLoops = numberInPivotColumn >> COINFACTORIZATION_SHIFT_PER_INT;
    21952198  CoinSimplexInt i = 0;
    21962199
    21972200  // do linked lists and update counts
    2198   while ( bigLoops ) {
     2201  while (bigLoops) {
    21992202    bigLoops--;
    22002203    CoinSimplexInt bit;
    2201     for ( bit = 0; bit < COINFACTORIZATION_BITS_PER_INT; i++, bit++ ) {
     2204    for (bit = 0; bit < COINFACTORIZATION_BITS_PER_INT; i++, bit++) {
    22022205      CoinSimplexUnsignedInt *putThis = putBase;
    22032206      CoinSimplexInt iRow = indexL[i];
     
    22072210      CoinSimplexInt jColumn;
    22082211
    2209       for ( jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
    2210         CoinSimplexUnsignedInt test = *putThis;
    2211 
    2212         putThis += increment2;
    2213         test = 1 - ( ( test >> bit ) & 1 );
    2214         number += test;
     2212      for (jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
     2213        CoinSimplexUnsignedInt test = *putThis;
     2214
     2215        putThis += increment2;
     2216        test = 1 - ((test >> bit) & 1);
     2217        number += test;
    22152218      }
    22162219      CoinSimplexInt next = nextRow[iRow];
     
    22192222      space = startRowU[next] - startRowU[iRow];
    22202223      number += numberInRow[iRow];
    2221       if ( space < number ) {
    2222         if ( !getRowSpace ( iRow, number ) ) {
    2223           return -99;
    2224         }
     2224      if (space < number) {
     2225        if (!getRowSpace(iRow, number)) {
     2226          return -99;
     2227        }
    22252228      }
    22262229      // now do
     
    22322235
    22332236      //add in
    2234       for ( jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
    2235         CoinSimplexUnsignedInt test = *putThis;
    2236 
    2237         putThis += increment2;
    2238         test = 1 - ( ( test >> bit ) & 1 );
    2239         indexColumnU[end] = saveColumn[jColumn];
     2237      for (jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
     2238        CoinSimplexUnsignedInt test = *putThis;
     2239
     2240        putThis += increment2;
     2241        test = 1 - ((test >> bit) & 1);
     2242        indexColumnU[end] = saveColumn[jColumn];
    22402243#if BOTH_WAYS
    22412244#endif
    2242         end += test;
    2243       }
    2244       lastEntryByRowU_ = CoinMax(end,lastEntryByRowU_);
    2245       assert (lastEntryByRowU_<=lengthAreaU_);
     2245        end += test;
     2246      }
     2247      lastEntryByRowU_ = CoinMax(end, lastEntryByRowU_);
     2248      assert(lastEntryByRowU_ <= lengthAreaU_);
    22462249      //put back next one in case zapped
    22472250      indexColumnU[startRowU[next]] = saveIndex;
     
    22552258    }
    22562259    putBase++;
    2257   }                             /* endwhile */
     2260  } /* endwhile */
    22582261  CoinSimplexInt bit;
    22592262
    2260   for ( bit = 0; i < numberInPivotColumn; i++, bit++ ) {
     2263  for (bit = 0; i < numberInPivotColumn; i++, bit++) {
    22612264    CoinSimplexUnsignedInt *putThis = putBase;
    22622265    CoinSimplexInt iRow = indexL[i];
     
    22662269    CoinSimplexInt jColumn;
    22672270
    2268     for ( jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     2271    for (jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    22692272      CoinSimplexUnsignedInt test = *putThis;
    22702273
    22712274      putThis += increment2;
    2272       test = 1 - ( ( test >> bit ) & 1 );
     2275      test = 1 - ((test >> bit) & 1);
    22732276      number += test;
    22742277    }
     
    22782281    space = startRowU[next] - startRowU[iRow];
    22792282    number += numberInRow[iRow];
    2280     if ( space < number ) {
    2281       if ( !getRowSpace ( iRow, number ) ) {
    2282         return -99;
     2283    if (space < number) {
     2284      if (!getRowSpace(iRow, number)) {
     2285        return -99;
    22832286      }
    22842287    }
     
    22942297    //printf("start %d end %d\n",startRowU[iRow],end);
    22952298    //add in
    2296     for ( jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     2299    for (jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    22972300      CoinSimplexUnsignedInt test = *putThis;
    22982301
    22992302      putThis += increment2;
    2300       test = 1 - ( ( test >> bit ) & 1 );
     2303      test = 1 - ((test >> bit) & 1);
    23012304
    23022305      indexColumnU[end] = saveColumn[jColumn];
     
    23082311    }
    23092312    indexColumnU[startRowU[next]] = saveIndex;
    2310     lastEntryByRowU_ = CoinMax(end,lastEntryByRowU_);
    2311     assert (lastEntryByRowU_<=lengthAreaU_);
     2313    lastEntryByRowU_ = CoinMax(end, lastEntryByRowU_);
     2314    assert(lastEntryByRowU_ <= lengthAreaU_);
    23122315#if BOTH_WAYS
    23132316#endif
     
    23182321    //modifyLink ( iRow, number );
    23192322  }
    2320   for ( jColumn = 0; jColumn < numberInPivotRow; jColumn++ ) {
     2323  for (jColumn = 0; jColumn < numberInPivotRow; jColumn++) {
    23212324    CoinSimplexInt iColumn = saveColumn[jColumn];
    2322     modifyLink ( iColumn + numberRows_, numberInColumn[iColumn] );
    2323   }
    2324   for (int i=0;i<numberInPivotColumn;i++) {
    2325     int iRow=indexL[i];
    2326     modifyLink(iRow,numberInRow[iRow]);
     2325    modifyLink(iColumn + numberRows_, numberInColumn[iColumn]);
     2326  }
     2327  for (int i = 0; i < numberInPivotColumn; i++) {
     2328    int iRow = indexL[i];
     2329    modifyLink(iRow, numberInRow[iRow]);
    23272330  }
    23282331#ifdef SMALL_PERMUTE
    23292332  // redo L indices
    2330   for (CoinBigIndex j=lSave;j<startColumnL[numberGoodL_];j++) {
    2331     int iRow=indexRowL[j];
     2333  for (CoinBigIndex j = lSave; j < startColumnL[numberGoodL_]; j++) {
     2334    int iRow = indexRowL[j];
    23322335    indexRowL[j] = fromSmallToBigRow_[iRow];
    23332336  }
     
    23352338  markRow[pivotRow] = LARGE_UNSET;
    23362339  //modify linked list for pivots
    2337   deleteLink ( pivotRow );
    2338   deleteLink ( pivotColumn + numberRows_ );
     2340  deleteLink(pivotRow);
     2341  deleteLink(pivotColumn + numberRows_);
    23392342  totalElements_ += added;
    23402343  return 0;
    23412344}
    23422345// After pivoting
    2343 void
    2344 CoinAbcTypeFactorization::afterPivot( CoinSimplexInt pivotRow,
    2345                                       CoinSimplexInt pivotColumn )
     2346void CoinAbcTypeFactorization::afterPivot(CoinSimplexInt pivotRow,
     2347  CoinSimplexInt pivotColumn)
    23462348{
    23472349#ifdef SMALL_PERMUTE
    2348   int realPivotRow=fromSmallToBigRow_[pivotRow];
    2349   int realPivotColumn=fromSmallToBigColumn_[pivotColumn];
    2350   assert (permuteAddress_[realPivotRow]==numberGoodU_);
     2350  int realPivotRow = fromSmallToBigRow_[pivotRow];
     2351  int realPivotColumn = fromSmallToBigColumn_[pivotColumn];
     2352  assert(permuteAddress_[realPivotRow] == numberGoodU_);
    23512353  pivotColumnAddress_[numberGoodU_] = realPivotColumn;
    23522354#else
    2353   assert (permuteAddress_[pivotRow]==numberGoodU_);
     2355  assert(permuteAddress_[pivotRow] == numberGoodU_);
    23542356  pivotColumnAddress_[numberGoodU_] = pivotColumn;
    23552357#endif
    23562358#ifdef ABC_USE_FUNCTION_POINTERS
    23572359  int number = numberInColumnPlusAddress_[pivotColumn];
    2358   scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
     2360  scatterStruct *COIN_RESTRICT scatter = scatterUColumn();
    23592361#ifdef SMALL_PERMUTE
    23602362#if ABC_USE_FUNCTION_POINTERS
    2361   if (number<9) {
    2362     scatter[realPivotRow].functionPointer=AbcScatterLowSubtract[number];
     2363  if (number < 9) {
     2364    scatter[realPivotRow].functionPointer = AbcScatterLowSubtract[number];
    23632365  } else {
    2364     scatter[realPivotRow].functionPointer=AbcScatterHighSubtract[number&3];
    2365   }
    2366 #endif
    2367   scatter[realPivotRow].offset=lastEntryByColumnUPlus_;
    2368   scatter[realPivotRow].number=number;
     2366    scatter[realPivotRow].functionPointer = AbcScatterHighSubtract[number & 3];
     2367  }
     2368#endif
     2369  scatter[realPivotRow].offset = lastEntryByColumnUPlus_;
     2370  scatter[realPivotRow].number = number;
    23692371#else
    23702372#if ABC_USE_FUNCTION_POINTERS
    2371   if (number<9) {
    2372     scatter[pivotRow].functionPointer=AbcScatterLowSubtract[number];
     2373  if (number < 9) {
     2374    scatter[pivotRow].functionPointer = AbcScatterLowSubtract[number];
    23732375  } else {
    2374     scatter[pivotRow].functionPointer=AbcScatterHighSubtract[number&3];
    2375   }
    2376 #endif
    2377   scatter[pivotRow].offset=lastEntryByColumnUPlus_;
    2378   scatter[pivotRow].number=number;
     2376    scatter[pivotRow].functionPointer = AbcScatterHighSubtract[number & 3];
     2377  }
     2378#endif
     2379  scatter[pivotRow].offset = lastEntryByColumnUPlus_;
     2380  scatter[pivotRow].number = number;
    23792381#endif
    23802382  // if scatter could move from inside pivot etc rather than indexRow
    2381   CoinSimplexInt * COIN_RESTRICT indexRow = indexRowUAddress_;
    2382   CoinFactorizationDouble * COIN_RESTRICT element = elementUAddress_;
    2383   CoinBigIndex *  COIN_RESTRICT startColumnU = startColumnUAddress_;
    2384   CoinBigIndex startC = startColumnU[pivotColumn]-number;
     2383  CoinSimplexInt *COIN_RESTRICT indexRow = indexRowUAddress_;
     2384  CoinFactorizationDouble *COIN_RESTRICT element = elementUAddress_;
     2385  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     2386  CoinBigIndex startC = startColumnU[pivotColumn] - number;
    23852387  CoinFactorizationDouble pivotMultiplier = pivotRegionAddress_[numberGoodU_];
    2386   for (int i=startC;i<startC+number;i++)
    2387     elementUColumnPlusAddress_[lastEntryByColumnUPlus_++]=element[i]*pivotMultiplier;
    2388   CoinAbcMemcpy(reinterpret_cast<CoinSimplexInt *>(elementUColumnPlusAddress_+lastEntryByColumnUPlus_),indexRow+startC,number);
    2389   lastEntryByColumnUPlus_ += (number+1)>>1;
     2388  for (int i = startC; i < startC + number; i++)
     2389    elementUColumnPlusAddress_[lastEntryByColumnUPlus_++] = element[i] * pivotMultiplier;
     2390  CoinAbcMemcpy(reinterpret_cast< CoinSimplexInt * >(elementUColumnPlusAddress_ + lastEntryByColumnUPlus_), indexRow + startC, number);
     2391  lastEntryByColumnUPlus_ += (number + 1) >> 1;
    23902392#ifdef ABC_USE_FUNCTION_POINTERS
    23912393  if (!numberInColumnAddress_[pivotColumn]) {
    2392     int iNext=nextColumnAddress_[pivotColumn];
    2393     int iLast=lastColumnAddress_[pivotColumn];
    2394     lastColumnAddress_[iNext]=iLast;
    2395     assert (iLast>=0);
    2396     nextColumnAddress_[iLast]=iNext;
     2394    int iNext = nextColumnAddress_[pivotColumn];
     2395    int iLast = lastColumnAddress_[pivotColumn];
     2396    lastColumnAddress_[iNext] = iLast;
     2397    assert(iLast >= 0);
     2398    nextColumnAddress_[iLast] = iNext;
    23972399  }
    23982400#endif
     
    24002402  numberGoodU_++;
    24012403  numberRowsLeft_--;
    2402 #if COIN_DEBUG==2
    2403   checkConsistency (  );
     2404#if COIN_DEBUG == 2
     2405  checkConsistency();
    24042406#endif
    24052407}
     
    24082410int CoinAbcTypeFactorization::wantToGoDense()
    24092411{
    2410   int status=0;
     2412  int status = 0;
    24112413  if (denseThreshold_) {
    2412     // see whether to go dense 
     2414    // see whether to go dense
    24132415    // only if exact multiple
    2414     if ((numberRowsLeft_&7)==0) {
     2416    if ((numberRowsLeft_ & 7) == 0) {
    24152417      CoinSimplexDouble full = numberRowsLeft_;
    24162418      full *= full;
    2417       assert (full>=0.0);
     2419      assert(full >= 0.0);
    24182420      CoinSimplexDouble leftElements = totalElements_;
    24192421      //if (numberRowsLeft_==100)
    24202422      //printf("at 100 %d elements\n",totalElements_);
    24212423      CoinSimplexDouble ratio;
    2422       if (numberRowsLeft_>2000)
    2423         ratio=3.5;
    2424       else if (numberRowsLeft_>800)
    2425         ratio=2.75;//3.5;
    2426       else if (numberRowsLeft_>256)
    2427         ratio=2.0;//2.5;
     2424      if (numberRowsLeft_ > 2000)
     2425        ratio = 3.5;
     2426      else if (numberRowsLeft_ > 800)
     2427        ratio = 2.75; //3.5;
     2428      else if (numberRowsLeft_ > 256)
     2429        ratio = 2.0; //2.5;
    24282430      //else if (numberRowsLeft_==8)
    24292431      //ratio=200.0;
    24302432      else
    2431         ratio=1.5;
     2433        ratio = 1.5;
    24322434      //ratio=200.0;
    24332435      //ratio *=0.75;
    2434       if ((ratio*leftElements>full&&numberRowsLeft_>abs(denseThreshold_))) {
    2435 #if 0 //ndef NDEBUG
    2436         //return to do dense
     2436      if ((ratio * leftElements > full && numberRowsLeft_ > abs(denseThreshold_))) {
     2437#if 0 //ndef NDEBUG \
     2438  //return to do dense
    24372439        CoinSimplexInt check=0;
    24382440        for (CoinSimplexInt iColumn=0;iColumn<numberRowsSmall_;iColumn++) {
     
    24502452        }
    24512453#else
    2452         status=2;
    2453 #if ABC_NORMAL_DEBUG>1
    2454         std::cout<<"      Went dense at "<<numberRowsLeft_<<" rows "<<
    2455           totalElements_<<" "<<full<<" "<<leftElements<<std::endl;
     2454        status = 2;
     2455#if ABC_NORMAL_DEBUG > 1
     2456        std::cout << "      Went dense at " << numberRowsLeft_ << " rows " << totalElements_ << " " << full << " " << leftElements << std::endl;
    24562457#endif
    24572458#endif
     
    24632464#endif
    24642465//  pivotRowSingleton.  Does one pivot on Row Singleton in factorization
    2465 bool
    2466 CoinAbcTypeFactorization::pivotRowSingleton ( CoinSimplexInt pivotRow,
    2467                                   CoinSimplexInt pivotColumn )
     2466bool CoinAbcTypeFactorization::pivotRowSingleton(CoinSimplexInt pivotRow,
     2467  CoinSimplexInt pivotColumn)
    24682468{
    24692469  //store pivot columns (so can easily compress)
    2470   CoinBigIndex *  COIN_RESTRICT startColumnU = startColumnUAddress_;
    2471   CoinBigIndex  COIN_RESTRICT startColumn = startColumnU[pivotColumn];
    2472   CoinSimplexInt *  COIN_RESTRICT numberInRow = numberInRowAddress_;
    2473   CoinSimplexInt *  COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     2470  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     2471  CoinBigIndex COIN_RESTRICT startColumn = startColumnU[pivotColumn];
     2472  CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRowAddress_;
     2473  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    24742474  CoinSimplexInt numberDoColumn = numberInColumn[pivotColumn] - 1;
    24752475  CoinBigIndex endColumn = startColumn + numberDoColumn + 1;
    24762476  CoinBigIndex pivotRowPosition = startColumn;
    2477   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
     2477  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
    24782478  CoinSimplexInt iRow = indexRowU[pivotRowPosition];
    2479   CoinBigIndex *  COIN_RESTRICT startRowU = startRowUAddress_;
    2480   CoinSimplexInt *  COIN_RESTRICT nextRow = nextRowAddress_;
    2481   CoinSimplexInt *  COIN_RESTRICT lastRow = lastRowAddress_;
    2482 
    2483   while ( iRow != pivotRow ) {
     2479  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
     2480  CoinSimplexInt *COIN_RESTRICT nextRow = nextRowAddress_;
     2481  CoinSimplexInt *COIN_RESTRICT lastRow = lastRowAddress_;
     2482
     2483  while (iRow != pivotRow) {
    24842484    pivotRowPosition++;
    24852485    iRow = indexRowU[pivotRowPosition];
    2486   }                             /* endwhile */
    2487   assert ( pivotRowPosition < endColumn );
     2486  } /* endwhile */
     2487  assert(pivotRowPosition < endColumn);
    24882488  //store column in L, compress in U and take column out
    24892489  CoinBigIndex l = lengthL_;
    24902490
    2491   if ( l + numberDoColumn > lengthAreaL_ ) {
     2491  if (l + numberDoColumn > lengthAreaL_) {
    24922492    //need more memory
    2493     if ((messageLevel_&4)!=0)
     2493    if ((messageLevel_ & 4) != 0)
    24942494      std::cout << "more memory needed in middle of invert" << std::endl;
    24952495    return false;
    24962496  }
    2497   CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnLAddress_;
    2498   CoinFactorizationDouble *  COIN_RESTRICT elementL = elementLAddress_;
    2499   CoinSimplexInt *  COIN_RESTRICT indexRowL = indexRowLAddress_;
    2500   startColumnL[numberGoodL_] = l;       //for luck and first time
     2497  CoinBigIndex *COIN_RESTRICT startColumnL = startColumnLAddress_;
     2498  CoinFactorizationDouble *COIN_RESTRICT elementL = elementLAddress_;
     2499  CoinSimplexInt *COIN_RESTRICT indexRowL = indexRowLAddress_;
     2500  startColumnL[numberGoodL_] = l; //for luck and first time
    25012501  numberGoodL_++;
    25022502  startColumnL[numberGoodL_] = l + numberDoColumn;
    25032503  lengthL_ += numberDoColumn;
    2504   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
     2504  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
    25052505  CoinFactorizationDouble pivotElement = elementU[pivotRowPosition];
    25062506  CoinFactorizationDouble pivotMultiplier = 1.0 / pivotElement;
     
    25092509  CoinBigIndex i;
    25102510
    2511   CoinSimplexInt *  COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     2511  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    25122512#ifdef SMALL_PERMUTE
    2513   int realPivotRow=fromSmallToBigRow_[pivotRow];
    2514 #endif
    2515   for ( i = startColumn; i < pivotRowPosition; i++ ) {
     2513  int realPivotRow = fromSmallToBigRow_[pivotRow];
     2514#endif
     2515  for (i = startColumn; i < pivotRowPosition; i++) {
    25162516    CoinSimplexInt iRow = indexRowU[i];
    25172517
     
    25292529    CoinBigIndex where = start;
    25302530
    2531     while ( indexColumnU[where] != pivotColumn ) {
     2531    while (indexColumnU[where] != pivotColumn) {
    25322532      where++;
    2533     }                           /* endwhile */
    2534     assert ( where < end );
     2533    } /* endwhile */
     2534    assert(where < end);
    25352535#if BOTH_WAYS
    25362536#endif
     
    25382538    iNumberInRow--;
    25392539    numberInRow[iRow] = iNumberInRow;
    2540     modifyLink ( iRow, iNumberInRow );
    2541   }
    2542   for ( i = pivotRowPosition + 1; i < endColumn; i++ ) {
     2540    modifyLink(iRow, iNumberInRow);
     2541  }
     2542  for (i = pivotRowPosition + 1; i < endColumn; i++) {
    25432543    CoinSimplexInt iRow = indexRowU[i];
    25442544
     
    25562556    CoinBigIndex where = start;
    25572557
    2558     while ( indexColumnU[where] != pivotColumn ) {
     2558    while (indexColumnU[where] != pivotColumn) {
    25592559      where++;
    2560     }                           /* endwhile */
    2561     assert ( where < end );
     2560    } /* endwhile */
     2561    assert(where < end);
    25622562#if BOTH_WAYS
    25632563#endif
     
    25652565    iNumberInRow--;
    25662566    numberInRow[iRow] = iNumberInRow;
    2567     modifyLink ( iRow, iNumberInRow );
     2567    modifyLink(iRow, iNumberInRow);
    25682568  }
    25692569  numberInColumn[pivotColumn] = 0;
    25702570  //modify linked list for pivots
    25712571  numberInRow[pivotRow] = 0;
    2572   deleteLink ( pivotRow );
    2573   deleteLink ( pivotColumn + numberRows_ );
     2572  deleteLink(pivotRow);
     2573  deleteLink(pivotColumn + numberRows_);
    25742574  //take out this bit of indexColumnU
    25752575  CoinSimplexInt next = nextRow[pivotRow];
     
    25782578  nextRow[last] = next;
    25792579  lastRow[next] = last;
    2580   lastRow[pivotRow] =-2;
     2580  lastRow[pivotRow] = -2;
    25812581#ifdef SMALL_PERMUTE
    2582   permuteAddress_[realPivotRow]=numberGoodU_;
     2582  permuteAddress_[realPivotRow] = numberGoodU_;
    25832583#else
    2584   permuteAddress_[pivotRow]=numberGoodU_;
     2584  permuteAddress_[pivotRow] = numberGoodU_;
    25852585#endif
    25862586  return true;
     
    25882588
    25892589//  pivotColumnSingleton.  Does one pivot on Column Singleton in factorization
    2590 void
    2591 CoinAbcTypeFactorization::pivotColumnSingleton ( CoinSimplexInt pivotRow,
    2592                                      CoinSimplexInt pivotColumn )
     2590void CoinAbcTypeFactorization::pivotColumnSingleton(CoinSimplexInt pivotRow,
     2591  CoinSimplexInt pivotColumn)
    25932592{
    2594   CoinSimplexInt *  COIN_RESTRICT numberInRow = numberInRowAddress_;
    2595   CoinSimplexInt *  COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    2596   CoinSimplexInt *  COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
     2593  CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRowAddress_;
     2594  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     2595  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    25972596  //store pivot columns (so can easily compress)
    25982597  CoinSimplexInt numberDoRow = numberInRow[pivotRow] - 1;
    2599   CoinBigIndex *  COIN_RESTRICT startColumnU = startColumnUAddress_;
     2598  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
    26002599  CoinBigIndex startColumn = startColumnU[pivotColumn];
    2601   CoinBigIndex *  COIN_RESTRICT startRowU = startRowUAddress_;
     2600  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
    26022601  CoinBigIndex startRow = startRowU[pivotRow];
    26032602  CoinBigIndex endRow = startRow + numberDoRow + 1;
    2604   CoinSimplexInt *  COIN_RESTRICT nextRow = nextRowAddress_;
    2605   CoinSimplexInt *  COIN_RESTRICT lastRow = lastRowAddress_;
     2603  CoinSimplexInt *COIN_RESTRICT nextRow = nextRowAddress_;
     2604  CoinSimplexInt *COIN_RESTRICT lastRow = lastRowAddress_;
    26062605  //take out this bit of indexColumnU
    26072606  CoinSimplexInt next = nextRow[pivotRow];
     
    26102609  nextRow[last] = next;
    26112610  lastRow[next] = last;
    2612   lastRow[pivotRow] =-2; //mark
     2611  lastRow[pivotRow] = -2; //mark
    26132612#ifdef SMALL_PERMUTE
    2614   int realPivotRow=fromSmallToBigRow_[pivotRow];
    2615   permuteAddress_[realPivotRow]=numberGoodU_;
     2613  int realPivotRow = fromSmallToBigRow_[pivotRow];
     2614  permuteAddress_[realPivotRow] = numberGoodU_;
    26162615#else
    2617   permuteAddress_[pivotRow]=numberGoodU_;
     2616  permuteAddress_[pivotRow] = numberGoodU_;
    26182617#endif
    26192618  //clean up counts
    2620   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
     2619  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
    26212620  CoinFactorizationDouble pivotElement = elementU[startColumn];
    26222621
    26232622  pivotRegionAddress_[numberGoodU_] = 1.0 / pivotElement;
    26242623  numberInColumn[pivotColumn] = 0;
    2625   CoinSimplexInt *  COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    2626   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
     2624  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     2625  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
    26272626  //CoinSimplexInt *  COIN_RESTRICT saveColumn = saveColumnAddress_;
    26282627  CoinBigIndex i;
    26292628  // would I be better off doing other way first??
    2630   for ( i = startRow; i < endRow; i++ ) {
     2629  for (i = startRow; i < endRow; i++) {
    26312630    CoinSimplexInt iColumn = indexColumnU[i];
    2632     if ( numberInColumn[iColumn] ) {
     2631    if (numberInColumn[iColumn]) {
    26332632      CoinSimplexInt number = numberInColumn[iColumn] - 1;
    26342633      //modify linked list
    2635       modifyLink ( iColumn + numberRows_, number );
     2634      modifyLink(iColumn + numberRows_, number);
    26362635      //move pivot row element
    26372636#ifdef SMALL_PERMUTE
    26382637      CoinBigIndex start = startColumnU[iColumn];
    26392638#endif
    2640       if ( number ) {
     2639      if (number) {
    26412640#ifndef SMALL_PERMUTE
    2642         CoinBigIndex start = startColumnU[iColumn];
    2643 #endif
    2644         CoinBigIndex pivot = start;
    2645         CoinSimplexInt iRow = indexRowU[pivot];
    2646         while ( iRow != pivotRow ) {
    2647           pivot++;
    2648           iRow = indexRowU[pivot];
    2649         }
    2650         assert (pivot < startColumnU[iColumn] +
    2651                 numberInColumn[iColumn]);
     2641        CoinBigIndex start = startColumnU[iColumn];
     2642#endif
     2643        CoinBigIndex pivot = start;
     2644        CoinSimplexInt iRow = indexRowU[pivot];
     2645        while (iRow != pivotRow) {
     2646          pivot++;
     2647          iRow = indexRowU[pivot];
     2648        }
     2649        assert(pivot < startColumnU[iColumn] + numberInColumn[iColumn]);
    26522650#if BOTH_WAYS
    26532651#endif
    2654         if ( pivot != start ) {
    2655           //move largest one up
    2656           CoinFactorizationDouble value = elementU[start];
    2657 
    2658           iRow = indexRowU[start];
    2659           elementU[start] = elementU[pivot];
    2660           assert (indexRowU[pivot]==pivotRow);
    2661           indexRowU[start] = indexRowU[pivot];
    2662           elementU[pivot] = elementU[start + 1];
    2663           indexRowU[pivot] = indexRowU[start + 1];
    2664           elementU[start + 1] = value;
    2665           indexRowU[start + 1] = iRow;
     2652        if (pivot != start) {
     2653          //move largest one up
     2654          CoinFactorizationDouble value = elementU[start];
     2655
     2656          iRow = indexRowU[start];
     2657          elementU[start] = elementU[pivot];
     2658          assert(indexRowU[pivot] == pivotRow);
     2659          indexRowU[start] = indexRowU[pivot];
     2660          elementU[pivot] = elementU[start + 1];
     2661          indexRowU[pivot] = indexRowU[start + 1];
     2662          elementU[start + 1] = value;
     2663          indexRowU[start + 1] = iRow;
    26662664#if BOTH_WAYS
    26672665#endif
    2668         } else {
    2669           //find new largest element
    2670           CoinSimplexInt iRowSave = indexRowU[start + 1];
    2671           CoinFactorizationDouble valueSave = elementU[start + 1];
    2672           CoinFactorizationDouble valueLargest = fabs ( valueSave );
    2673           CoinBigIndex end = start + numberInColumn[iColumn];
    2674           CoinBigIndex largest = start + 1;
    2675 
    2676           CoinBigIndex k;
    2677           for ( k = start + 2; k < end; k++ ) {
    2678             CoinFactorizationDouble value = elementU[k];
    2679             CoinFactorizationDouble valueAbs = fabs ( value );
    2680 
    2681             if ( valueAbs > valueLargest ) {
    2682               valueLargest = valueAbs;
    2683               largest = k;
    2684             }
    2685           }
    2686           indexRowU[start + 1] = indexRowU[largest];
    2687           elementU[start + 1] = elementU[largest];
    2688           indexRowU[largest] = iRowSave;
    2689           elementU[largest] = valueSave;
     2666        } else {
     2667          //find new largest element
     2668          CoinSimplexInt iRowSave = indexRowU[start + 1];
     2669          CoinFactorizationDouble valueSave = elementU[start + 1];
     2670          CoinFactorizationDouble valueLargest = fabs(valueSave);
     2671          CoinBigIndex end = start + numberInColumn[iColumn];
     2672          CoinBigIndex largest = start + 1;
     2673
     2674          CoinBigIndex k;
     2675          for (k = start + 2; k < end; k++) {
     2676            CoinFactorizationDouble value = elementU[k];
     2677            CoinFactorizationDouble valueAbs = fabs(value);
     2678
     2679            if (valueAbs > valueLargest) {
     2680              valueLargest = valueAbs;
     2681              largest = k;
     2682            }
     2683          }
     2684          indexRowU[start + 1] = indexRowU[largest];
     2685          elementU[start + 1] = elementU[largest];
     2686          indexRowU[largest] = iRowSave;
     2687          elementU[largest] = valueSave;
    26902688#if BOTH_WAYS
    26912689#endif
    2692         }
     2690        }
    26932691      }
    26942692#ifdef SMALL_PERMUTE
    2695       indexRowU[start]=realPivotRow;
     2693      indexRowU[start] = realPivotRow;
    26962694#endif
    26972695      //clean up counts
     
    27032701  }
    27042702  //modify linked list for pivots
    2705   deleteLink ( pivotRow );
    2706   deleteLink ( pivotColumn + numberRows_ );
     2703  deleteLink(pivotRow);
     2704  deleteLink(pivotColumn + numberRows_);
    27072705  numberInRow[pivotRow] = 0;
    27082706  //put in dummy pivot in L
    27092707  CoinBigIndex l = lengthL_;
    27102708
    2711   CoinBigIndex * startColumnL = startColumnLAddress_;
    2712   startColumnL[numberGoodL_] = l;       //for luck and first time
     2709  CoinBigIndex *startColumnL = startColumnLAddress_;
     2710  startColumnL[numberGoodL_] = l; //for luck and first time
    27132711  numberGoodL_++;
    27142712  startColumnL[numberGoodL_] = l;
    27152713}
    27162714
    2717 
    27182715//  getColumnSpace.  Gets space for one Column with given length
    27192716//may have to do compression  (returns true)
    27202717//also moves existing vector
    2721 bool
    2722 CoinAbcTypeFactorization::getColumnSpace ( CoinSimplexInt iColumn,
    2723                                CoinSimplexInt extraNeeded )
     2718bool CoinAbcTypeFactorization::getColumnSpace(CoinSimplexInt iColumn,
     2719  CoinSimplexInt extraNeeded)
    27242720{
    2725   CoinSimplexInt *  COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    2726   CoinSimplexInt *  COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    2727   CoinSimplexInt *  COIN_RESTRICT nextColumn = nextColumnAddress_;
    2728   CoinSimplexInt *  COIN_RESTRICT lastColumn = lastColumnAddress_;
    2729   CoinSimplexInt number = numberInColumnPlus[iColumn] +
    2730     numberInColumn[iColumn];
    2731   CoinBigIndex *  COIN_RESTRICT startColumnU = startColumnUAddress_;
     2721  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     2722  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
     2723  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumnAddress_;
     2724  CoinSimplexInt *COIN_RESTRICT lastColumn = lastColumnAddress_;
     2725  CoinSimplexInt number = numberInColumnPlus[iColumn] + numberInColumn[iColumn];
     2726  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
    27322727  CoinBigIndex space = lengthAreaU_ - lastEntryByColumnU_;
    2733   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
    2734   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
    2735 
    2736   if ( space < extraNeeded + number + 4 ) {
     2728  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
     2729  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
     2730
     2731  if (space < extraNeeded + number + 4) {
    27372732    //compression
    27382733    CoinSimplexInt iColumn = nextColumn[maximumRowsExtra_];
    27392734    CoinBigIndex put = 0;
    27402735
    2741     while ( iColumn != maximumRowsExtra_ ) {
     2736    while (iColumn != maximumRowsExtra_) {
    27422737      //move
    27432738      CoinBigIndex get;
    27442739      CoinBigIndex getEnd;
    27452740
    2746       if ( startColumnU[iColumn] >= 0 ) {
    2747         get = startColumnU[iColumn]
    2748           - numberInColumnPlus[iColumn];
    2749         getEnd = startColumnU[iColumn] + numberInColumn[iColumn];
    2750         startColumnU[iColumn] = put + numberInColumnPlus[iColumn];
     2741      if (startColumnU[iColumn] >= 0) {
     2742        get = startColumnU[iColumn]
     2743          - numberInColumnPlus[iColumn];
     2744        getEnd = startColumnU[iColumn] + numberInColumn[iColumn];
     2745        startColumnU[iColumn] = put + numberInColumnPlus[iColumn];
    27512746      } else {
    2752         get = -startColumnU[iColumn];
    2753         getEnd = get + numberInColumn[iColumn];
    2754         startColumnU[iColumn] = -put;
    2755       }
    2756       assert (put<=get);
    2757       for (CoinBigIndex i = get; i < getEnd; i++ ) {
    2758         indexRowU[put] = indexRowU[i];
    2759         elementU[put] = elementU[i];
     2747        get = -startColumnU[iColumn];
     2748        getEnd = get + numberInColumn[iColumn];
     2749        startColumnU[iColumn] = -put;
     2750      }
     2751      assert(put <= get);
     2752      for (CoinBigIndex i = get; i < getEnd; i++) {
     2753        indexRowU[put] = indexRowU[i];
     2754        elementU[put] = elementU[i];
    27602755#if BOTH_WAYS
    27612756#endif
    2762         put++;
     2757        put++;
    27632758      }
    27642759      iColumn = nextColumn[iColumn];
    2765     }                           /* endwhile */
     2760    } /* endwhile */
    27662761    numberCompressions_++;
    27672762    lastEntryByColumnU_ = put;
    27682763    space = lengthAreaU_ - put;
    2769     if ( extraNeeded == COIN_INT_MAX >> 1 ) {
     2764    if (extraNeeded == COIN_INT_MAX >> 1) {
    27702765      return true;
    27712766    }
    2772     if ( space < extraNeeded + number + 2 ) {
     2767    if (space < extraNeeded + number + 2) {
    27732768      //need more space
    27742769      //if we can allocate bigger then do so and copy
     
    27822777  CoinSimplexInt last = lastColumn[iColumn];
    27832778
    2784   if ( extraNeeded || next != maximumRowsExtra_ ) {
     2779  if (extraNeeded || next != maximumRowsExtra_) {
    27852780    //out
    27862781    nextColumn[last] = next;
     
    28002795    CoinFactorizationDouble *element = elementU;
    28012796    CoinSimplexInt i = 0;
    2802    
    2803     if ( ( number & 1 ) != 0 ) {
     2797
     2798    if ((number & 1) != 0) {
    28042799      element[put] = element[get];
    28052800      indexRow[put] = indexRow[get];
     
    28082803      i = 1;
    28092804    }
    2810     for ( ; i < number; i += 2 ) {
     2805    for (; i < number; i += 2) {
    28112806      CoinFactorizationDouble value0 = element[get + i];
    28122807      CoinFactorizationDouble value1 = element[get + i + 1];
    28132808      CoinSimplexInt index0 = indexRow[get + i];
    28142809      CoinSimplexInt index1 = indexRow[get + i + 1];
    2815      
     2810
    28162811      element[put + i] = value0;
    28172812      element[put + i + 1] = value1;
     
    28252820    //add 2 for luck
    28262821    lastEntryByColumnU_ = put + extraNeeded + 2;
    2827     if (lastEntryByColumnU_>lengthAreaU_) {
     2822    if (lastEntryByColumnU_ > lengthAreaU_) {
    28282823      // get more memory
    28292824#ifdef CLP_DEVELOP
    28302825      printf("put %d, needed %d, start %d, length %d\n",
    2831              put,extraNeeded,lastEntryByColumnU_,
    2832              lengthAreaU_);
     2826        put, extraNeeded, lastEntryByColumnU_,
     2827        lengthAreaU_);
    28332828#endif
    28342829      return false;
     
    28382833    lastEntryByColumnU_ = startColumnU[last] + numberInColumn[last];
    28392834  }
    2840   startColumnU[maximumRowsExtra_]=lastEntryByColumnU_;
     2835  startColumnU[maximumRowsExtra_] = lastEntryByColumnU_;
    28412836  return true;
    28422837}
     
    28452840//may have to do compression  (returns true)
    28462841//also moves existing vector
    2847 bool
    2848 CoinAbcTypeFactorization::getRowSpace ( CoinSimplexInt iRow,
    2849                             CoinSimplexInt extraNeeded )
     2842bool CoinAbcTypeFactorization::getRowSpace(CoinSimplexInt iRow,
     2843  CoinSimplexInt extraNeeded)
    28502844{
    2851   CoinSimplexInt *  COIN_RESTRICT numberInRow = numberInRowAddress_;
     2845  CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRowAddress_;
    28522846  CoinSimplexInt number = numberInRow[iRow];
    2853   CoinBigIndex *  COIN_RESTRICT startRowU = startRowUAddress_;
     2847  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
    28542848  CoinBigIndex space = lengthAreaU_ - lastEntryByRowU_;
    2855   CoinSimplexInt *  COIN_RESTRICT nextRow = nextRowAddress_;
    2856   CoinSimplexInt *  COIN_RESTRICT lastRow = lastRowAddress_;
    2857   CoinSimplexInt *  COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    2858 
    2859   if ( space < extraNeeded + number + 2 ) {
     2849  CoinSimplexInt *COIN_RESTRICT nextRow = nextRowAddress_;
     2850  CoinSimplexInt *COIN_RESTRICT lastRow = lastRowAddress_;
     2851  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     2852
     2853  if (space < extraNeeded + number + 2) {
    28602854    //compression
    28612855    CoinSimplexInt iRow = nextRow[numberRows_];
    28622856    CoinBigIndex put = 0;
    28632857
    2864     while ( iRow != numberRows_ ) {
     2858    while (iRow != numberRows_) {
    28652859      //move
    28662860      CoinBigIndex get = startRowU[iRow];
     
    28682862
    28692863      startRowU[iRow] = put;
    2870       if (put>get) {
    2871         //need more space
    2872         //if we can allocate bigger then do so and copy
    2873         //if not then return so code can start again
    2874         status_ = -99;
    2875         return false;;
     2864      if (put > get) {
     2865        //need more space
     2866        //if we can allocate bigger then do so and copy
     2867        //if not then return so code can start again
     2868        status_ = -99;
     2869        return false;
     2870        ;
    28762871      }
    28772872      CoinBigIndex i;
    2878       for ( i = get; i < getEnd; i++ ) {
    2879         indexColumnU[put] = indexColumnU[i];
     2873      for (i = get; i < getEnd; i++) {
     2874        indexColumnU[put] = indexColumnU[i];
    28802875#if BOTH_WAYS
    28812876#endif
    2882         put++;
     2877        put++;
    28832878      }
    28842879      iRow = nextRow[iRow];
    2885     }                           /* endwhile */
     2880    } /* endwhile */
    28862881    numberCompressions_++;
    28872882    lastEntryByRowU_ = put;
    28882883    space = lengthAreaU_ - put;
    2889     if ( space < extraNeeded + number + 2 ) {
     2884    if (space < extraNeeded + number + 2) {
    28902885      //need more space
    28912886      //if we can allocate bigger then do so and copy
    28922887      //if not then return so code can start again
    28932888      status_ = -99;
    2894       return false;;
     2889      return false;
     2890      ;
    28952891    }
    28962892  }
     
    29122908
    29132909  startRowU[iRow] = put;
    2914   while ( number ) {
     2910  while (number) {
    29152911    number--;
    29162912    indexColumnU[put] = indexColumnU[get];
     
    29192915    put++;
    29202916    get++;
    2921   }                             /* endwhile */
     2917  } /* endwhile */
    29222918  //add 4 for luck
    29232919  lastEntryByRowU_ = put + extraNeeded + 4;
     
    29262922
    29272923//  cleanup.  End of factorization
    2928 void
    2929 CoinAbcTypeFactorization::cleanup (  )
     2924void CoinAbcTypeFactorization::cleanup()
    29302925{
    29312926#ifdef ABC_USE_FUNCTION_POINTERS
    29322927#define PRINT_LEVEL 0
    2933   if (PRINT_LEVEL){
     2928  if (PRINT_LEVEL) {
    29342929    printf("----------Start---------\n");
    2935 #if PRINT_LEVEL<2
    2936     double smallestP=COIN_DBL_MAX;
    2937     int iPs=-1;
    2938     double largestP=0.0;
    2939     int iP=-1;
    2940     double largestL=0.0;
    2941     int iL=-1;
    2942     double largestU=0.0;
    2943     int iU=-1;
    2944 #endif
    2945     for (int i=0;i<numberRows_;i++) {
    2946 #if PRINT_LEVEL>1
    2947       printf("%d permute %d pivotColumn %d pivotRegion %g\n",i,permuteAddress_[i],
    2948              pivotColumnAddress_[i],pivotRegionAddress_[i]);
     2930#if PRINT_LEVEL < 2
     2931    double smallestP = COIN_DBL_MAX;
     2932    int iPs = -1;
     2933    double largestP = 0.0;
     2934    int iP = -1;
     2935    double largestL = 0.0;
     2936    int iL = -1;
     2937    double largestU = 0.0;
     2938    int iU = -1;
     2939#endif
     2940    for (int i = 0; i < numberRows_; i++) {
     2941#if PRINT_LEVEL > 1
     2942      printf("%d permute %d pivotColumn %d pivotRegion %g\n", i, permuteAddress_[i],
     2943        pivotColumnAddress_[i], pivotRegionAddress_[i]);
    29492944#else
    2950       if (fabs(pivotRegionAddress_[i])>largestP) {
    2951         iP=i;
    2952         largestP=fabs(pivotRegionAddress_[i]);
    2953       }
    2954       if (fabs(pivotRegionAddress_[i])<smallestP) {
    2955         iPs=i;
    2956         smallestP=fabs(pivotRegionAddress_[i]);
    2957       }
    2958 #endif
    2959     }
    2960     scatterStruct * COIN_RESTRICT scatterPointer = scatterUColumn();
    2961     CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    2962     for (int i=0;i<numberRows_;i++) {
    2963       scatterStruct & COIN_RESTRICT scatter = scatterPointer[i];
     2945      if (fabs(pivotRegionAddress_[i]) > largestP) {
     2946        iP = i;
     2947        largestP = fabs(pivotRegionAddress_[i]);
     2948      }
     2949      if (fabs(pivotRegionAddress_[i]) < smallestP) {
     2950        iPs = i;
     2951        smallestP = fabs(pivotRegionAddress_[i]);
     2952      }
     2953#endif
     2954    }
     2955    scatterStruct *COIN_RESTRICT scatterPointer = scatterUColumn();
     2956    CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     2957    for (int i = 0; i < numberRows_; i++) {
     2958      scatterStruct &COIN_RESTRICT scatter = scatterPointer[i];
    29642959      CoinSimplexInt number = scatter.number;
    2965 #if PRINT_LEVEL>1
    2966       printf("pivot %d offset %d number %d\n",i,scatter.offset,number);
    2967 #endif
    2968       const CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter.offset;
    2969       const CoinBigIndex * COIN_RESTRICT indices = reinterpret_cast<const CoinBigIndex *>(area+number);
    2970 #if PRINT_LEVEL>1
    2971       for (int j1 = 0; j1 < number; j1+=5 ) {
    2972         for (int j = j1; j < CoinMin(number,j1+5); j++ )
    2973           printf("(%d,%g) ",indices[j],area[j]);
    2974         printf("\n");
     2960#if PRINT_LEVEL > 1
     2961      printf("pivot %d offset %d number %d\n", i, scatter.offset, number);
     2962#endif
     2963      const CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter.offset;
     2964      const CoinBigIndex *COIN_RESTRICT indices = reinterpret_cast< const CoinBigIndex * >(area + number);
     2965#if PRINT_LEVEL > 1
     2966      for (int j1 = 0; j1 < number; j1 += 5) {
     2967        for (int j = j1; j < CoinMin(number, j1 + 5); j++)
     2968          printf("(%d,%g) ", indices[j], area[j]);
     2969        printf("\n");
    29752970      }
    29762971#else
    2977       for (int j = 0; j < number; j++ )
    2978         if (fabs(area[j])>largestU) {
    2979           iU=i;
    2980           largestU=fabs(area[j]);
    2981         }
     2972      for (int j = 0; j < number; j++)
     2973        if (fabs(area[j]) > largestU) {
     2974          iU = i;
     2975          largestU = fabs(area[j]);
     2976        }
    29822977#endif
    29832978    }
    29842979    printf("----------LLL---------\n");
    2985     CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnLAddress_;
    2986     CoinSimplexInt *  COIN_RESTRICT indexRowL = indexRowLAddress_;
    2987     CoinFactorizationDouble *  COIN_RESTRICT elementL = elementLAddress_;
    2988     for (int i=0;i<numberRows_;i++) {
    2989       int number=startColumnL[i+1]-startColumnL[i];
     2980    CoinBigIndex *COIN_RESTRICT startColumnL = startColumnLAddress_;
     2981    CoinSimplexInt *COIN_RESTRICT indexRowL = indexRowLAddress_;
     2982    CoinFactorizationDouble *COIN_RESTRICT elementL = elementLAddress_;
     2983    for (int i = 0; i < numberRows_; i++) {
     2984      int number = startColumnL[i + 1] - startColumnL[i];
    29902985      if (number) {
    2991 #if PRINT_LEVEL>1
    2992         int * indices = indexRowL+startColumnL[i];
    2993         printf("%d has %d elements\n",i,number);
    2994         for (int j1 = 0; j1 < number; j1+=5 ) {
    2995           for (int j = j1; j < CoinMin(number,j1+5); j++ )
    2996             printf("(%d,%g) ",indices[j],elementL[j+startColumnL[i]]);
    2997           printf("\n");
    2998         }
     2986#if PRINT_LEVEL > 1
     2987        int *indices = indexRowL + startColumnL[i];
     2988        printf("%d has %d elements\n", i, number);
     2989        for (int j1 = 0; j1 < number; j1 += 5) {
     2990          for (int j = j1; j < CoinMin(number, j1 + 5); j++)
     2991            printf("(%d,%g) ", indices[j], elementL[j + startColumnL[i]]);
     2992          printf("\n");
     2993        }
    29992994#else
    3000         for (int j = 0; j < number; j++ ) {
    3001           if (fabs(elementL[j+startColumnL[i]])>largestL) {
    3002             iL=i;
    3003             largestL=fabs(elementL[j+startColumnL[i]]);
    3004           }
    3005         }
    3006 #endif
    3007       }
    3008     }
    3009 #if PRINT_LEVEL<2
    3010     printf("smallest pivot %g at %d, largest %g at %d - largestL %g at %d largestU %g at %d\n",smallestP,iPs,largestP,iP,largestL,iL,largestU,iU);
     2995        for (int j = 0; j < number; j++) {
     2996          if (fabs(elementL[j + startColumnL[i]]) > largestL) {
     2997            iL = i;
     2998            largestL = fabs(elementL[j + startColumnL[i]]);
     2999          }
     3000        }
     3001#endif
     3002      }
     3003    }
     3004#if PRINT_LEVEL < 2
     3005    printf("smallest pivot %g at %d, largest %g at %d - largestL %g at %d largestU %g at %d\n", smallestP, iPs, largestP, iP, largestL, iL, largestU, iU);
    30113006#endif
    30123007    printf("----------End---------\n");
     
    30173012    //int sizeL=0;
    30183013    //int sizeU=0;
    3019     CoinSimplexInt *  COIN_RESTRICT permuteA = permuteAddress_+maximumRowsExtra_+1;
    3020     CoinSimplexInt *  COIN_RESTRICT permuteB = permuteA + numberRows_;
     3014    CoinSimplexInt *COIN_RESTRICT permuteA = permuteAddress_ + maximumRowsExtra_ + 1;
     3015    CoinSimplexInt *COIN_RESTRICT permuteB = permuteA + numberRows_;
    30213016    // one may be correct
    3022     for (int i=0;i<numberRows_;i++) {
    3023       int iPermute=permuteAddress_[i];
    3024       permuteA[i]=iPermute;
    3025       permuteB[iPermute]=i;
    3026       permuteAddress_[i]=i;
    3027     }
    3028     scatterStruct * COIN_RESTRICT scatterPointer = scatterUColumn();
    3029     CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    3030     for (int i=0;i<numberRows_;i++) {
    3031       scatterStruct & COIN_RESTRICT scatter = scatterPointer[i];
     3017    for (int i = 0; i < numberRows_; i++) {
     3018      int iPermute = permuteAddress_[i];
     3019      permuteA[i] = iPermute;
     3020      permuteB[iPermute] = i;
     3021      permuteAddress_[i] = i;
     3022    }
     3023    scatterStruct *COIN_RESTRICT scatterPointer = scatterUColumn();
     3024    CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     3025    for (int i = 0; i < numberRows_; i++) {
     3026      scatterStruct &COIN_RESTRICT scatter = scatterPointer[i];
    30323027      CoinSimplexInt number = scatter.number;
    30333028      //sizeU+=number;
    3034       CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter.offset;
    3035       CoinBigIndex * COIN_RESTRICT indices = reinterpret_cast<CoinBigIndex *>(area+number);
    3036       for (int j = 0; j < number; j++ ) {
    3037         int iRow=indices[j];
    3038         indices[j]=permuteA[iRow];
    3039       }
    3040     }
    3041     CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnLAddress_;
    3042     CoinSimplexInt *  COIN_RESTRICT indexRowL = indexRowLAddress_;
    3043     CoinFactorizationDouble *  COIN_RESTRICT elementL = elementLAddress_;
    3044     for (int i=0;i<numberRows_;i++) {
    3045       int number=startColumnL[i+1]-startColumnL[i];
     3029      CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter.offset;
     3030      CoinBigIndex *COIN_RESTRICT indices = reinterpret_cast< CoinBigIndex * >(area + number);
     3031      for (int j = 0; j < number; j++) {
     3032        int iRow = indices[j];
     3033        indices[j] = permuteA[iRow];
     3034      }
     3035    }
     3036    CoinBigIndex *COIN_RESTRICT startColumnL = startColumnLAddress_;
     3037    CoinSimplexInt *COIN_RESTRICT indexRowL = indexRowLAddress_;
     3038    CoinFactorizationDouble *COIN_RESTRICT elementL = elementLAddress_;
     3039    for (int i = 0; i < numberRows_; i++) {
     3040      int number = startColumnL[i + 1] - startColumnL[i];
    30463041      if (number) {
    3047         //sizeL+=number;
    3048         int * indices = indexRowL+startColumnL[i];
    3049         for (int j = 0; j < number; j++ ) {
    3050           int iRow=indices[j];
    3051           indices[j]=permuteA[iRow];
    3052         }
     3042        //sizeL+=number;
     3043        int *indices = indexRowL + startColumnL[i];
     3044        for (int j = 0; j < number; j++) {
     3045          int iRow = indices[j];
     3046          indices[j] = permuteA[iRow];
     3047        }
    30533048      }
    30543049    }
     
    30583053#ifdef ABC_USE_FUNCTION_POINTERS
    30593054  {
    3060     int sizeL=0;
    3061     int sizeU=0;
    3062     scatterStruct * COIN_RESTRICT scatterPointer = scatterUColumn();
    3063     for (int i=0;i<numberRows_;i++) {
    3064       scatterStruct & COIN_RESTRICT scatter = scatterPointer[i];
     3055    int sizeL = 0;
     3056    int sizeU = 0;
     3057    scatterStruct *COIN_RESTRICT scatterPointer = scatterUColumn();
     3058    for (int i = 0; i < numberRows_; i++) {
     3059      scatterStruct &COIN_RESTRICT scatter = scatterPointer[i];
    30653060      CoinSimplexInt number = scatter.number;
    3066       sizeU+=number;
    3067     }
    3068     CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnLAddress_;
    3069     for (int i=0;i<numberRows_;i++) {
    3070       int number=startColumnL[i+1]-startColumnL[i];
    3071       if (number) 
    3072         sizeL+=number;
    3073     }
    3074     printf("Unordered says %d L %d U\n",sizeL,sizeU);
     3061      sizeU += number;
     3062    }
     3063    CoinBigIndex *COIN_RESTRICT startColumnL = startColumnLAddress_;
     3064    for (int i = 0; i < numberRows_; i++) {
     3065      int number = startColumnL[i + 1] - startColumnL[i];
     3066      if (number)
     3067        sizeL += number;
     3068    }
     3069    printf("Unordered says %d L %d U\n", sizeL, sizeU);
    30753070  }
    30763071#endif
    30773072#endif
    30783073  //free some memory here
    3079   markRow_.conditionalDelete() ;
     3074  markRow_.conditionalDelete();
    30803075  nextRowAddress_ = nextRow_.array();
    30813076  //safety feature
    3082   CoinSimplexInt *  COIN_RESTRICT permute = permuteAddress_;
     3077  CoinSimplexInt *COIN_RESTRICT permute = permuteAddress_;
    30833078  permute[numberRows_] = 0;
    30843079#ifndef NDEBUG
    30853080  {
    3086     if (numberGoodU_<numberRows_)
     3081    if (numberGoodU_ < numberRows_)
    30873082      abort();
    3088     char * mark = new char[numberRows_];
    3089     memset(mark,0,numberRows_);
    3090     for (int i = 0; i < numberRows_; i++ ) {
    3091       assert (permute[i]>=0&&permute[i]<numberRows_);
     3083    char *mark = new char[numberRows_];
     3084    memset(mark, 0, numberRows_);
     3085    for (int i = 0; i < numberRows_; i++) {
     3086      assert(permute[i] >= 0 && permute[i] < numberRows_);
    30923087      CoinSimplexInt k = permute[i];
    3093       if(k<0||k>=numberRows_)
    3094         printf("Bad a %d %d\n",i,k);
    3095       assert(k>=0&&k<numberRows_);
    3096       if(mark[k]==1)
    3097         printf("Bad a %d %d\n",i,k);
    3098       mark[k]=1;
    3099     }
    3100     for (int i = 0; i < numberRows_; i++ ) {
    3101       assert(mark[i]==1);
    3102       if(mark[i]!=1)
    3103         printf("Bad b %d\n",i);
    3104     }
    3105     delete [] mark;
    3106   }
    3107 #endif
    3108   CoinSimplexInt *  COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    3109   const CoinSimplexInt *  COIN_RESTRICT pivotColumn = pivotColumnAddress_;
    3110   CoinSimplexInt *  COIN_RESTRICT pivotLOrder = firstCountAddress_;//tttt;//this->pivotLOrder();
    3111   CoinBigIndex *  COIN_RESTRICT startColumnU = startColumnUAddress_;
    3112   bool cleanCopy=false;
    3113 #if ABC_SMALL<2
    3114   assert (numberGoodU_==numberRows_);
    3115   if (numberGoodU_==numberRows_) {
     3088      if (k < 0 || k >= numberRows_)
     3089        printf("Bad a %d %d\n", i, k);
     3090      assert(k >= 0 && k < numberRows_);
     3091      if (mark[k] == 1)
     3092        printf("Bad a %d %d\n", i, k);
     3093      mark[k] = 1;
     3094    }
     3095    for (int i = 0; i < numberRows_; i++) {
     3096      assert(mark[i] == 1);
     3097      if (mark[i] != 1)
     3098        printf("Bad b %d\n", i);
     3099    }
     3100    delete[] mark;
     3101  }
     3102#endif
     3103  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
     3104  const CoinSimplexInt *COIN_RESTRICT pivotColumn = pivotColumnAddress_;
     3105  CoinSimplexInt *COIN_RESTRICT pivotLOrder = firstCountAddress_; //tttt;//this->pivotLOrder();
     3106  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     3107  bool cleanCopy = false;
     3108#if ABC_SMALL < 2
     3109  assert(numberGoodU_ == numberRows_);
     3110  if (numberGoodU_ == numberRows_) {
    31163111#ifndef ABC_USE_FUNCTION_POINTERS
    3117     const CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumnPlusAddress_;
    3118     CoinFactorizationDouble * elementU = elementUAddress_;
    3119     CoinFactorizationDouble * elementU2 = elementRowUAddress_;
    3120     CoinSimplexInt * COIN_RESTRICT indexRowU = indexRowUAddress_; 
    3121     CoinSimplexInt * COIN_RESTRICT indexRowU2 = indexColumnUAddress_; 
     3112    const CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnPlusAddress_;
     3113    CoinFactorizationDouble *elementU = elementUAddress_;
     3114    CoinFactorizationDouble *elementU2 = elementRowUAddress_;
     3115    CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
     3116    CoinSimplexInt *COIN_RESTRICT indexRowU2 = indexColumnUAddress_;
    31223117    // so that just slacks will have start of 0
    3123     CoinBigIndex size=1;
    3124     for (int i=0;i<numberSlacks_;i++) {
    3125       CoinSimplexInt iNext=pivotColumn[i];
    3126       startColumnU[iNext]=0;
    3127       assert (!numberInColumn[iNext]);
    3128     }
    3129     for (int i=numberSlacks_;i<numberRows_;i++) {
    3130       CoinSimplexInt iNext=pivotColumn[i];
     3118    CoinBigIndex size = 1;
     3119    for (int i = 0; i < numberSlacks_; i++) {
     3120      CoinSimplexInt iNext = pivotColumn[i];
     3121      startColumnU[iNext] = 0;
     3122      assert(!numberInColumn[iNext]);
     3123    }
     3124    for (int i = numberSlacks_; i < numberRows_; i++) {
     3125      CoinSimplexInt iNext = pivotColumn[i];
    31313126      CoinSimplexInt number = numberInColumn[iNext];
    3132       CoinBigIndex start = startColumnU[iNext]-number;
    3133       startColumnU[iNext]=size;
    3134       CoinAbcMemcpy(elementU2+size,elementU+start,number);
    3135       CoinAbcMemcpy(indexRowU2+size,indexRowU+start,number);
    3136       size+=number;
     3127      CoinBigIndex start = startColumnU[iNext] - number;
     3128      startColumnU[iNext] = size;
     3129      CoinAbcMemcpy(elementU2 + size, elementU + start, number);
     3130      CoinAbcMemcpy(indexRowU2 + size, indexRowU + start, number);
     3131      size += number;
    31373132    }
    31383133    // swap arrays
     
    31443139    indexColumnUAddress_ = indexColumnU_.array();
    31453140    // Redo total elements
    3146     totalElements_=size;
     3141    totalElements_ = size;
    31473142#else
    31483143    // swap arrays
     
    31503145    elementUAddress_ = elementU_.array();
    31513146    elementRowUAddress_ = elementRowU_.array();
    3152     totalElements_=lastEntryByColumnUPlus_;
    3153 #endif
    3154     cleanCopy=true;
     3147    totalElements_ = lastEntryByColumnUPlus_;
     3148#endif
     3149    cleanCopy = true;
    31553150  }
    31563151#endif
    31573152#ifndef ABC_USE_FUNCTION_POINTERS
    31583153  if (!cleanCopy) {
    3159     getColumnSpace ( 0, COIN_INT_MAX >> 1 );    //compress
     3154    getColumnSpace(0, COIN_INT_MAX >> 1); //compress
    31603155    // Redo total elements
    3161     totalElements_=0;
    3162     for (int i = 0; i < numberRows_; i++ ) {
     3156    totalElements_ = 0;
     3157    for (int i = 0; i < numberRows_; i++) {
    31633158      CoinSimplexInt number = numberInColumnPlus[i];
    31643159      totalElements_ += number;
     
    31713166  numberInColumnAddress_ = numberInColumn_.array();
    31723167  numberInColumnPlusAddress_ = numberInColumnPlus_.array();
    3173   CoinSimplexInt *  COIN_RESTRICT numberInRow = numberInRowAddress_;
    3174   CoinSimplexInt *  COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    3175 #if ABC_SMALL<2
     3168  CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRowAddress_;
     3169  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     3170#if ABC_SMALL < 2
    31763171  numberInColumnPlus = numberInColumnPlusAddress_;
    31773172#endif
     
    31823177  lastEntryByRowU_ = totalElements_;
    31833178
    3184   CoinSimplexInt *  COIN_RESTRICT back = firstCountAddress_+numberRows_;
    3185   CoinBigIndex * COIN_RESTRICT startRow = startRowUAddress_;
     3179  CoinSimplexInt *COIN_RESTRICT back = firstCountAddress_ + numberRows_;
     3180  CoinBigIndex *COIN_RESTRICT startRow = startRowUAddress_;
    31863181#ifndef ABC_USE_FUNCTION_POINTERS
    3187   maximumU_=startColumnU[numberRows_-1]+numberInColumn[numberRows_-1];
     3182  maximumU_ = startColumnU[numberRows_ - 1] + numberInColumn[numberRows_ - 1];
    31883183#else
    3189   maximumU_=lastEntryByColumnUPlus_;
     3184  maximumU_ = lastEntryByColumnUPlus_;
    31903185#endif
    31913186#ifndef ABC_ORDERED_FACTORIZATION
    3192   CoinFactorizationDouble *  COIN_RESTRICT workArea = workAreaAddress_;
    3193   CoinFactorizationDouble *  COIN_RESTRICT pivotRegion = pivotRegionAddress_;
     3187  CoinFactorizationDouble *COIN_RESTRICT workArea = workAreaAddress_;
     3188  CoinFactorizationDouble *COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    31943189#else
    3195   CoinSimplexInt *  COIN_RESTRICT permuteA = permuteAddress_+maximumRowsExtra_+1;
     3190  CoinSimplexInt *COIN_RESTRICT permuteA = permuteAddress_ + maximumRowsExtra_ + 1;
    31963191  // use work area for scatter
    3197   scatterStruct * COIN_RESTRICT scatterPointer = scatterUColumn();
    3198   scatterStruct * COIN_RESTRICT scatterPointerTemp = reinterpret_cast<scatterStruct *>(workAreaAddress_);
    3199 #endif
    3200   for (CoinSimplexInt i=0;i<numberRows_;i++) {
     3192  scatterStruct *COIN_RESTRICT scatterPointer = scatterUColumn();
     3193  scatterStruct *COIN_RESTRICT scatterPointerTemp = reinterpret_cast< scatterStruct * >(workAreaAddress_);
     3194#endif
     3195  for (CoinSimplexInt i = 0; i < numberRows_; i++) {
    32013196#ifndef ABC_ORDERED_FACTORIZATION
    3202     CoinSimplexInt pivotOrder=permute[i];
    3203     CoinSimplexInt columnOrder=pivotColumn[pivotOrder];
    3204     workArea[i]=pivotRegion[pivotOrder];
     3197    CoinSimplexInt pivotOrder = permute[i];
     3198    CoinSimplexInt columnOrder = pivotColumn[pivotOrder];
     3199    workArea[i] = pivotRegion[pivotOrder];
    32053200    back[columnOrder] = i;
    32063201#else
    3207     CoinSimplexInt pivotOrder=i;
    3208     CoinSimplexInt columnOrder=pivotColumn[pivotOrder];
    3209     int pivotOrder2=permuteA[i];
    3210     scatterPointerTemp[pivotOrder2]=scatterPointer[i];
     3202    CoinSimplexInt pivotOrder = i;
     3203    CoinSimplexInt columnOrder = pivotColumn[pivotOrder];
     3204    int pivotOrder2 = permuteA[i];
     3205    scatterPointerTemp[pivotOrder2] = scatterPointer[i];
    32113206    back[columnOrder] = i;
    32123207#endif
    32133208#ifndef ABC_USE_FUNCTION_POINTERS
    3214     startRow[i]=startColumnU[columnOrder];
    3215     numberInRow[i]=numberInColumn[columnOrder];
    3216 #endif
    3217     pivotLOrder[pivotOrder]=i;
     3209    startRow[i] = startColumnU[columnOrder];
     3210    numberInRow[i] = numberInColumn[columnOrder];
     3211#endif
     3212    pivotLOrder[pivotOrder] = i;
    32183213  }
    32193214#ifndef ABC_ORDERED_FACTORIZATION
    3220   CoinAbcMemcpy(pivotRegion,workArea,numberRows_); // could swap
     3215  CoinAbcMemcpy(pivotRegion, workArea, numberRows_); // could swap
    32213216#else
    3222   CoinAbcMemcpy(scatterPointer,scatterPointerTemp,numberRows_);
     3217  CoinAbcMemcpy(scatterPointer, scatterPointerTemp, numberRows_);
    32233218#endif
    32243219#ifndef EARLY_FACTORIZE
    3225   workArea_.conditionalDelete() ;
    3226   workAreaAddress_=NULL;
     3220  workArea_.conditionalDelete();
     3221  workAreaAddress_ = NULL;
    32273222#endif
    32283223#ifndef ABC_USE_FUNCTION_POINTERS
    32293224  //memcpy(this->pivotLOrder(),pivotLOrder,numberRows_*sizeof(int));
    32303225  // swap later
    3231   CoinAbcMemcpy(startColumnU,startRow,numberRows_);
    3232   CoinAbcMemcpy(numberInColumn,numberInRow,numberRows_);
    3233 #endif
    3234 #if ABC_DENSE_CODE==2
     3226  CoinAbcMemcpy(startColumnU, startRow, numberRows_);
     3227  CoinAbcMemcpy(numberInColumn, numberInRow, numberRows_);
     3228#endif
     3229#if ABC_DENSE_CODE == 2
    32353230  if (numberDense_) {
    3236     assert (numberDense_<30000);
    3237     CoinFactorizationDouble *  COIN_RESTRICT denseArea = denseAreaAddress_;
    3238     CoinFactorizationDouble * COIN_RESTRICT denseRegion =
    3239       denseArea+leadingDimension_*numberDense_;
    3240     CoinSimplexInt *  COIN_RESTRICT densePermute=
    3241       reinterpret_cast<CoinSimplexInt *>(denseRegion+FACTOR_CPU*numberDense_);
    3242     short * COIN_RESTRICT forFtran = reinterpret_cast<short *>(densePermute+numberDense_);
    3243     short * COIN_RESTRICT forBtran = forFtran+numberDense_;
    3244     short * COIN_RESTRICT forFtran2 = forBtran+numberDense_;
     3231    assert(numberDense_ < 30000);
     3232    CoinFactorizationDouble *COIN_RESTRICT denseArea = denseAreaAddress_;
     3233    CoinFactorizationDouble *COIN_RESTRICT denseRegion = denseArea + leadingDimension_ * numberDense_;
     3234    CoinSimplexInt *COIN_RESTRICT densePermute = reinterpret_cast< CoinSimplexInt * >(denseRegion + FACTOR_CPU * numberDense_);
     3235    short *COIN_RESTRICT forFtran = reinterpret_cast< short * >(densePermute + numberDense_);
     3236    short *COIN_RESTRICT forBtran = forFtran + numberDense_;
     3237    short *COIN_RESTRICT forFtran2 = forBtran + numberDense_;
    32453238    // maybe could do inside dgetrf
    32463239    //CoinAbcMemcpy(forBtran,pivotLOrder+numberRows_-numberDense_,numberDense_);
    32473240    //CoinAbcMemcpy(forFtran,pivotLOrder+numberRows_-numberDense_,numberDense_);
    3248     for (int i=0;i<numberDense_;i++) {
    3249       forBtran[i]=static_cast<short>(i);
    3250       forFtran[i]=static_cast<short>(i);
    3251     }
    3252     for (int i=0;i<numberDense_;i++) {
    3253       int ip=densePermute[i];
    3254       short temp=forBtran[i];
    3255       forBtran[i]=forBtran[ip];
    3256       forBtran[ip]=temp;
    3257     }
    3258     for (int i=numberDense_-1;i>=0;i--) {
    3259       int ip=densePermute[i];
    3260       short temp=forFtran[i];
    3261       forFtran[i]=forFtran[ip];
    3262       forFtran[ip]=temp;
    3263     }
    3264 #if ABC_SMALL<3
    3265     const CoinSimplexInt * COIN_RESTRICT pivotLBackwardOrder = permuteAddress_;
    3266     int lastSparse=numberRows_-numberDense_;
     3241    for (int i = 0; i < numberDense_; i++) {
     3242      forBtran[i] = static_cast< short >(i);
     3243      forFtran[i] = static_cast< short >(i);
     3244    }
     3245    for (int i = 0; i < numberDense_; i++) {
     3246      int ip = densePermute[i];
     3247      short temp = forBtran[i];
     3248      forBtran[i] = forBtran[ip];
     3249      forBtran[ip] = temp;
     3250    }
     3251    for (int i = numberDense_ - 1; i >= 0; i--) {
     3252      int ip = densePermute[i];
     3253      short temp = forFtran[i];
     3254      forFtran[i] = forFtran[ip];
     3255      forFtran[ip] = temp;
     3256    }
     3257#if ABC_SMALL < 3
     3258    const CoinSimplexInt *COIN_RESTRICT pivotLBackwardOrder = permuteAddress_;
     3259    int lastSparse = numberRows_ - numberDense_;
    32673260    forFtran -= lastSparse; // adjust
    3268     CoinFillN(forFtran2,numberRows_,static_cast<short>(-1));
    3269     for (int i=0;i<numberRows_;i++) {
    3270       int jRow=pivotLBackwardOrder[i];
    3271       if (jRow>=lastSparse) {
    3272         short kRow = static_cast<short>(forFtran[jRow]);
    3273         forFtran2[i]=kRow;
    3274       }
    3275     }
    3276 #endif 
    3277   }
    3278 #endif
    3279   CoinAbcMemset0(numberInRow,numberRows_+1);
    3280   if ( (messageLevel_ & 8)) {
    3281     std::cout<<"        length of U "<<totalElements_<<", length of L "<<lengthL_;
    3282 #if ABC_SMALL<4
     3261    CoinFillN(forFtran2, numberRows_, static_cast< short >(-1));
     3262    for (int i = 0; i < numberRows_; i++) {
     3263      int jRow = pivotLBackwardOrder[i];
     3264      if (jRow >= lastSparse) {
     3265        short kRow = static_cast< short >(forFtran[jRow]);
     3266        forFtran2[i] = kRow;
     3267      }
     3268    }
     3269#endif
     3270  }
     3271#endif
     3272  CoinAbcMemset0(numberInRow, numberRows_ + 1);
     3273  if ((messageLevel_ & 8)) {
     3274    std::cout << "        length of U " << totalElements_ << ", length of L " << lengthL_;
     3275#if ABC_SMALL < 4
    32833276    if (numberDense_)
    3284       std::cout<<" plus "<<numberDense_*numberDense_<<" from "<<numberDense_<<" dense rows";
    3285 #endif
    3286     std::cout<<std::endl;
    3287   }
    3288 #if ABC_SMALL<4
     3277      std::cout << " plus " << numberDense_ * numberDense_ << " from " << numberDense_ << " dense rows";
     3278#endif
     3279    std::cout << std::endl;
     3280  }
     3281#if ABC_SMALL < 4
    32893282  // and add L and dense
    3290   totalElements_ += numberDense_*numberDense_+lengthL_;
    3291 #endif
    3292 #if ABC_SMALL<2
    3293   CoinSimplexInt *  COIN_RESTRICT nextColumn = nextColumnAddress_;
    3294   CoinSimplexInt *  COIN_RESTRICT lastColumn = lastColumnAddress_;
     3283  totalElements_ += numberDense_ * numberDense_ + lengthL_;
     3284#endif
     3285#if ABC_SMALL < 2
     3286  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumnAddress_;
     3287  CoinSimplexInt *COIN_RESTRICT lastColumn = lastColumnAddress_;
    32953288  //goSparse2();
    32963289  // See whether to have extra copy of R
    3297 #if ABC_SMALL>=0
    3298   if (maximumU_>10*numberRows_||numberRows_<200) {
     3290#if ABC_SMALL >= 0
     3291  if (maximumU_ > 10 * numberRows_ || numberRows_ < 200) {
    32993292    // NO
    3300     numberInColumnPlus_.conditionalDelete() ;
    3301     numberInColumnPlusAddress_=NULL;
     3293    numberInColumnPlus_.conditionalDelete();
     3294    numberInColumnPlusAddress_ = NULL;
    33023295    setNoGotRCopy();
    33033296  } else {
    33043297#endif
    33053298    setYesGotRCopy();
    3306     for (int i = 0; i < numberRows_; i++ ) {
     3299    for (int i = 0; i < numberRows_; i++) {
    33073300      lastColumn[i] = i - 1;
    33083301      nextColumn[i] = i + 1;
    3309       numberInColumnPlus[i]=0;
    3310 #if ABC_SMALL>=0
     3302      numberInColumnPlus[i] = 0;
     3303#if ABC_SMALL >= 0
    33113304    }
    33123305#endif
     
    33223315  CoinSimplexInt firstReal = numberSlacks_;
    33233316
    3324   CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnLAddress_;
     3317  CoinBigIndex *COIN_RESTRICT startColumnL = startColumnLAddress_;
    33253318  // We should know how many in L
    33263319  //CoinSimplexInt *  COIN_RESTRICT indexRowL = indexRowLAddress_;
    3327   for (firstReal = numberSlacks_; firstReal<numberRows_; firstReal++ ) {
    3328     if (startColumnL[firstReal+1])
     3320  for (firstReal = numberSlacks_; firstReal < numberRows_; firstReal++) {
     3321    if (startColumnL[firstReal + 1])
    33293322      break;
    33303323  }
     
    33373330  CoinBigIndex spaceUsed = lengthL_ + lengthU_;
    33383331
    3339   CoinSimplexInt needed = ( spaceUsed + numberRows_ - 1 ) / numberRows_;
     3332  CoinSimplexInt needed = (spaceUsed + numberRows_ - 1) / numberRows_;
    33403333
    33413334  needed = needed * 2 * maximumPivots_;
    3342   if ( needed < 2 * numberRows_ ) {
     3335  if (needed < 2 * numberRows_) {
    33433336    needed = 2 * numberRows_;
    33443337  }
     
    33463339    //if (numberInColumnPlusAddress_) {
    33473340    // Need double the space for R
    3348     space = space/2;
     3341    space = space / 2;
    33493342  }
    33503343  elementRAddress_ = elementLAddress_ + lengthL_;
    33513344  indexRowRAddress_ = indexRowLAddress_ + lengthL_;
    3352   if ( space >= needed ) {
     3345  if (space >= needed) {
    33533346    lengthR_ = 0;
    33543347    lengthAreaR_ = space;
     
    33563349    lengthR_ = 0;
    33573350    lengthAreaR_ = space;
    3358     if ((messageLevel_&4))
    3359       std::cout<<"Factorization may need some increasing area space"
    3360                <<std::endl;
    3361     if ( areaFactor_ ) {
     3351    if ((messageLevel_ & 4))
     3352      std::cout << "Factorization may need some increasing area space"
     3353                << std::endl;
     3354    if (areaFactor_) {
    33623355      areaFactor_ *= 1.1;
    33633356    } else {
     
    33683361}
    33693362// Returns areaFactor but adjusted for dense
    3370 double 
     3363double
    33713364CoinAbcTypeFactorization::adjustedAreaFactor() const
    33723365{
    33733366  double factor = areaFactor_;
    3374 #if ABC_SMALL<4
    3375   if (numberDense_&&areaFactor_>1.0) {
     3367#if ABC_SMALL < 4
     3368  if (numberDense_ && areaFactor_ > 1.0) {
    33763369    double dense = numberDense_;
    33773370    dense *= dense;
    3378     double withoutDense = totalElements_ - dense +1.0;
    3379     factor *= 1.0 +dense/withoutDense;
     3371    double withoutDense = totalElements_ - dense + 1.0;
     3372    factor *= 1.0 + dense / withoutDense;
    33803373  }
    33813374#endif
     
    33843377
    33853378//  checkConsistency.  Checks that row and column copies look OK
    3386 void
    3387 CoinAbcTypeFactorization::checkConsistency (  )
     3379void CoinAbcTypeFactorization::checkConsistency()
    33883380{
    33893381  bool bad = false;
    33903382
    33913383  CoinSimplexInt iRow;
    3392   CoinBigIndex * startRowU = startRowUAddress_;
    3393   CoinSimplexInt * numberInRow = numberInRowAddress_;
    3394   CoinSimplexInt * numberInColumn = numberInColumnAddress_;
    3395   CoinSimplexInt * indexColumnU = indexColumnUAddress_;
    3396   CoinSimplexInt * indexRowU = indexRowUAddress_;
    3397   CoinBigIndex * startColumnU = startColumnUAddress_;
    3398   for ( iRow = 0; iRow < numberRows_; iRow++ ) {
    3399     if ( numberInRow[iRow] ) {
     3384  CoinBigIndex *startRowU = startRowUAddress_;
     3385  CoinSimplexInt *numberInRow = numberInRowAddress_;
     3386  CoinSimplexInt *numberInColumn = numberInColumnAddress_;
     3387  CoinSimplexInt *indexColumnU = indexColumnUAddress_;
     3388  CoinSimplexInt *indexRowU = indexRowUAddress_;
     3389  CoinBigIndex *startColumnU = startColumnUAddress_;
     3390  for (iRow = 0; iRow < numberRows_; iRow++) {
     3391    if (numberInRow[iRow]) {
    34003392      CoinBigIndex startRow = startRowU[iRow];
    34013393      CoinBigIndex endRow = startRow + numberInRow[iRow];
    34023394
    34033395      CoinBigIndex j;
    3404       for ( j = startRow; j < endRow; j++ ) {
    3405         CoinSimplexInt iColumn = indexColumnU[j];
    3406         CoinBigIndex startColumn = startColumnU[iColumn];
    3407         CoinBigIndex endColumn = startColumn + numberInColumn[iColumn];
    3408         bool found = false;
    3409 
    3410         CoinBigIndex k;
    3411         for ( k = startColumn; k < endColumn; k++ ) {
    3412           if ( indexRowU[k] == iRow ) {
    3413             found = true;
    3414             break;
    3415           }
    3416         }
    3417         if ( !found ) {
    3418           bad = true;
    3419           std::cout << "row " << iRow << " column " << iColumn << " Rows" << std::endl;
    3420         }
     3396      for (j = startRow; j < endRow; j++) {
     3397        CoinSimplexInt iColumn = indexColumnU[j];
     3398        CoinBigIndex startColumn = startColumnU[iColumn];
     3399        CoinBigIndex endColumn = startColumn + numberInColumn[iColumn];
     3400        bool found = false;
     3401
     3402        CoinBigIndex k;
     3403        for (k = startColumn; k < endColumn; k++) {
     3404          if (indexRowU[k] == iRow) {
     3405            found = true;
     3406            break;
     3407          }
     3408        }
     3409        if (!found) {
     3410          bad = true;
     3411          std::cout << "row " << iRow << " column " << iColumn << " Rows" << std::endl;
     3412        }
    34213413      }
    34223414    }
    34233415  }
    34243416  CoinSimplexInt iColumn;
    3425   for ( iColumn = 0; iColumn < numberRows_; iColumn++ ) {
    3426     if ( numberInColumn[iColumn] ) {
     3417  for (iColumn = 0; iColumn < numberRows_; iColumn++) {
     3418    if (numberInColumn[iColumn]) {
    34273419      CoinBigIndex startColumn = startColumnU[iColumn];
    34283420      CoinBigIndex endColumn = startColumn + numberInColumn[iColumn];
    34293421
    34303422      CoinBigIndex j;
    3431       for ( j = startColumn; j < endColumn; j++ ) {
    3432         CoinSimplexInt iRow = indexRowU[j];
    3433         CoinBigIndex startRow = startRowU[iRow];
    3434         CoinBigIndex endRow = startRow + numberInRow[iRow];
    3435         bool found = false;
    3436 
    3437         CoinBigIndex k;
    3438         for (  k = startRow; k < endRow; k++ ) {
    3439           if ( indexColumnU[k] == iColumn ) {
    3440             found = true;
    3441             break;
    3442           }
    3443         }
    3444         if ( !found ) {
    3445           bad = true;
    3446           std::cout << "row " << iRow << " column " << iColumn << " Columns" <<
    3447             std::endl;
    3448         }
    3449       }
    3450     }
    3451   }
    3452   if ( bad ) {
    3453     abort (  );
     3423      for (j = startColumn; j < endColumn; j++) {
     3424        CoinSimplexInt iRow = indexRowU[j];
     3425        CoinBigIndex startRow = startRowU[iRow];
     3426        CoinBigIndex endRow = startRow + numberInRow[iRow];
     3427        bool found = false;
     3428
     3429        CoinBigIndex k;
     3430        for (k = startRow; k < endRow; k++) {
     3431          if (indexColumnU[k] == iColumn) {
     3432            found = true;
     3433            break;
     3434          }
     3435        }
     3436        if (!found) {
     3437          bad = true;
     3438          std::cout << "row " << iRow << " column " << iColumn << " Columns" << std::endl;
     3439        }
     3440      }
     3441    }
     3442  }
     3443  if (bad) {
     3444    abort();
    34543445  }
    34553446}
    3456   //  pivotOneOtherRow.  When just one other row so faster
    3457 bool
    3458 CoinAbcTypeFactorization::pivotOneOtherRow ( CoinSimplexInt pivotRow,
    3459                                            CoinSimplexInt pivotColumn )
     3447//  pivotOneOtherRow.  When just one other row so faster
     3448bool CoinAbcTypeFactorization::pivotOneOtherRow(CoinSimplexInt pivotRow,
     3449  CoinSimplexInt pivotColumn)
    34603450{
    3461   CoinSimplexInt *  COIN_RESTRICT numberInRow = numberInRowAddress_;
    3462   CoinSimplexInt *  COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    3463   CoinSimplexInt *  COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    3464   CoinSimplexInt  COIN_RESTRICT numberInPivotRow = numberInRow[pivotRow] - 1;
    3465   CoinBigIndex *  COIN_RESTRICT startRowU = startRowUAddress_;
    3466   CoinBigIndex *  COIN_RESTRICT startColumnU = startColumnUAddress_;
     3451  CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRowAddress_;
     3452  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     3453  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
     3454  CoinSimplexInt COIN_RESTRICT numberInPivotRow = numberInRow[pivotRow] - 1;
     3455  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
     3456  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
    34673457  CoinBigIndex startColumn = startColumnU[pivotColumn];
    34683458  CoinBigIndex startRow = startRowU[pivotRow];
     
    34703460
    34713461  //take out this bit of indexColumnU
    3472   CoinSimplexInt *  COIN_RESTRICT nextRow = nextRowAddress_;
    3473   CoinSimplexInt *  COIN_RESTRICT lastRow = lastRowAddress_;
     3462  CoinSimplexInt *COIN_RESTRICT nextRow = nextRowAddress_;
     3463  CoinSimplexInt *COIN_RESTRICT lastRow = lastRowAddress_;
    34743464  CoinSimplexInt next = nextRow[pivotRow];
    34753465  CoinSimplexInt last = lastRow[pivotRow];
     
    34793469  lastRow[pivotRow] = -2;
    34803470#ifdef SMALL_PERMUTE
    3481   int realPivotRow=fromSmallToBigRow_[pivotRow];
     3471  int realPivotRow = fromSmallToBigRow_[pivotRow];
    34823472  //int realPivotColumn=fromSmallToBigColumn[pivotColumn];
    34833473#endif
    34843474#ifdef SMALL_PERMUTE
    3485   permuteAddress_[realPivotRow]=numberGoodU_;
     3475  permuteAddress_[realPivotRow] = numberGoodU_;
    34863476#else
    3487   permuteAddress_[pivotRow]=numberGoodU_;
     3477  permuteAddress_[pivotRow] = numberGoodU_;
    34883478#endif
    34893479  numberInRow[pivotRow] = 0;
    3490   #if ABC_SMALL<2
    3491 // temp - switch off marker for valid row/column lookup
    3492   sparseThreshold_=-2;
     3480#if ABC_SMALL < 2
     3481  // temp - switch off marker for valid row/column lookup
     3482  sparseThreshold_ = -2;
    34933483#endif
    34943484  //store column in L, compress in U and take column out
    34953485  CoinBigIndex l = lengthL_;
    34963486
    3497   if ( l + 1 > lengthAreaL_ ) {
     3487  if (l + 1 > lengthAreaL_) {
    34983488    //need more memory
    3499     if ((messageLevel_&4)!=0)
     3489    if ((messageLevel_ & 4) != 0)
    35003490      std::cout << "more memory needed in middle of invert" << std::endl;
    35013491    return false;
     
    35033493  //l+=currentAreaL_->elementByColumn-elementL_;
    35043494  //CoinBigIndex lSave=l;
    3505   CoinBigIndex *  COIN_RESTRICT startColumnL = startColumnLAddress_;
    3506   CoinFactorizationDouble *  COIN_RESTRICT elementL = elementLAddress_;
    3507   CoinSimplexInt *  COIN_RESTRICT indexRowL = indexRowLAddress_;
    3508   startColumnL[numberGoodL_] = l;       //for luck and first time
     3495  CoinBigIndex *COIN_RESTRICT startColumnL = startColumnLAddress_;
     3496  CoinFactorizationDouble *COIN_RESTRICT elementL = elementLAddress_;
     3497  CoinSimplexInt *COIN_RESTRICT indexRowL = indexRowLAddress_;
     3498  startColumnL[numberGoodL_] = l; //for luck and first time
    35093499  numberGoodL_++;
    35103500  startColumnL[numberGoodL_] = l + 1;
     
    35133503  CoinFactorizationDouble otherMultiplier;
    35143504  CoinSimplexInt otherRow;
    3515   CoinSimplexInt *  COIN_RESTRICT saveColumn = saveColumnAddress_;
    3516   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
    3517   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
    3518 
    3519   if ( indexRowU[startColumn] == pivotRow ) {
     3505  CoinSimplexInt *COIN_RESTRICT saveColumn = saveColumnAddress_;
     3506  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
     3507  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
     3508
     3509  if (indexRowU[startColumn] == pivotRow) {
    35203510    pivotElement = elementU[startColumn];
    35213511    otherMultiplier = elementU[startColumn + 1];
     
    35293519  CoinFactorizationDouble pivotMultiplier = 1.0 / pivotElement;
    35303520
    3531   CoinFactorizationDouble *  COIN_RESTRICT pivotRegion = pivotRegionAddress_;
     3521  CoinFactorizationDouble *COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    35323522  pivotRegion[numberGoodU_] = pivotMultiplier;
    35333523  numberInColumn[pivotColumn] = 0;
     
    35433533  CoinBigIndex end = start + numberSave;
    35443534  CoinBigIndex where = start;
    3545   CoinSimplexInt *  COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    3546 
    3547   while ( indexColumnU[where] != pivotColumn ) {
     3535  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     3536
     3537  while (indexColumnU[where] != pivotColumn) {
    35483538    where++;
    3549   }                             /* endwhile */
    3550   assert ( where < end );
     3539  } /* endwhile */
     3540  assert(where < end);
    35513541#if BOTH_WAYS
    35523542#endif
     
    35583548  //pack down and move to work
    35593549  CoinSimplexInt j;
    3560   const CoinSimplexInt *  COIN_RESTRICT nextCount = this->nextCountAddress_;
    3561   CoinSimplexInt *  COIN_RESTRICT nextColumn = nextColumnAddress_;
    3562   for ( j = startRow; j < endRow; j++ ) {
     3550  const CoinSimplexInt *COIN_RESTRICT nextCount = this->nextCountAddress_;
     3551  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumnAddress_;
     3552  for (j = startRow; j < endRow; j++) {
    35633553    CoinSimplexInt iColumn = indexColumnU[j];
    35643554
    3565     if ( iColumn != pivotColumn ) {
     3555    if (iColumn != pivotColumn) {
    35663556      CoinBigIndex startColumn = startColumnU[iColumn];
    3567       CoinSimplexInt numberInColumnIn=numberInColumn[iColumn];
     3557      CoinSimplexInt numberInColumnIn = numberInColumn[iColumn];
    35683558      CoinBigIndex endColumn = startColumn + numberInColumnIn;
    35693559      CoinSimplexInt iRow = indexRowU[startColumn];
     
    35773567      CoinFactorizationDouble thisPivotValue = 0.0;
    35783568      CoinFactorizationDouble otherElement = 0.0;
    3579       CoinFactorizationDouble nextValue = elementU[put];;
     3569      CoinFactorizationDouble nextValue = elementU[put];
     3570      ;
    35803571      CoinSimplexInt nextIRow = indexRowU[put];
    35813572
    35823573      //compress column and find largest not updated
    3583       if ( iRow != pivotRow ) {
    3584         if ( iRow != otherRow ) {
    3585           largest = fabs ( value );
    3586           elementU[put] = value;
    3587           indexRowU[put] = iRow;
    3588           positionLargest = put;
     3574      if (iRow != pivotRow) {
     3575        if (iRow != otherRow) {
     3576          largest = fabs(value);
     3577          elementU[put] = value;
     3578          indexRowU[put] = iRow;
     3579          positionLargest = put;
    35893580#if BOTH_WAYS
    35903581#endif
    3591           put++;
    3592           CoinBigIndex i;
    3593           for ( i = startColumn + 1; i < endColumn; i++ ) {
    3594             iRow = nextIRow;
    3595             value = nextValue;
    3596             nextIRow = indexRowU[i + 1];
    3597             nextValue = elementU[i + 1];
    3598             if ( iRow != pivotRow ) {
    3599               if ( iRow != otherRow ) {
    3600                 //keep
    3601                 indexRowU[put] = iRow;
    3602                 elementU[put] = value;;
     3582          put++;
     3583          CoinBigIndex i;
     3584          for (i = startColumn + 1; i < endColumn; i++) {
     3585            iRow = nextIRow;
     3586            value = nextValue;
     3587            nextIRow = indexRowU[i + 1];
     3588            nextValue = elementU[i + 1];
     3589            if (iRow != pivotRow) {
     3590              if (iRow != otherRow) {
     3591                //keep
     3592                indexRowU[put] = iRow;
     3593                elementU[put] = value;
     3594                ;
    36033595#if BOTH_WAYS
    36043596#endif
    3605                 put++;
    3606               } else {
    3607                 otherElement = value;
    3608                 foundOther = true;
    3609               }
    3610             } else {
    3611               thisPivotValue = value;
    3612             }
    3613           }
    3614         } else {
    3615           otherElement = value;
    3616           foundOther = true;
    3617           //need to find largest
    3618           largest = 0.0;
    3619           CoinBigIndex i;
    3620           for ( i = startColumn + 1; i < endColumn; i++ ) {
    3621             iRow = nextIRow;
    3622             value = nextValue;
    3623             nextIRow = indexRowU[i + 1];
    3624             nextValue = elementU[i + 1];
    3625             if ( iRow != pivotRow ) {
    3626               //keep
    3627               indexRowU[put] = iRow;
    3628               elementU[put] = value;;
     3597                put++;
     3598              } else {
     3599                otherElement = value;
     3600                foundOther = true;
     3601              }
     3602            } else {
     3603              thisPivotValue = value;
     3604            }
     3605          }
     3606        } else {
     3607          otherElement = value;
     3608          foundOther = true;
     3609          //need to find largest
     3610          largest = 0.0;
     3611          CoinBigIndex i;
     3612          for (i = startColumn + 1; i < endColumn; i++) {
     3613            iRow = nextIRow;
     3614            value = nextValue;
     3615            nextIRow = indexRowU[i + 1];
     3616            nextValue = elementU[i + 1];
     3617            if (iRow != pivotRow) {
     3618              //keep
     3619              indexRowU[put] = iRow;
     3620              elementU[put] = value;
     3621              ;
    36293622#if BOTH_WAYS
    36303623#endif
    3631               CoinFactorizationDouble absValue = fabs ( value );
    3632 
    3633               if ( absValue > largest ) {
    3634                 largest = absValue;
    3635                 positionLargest = put;
    3636               }
    3637               put++;
    3638             } else {
    3639               thisPivotValue = value;
    3640             }
    3641           }
    3642         }
     3624              CoinFactorizationDouble absValue = fabs(value);
     3625
     3626              if (absValue > largest) {
     3627                largest = absValue;
     3628                positionLargest = put;
     3629              }
     3630              put++;
     3631            } else {
     3632              thisPivotValue = value;
     3633            }
     3634          }
     3635        }
    36433636      } else {
    3644         //need to find largest
    3645         largest = 0.0;
    3646         thisPivotValue = value;
    3647         CoinBigIndex i;
    3648         for ( i = startColumn + 1; i < endColumn; i++ ) {
    3649           iRow = nextIRow;
    3650           value = nextValue;
    3651           nextIRow = indexRowU[i + 1];
    3652           nextValue = elementU[i + 1];
    3653           if ( iRow != otherRow ) {
    3654             //keep
    3655             indexRowU[put] = iRow;
    3656             elementU[put] = value;;
     3637        //need to find largest
     3638        largest = 0.0;
     3639        thisPivotValue = value;
     3640        CoinBigIndex i;
     3641        for (i = startColumn + 1; i < endColumn; i++) {
     3642          iRow = nextIRow;
     3643          value = nextValue;
     3644          nextIRow = indexRowU[i + 1];
     3645          nextValue = elementU[i + 1];
     3646          if (iRow != otherRow) {
     3647            //keep
     3648            indexRowU[put] = iRow;
     3649            elementU[put] = value;
     3650            ;
    36573651#if BOTH_WAYS
    36583652#endif
    3659             CoinFactorizationDouble absValue = fabs ( value );
    3660 
    3661             if ( absValue > largest ) {
    3662               largest = absValue;
    3663               positionLargest = put;
    3664             }
    3665             put++;
    3666           } else {
    3667             otherElement = value;
    3668             foundOther = true;
    3669           }
    3670         }
     3653            CoinFactorizationDouble absValue = fabs(value);
     3654
     3655            if (absValue > largest) {
     3656              largest = absValue;
     3657              positionLargest = put;
     3658            }
     3659            put++;
     3660          } else {
     3661            otherElement = value;
     3662            foundOther = true;
     3663          }
     3664        }
    36713665      }
    36723666      //slot in pivot
     
    36833677      startColumnU[iColumn]++;
    36843678      otherElement = otherElement - thisPivotValue * otherMultiplier;
    3685       CoinFactorizationDouble absValue = fabs ( otherElement );
    3686 
    3687       if ( !TEST_LESS_THAN_TOLERANCE_REGISTER(absValue) ) {
    3688         if ( !foundOther ) {
    3689           //have we space
    3690           saveColumn[numberAdded++] = iColumn;
    3691           CoinSimplexInt next = nextColumn[iColumn];
    3692           CoinBigIndex space;
    3693 
    3694           space = startColumnU[next] - put - numberInColumnPlus[next];
    3695           if ( space <= 0 ) {
    3696             //getColumnSpace also moves fixed part
    3697             CoinSimplexInt number = numberInColumn[iColumn];
    3698 
    3699             if ( !getColumnSpace ( iColumn, number + 1 ) ) {
    3700               return false;
    3701             }
    3702             //redo starts
    3703             positionLargest =
    3704               positionLargest + startColumnU[iColumn] - startColumn;
    3705             startColumn = startColumnU[iColumn];
    3706             put = startColumn + number;
    3707           }
    3708         }
    3709         elementU[put] = otherElement;
    3710         indexRowU[put] = otherRow;
     3679      CoinFactorizationDouble absValue = fabs(otherElement);
     3680
     3681      if (!TEST_LESS_THAN_TOLERANCE_REGISTER(absValue)) {
     3682        if (!foundOther) {
     3683          //have we space
     3684          saveColumn[numberAdded++] = iColumn;
     3685          CoinSimplexInt next = nextColumn[iColumn];
     3686          CoinBigIndex space;
     3687
     3688          space = startColumnU[next] - put - numberInColumnPlus[next];
     3689          if (space <= 0) {
     3690            //getColumnSpace also moves fixed part
     3691            CoinSimplexInt number = numberInColumn[iColumn];
     3692
     3693            if (!getColumnSpace(iColumn, number + 1)) {
     3694              return false;
     3695            }
     3696            //redo starts
     3697            positionLargest = positionLargest + startColumnU[iColumn] - startColumn;
     3698            startColumn = startColumnU[iColumn];
     3699            put = startColumn + number;
     3700          }
     3701        }
     3702        elementU[put] = otherElement;
     3703        indexRowU[put] = otherRow;
    37113704#if BOTH_WAYS
    37123705#endif
    3713         if ( absValue > largest ) {
    3714           largest = absValue;
    3715           positionLargest = put;
    3716         }
    3717         put++;
     3706        if (absValue > largest) {
     3707          largest = absValue;
     3708          positionLargest = put;
     3709        }
     3710        put++;
    37183711      } else {
    3719         if ( foundOther ) {
    3720           numberDeleted++;
    3721           //take out of row list
    3722           CoinBigIndex where = start;
    3723 
    3724           while ( indexColumnU[where] != iColumn ) {
    3725             where++;
    3726           }                     /* endwhile */
    3727           assert ( where < end );