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

formatting

File:
1 edited

Legend:

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

    r2078 r2385  
    1414#include "CoinHelperFunctions.hpp"
    1515#include "CoinAbcHelperFunctions.hpp"
    16 #if CILK_CONFLICT>0
     16#if CILK_CONFLICT > 0
    1717// for conflicts
    1818extern int cilk_conflict;
     
    2020
    2121//:class CoinAbcTypeFactorization.  Deals with Factorization and Updates
    22 #if ABC_SMALL<2
     22#if ABC_SMALL < 2
    2323//  getColumnSpaceIterateR.  Gets space for one extra R element in Column
    2424//may have to do compression  (returns true)
    2525//also moves existing vector
    26 bool
    27 CoinAbcTypeFactorization::getColumnSpaceIterateR ( CoinSimplexInt iColumn, CoinFactorizationDouble value,
    28                                            CoinSimplexInt iRow)
     26bool CoinAbcTypeFactorization::getColumnSpaceIterateR(CoinSimplexInt iColumn, CoinFactorizationDouble value,
     27  CoinSimplexInt iRow)
    2928{
    30   CoinFactorizationDouble * COIN_RESTRICT elementR = elementRAddress_ + lengthAreaR_;
    31   CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_ + lengthAreaR_;
    32   CoinBigIndex * COIN_RESTRICT startR = startColumnRAddress_+maximumPivots_+1;
    33   CoinSimplexInt * COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
     29  CoinFactorizationDouble *COIN_RESTRICT elementR = elementRAddress_ + lengthAreaR_;
     30  CoinSimplexInt *COIN_RESTRICT indexRowR = indexRowRAddress_ + lengthAreaR_;
     31  CoinBigIndex *COIN_RESTRICT startR = startColumnRAddress_ + maximumPivots_ + 1;
     32  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    3433  CoinSimplexInt number = numberInColumnPlus[iColumn];
    3534  //*** modify so sees if can go in
    3635  //see if it can go in at end
    37   CoinSimplexInt * COIN_RESTRICT nextColumn = nextColumnAddress_;
    38   CoinSimplexInt * COIN_RESTRICT lastColumn = lastColumnAddress_;
    39   if (lengthAreaR_-startR[maximumRowsExtra_]<number+1) {
     36  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumnAddress_;
     37  CoinSimplexInt *COIN_RESTRICT lastColumn = lastColumnAddress_;
     38  if (lengthAreaR_ - startR[maximumRowsExtra_] < number + 1) {
    4039    //compression
    4140    CoinSimplexInt jColumn = nextColumn[maximumRowsExtra_];
    4241    CoinBigIndex put = 0;
    43     while ( jColumn != maximumRowsExtra_ ) {
     42    while (jColumn != maximumRowsExtra_) {
    4443      //move
    4544      CoinBigIndex get;
     
    4948      startR[jColumn] = put;
    5049      CoinBigIndex i;
    51       for ( i = get; i < getEnd; i++ ) {
    52         indexRowR[put] = indexRowR[i];
    53         elementR[put] = elementR[i];
    54         put++;
     50      for (i = get; i < getEnd; i++) {
     51        indexRowR[put] = indexRowR[i];
     52        elementR[put] = elementR[i];
     53        put++;
    5554      }
    5655      jColumn = nextColumn[jColumn];
    5756    }
    5857    numberCompressions_++;
    59     startR[maximumRowsExtra_]=put;
     58    startR[maximumRowsExtra_] = put;
    6059  }
    6160  // Still may not be room (as iColumn was still in)
    62   if (lengthAreaR_-startR[maximumRowsExtra_]<number+1)
     61  if (lengthAreaR_ - startR[maximumRowsExtra_] < number + 1)
    6362    return false;
    6463
     
    7675  lastColumn[iColumn] = last;
    7776  nextColumn[iColumn] = maximumRowsExtra_;
    78  
     77
    7978  //move
    8079  CoinBigIndex get = startR[iColumn];
    8180  startR[iColumn] = put;
    8281  CoinSimplexInt i = 0;
    83   for (i=0 ; i < number; i ++ ) {
    84     elementR[put]= elementR[get];
     82  for (i = 0; i < number; i++) {
     83    elementR[put] = elementR[get];
    8584    indexRowR[put++] = indexRowR[get++];
    8685  }
    8786  //insert
    88   elementR[put]=value;
    89   indexRowR[put++]=iRow;
     87  elementR[put] = value;
     88  indexRowR[put++] = iRow;
    9089  numberInColumnPlus[iColumn]++;
    9190  //add 4 for luck
    92   startR[maximumRowsExtra_] = CoinMin(static_cast<CoinBigIndex> (put + 4) ,lengthAreaR_);
     91  startR[maximumRowsExtra_] = CoinMin(static_cast< CoinBigIndex >(put + 4), lengthAreaR_);
    9392  return true;
    9493}
    9594#endif
    9695CoinSimplexInt CoinAbcTypeFactorization::checkPivot(CoinSimplexDouble saveFromU,
    97                                 CoinSimplexDouble oldPivot) const
     96  CoinSimplexDouble oldPivot) const
    9897{
    9998  CoinSimplexInt status;
    100   if ( fabs ( saveFromU ) > 1.0e-8 ) {
     99  if (fabs(saveFromU) > 1.0e-8) {
    101100    CoinFactorizationDouble checkTolerance;
    102     if ( numberRowsExtra_ < numberRows_ + 2 ) {
     101    if (numberRowsExtra_ < numberRows_ + 2) {
    103102      checkTolerance = 1.0e-5;
    104     } else if ( numberRowsExtra_ < numberRows_ + 10 ) {
     103    } else if (numberRowsExtra_ < numberRows_ + 10) {
    105104      checkTolerance = 1.0e-6;
    106     } else if ( numberRowsExtra_ < numberRows_ + 50 ) {
     105    } else if (numberRowsExtra_ < numberRows_ + 50) {
    107106      checkTolerance = 1.0e-8;
    108107    } else {
    109108      checkTolerance = 1.0e-10;
    110     }       
     109    }
    111110    checkTolerance *= relaxCheck_;
    112     if ( fabs ( 1.0 - fabs ( saveFromU / oldPivot ) ) < checkTolerance ) {
     111    if (fabs(1.0 - fabs(saveFromU / oldPivot)) < checkTolerance) {
    113112      status = 0;
    114113    } else {
    115114#if COIN_DEBUG
    116       std::cout <<"inaccurate pivot "<< oldPivot << " "
    117                 << saveFromU << std::endl;
    118 #endif
    119       if ( fabs ( fabs ( oldPivot ) - fabs ( saveFromU ) ) < 1.0e-12 ||
    120         fabs ( 1.0 - fabs ( saveFromU / oldPivot ) ) < 1.0e-8 ) {
     115      std::cout << "inaccurate pivot " << oldPivot << " "
     116                << saveFromU << std::endl;
     117#endif
     118      if (fabs(fabs(oldPivot) - fabs(saveFromU)) < 1.0e-12 || fabs(1.0 - fabs(saveFromU / oldPivot)) < 1.0e-8) {
    121119        status = 1;
    122120      } else {
    123121        status = 2;
    124       }       
    125     }       
     122      }
     123    }
    126124  } else {
    127125    //error
    128126    status = 2;
    129127#if COIN_DEBUG
    130     std::cout <<"inaccurate pivot "<< saveFromU / oldPivot
    131               << " " << saveFromU << std::endl;
    132 #endif
    133   } 
     128    std::cout << "inaccurate pivot " << saveFromU / oldPivot
     129              << " " << saveFromU << std::endl;
     130#endif
     131  }
    134132  return status;
    135133}
     
    139137#define UNROLL 0
    140138inline void scatterUpdateInline(CoinSimplexInt number,
    141                           CoinFactorizationDouble pivotValue,
    142                           const CoinFactorizationDouble *  COIN_RESTRICT thisElement,
    143                           const CoinSimplexInt *  COIN_RESTRICT thisIndex,
    144                           CoinFactorizationDouble *  COIN_RESTRICT region)
     139  CoinFactorizationDouble pivotValue,
     140  const CoinFactorizationDouble *COIN_RESTRICT thisElement,
     141  const CoinSimplexInt *COIN_RESTRICT thisIndex,
     142  CoinFactorizationDouble *COIN_RESTRICT region)
    145143{
    146 #if UNROLL==0
    147   for (CoinBigIndex j=number-1 ; j >=0; j-- ) {
     144#if UNROLL == 0
     145  for (CoinBigIndex j = number - 1; j >= 0; j--) {
    148146    CoinSimplexInt iRow = thisIndex[j];
    149147    CoinFactorizationDouble regionValue = region[iRow];
    150148    CoinFactorizationDouble value = thisElement[j];
    151     assert (value);
     149    assert(value);
    152150    region[iRow] = regionValue - value * pivotValue;
    153151  }
    154 #elif UNROLL==1
    155   if ((number&1)!=0) {
     152#elif UNROLL == 1
     153  if ((number & 1) != 0) {
    156154    number--;
    157155    CoinSimplexInt iRow = thisIndex[number];
     
    160158    region[iRow] = regionValue - value * pivotValue;
    161159  }
    162   for (CoinBigIndex j=number-1 ; j >=0; j-=2 ) {
     160  for (CoinBigIndex j = number - 1; j >= 0; j -= 2) {
    163161    CoinSimplexInt iRow0 = thisIndex[j];
    164     CoinSimplexInt iRow1 = thisIndex[j-1];
     162    CoinSimplexInt iRow1 = thisIndex[j - 1];
    165163    CoinFactorizationDouble regionValue0 = region[iRow0];
    166164    CoinFactorizationDouble regionValue1 = region[iRow1];
    167165    region[iRow0] = regionValue0 - thisElement[j] * pivotValue;
    168     region[iRow1] = regionValue1 - thisElement[j-1] * pivotValue;
    169   }
    170 #elif UNROLL==2
     166    region[iRow1] = regionValue1 - thisElement[j - 1] * pivotValue;
     167  }
     168#elif UNROLL == 2
    171169  CoinSimplexInt iRow0;
    172170  CoinSimplexInt iRow1;
    173171  CoinFactorizationDouble regionValue0;
    174172  CoinFactorizationDouble regionValue1;
    175   switch(number) {
     173  switch (number) {
    176174  case 0:
    177175    break;
     
    301299    break;
    302300  default:
    303     if ((number&1)!=0) {
     301    if ((number & 1) != 0) {
    304302      number--;
    305303      CoinSimplexInt iRow = thisIndex[number];
     
    308306      region[iRow] = regionValue - value * pivotValue;
    309307    }
    310     for (CoinBigIndex j=number-1 ; j >=0; j-=2 ) {
     308    for (CoinBigIndex j = number - 1; j >= 0; j -= 2) {
    311309      CoinSimplexInt iRow0 = thisIndex[j];
    312       CoinSimplexInt iRow1 = thisIndex[j-1];
     310      CoinSimplexInt iRow1 = thisIndex[j - 1];
    313311      CoinFactorizationDouble regionValue0 = region[iRow0];
    314312      CoinFactorizationDouble regionValue1 = region[iRow1];
    315313      region[iRow0] = regionValue0 - thisElement[j] * pivotValue;
    316       region[iRow1] = regionValue1 - thisElement[j-1] * pivotValue;
     314      region[iRow1] = regionValue1 - thisElement[j - 1] * pivotValue;
    317315    }
    318316    break;
     
    321319}
    322320inline CoinFactorizationDouble gatherUpdate(CoinSimplexInt number,
    323                           const CoinFactorizationDouble *  COIN_RESTRICT thisElement,
    324                           const CoinSimplexInt *  COIN_RESTRICT thisIndex,
    325                           CoinFactorizationDouble *  COIN_RESTRICT region)
     321  const CoinFactorizationDouble *COIN_RESTRICT thisElement,
     322  const CoinSimplexInt *COIN_RESTRICT thisIndex,
     323  CoinFactorizationDouble *COIN_RESTRICT region)
    326324{
    327   CoinFactorizationDouble pivotValue=0.0;
    328   for (CoinBigIndex j = 0; j < number; j ++ ) {
     325  CoinFactorizationDouble pivotValue = 0.0;
     326  for (CoinBigIndex j = 0; j < number; j++) {
    329327    CoinFactorizationDouble value = thisElement[j];
    330328    CoinSimplexInt jRow = thisIndex[j];
     
    335333}
    336334inline void multiplyIndexed(CoinSimplexInt number,
    337                             const CoinFactorizationDouble *  COIN_RESTRICT multiplier,
    338                             const CoinSimplexInt *  COIN_RESTRICT thisIndex,
    339                             CoinFactorizationDouble *  COIN_RESTRICT region)
     335  const CoinFactorizationDouble *COIN_RESTRICT multiplier,
     336  const CoinSimplexInt *COIN_RESTRICT thisIndex,
     337  CoinFactorizationDouble *COIN_RESTRICT region)
    340338{
    341   for (CoinSimplexInt i = 0; i < number; i ++ ) {
     339  for (CoinSimplexInt i = 0; i < number; i++) {
    342340    CoinSimplexInt iRow = thisIndex[i];
    343341    CoinSimplexDouble value = region[iRow];
     
    361359    //not enough room
    362360    return 3;
    363   }       
     361  }
    364362#ifdef ABC_USE_FUNCTION_POINTERS
    365363  scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
     
    382380    return 3;
    383381  }
    384 #if ABC_SMALL<2
     382#if ABC_SMALL < 2
    385383  CoinSimplexInt * COIN_RESTRICT numberInRowU = numberInRowAddress_;
    386384#endif
     
    398396  //get entries in row (pivot not stored)
    399397  CoinSimplexInt numberNonZero = 0;
    400 #if ABC_SMALL<2
     398#if ABC_SMALL < 2
    401399  CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    402400#endif
    403401#if CONVERTROW
    404402  CoinBigIndex * COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
    405 #if CONVERTROW>2
     403#if CONVERTROW > 2
    406404  CoinBigIndex * COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
    407405#endif
    408406#endif
    409 #if ABC_SMALL<2
     407#if ABC_SMALL < 2
    410408  CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    411409  CoinBigIndex * COIN_RESTRICT startRowU = startRowUAddress_;
     
    423421#endif
    424422  int nInRow;
    425 #if ABC_SMALL<2
     423#if ABC_SMALL < 2
    426424  CoinBigIndex start=0;
    427425  CoinBigIndex end=0;
     
    491489#endif
    492490      //smallestIndex=pivotLinkedForwardsAddress_[-1];
    493       updateColumnTransposeU ( regionSparse, smallestIndex 
    494 #if ABC_SMALL<2
     491      updateColumnTransposeU ( regionSparse, smallestIndex
     492#if ABC_SMALL < 2
    495493                  ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    496494#endif
     
    502500  } else {
    503501#endif
    504 #if ABC_SMALL>=0
     502#if ABC_SMALL >= 0
    505503    // No row copy check space
    506504    CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_;
     
    510508    nInRow=replaceColumnU(regionSparse,deletedPosition,deletedColumns,pivotRow);
    511509#endif
    512 #if ABC_SMALL<2
     510#if ABC_SMALL < 2
    513511  }
    514512#endif
     
    545543{
    546544  assert (numberU_<=numberRowsExtra_);
    547  
     545
    548546#ifndef ALWAYS_SKIP_BTRAN
    549547  //return at once if too many iterations
     
    554552    return 3;
    555553  }
    556 #endif 
     554#endif
    557555#ifndef ABC_USE_FUNCTION_POINTERS
    558556  CoinBigIndex * COIN_RESTRICT startColumnU = startColumnUAddress_;
     
    561559#endif
    562560  CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_;
    563 #if ABC_SMALL<2
     561#if ABC_SMALL < 2
    564562  CoinSimplexInt * COIN_RESTRICT numberInRowU = numberInRowAddress_;
    565563#endif
    566 #if ABC_SMALL<2
     564#if ABC_SMALL < 2
    567565  CoinSimplexInt * COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    568566#endif
     
    571569 
    572570  //take out old pivot column
    573  
     571
    574572#ifndef ABC_USE_FUNCTION_POINTERS
    575573  totalElements_ -= numberInColumn[pivotRow];
     
    597595  //get entries in row (pivot not stored)
    598596  CoinSimplexInt numberNonZero = 0;
    599 #if ABC_SMALL<2
     597#if ABC_SMALL < 2
    600598  CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    601599#endif
    602600#if CONVERTROW
    603601  CoinBigIndex * COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
    604 #if CONVERTROW>2
     602#if CONVERTROW > 2
    605603  CoinBigIndex * COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
    606604#endif
    607605#endif
    608 #if ABC_SMALL<2
     606#if ABC_SMALL < 2
    609607  CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    610608  CoinBigIndex * COIN_RESTRICT startRowU = startRowUAddress_;
     
    624622#endif
    625623  int nInRow;
    626 #if ABC_SMALL<2
     624#if ABC_SMALL < 2
    627625  CoinBigIndex start=0;
    628626  CoinBigIndex end=0;
     
    639637  // for accuracy check
    640638  pivotCheck = pivotCheck / oldPivot;
    641 #if ABC_SMALL<2
     639#if ABC_SMALL < 2
    642640  if (gotUCopy()) {
    643641    CoinSimplexInt smallestIndex=pivotLinkedForwardsAddress_[-1];
     
    702700#endif
    703701      //smallestIndex=pivotLinkedForwardsAddress_[-1];
    704       updateColumnTransposeU ( regionSparse, smallestIndex 
    705 #if ABC_SMALL<2
     702      updateColumnTransposeU ( regionSparse, smallestIndex
     703#if ABC_SMALL < 2
    706704                  ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    707705#endif
     
    713711  } else {
    714712#endif
    715 #if ABC_SMALL>=0
     713#if ABC_SMALL >= 0
    716714    // No row copy check space
    717715    if ( lengthR_ + numberRows_>= lengthAreaR_ ) {
     
    723721    nInRow=replaceColumnU(regionSparse,deletedPosition,deletedColumns,pivotRow);
    724722#endif
    725 #if ABC_SMALL<2
     723#if ABC_SMALL < 2
    726724  }
    727725#endif
     
    770768    pivotValue = 1.0 / saveFromU;
    771769    // do what we would have done by now
    772 #if ABC_SMALL<2
     770#if ABC_SMALL < 2
    773771    if (gotUCopy()) {
    774772      for (CoinBigIndex i = start; i < end ; i ++ ) {
     
    790788#ifdef CONVERTDEBUG
    791789        assert (fabs(elementU[j+startColumn]-elementRowU[i])<1.0e-4);
    792 #endif     
     790#endif
    793791#else
    794792        int number = scatter[jColumn].number;
     
    810808#ifdef CONVERTDEBUG
    811809        assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    812 #endif     
     810#endif
    813811#endif
    814812        // swap
     
    864862    } else {
    865863#endif
    866 #if ABC_SMALL>=0
     864#if ABC_SMALL >= 0
    867865      // no row copy
    868866      CoinBigIndex COIN_RESTRICT * deletedPosition = reinterpret_cast<CoinBigIndex *>(elementR+lengthR_);
     
    881879      }
    882880#endif
    883 #if ABC_SMALL<2
    884     }
    885 #endif
    886   }
    887 #if ABC_SMALL<2
     881#if ABC_SMALL < 2
     882    }
     883#endif
     884  }
     885#if ABC_SMALL < 2
    888886  if (gotUCopy()) {
    889887    // Now zero out column of U
     
    940938  }
    941939
    942 #if ABC_SMALL<2
     940#if ABC_SMALL < 2
    943941  CoinSimplexInt *  COIN_RESTRICT nextRow=NULL;
    944942  CoinSimplexInt *  COIN_RESTRICT lastRow=NULL;
     
    971969        indexU2[n]=iRow;
    972970        elementU2[n++] = value2;
    973 #if ABC_SMALL<2
     971#if ABC_SMALL < 2
    974972        if (gotUCopy()) {
    975973          CoinSimplexInt next = nextRow[iRow];
     
    10171015  numberU_++;
    10181016
    1019 #if ABC_SMALL<2
     1017#if ABC_SMALL < 2
    10201018  if (gotUCopy()) {
    10211019    //in at end
     
    10551053  totalElements_ += numberInColumnU2;
    10561054  lengthU_ += numberInColumnU2;
    1057 #if ABC_SMALL<2
     1055#if ABC_SMALL < 2
    10581056  CoinSimplexInt * COIN_RESTRICT nextColumn = nextColumnAddress_;
    10591057  CoinSimplexInt * COIN_RESTRICT lastColumn = lastColumnAddress_;
     
    11321130    }       
    11331131  }
    1134 #if ABC_SMALL<2
     1132#if ABC_SMALL < 2
    11351133  if (gotRCopy()&&status<2) {
    11361134    //if (numberInColumnPlus&&status<2) {
     
    11721170          setNoGotRCopy();
    11731171          regionSparse->clear();
    1174 #if ABC_SMALL<0
     1172#if ABC_SMALL < 0
    11751173          status=3;
    11761174#endif
     
    11871185      indexRowR[putR] = iRow;
    11881186      putR++;
    1189     }       
    1190 #if ABC_SMALL<2
     1187    }
     1188#if ABC_SMALL < 2
    11911189  }
    11921190#endif
     
    12511249   Fills in region for use later
    12521250   partial update already in U */
    1253 #ifdef ABC_LONG_FACTORIZATION 
    1254   long
    1255 #endif
    1256 double
    1257 CoinAbcTypeFactorization::checkReplacePart1 (CoinIndexedVector * regionSparse,
    1258                                               int pivotRow)
     1251#ifdef ABC_LONG_FACTORIZATION
     1252long
     1253#endif
     1254  double
     1255  CoinAbcTypeFactorization::checkReplacePart1(CoinIndexedVector *regionSparse,
     1256    int pivotRow)
    12591257{
    12601258#ifdef ABC_USE_FUNCTION_POINTERS
    1261   scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
    1262   CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     1259  scatterStruct *COIN_RESTRICT scatter = scatterUColumn();
     1260  CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    12631261  CoinBigIndex startU = scatter[numberRows_].offset;
    12641262  CoinSimplexInt numberInColumnU2 = scatter[numberRows_].number;
    1265   CoinFactorizationDouble * COIN_RESTRICT elementU2 = elementUColumnPlus+startU;
     1263  CoinFactorizationDouble *COIN_RESTRICT elementU2 = elementUColumnPlus + startU;
    12661264  //CoinSimplexInt * COIN_RESTRICT indexU2 = reinterpret_cast<CoinSimplexInt *>(elementU2+numberInColumnU2);
    12671265#else
    1268   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnUAddress_;
    1269   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    1270   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
     1266  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     1267  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     1268  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
    12711269  CoinBigIndex startU = startColumnU[numberRows_];
    1272   CoinSimplexInt * COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
    1273   CoinFactorizationDouble * COIN_RESTRICT elementU2 = &elementUAddress_[startU];
     1270  CoinSimplexInt *COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
     1271  CoinFactorizationDouble *COIN_RESTRICT elementU2 = &elementUAddress_[startU];
    12741272  CoinSimplexInt numberInColumnU2 = numberInColumn[numberRows_];
    12751273#endif
    1276 #if ABC_SMALL<2
    1277   CoinSimplexInt * COIN_RESTRICT numberInRowU = numberInRowAddress_;
     1274#if ABC_SMALL < 2
     1275  CoinSimplexInt *COIN_RESTRICT numberInRowU = numberInRowAddress_;
    12781276#endif
    12791277  //zeroed out region
    1280   toLongArray(regionSparse,3);
    1281   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
     1278  toLongArray(regionSparse, 3);
     1279  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
    12821280  //CoinFactorizationDouble * COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    12831281
     
    12881286  //get entries in row (pivot not stored)
    12891287  CoinSimplexInt numberNonZero = 0;
    1290 #if ABC_SMALL<2
    1291   CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     1288#if ABC_SMALL < 2
     1289  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    12921290#endif
    12931291#if CONVERTROW
     
    12961294#endif
    12971295#ifdef CONVERTDEBUG
    1298   CoinBigIndex * COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
    1299 #endif
    1300 #if CONVERTROW>2
    1301   CoinBigIndex * COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
    1302 #endif
    1303 #endif
    1304 #if ABC_SMALL<2
    1305   CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    1306   CoinBigIndex * COIN_RESTRICT startRowU = startRowUAddress_;
    1307 #endif
    1308   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
     1296  CoinBigIndex *COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
     1297#endif
     1298#if CONVERTROW > 2
     1299  CoinBigIndex *COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
     1300#endif
     1301#endif
     1302#if ABC_SMALL < 2
     1303  CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowUAddress_;
     1304  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
     1305#endif
     1306  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    13091307  //CoinSimplexInt status=0;
    13101308#ifndef ABC_USE_FUNCTION_POINTERS
    1311   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
     1309  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
    13121310#endif
    13131311
    13141312  int nInRow;
    1315 #if ABC_SMALL<2
    1316   CoinBigIndex start=0;
    1317   CoinBigIndex end=0;
     1313#if ABC_SMALL < 2
     1314  CoinBigIndex start = 0;
     1315  CoinBigIndex end = 0;
    13181316  if (gotUCopy()) {
    1319     start=startRowU[pivotRow];
    1320     nInRow=numberInRowU[pivotRow];
    1321     end= start + nInRow;
    1322     CoinSimplexInt smallestIndex=pivotLinkedForwardsAddress_[-1];
    1323     CoinSimplexInt *  COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
    1324     if (nInRow<10) {
    1325       CoinSimplexInt smallest=numberRowsExtra_;
    1326       for (CoinBigIndex i = start; i < end ; i ++ ) {
    1327         CoinSimplexInt jColumn = indexColumnU[i];
    1328         if (pivotRowForward[jColumn]<smallest) {
    1329           smallest=pivotRowForward[jColumn];
    1330           smallestIndex=jColumn;
    1331         }
     1317    start = startRowU[pivotRow];
     1318    nInRow = numberInRowU[pivotRow];
     1319    end = start + nInRow;
     1320    CoinSimplexInt smallestIndex = pivotLinkedForwardsAddress_[-1];
     1321    CoinSimplexInt *COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
     1322    if (nInRow < 10) {
     1323      CoinSimplexInt smallest = numberRowsExtra_;
     1324      for (CoinBigIndex i = start; i < end; i++) {
     1325        CoinSimplexInt jColumn = indexColumnU[i];
     1326        if (pivotRowForward[jColumn] < smallest) {
     1327          smallest = pivotRowForward[jColumn];
     1328          smallestIndex = jColumn;
     1329        }
    13321330#ifndef ABC_USE_FUNCTION_POINTERS
    13331331#ifdef CONVERTDEBUG
    1334         CoinBigIndex j = convertRowToColumn[i]+startColumnU[jColumn];
    1335         assert (fabs(elementU[j]-elementRowU[i])<1.0e-4);
    1336 #endif     
    1337         region[jColumn] = elementRowU[i];
     1332        CoinBigIndex j = convertRowToColumn[i] + startColumnU[jColumn];
     1333        assert(fabs(elementU[j] - elementRowU[i]) < 1.0e-4);
     1334#endif
     1335        region[jColumn] = elementRowU[i];
    13381336#else
    13391337#ifdef CONVERTDEBUG
    1340         CoinBigIndex j = convertRowToColumn[i];
    1341         CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    1342         assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    1343 #endif     
    1344         region[jColumn] = elementRowU[i];
    1345 #endif
    1346         regionIndex[numberNonZero++] = jColumn;
     1338        CoinBigIndex j = convertRowToColumn[i];
     1339        CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     1340        assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     1341#endif
     1342        region[jColumn] = elementRowU[i];
     1343#endif
     1344        regionIndex[numberNonZero++] = jColumn;
    13471345      }
    13481346    } else {
    1349       for (CoinBigIndex i = start; i < end ; i ++ ) {
    1350         CoinSimplexInt jColumn = indexColumnU[i];
     1347      for (CoinBigIndex i = start; i < end; i++) {
     1348        CoinSimplexInt jColumn = indexColumnU[i];
    13511349#ifdef CONVERTDEBUG
    13521350#ifdef ABC_USE_FUNCTION_POINTERS
    1353         CoinBigIndex j = convertRowToColumn[i];
    1354         CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    1355         assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    1356 #else
    1357         CoinBigIndex j = convertRowToColumn[i]+startColumnU[jColumn];
    1358         assert (fabs(elementU[j]-elementRowU[i])<1.0e-4);
    1359 #endif
    1360 #endif     
    1361         region[jColumn] = elementRowU[i];
    1362         regionIndex[numberNonZero++] = jColumn;
     1351        CoinBigIndex j = convertRowToColumn[i];
     1352        CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     1353        assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     1354#else
     1355        CoinBigIndex j = convertRowToColumn[i] + startColumnU[jColumn];
     1356        assert(fabs(elementU[j] - elementRowU[i]) < 1.0e-4);
     1357#endif
     1358#endif
     1359        region[jColumn] = elementRowU[i];
     1360        regionIndex[numberNonZero++] = jColumn;
    13631361      }
    13641362    }
    13651363    //do BTRAN - finding first one to use
    1366     regionSparse->setNumElements ( numberNonZero );
     1364    regionSparse->setNumElements(numberNonZero);
    13671365    if (numberNonZero) {
    1368       assert (smallestIndex>=0);
     1366      assert(smallestIndex >= 0);
    13691367#ifndef NDEBUG
    1370       const CoinSimplexInt *  COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
    1371       CoinSimplexInt jRow=pivotLinked[-1];
    1372       if (jRow!=smallestIndex) {
    1373         while (jRow>=0) {
    1374           CoinFactorizationDouble pivotValue = region[jRow];
    1375           if (pivotValue)
    1376             break;
    1377           jRow=pivotLinked[jRow];
    1378         }
    1379         assert (jRow==smallestIndex);
    1380       }
    1381 #endif
    1382 #if ABC_PARALLEL==0
     1368      const CoinSimplexInt *COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
     1369      CoinSimplexInt jRow = pivotLinked[-1];
     1370      if (jRow != smallestIndex) {
     1371        while (jRow >= 0) {
     1372          CoinFactorizationDouble pivotValue = region[jRow];
     1373          if (pivotValue)
     1374            break;
     1375          jRow = pivotLinked[jRow];
     1376        }
     1377        assert(jRow == smallestIndex);
     1378      }
     1379#endif
     1380#if ABC_PARALLEL == 0
    13831381      //smallestIndex=pivotLinkedForwardsAddress_[-1];
    1384       updateColumnTransposeU ( regionSparse, smallestIndex
    1385 #if ABC_SMALL<2
    1386               ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    1387 #endif
    1388                                );
    1389 #else
    1390       assert (FACTOR_CPU>3);
    1391       updateColumnTransposeU ( regionSparse, smallestIndex
    1392 #if ABC_SMALL<2
    1393               ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    1394 #endif
    1395                                ,3
    1396                                );
     1382      updateColumnTransposeU(regionSparse, smallestIndex
     1383#if ABC_SMALL < 2
     1384        ,
     1385        reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
     1386#endif
     1387      );
     1388#else
     1389      assert(FACTOR_CPU > 3);
     1390      updateColumnTransposeU(regionSparse, smallestIndex
     1391#if ABC_SMALL < 2
     1392        ,
     1393        reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
     1394#endif
     1395          ,
     1396        3);
    13971397#endif
    13981398    }
    13991399  } else {
    14001400#endif
    1401 #if ABC_SMALL>=0
     1401#if ABC_SMALL >= 0
    14021402    // No row copy check space
    1403     CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_;
    1404     CoinFactorizationDouble *  COIN_RESTRICT elementR = elementRAddress_;
    1405     CoinBigIndex COIN_RESTRICT * deletedPosition = reinterpret_cast<CoinBigIndex *>(elementR+lengthR_);
    1406     CoinSimplexInt COIN_RESTRICT * deletedColumns = reinterpret_cast<CoinSimplexInt *>(indexRowR+lengthR_);
    1407     nInRow=replaceColumnU(regionSparse,deletedPosition,deletedColumns,pivotRow);
    1408 #endif
    1409 #if ABC_SMALL<2
    1410   }
    1411 #endif
    1412   if ( lengthR_+numberRows_ >= lengthAreaR_ ) {
     1403    CoinSimplexInt *COIN_RESTRICT indexRowR = indexRowRAddress_;
     1404    CoinFactorizationDouble *COIN_RESTRICT elementR = elementRAddress_;
     1405    CoinBigIndex COIN_RESTRICT *deletedPosition = reinterpret_cast< CoinBigIndex * >(elementR + lengthR_);
     1406    CoinSimplexInt COIN_RESTRICT *deletedColumns = reinterpret_cast< CoinSimplexInt * >(indexRowR + lengthR_);
     1407    nInRow = replaceColumnU(regionSparse, deletedPosition, deletedColumns, pivotRow);
     1408#endif
     1409#if ABC_SMALL < 2
     1410  }
     1411#endif
     1412  if (lengthR_ + numberRows_ >= lengthAreaR_) {
    14131413    //not enough room
    14141414    return 0.0;
    1415   }       
     1415  }
    14161416#ifdef ABC_USE_FUNCTION_POINTERS
    1417   CoinSimplexInt * COIN_RESTRICT indexU2 = reinterpret_cast<CoinSimplexInt *>(elementU2+numberInColumnU2);
    1418 #endif
    1419   if ( lengthU_+numberInColumnU2 >= lengthAreaU_ ) {
     1417  CoinSimplexInt *COIN_RESTRICT indexU2 = reinterpret_cast< CoinSimplexInt * >(elementU2 + numberInColumnU2);
     1418#endif
     1419  if (lengthU_ + numberInColumnU2 >= lengthAreaU_) {
    14201420    //not enough room
    14211421    return 0.0;
     
    14291429  CoinFactorizationDouble saveFromU = 0.0;
    14301430
    1431   for (CoinBigIndex i = 0; i < numberInColumnU2; i++ ) {
     1431  for (CoinBigIndex i = 0; i < numberInColumnU2; i++) {
    14321432    CoinSimplexInt iRow = indexU2[i];
    1433     if ( iRow != pivotRow ) {
     1433    if (iRow != pivotRow) {
    14341434      saveFromU -= elementU2[i] * region[iRow];
    14351435    } else {
    14361436      saveFromU += elementU2[i];
    14371437    }
    1438   }       
     1438  }
    14391439  return saveFromU;
    14401440}
     
    14431443   Fills in region for use later
    14441444   partial update in vector */
    1445 #ifdef ABC_LONG_FACTORIZATION 
    1446   long
    1447 #endif
    1448 double
    1449 CoinAbcTypeFactorization::checkReplacePart1 (CoinIndexedVector * regionSparse,
    1450                                              CoinIndexedVector * partialUpdate,
    1451                                               int pivotRow)
     1445#ifdef ABC_LONG_FACTORIZATION
     1446long
     1447#endif
     1448  double
     1449  CoinAbcTypeFactorization::checkReplacePart1(CoinIndexedVector *regionSparse,
     1450    CoinIndexedVector *partialUpdate,
     1451    int pivotRow)
    14521452{
    14531453#ifdef ABC_USE_FUNCTION_POINTERS
    1454   scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
    1455   CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     1454  scatterStruct *COIN_RESTRICT scatter = scatterUColumn();
     1455  CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    14561456  CoinBigIndex startU = scatter[numberRows_].offset;
    14571457#else
    1458   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnUAddress_;
    1459   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    1460   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
    1461 #endif
    1462   CoinSimplexInt * COIN_RESTRICT indexU2 = partialUpdate->getIndices();
    1463   CoinFactorizationDouble * COIN_RESTRICT elementU2 = denseVector(partialUpdate);
     1458  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     1459  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     1460  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
     1461#endif
     1462  CoinSimplexInt *COIN_RESTRICT indexU2 = partialUpdate->getIndices();
     1463  CoinFactorizationDouble *COIN_RESTRICT elementU2 = denseVector(partialUpdate);
    14641464  CoinSimplexInt numberInColumnU2 = partialUpdate->getNumElements();
    1465 #if ABC_SMALL<2
    1466   CoinSimplexInt * COIN_RESTRICT numberInRowU = numberInRowAddress_;
     1465#if ABC_SMALL < 2
     1466  CoinSimplexInt *COIN_RESTRICT numberInRowU = numberInRowAddress_;
    14671467#endif
    14681468  //zeroed out region
    1469   toLongArray(regionSparse,3);
    1470   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
     1469  toLongArray(regionSparse, 3);
     1470  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
    14711471  //CoinFactorizationDouble * COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    14721472
     
    14771477  //get entries in row (pivot not stored)
    14781478  CoinSimplexInt numberNonZero = 0;
    1479 #if ABC_SMALL<2
    1480   CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     1479#if ABC_SMALL < 2
     1480  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    14811481#endif
    14821482#if CONVERTROW
     
    14851485#endif
    14861486#ifdef CONVERTDEBUG
    1487   CoinBigIndex * COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
    1488 #endif
    1489 #if CONVERTROW>2
    1490   CoinBigIndex * COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
    1491 #endif
    1492 #endif
    1493 #if ABC_SMALL<2
    1494   CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    1495   CoinBigIndex * COIN_RESTRICT startRowU = startRowUAddress_;
    1496 #endif
    1497   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
     1487  CoinBigIndex *COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
     1488#endif
     1489#if CONVERTROW > 2
     1490  CoinBigIndex *COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
     1491#endif
     1492#endif
     1493#if ABC_SMALL < 2
     1494  CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowUAddress_;
     1495  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
     1496#endif
     1497  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    14981498  //CoinSimplexInt status=0;
    14991499#ifndef ABC_USE_FUNCTION_POINTERS
    1500   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
     1500  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
    15011501#endif
    15021502
    15031503  int nInRow;
    1504 #if ABC_SMALL<2
    1505   CoinBigIndex start=0;
    1506   CoinBigIndex end=0;
     1504#if ABC_SMALL < 2
     1505  CoinBigIndex start = 0;
     1506  CoinBigIndex end = 0;
    15071507  if (gotUCopy()) {
    1508     start=startRowU[pivotRow];
    1509     nInRow=numberInRowU[pivotRow];
    1510     end= start + nInRow;
    1511     CoinSimplexInt smallestIndex=pivotLinkedForwardsAddress_[-1];
    1512     CoinSimplexInt *  COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
    1513     if (nInRow<10) {
    1514       CoinSimplexInt smallest=numberRowsExtra_;
    1515       for (CoinBigIndex i = start; i < end ; i ++ ) {
    1516         CoinSimplexInt jColumn = indexColumnU[i];
    1517         if (pivotRowForward[jColumn]<smallest) {
    1518           smallest=pivotRowForward[jColumn];
    1519           smallestIndex=jColumn;
    1520         }
     1508    start = startRowU[pivotRow];
     1509    nInRow = numberInRowU[pivotRow];
     1510    end = start + nInRow;
     1511    CoinSimplexInt smallestIndex = pivotLinkedForwardsAddress_[-1];
     1512    CoinSimplexInt *COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
     1513    if (nInRow < 10) {
     1514      CoinSimplexInt smallest = numberRowsExtra_;
     1515      for (CoinBigIndex i = start; i < end; i++) {
     1516        CoinSimplexInt jColumn = indexColumnU[i];
     1517        if (pivotRowForward[jColumn] < smallest) {
     1518          smallest = pivotRowForward[jColumn];
     1519          smallestIndex = jColumn;
     1520        }
    15211521#ifndef ABC_USE_FUNCTION_POINTERS
    15221522#ifdef CONVERTDEBUG
    1523         CoinBigIndex j = convertRowToColumn[i]+startColumnU[jColumn];
    1524         assert (fabs(elementU[j]-elementRowU[i])<1.0e-4);
    1525 #endif     
    1526         region[jColumn] = elementRowU[i];
     1523        CoinBigIndex j = convertRowToColumn[i] + startColumnU[jColumn];
     1524        assert(fabs(elementU[j] - elementRowU[i]) < 1.0e-4);
     1525#endif
     1526        region[jColumn] = elementRowU[i];
    15271527#else
    15281528#ifdef CONVERTDEBUG
    1529         CoinBigIndex j = convertRowToColumn[i];
    1530         CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    1531         assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    1532 #endif     
    1533         region[jColumn] = elementRowU[i];
    1534 #endif
    1535         regionIndex[numberNonZero++] = jColumn;
     1529        CoinBigIndex j = convertRowToColumn[i];
     1530        CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     1531        assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     1532#endif
     1533        region[jColumn] = elementRowU[i];
     1534#endif
     1535        regionIndex[numberNonZero++] = jColumn;
    15361536      }
    15371537    } else {
    1538       for (CoinBigIndex i = start; i < end ; i ++ ) {
    1539         CoinSimplexInt jColumn = indexColumnU[i];
     1538      for (CoinBigIndex i = start; i < end; i++) {
     1539        CoinSimplexInt jColumn = indexColumnU[i];
    15401540#ifdef CONVERTDEBUG
    15411541#ifdef ABC_USE_FUNCTION_POINTERS
    1542         CoinBigIndex j = convertRowToColumn[i];
    1543         CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    1544         assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    1545 #else
    1546         CoinBigIndex j = convertRowToColumn[i]+startColumnU[jColumn];
    1547         assert (fabs(elementU[j]-elementRowU[i])<1.0e-4);
    1548 #endif
    1549 #endif     
    1550         region[jColumn] = elementRowU[i];
    1551         regionIndex[numberNonZero++] = jColumn;
     1542        CoinBigIndex j = convertRowToColumn[i];
     1543        CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     1544        assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     1545#else
     1546        CoinBigIndex j = convertRowToColumn[i] + startColumnU[jColumn];
     1547        assert(fabs(elementU[j] - elementRowU[i]) < 1.0e-4);
     1548#endif
     1549#endif
     1550        region[jColumn] = elementRowU[i];
     1551        regionIndex[numberNonZero++] = jColumn;
    15521552      }
    15531553    }
    15541554    //do BTRAN - finding first one to use
    1555     regionSparse->setNumElements ( numberNonZero );
     1555    regionSparse->setNumElements(numberNonZero);
    15561556    if (numberNonZero) {
    1557       assert (smallestIndex>=0);
     1557      assert(smallestIndex >= 0);
    15581558#ifndef NDEBUG
    1559       const CoinSimplexInt *  COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
    1560       CoinSimplexInt jRow=pivotLinked[-1];
    1561       if (jRow!=smallestIndex) {
    1562         while (jRow>=0) {
    1563           CoinFactorizationDouble pivotValue = region[jRow];
    1564           if (pivotValue)
    1565             break;
    1566           jRow=pivotLinked[jRow];
    1567         }
    1568         assert (jRow==smallestIndex);
    1569       }
    1570 #endif
    1571 #if ABC_PARALLEL==0
     1559      const CoinSimplexInt *COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
     1560      CoinSimplexInt jRow = pivotLinked[-1];
     1561      if (jRow != smallestIndex) {
     1562        while (jRow >= 0) {
     1563          CoinFactorizationDouble pivotValue = region[jRow];
     1564          if (pivotValue)
     1565            break;
     1566          jRow = pivotLinked[jRow];
     1567        }
     1568        assert(jRow == smallestIndex);
     1569      }
     1570#endif
     1571#if ABC_PARALLEL == 0
    15721572      //smallestIndex=pivotLinkedForwardsAddress_[-1];
    1573       updateColumnTransposeU ( regionSparse, smallestIndex
    1574 #if ABC_SMALL<2
    1575               ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    1576 #endif
    1577                                );
    1578 #else
    1579       assert (FACTOR_CPU>3);
    1580       updateColumnTransposeU ( regionSparse, smallestIndex
    1581 #if ABC_SMALL<2
    1582               ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    1583 #endif
    1584                                ,3
    1585                                );
     1573      updateColumnTransposeU(regionSparse, smallestIndex
     1574#if ABC_SMALL < 2
     1575        ,
     1576        reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
     1577#endif
     1578      );
     1579#else
     1580      assert(FACTOR_CPU > 3);
     1581      updateColumnTransposeU(regionSparse, smallestIndex
     1582#if ABC_SMALL < 2
     1583        ,
     1584        reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
     1585#endif
     1586          ,
     1587        3);
    15861588#endif
    15871589    }
    15881590  } else {
    15891591#endif
    1590 #if ABC_SMALL>=0
     1592#if ABC_SMALL >= 0
    15911593    // No row copy check space
    1592     CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_;
    1593     CoinFactorizationDouble *  COIN_RESTRICT elementR = elementRAddress_;
    1594     CoinBigIndex COIN_RESTRICT * deletedPosition = reinterpret_cast<CoinBigIndex *>(elementR+lengthR_);
    1595     CoinSimplexInt COIN_RESTRICT * deletedColumns = reinterpret_cast<CoinSimplexInt *>(indexRowR+lengthR_);
    1596     nInRow=replaceColumnU(regionSparse,deletedPosition,deletedColumns,pivotRow);
    1597 #endif
    1598 #if ABC_SMALL<2
    1599   }
    1600 #endif
    1601   if ( lengthR_+numberRows_ >= lengthAreaR_ ) {
     1594    CoinSimplexInt *COIN_RESTRICT indexRowR = indexRowRAddress_;
     1595    CoinFactorizationDouble *COIN_RESTRICT elementR = elementRAddress_;
     1596    CoinBigIndex COIN_RESTRICT *deletedPosition = reinterpret_cast< CoinBigIndex * >(elementR + lengthR_);
     1597    CoinSimplexInt COIN_RESTRICT *deletedColumns = reinterpret_cast< CoinSimplexInt * >(indexRowR + lengthR_);
     1598    nInRow = replaceColumnU(regionSparse, deletedPosition, deletedColumns, pivotRow);
     1599#endif
     1600#if ABC_SMALL < 2
     1601  }
     1602#endif
     1603  if (lengthR_ + numberRows_ >= lengthAreaR_) {
    16021604    //not enough room
    16031605    return 0.0;
    1604   }       
    1605   if ( lengthU_+numberInColumnU2 >= lengthAreaU_ ) {
     1606  }
     1607  if (lengthU_ + numberInColumnU2 >= lengthAreaU_) {
    16061608    //not enough room
    16071609    partialUpdate->clear();
     
    16161618  CoinFactorizationDouble saveFromU = 0.0;
    16171619
    1618   for (CoinBigIndex i = 0; i < numberInColumnU2; i++ ) {
     1620  for (CoinBigIndex i = 0; i < numberInColumnU2; i++) {
    16191621    CoinSimplexInt iRow = indexU2[i];
    1620     if ( iRow != pivotRow ) {
     1622    if (iRow != pivotRow) {
    16211623      saveFromU -= elementU2[iRow] * region[iRow];
    16221624    } else {
    16231625      saveFromU += elementU2[iRow];
    16241626    }
    1625   }       
     1627  }
    16261628  return saveFromU;
    16271629}
     
    16311633   Fills in region for use later
    16321634   partial update already in U */
    1633 void
    1634 CoinAbcTypeFactorization::checkReplacePart1a (CoinIndexedVector * regionSparse,
    1635                                               int pivotRow)
     1635void CoinAbcTypeFactorization::checkReplacePart1a(CoinIndexedVector *regionSparse,
     1636  int pivotRow)
    16361637{
    16371638#ifdef ABC_USE_FUNCTION_POINTERS
    1638   scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
    1639   CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     1639  scatterStruct *COIN_RESTRICT scatter = scatterUColumn();
     1640  CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    16401641  CoinBigIndex startU = scatter[numberRows_].offset;
    16411642  CoinSimplexInt numberInColumnU2 = scatter[numberRows_].number;
    1642   CoinFactorizationDouble * COIN_RESTRICT elementU2 = elementUColumnPlus+startU;
     1643  CoinFactorizationDouble *COIN_RESTRICT elementU2 = elementUColumnPlus + startU;
    16431644  //CoinSimplexInt * COIN_RESTRICT indexU2 = reinterpret_cast<CoinSimplexInt *>(elementU2+numberInColumnU2);
    16441645#else
    1645   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnUAddress_;
    1646   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    1647   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
     1646  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     1647  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     1648  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
    16481649  CoinBigIndex startU = startColumnU[numberRows_];
    1649   CoinSimplexInt * COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
    1650   CoinFactorizationDouble * COIN_RESTRICT elementU2 = &elementUAddress_[startU];
     1650  CoinSimplexInt *COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
     1651  CoinFactorizationDouble *COIN_RESTRICT elementU2 = &elementUAddress_[startU];
    16511652  CoinSimplexInt numberInColumnU2 = numberInColumn[numberRows_];
    16521653#endif
    1653 #if ABC_SMALL<2
    1654   CoinSimplexInt * COIN_RESTRICT numberInRowU = numberInRowAddress_;
     1654#if ABC_SMALL < 2
     1655  CoinSimplexInt *COIN_RESTRICT numberInRowU = numberInRowAddress_;
    16551656#endif
    16561657  //zeroed out region
    1657   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
     1658  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
    16581659  //CoinFactorizationDouble * COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    16591660
     
    16641665  //get entries in row (pivot not stored)
    16651666  CoinSimplexInt numberNonZero = 0;
    1666 #if ABC_SMALL<2
    1667   CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     1667#if ABC_SMALL < 2
     1668  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    16681669#endif
    16691670#if CONVERTROW
     
    16721673#endif
    16731674#ifdef CONVERTDEBUG
    1674   CoinBigIndex * COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
    1675 #endif
    1676 #if CONVERTROW>2
    1677   CoinBigIndex * COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
    1678 #endif
    1679 #endif
    1680 #if ABC_SMALL<2
    1681   CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    1682   CoinBigIndex * COIN_RESTRICT startRowU = startRowUAddress_;
    1683 #endif
    1684   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
     1675  CoinBigIndex *COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
     1676#endif
     1677#if CONVERTROW > 2
     1678  CoinBigIndex *COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
     1679#endif
     1680#endif
     1681#if ABC_SMALL < 2
     1682  CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowUAddress_;
     1683  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
     1684#endif
     1685  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    16851686  //CoinSimplexInt status=0;
    16861687#ifndef ABC_USE_FUNCTION_POINTERS
    1687   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
     1688  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
    16881689#endif
    16891690
    16901691  int nInRow;
    1691 #if ABC_SMALL<2
    1692   CoinBigIndex start=0;
    1693   CoinBigIndex end=0;
     1692#if ABC_SMALL < 2
     1693  CoinBigIndex start = 0;
     1694  CoinBigIndex end = 0;
    16941695  if (gotUCopy()) {
    1695     start=startRowU[pivotRow];
    1696     nInRow=numberInRowU[pivotRow];
    1697     end= start + nInRow;
    1698     CoinSimplexInt smallestIndex=pivotLinkedForwardsAddress_[-1];
    1699     CoinSimplexInt *  COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
    1700     if (nInRow<10) {
    1701       CoinSimplexInt smallest=numberRowsExtra_;
    1702       for (CoinBigIndex i = start; i < end ; i ++ ) {
    1703         CoinSimplexInt jColumn = indexColumnU[i];
    1704         if (pivotRowForward[jColumn]<smallest) {
    1705           smallest=pivotRowForward[jColumn];
    1706           smallestIndex=jColumn;
    1707         }
     1696    start = startRowU[pivotRow];
     1697    nInRow = numberInRowU[pivotRow];
     1698    end = start + nInRow;
     1699    CoinSimplexInt smallestIndex = pivotLinkedForwardsAddress_[-1];
     1700    CoinSimplexInt *COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
     1701    if (nInRow < 10) {
     1702      CoinSimplexInt smallest = numberRowsExtra_;
     1703      for (CoinBigIndex i = start; i < end; i++) {
     1704        CoinSimplexInt jColumn = indexColumnU[i];
     1705        if (pivotRowForward[jColumn] < smallest) {
     1706          smallest = pivotRowForward[jColumn];
     1707          smallestIndex = jColumn;
     1708        }
    17081709#ifndef ABC_USE_FUNCTION_POINTERS
    17091710#ifdef CONVERTDEBUG
    1710         CoinBigIndex j = convertRowToColumn[i]+startColumnU[jColumn];
    1711         assert (fabs(elementU[j]-elementRowU[i])<1.0e-4);
    1712 #endif     
    1713         region[jColumn] = elementRowU[i];
     1711        CoinBigIndex j = convertRowToColumn[i] + startColumnU[jColumn];
     1712        assert(fabs(elementU[j] - elementRowU[i]) < 1.0e-4);
     1713#endif
     1714        region[jColumn] = elementRowU[i];
    17141715#else
    17151716#ifdef CONVERTDEBUG
    1716         CoinBigIndex j = convertRowToColumn[i];
    1717         CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    1718         assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    1719 #endif     
    1720         region[jColumn] = elementRowU[i];
    1721 #endif
    1722         regionIndex[numberNonZero++] = jColumn;
     1717        CoinBigIndex j = convertRowToColumn[i];
     1718        CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     1719        assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     1720#endif
     1721        region[jColumn] = elementRowU[i];
     1722#endif
     1723        regionIndex[numberNonZero++] = jColumn;
    17231724      }
    17241725    } else {
    1725       for (CoinBigIndex i = start; i < end ; i ++ ) {
    1726         CoinSimplexInt jColumn = indexColumnU[i];
     1726      for (CoinBigIndex i = start; i < end; i++) {
     1727        CoinSimplexInt jColumn = indexColumnU[i];
    17271728#ifdef CONVERTDEBUG
    17281729#ifdef ABC_USE_FUNCTION_POINTERS
    1729         CoinBigIndex j = convertRowToColumn[i];
    1730         CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    1731         assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    1732 #else
    1733         CoinBigIndex j = convertRowToColumn[i]+startColumnU[jColumn];
    1734         assert (fabs(elementU[j]-elementRowU[i])<1.0e-4);
    1735 #endif
    1736 #endif     
    1737         region[jColumn] = elementRowU[i];
    1738         regionIndex[numberNonZero++] = jColumn;
     1730        CoinBigIndex j = convertRowToColumn[i];
     1731        CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     1732        assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     1733#else
     1734        CoinBigIndex j = convertRowToColumn[i] + startColumnU[jColumn];
     1735        assert(fabs(elementU[j] - elementRowU[i]) < 1.0e-4);
     1736#endif
     1737#endif
     1738        region[jColumn] = elementRowU[i];
     1739        regionIndex[numberNonZero++] = jColumn;
    17391740      }
    17401741    }
    17411742    //do BTRAN - finding first one to use
    1742     regionSparse->setNumElements ( numberNonZero );
     1743    regionSparse->setNumElements(numberNonZero);
    17431744    if (numberNonZero) {
    1744       assert (smallestIndex>=0);
     1745      assert(smallestIndex >= 0);
    17451746#ifndef NDEBUG
    1746       const CoinSimplexInt *  COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
    1747       CoinSimplexInt jRow=pivotLinked[-1];
    1748       if (jRow!=smallestIndex) {
    1749         while (jRow>=0) {
    1750           CoinFactorizationDouble pivotValue = region[jRow];
    1751           if (pivotValue)
    1752             break;
    1753           jRow=pivotLinked[jRow];
    1754         }
    1755         assert (jRow==smallestIndex);
    1756       }
    1757 #endif
    1758 #if ABC_PARALLEL==0
     1747      const CoinSimplexInt *COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
     1748      CoinSimplexInt jRow = pivotLinked[-1];
     1749      if (jRow != smallestIndex) {
     1750        while (jRow >= 0) {
     1751          CoinFactorizationDouble pivotValue = region[jRow];
     1752          if (pivotValue)
     1753            break;
     1754          jRow = pivotLinked[jRow];
     1755        }
     1756        assert(jRow == smallestIndex);
     1757      }
     1758#endif
     1759#if ABC_PARALLEL == 0
    17591760      //smallestIndex=pivotLinkedForwardsAddress_[-1];
    1760       updateColumnTransposeU ( regionSparse, smallestIndex
    1761 #if ABC_SMALL<2
    1762               ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    1763 #endif
    1764                                );
    1765 #else
    1766       assert (FACTOR_CPU>3);
    1767       updateColumnTransposeU ( regionSparse, smallestIndex
    1768 #if ABC_SMALL<2
    1769               ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    1770 #endif
    1771                                ,3
    1772                                );
     1761      updateColumnTransposeU(regionSparse, smallestIndex
     1762#if ABC_SMALL < 2
     1763        ,
     1764        reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
     1765#endif
     1766      );
     1767#else
     1768      assert(FACTOR_CPU > 3);
     1769      updateColumnTransposeU(regionSparse, smallestIndex
     1770#if ABC_SMALL < 2
     1771        ,
     1772        reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
     1773#endif
     1774          ,
     1775        3);
    17731776#endif
    17741777    }
    17751778  } else {
    17761779#endif
    1777 #if ABC_SMALL>=0
     1780#if ABC_SMALL >= 0
    17781781    // No row copy check space
    1779     CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_;
    1780     CoinFactorizationDouble *  COIN_RESTRICT elementR = elementRAddress_;
    1781     CoinBigIndex COIN_RESTRICT * deletedPosition = reinterpret_cast<CoinBigIndex *>(elementR+lengthR_);
    1782     CoinSimplexInt COIN_RESTRICT * deletedColumns = reinterpret_cast<CoinSimplexInt *>(indexRowR+lengthR_);
    1783     nInRow=replaceColumnU(regionSparse,deletedPosition,deletedColumns,pivotRow);
    1784 #endif
    1785 #if ABC_SMALL<2
     1782    CoinSimplexInt *COIN_RESTRICT indexRowR = indexRowRAddress_;
     1783    CoinFactorizationDouble *COIN_RESTRICT elementR = elementRAddress_;
     1784    CoinBigIndex COIN_RESTRICT *deletedPosition = reinterpret_cast< CoinBigIndex * >(elementR + lengthR_);
     1785    CoinSimplexInt COIN_RESTRICT *deletedColumns = reinterpret_cast< CoinSimplexInt * >(indexRowR + lengthR_);
     1786    nInRow = replaceColumnU(regionSparse, deletedPosition, deletedColumns, pivotRow);
     1787#endif
     1788#if ABC_SMALL < 2
    17861789  }
    17871790#endif
    17881791}
    1789 #ifdef ABC_LONG_FACTORIZATION 
    1790   long
    1791 #endif
    1792 double
    1793 CoinAbcTypeFactorization::checkReplacePart1b (CoinIndexedVector * regionSparse,
    1794                                               int pivotRow)
     1792#ifdef ABC_LONG_FACTORIZATION
     1793long
     1794#endif
     1795  double
     1796  CoinAbcTypeFactorization::checkReplacePart1b(CoinIndexedVector *regionSparse,
     1797    int pivotRow)
    17951798{
    1796   if ( lengthR_+numberRows_ >= lengthAreaR_ ) {
     1799  if (lengthR_ + numberRows_ >= lengthAreaR_) {
    17971800    //not enough room
    17981801    return 0.0;
    1799   }       
     1802  }
    18001803#ifdef ABC_USE_FUNCTION_POINTERS
    1801   scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
    1802   CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     1804  scatterStruct *COIN_RESTRICT scatter = scatterUColumn();
     1805  CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    18031806  CoinBigIndex startU = scatter[numberRows_].offset;
    18041807  CoinSimplexInt numberInColumnU2 = scatter[numberRows_].number;
    1805   CoinFactorizationDouble * COIN_RESTRICT elementU2 = elementUColumnPlus+startU;
    1806   CoinSimplexInt * COIN_RESTRICT indexU2 = reinterpret_cast<CoinSimplexInt *>(elementU2+numberInColumnU2);
    1807 #else
    1808   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnUAddress_;
    1809   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    1810   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
     1808  CoinFactorizationDouble *COIN_RESTRICT elementU2 = elementUColumnPlus + startU;
     1809  CoinSimplexInt *COIN_RESTRICT indexU2 = reinterpret_cast< CoinSimplexInt * >(elementU2 + numberInColumnU2);
     1810#else
     1811  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     1812  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     1813  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
    18111814  CoinBigIndex startU = startColumnU[numberRows_];
    1812   CoinSimplexInt * COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
    1813   CoinFactorizationDouble * COIN_RESTRICT elementU2 = &elementUAddress_[startU];
     1815  CoinSimplexInt *COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
     1816  CoinFactorizationDouble *COIN_RESTRICT elementU2 = &elementUAddress_[startU];
    18141817  CoinSimplexInt numberInColumnU2 = numberInColumn[numberRows_];
    18151818#endif
    1816   if ( lengthU_+numberInColumnU2 >= lengthAreaU_ ) {
     1819  if (lengthU_ + numberInColumnU2 >= lengthAreaU_) {
    18171820    //not enough room
    18181821    return 0.0;
    18191822  }
    1820   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
     1823  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
    18211824  //CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
    18221825  //CoinSimplexInt status=0;
     
    18261829  CoinFactorizationDouble saveFromU = 0.0;
    18271830
    1828   for (CoinBigIndex i = 0; i < numberInColumnU2; i++ ) {
     1831  for (CoinBigIndex i = 0; i < numberInColumnU2; i++) {
    18291832    CoinSimplexInt iRow = indexU2[i];
    1830     if ( iRow != pivotRow ) {
     1833    if (iRow != pivotRow) {
    18311834      saveFromU -= elementU2[i] * region[iRow];
    18321835    } else {
    18331836      saveFromU += elementU2[i];
    18341837    }
    1835   }       
     1838  }
    18361839  return saveFromU;
    18371840}
     
    18401843/* Checks if can replace one Column to basis,
    18411844   returns 0=OK, 1=Probably OK, 2=singular, 3=no room, 5 max pivots */
    1842 int
    1843 CoinAbcTypeFactorization::checkReplacePart2 ( int pivotRow,
    1844                                               CoinSimplexDouble /*btranAlpha*/, CoinSimplexDouble ftranAlpha,
    1845 #ifdef ABC_LONG_FACTORIZATION
    1846                                               long
    1847 #endif
    1848                                               double ftAlpha,
    1849                                               double /*acceptablePivot*/)
     1845int CoinAbcTypeFactorization::checkReplacePart2(int pivotRow,
     1846  CoinSimplexDouble /*btranAlpha*/, CoinSimplexDouble ftranAlpha,
     1847#ifdef ABC_LONG_FACTORIZATION
     1848  long
     1849#endif
     1850  double ftAlpha,
     1851  double /*acceptablePivot*/)
    18501852{
    1851   if ( lengthR_+numberRows_ >= lengthAreaR_ ) {
     1853  if (lengthR_ + numberRows_ >= lengthAreaR_) {
    18521854    //not enough room
    18531855    return 3;
    1854   }       
    1855   CoinFactorizationDouble * COIN_RESTRICT pivotRegion = pivotRegionAddress_;
     1856  }
     1857  CoinFactorizationDouble *COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    18561858  CoinFactorizationDouble oldPivot = pivotRegion[pivotRow];
    18571859  // for accuracy check
    18581860  CoinFactorizationDouble pivotCheck = ftranAlpha / oldPivot;
    18591861  //check accuracy
    1860   int status = checkPivot(ftAlpha,pivotCheck);
    1861   if (status==1&&!numberPivots_) {
     1862  int status = checkPivot(ftAlpha, pivotCheck);
     1863  if (status == 1 && !numberPivots_) {
    18621864    printf("check status ok\n");
    1863     status=2;
     1865    status = 2;
    18641866  }
    18651867  return status;
     
    18671869/* Replaces one Column to basis,
    18681870   partial update already in U */
    1869 void
    1870 CoinAbcTypeFactorization::replaceColumnPart3 ( const AbcSimplex * /*model*/,
    1871                                           CoinIndexedVector * regionSparse,
    1872                                                CoinIndexedVector * /*tableauColumn*/,
    1873                                           int pivotRow,
    1874 #ifdef ABC_LONG_FACTORIZATION
    1875                                                long
    1876 #endif
    1877                                           double alpha )
     1871void CoinAbcTypeFactorization::replaceColumnPart3(const AbcSimplex * /*model*/,
     1872  CoinIndexedVector *regionSparse,
     1873  CoinIndexedVector * /*tableauColumn*/,
     1874  int pivotRow,
     1875#ifdef ABC_LONG_FACTORIZATION
     1876  long
     1877#endif
     1878  double alpha)
    18781879{
    1879   assert (numberU_<=numberRowsExtra_);
     1880  assert(numberU_ <= numberRowsExtra_);
    18801881#ifndef ABC_USE_FUNCTION_POINTERS
    1881   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnUAddress_;
    1882   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    1883   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
    1884 #endif
    1885   CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_;
    1886 #if ABC_SMALL<2
    1887   CoinSimplexInt * COIN_RESTRICT numberInRowU = numberInRowAddress_;
    1888 #endif
    1889 #if ABC_SMALL<2
    1890   CoinSimplexInt * COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    1891 #endif
    1892   CoinSimplexInt *  COIN_RESTRICT permuteLookup = pivotColumnAddress_;
    1893   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    1894  
     1882  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     1883  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     1884  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
     1885#endif
     1886  CoinSimplexInt *COIN_RESTRICT indexRowR = indexRowRAddress_;
     1887#if ABC_SMALL < 2
     1888  CoinSimplexInt *COIN_RESTRICT numberInRowU = numberInRowAddress_;
     1889#endif
     1890#if ABC_SMALL < 2
     1891  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
     1892#endif
     1893  CoinSimplexInt *COIN_RESTRICT permuteLookup = pivotColumnAddress_;
     1894  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     1895
    18951896  //take out old pivot column
    1896  
     1897
    18971898#ifndef ABC_USE_FUNCTION_POINTERS
    18981899  totalElements_ -= numberInColumn[pivotRow];
    18991900#else
    1900   scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
     1901  scatterStruct *COIN_RESTRICT scatter = scatterUColumn();
    19011902#if ABC_USE_FUNCTION_POINTERS
    19021903  extern scatterUpdate AbcScatterLowSubtract[9];
    19031904  extern scatterUpdate AbcScatterHighSubtract[4];
    19041905#endif
    1905   CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     1906  CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    19061907  CoinBigIndex startU = scatter[numberRows_].offset;
    19071908  totalElements_ -= scatter[pivotRow].number;
    19081909  CoinBigIndex saveStart = scatter[pivotRow].offset;
    19091910  CoinBigIndex saveEnd = scatter[pivotRow].number;
    1910   scatter[pivotRow].offset=startU;
     1911  scatter[pivotRow].offset = startU;
    19111912  CoinSimplexInt numberInColumnU2 = scatter[numberRows_].number;
    1912   CoinFactorizationDouble * COIN_RESTRICT elementU2 = elementUColumnPlus+startU;
    1913   CoinSimplexInt * COIN_RESTRICT indexU2 = reinterpret_cast<CoinSimplexInt *>(elementU2+numberInColumnU2);
     1913  CoinFactorizationDouble *COIN_RESTRICT elementU2 = elementUColumnPlus + startU;
     1914  CoinSimplexInt *COIN_RESTRICT indexU2 = reinterpret_cast< CoinSimplexInt * >(elementU2 + numberInColumnU2);
    19141915#endif
    19151916  //get entries in row (pivot not stored)
    19161917  CoinSimplexInt numberNonZero = 0;
    1917 #if ABC_SMALL<2
    1918   CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     1918#if ABC_SMALL < 2
     1919  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    19191920#endif
    19201921#if CONVERTROW
    1921   CoinBigIndex * COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
    1922 #if CONVERTROW>2
    1923   CoinBigIndex * COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
    1924 #endif
    1925 #endif
    1926 #if ABC_SMALL<2
    1927   CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    1928   CoinBigIndex * COIN_RESTRICT startRowU = startRowUAddress_;
    1929 #endif
    1930   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
     1922  CoinBigIndex *COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
     1923#if CONVERTROW > 2
     1924  CoinBigIndex *COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
     1925#endif
     1926#endif
     1927#if ABC_SMALL < 2
     1928  CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowUAddress_;
     1929  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
     1930#endif
     1931  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    19311932  CoinFactorizationDouble pivotValue = 1.0;
    1932   CoinSimplexInt status=0;
     1933  CoinSimplexInt status = 0;
    19331934#ifndef ABC_USE_FUNCTION_POINTERS
    1934   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
    1935 #endif
    1936   CoinFactorizationDouble *  COIN_RESTRICT elementR = elementRAddress_;
     1935  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
     1936#endif
     1937  CoinFactorizationDouble *COIN_RESTRICT elementR = elementRAddress_;
    19371938
    19381939#ifndef NDEBUG
     
    19411942#endif
    19421943#endif
    1943   int nInRow=9999999; // ? what if ABC_SMALL==0 or ABC_SMALL==1
    1944 #if ABC_SMALL<2
    1945   CoinBigIndex start=0;
    1946   CoinBigIndex end=0;
     1944  int nInRow = 9999999; // ? what if ABC_SMALL==0 or ABC_SMALL==1
     1945#if ABC_SMALL < 2
     1946  CoinBigIndex start = 0;
     1947  CoinBigIndex end = 0;
    19471948  if (gotUCopy()) {
    1948     start=startRowU[pivotRow];
    1949     nInRow=numberInRowU[pivotRow];
    1950     end= start + nInRow;
    1951   }
    1952 #endif
    1953   CoinFactorizationDouble * COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    1954   numberNonZero = regionSparse->getNumElements (  );
     1949    start = startRowU[pivotRow];
     1950    nInRow = numberInRowU[pivotRow];
     1951    end = start + nInRow;
     1952  }
     1953#endif
     1954  CoinFactorizationDouble *COIN_RESTRICT pivotRegion = pivotRegionAddress_;
     1955  numberNonZero = regionSparse->getNumElements();
    19551956  //CoinFactorizationDouble saveFromU = 0.0;
    19561957
    19571958#ifndef ABC_USE_FUNCTION_POINTERS
    19581959  CoinBigIndex startU = startColumnU[numberRows_];
    1959   startColumnU[pivotRow]=startU;
    1960   CoinSimplexInt * COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
    1961   CoinFactorizationDouble * COIN_RESTRICT elementU2 = &elementUAddress_[startU];
     1960  startColumnU[pivotRow] = startU;
     1961  CoinSimplexInt *COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
     1962  CoinFactorizationDouble *COIN_RESTRICT elementU2 = &elementUAddress_[startU];
    19621963  CoinSimplexInt numberInColumnU2 = numberInColumn[numberRows_];
    19631964#else
    19641965//CoinSimplexInt numberInColumnU2 = scatter[numberRows_].number;
    19651966#endif
    1966   instrument_do("CoinAbcFactorizationReplaceColumn",2*numberRows_+4*numberInColumnU2);
     1967  instrument_do("CoinAbcFactorizationReplaceColumn", 2 * numberRows_ + 4 * numberInColumnU2);
    19671968  pivotValue = 1.0 / alpha;
    1968 #if ABC_SMALL<2
     1969#if ABC_SMALL < 2
    19691970  if (gotUCopy()) {
    1970     for (CoinBigIndex i = start; i < end ; i ++ ) {
     1971    for (CoinBigIndex i = start; i < end; i++) {
    19711972      CoinSimplexInt jColumn = indexColumnU[i];
    19721973#ifndef ABC_USE_FUNCTION_POINTERS
     
    19771978      CoinBigIndex j;
    19781979      int number = numberInColumn[jColumn];
    1979       for (j=0;j<number;j++) {
    1980         if (indexRowU[j+startColumn]==pivotRow)
    1981           break;
    1982       }
    1983       assert (j<number);
     1980      for (j = 0; j < number; j++) {
     1981        if (indexRowU[j + startColumn] == pivotRow)
     1982          break;
     1983      }
     1984      assert(j < number);
    19841985      //assert (j==convertRowToColumn[i]); // temp
    19851986#endif
    19861987#ifdef CONVERTDEBUG
    1987       assert (fabs(elementU[j+startColumn]-elementRowU[i])<1.0e-4);
    1988 #endif     
     1988      assert(fabs(elementU[j + startColumn] - elementRowU[i]) < 1.0e-4);
     1989#endif
    19891990#else
    19901991      int number = scatter[jColumn].number;
    1991       CoinSimplexInt k = number-1;
    1992       scatter[jColumn].number=k;
    1993       CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    1994       CoinSimplexInt * COIN_RESTRICT indices = reinterpret_cast<CoinSimplexInt *>(area+k+1);
     1992      CoinSimplexInt k = number - 1;
     1993      scatter[jColumn].number = k;
     1994      CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     1995      CoinSimplexInt *COIN_RESTRICT indices = reinterpret_cast< CoinSimplexInt * >(area + k + 1);
    19951996#if CONVERTROW
    19961997      CoinSimplexInt j = convertRowToColumn[i];
    19971998#else
    19981999      CoinSimplexInt j;
    1999       for (j=0;j<number;j++) {
    2000         if (indices[j]==pivotRow)
    2001           break;
    2002       }
    2003       assert (j<number);
     2000      for (j = 0; j < number; j++) {
     2001        if (indices[j] == pivotRow)
     2002          break;
     2003      }
     2004      assert(j < number);
    20042005      //assert (j==convertRowToColumn[i]); // temp
    20052006#endif
    20062007#ifdef CONVERTDEBUG
    2007       assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    2008 #endif     
     2008      assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     2009#endif
    20092010#endif
    20102011      // swap
    20112012#ifndef ABC_USE_FUNCTION_POINTERS
    2012       CoinSimplexInt k = numberInColumn[jColumn]-1;
    2013       numberInColumn[jColumn]=k;
    2014       CoinBigIndex k2 = k+startColumn;
    2015       int kRow2=indexRowU[k2];
    2016       indexRowU[j+startColumn]=kRow2;
    2017       CoinFactorizationDouble value2=elementU[k2];
    2018       elementU[j+startColumn]=value2;
    2019 #else
    2020       int kRow2=indices[k];
    2021       CoinFactorizationDouble value2=area[k];
     2013      CoinSimplexInt k = numberInColumn[jColumn] - 1;
     2014      numberInColumn[jColumn] = k;
     2015      CoinBigIndex k2 = k + startColumn;
     2016      int kRow2 = indexRowU[k2];
     2017      indexRowU[j + startColumn] = kRow2;
     2018      CoinFactorizationDouble value2 = elementU[k2];
     2019      elementU[j + startColumn] = value2;
     2020#else
     2021      int kRow2 = indices[k];
     2022      CoinFactorizationDouble value2 = area[k];
    20222023#if ABC_USE_FUNCTION_POINTERS
    2023       if (k<9) {
    2024         scatter[jColumn].functionPointer=AbcScatterLowSubtract[k];
     2024      if (k < 9) {
     2025        scatter[jColumn].functionPointer = AbcScatterLowSubtract[k];
    20252026      } else {
    2026         scatter[jColumn].functionPointer=AbcScatterHighSubtract[k&3];
     2027        scatter[jColumn].functionPointer = AbcScatterHighSubtract[k & 3];
    20272028      }
    20282029#endif
    20292030      // later more complicated swap to avoid move (don't think we can!)
    2030       indices[j]=kRow2;
    2031       area[j]=value2;
    2032       // move 
    2033       indices-=2;
    2034       for (int i=0;i<k;i++)
    2035         indices[i]=indices[i+2];
     2031      indices[j] = kRow2;
     2032      area[j] = value2;
     2033      // move
     2034      indices -= 2;
     2035      for (int i = 0; i < k; i++)
     2036        indices[i] = indices[i + 2];
    20362037#endif
    20372038      // move in row copy (slow - as other remark (but shouldn't need to))
    20382039      CoinBigIndex start2 = startRowU[kRow2];
    2039       int n=numberInRowU[kRow2];
     2040      int n = numberInRowU[kRow2];
    20402041      CoinBigIndex end2 = start2 + n;
    20412042#ifndef NDEBUG
    2042       bool found=false;
    2043 #endif
    2044       for (CoinBigIndex i2 = start2; i2 < end2 ; i2 ++ ) {
    2045         CoinSimplexInt iColumn2 = indexColumnU[i2];
    2046         if (jColumn==iColumn2) {
     2043      bool found = false;
     2044#endif
     2045      for (CoinBigIndex i2 = start2; i2 < end2; i2++) {
     2046        CoinSimplexInt iColumn2 = indexColumnU[i2];
     2047        if (jColumn == iColumn2) {
    20472048#if CONVERTROW
    2048           convertRowToColumn[i2] = j;
     2049          convertRowToColumn[i2] = j;
    20492050#endif
    20502051#ifndef NDEBUG
    2051           found=true;
    2052 #endif
    2053           break;
    2054         }
     2052          found = true;
     2053#endif
     2054          break;
     2055        }
    20552056      }
    20562057#ifndef NDEBUG
     
    20602061  } else {
    20612062#endif
    2062 #if ABC_SMALL>=0
    2063     assert(nInRow!=9999999); // ? what if ABC_SMALL==0 or ABC_SMALL==1
     2063#if ABC_SMALL >= 0
     2064    assert(nInRow != 9999999); // ? what if ABC_SMALL==0 or ABC_SMALL==1
    20642065    // no row copy
    2065     CoinBigIndex COIN_RESTRICT * deletedPosition = reinterpret_cast<CoinBigIndex *>(elementR+lengthR_);
    2066     CoinSimplexInt COIN_RESTRICT * deletedColumns = reinterpret_cast<CoinSimplexInt *>(indexRowR+lengthR_);
    2067     for (CoinSimplexInt i = 0; i < nInRow ; i ++ ) {
     2066    CoinBigIndex COIN_RESTRICT *deletedPosition = reinterpret_cast< CoinBigIndex * >(elementR + lengthR_);
     2067    CoinSimplexInt COIN_RESTRICT *deletedColumns = reinterpret_cast< CoinSimplexInt * >(indexRowR + lengthR_);
     2068    for (CoinSimplexInt i = 0; i < nInRow; i++) {
    20682069      CoinBigIndex j = deletedPosition[i];
    20692070      CoinSimplexInt jColumn = deletedColumns[i];
    20702071      // swap
    2071       CoinSimplexInt k = numberInColumn[jColumn]-1;
    2072       numberInColumn[jColumn]=k;
    2073       CoinBigIndex k2 = k+startColumnU[jColumn];
    2074       int kRow2=indexRowU[k2];
    2075       indexRowU[j]=kRow2;
    2076       CoinFactorizationDouble value2=elementU[k2];
    2077       elementU[j]=value2;
    2078     }
    2079 #endif
    2080 #if ABC_SMALL<2
    2081   }
    2082 #endif
    2083  #if ABC_SMALL<2
     2072      CoinSimplexInt k = numberInColumn[jColumn] - 1;
     2073      numberInColumn[jColumn] = k;
     2074      CoinBigIndex k2 = k + startColumnU[jColumn];
     2075      int kRow2 = indexRowU[k2];
     2076      indexRowU[j] = kRow2;
     2077      CoinFactorizationDouble value2 = elementU[k2];
     2078      elementU[j] = value2;
     2079    }
     2080#endif
     2081#if ABC_SMALL < 2
     2082  }
     2083#endif
     2084#if ABC_SMALL < 2
    20842085  if (gotUCopy()) {
    20852086    // Now zero out column of U
    20862087    //take out old pivot column
    20872088#ifdef ABC_USE_FUNCTION_POINTERS
    2088     CoinFactorizationDouble * COIN_RESTRICT elementU = elementUColumnPlus+saveStart;
    2089     saveStart=0;
    2090     CoinSimplexInt * COIN_RESTRICT indexRowU = reinterpret_cast<CoinSimplexInt *>(elementU+saveEnd);
    2091 #endif
    2092     for (CoinBigIndex i = saveStart; i < saveEnd ; i ++ ) {
     2089    CoinFactorizationDouble *COIN_RESTRICT elementU = elementUColumnPlus + saveStart;
     2090    saveStart = 0;
     2091    CoinSimplexInt *COIN_RESTRICT indexRowU = reinterpret_cast< CoinSimplexInt * >(elementU + saveEnd);
     2092#endif
     2093    for (CoinBigIndex i = saveStart; i < saveEnd; i++) {
    20932094      //elementU[i] = 0.0;
    20942095      // If too slow then reverse meaning of convertRowToColumn and use
    2095       int jRow=indexRowU[i];
     2096      int jRow = indexRowU[i];
    20962097      CoinBigIndex start = startRowU[jRow];
    20972098      CoinBigIndex end = start + numberInRowU[jRow];
    2098       for (CoinBigIndex j = start; j < end ; j ++ ) {
    2099         CoinSimplexInt jColumn = indexColumnU[j];
    2100         if (jColumn==pivotRow) {
    2101           // swap
    2102           numberInRowU[jRow]--;
    2103           elementRowU[j]=elementRowU[end-1];
     2099      for (CoinBigIndex j = start; j < end; j++) {
     2100        CoinSimplexInt jColumn = indexColumnU[j];
     2101        if (jColumn == pivotRow) {
     2102          // swap
     2103          numberInRowU[jRow]--;
     2104          elementRowU[j] = elementRowU[end - 1];
    21042105#if CONVERTROW
    2105           convertRowToColumn[j]=convertRowToColumn[end-1];
    2106 #endif
    2107           indexColumnU[j]=indexColumnU[end-1];
    2108           break;
    2109         }
    2110       }
    2111     }   
    2112   }
    2113 #endif   
     2106          convertRowToColumn[j] = convertRowToColumn[end - 1];
     2107#endif
     2108          indexColumnU[j] = indexColumnU[end - 1];
     2109          break;
     2110        }
     2111      }
     2112    }
     2113  }
     2114#endif
    21142115  //zero out pivot Row (before or after?)
    21152116  //add to R
    2116   CoinBigIndex * COIN_RESTRICT startColumnR = startColumnRAddress_;
     2117  CoinBigIndex *COIN_RESTRICT startColumnR = startColumnRAddress_;
    21172118  CoinBigIndex putR = lengthR_;
    21182119  CoinSimplexInt number = numberR_;
    2119  
    2120   startColumnR[number] = putR;  //for luck and first time
     2120
     2121  startColumnR[number] = putR; //for luck and first time
    21212122  number++;
    21222123  //assert (startColumnR+number-firstCountAddress_<( CoinMax(5*numberRows_,2*numberRows_+2*maximumPivots_)+2));
     
    21262127  totalElements_ += numberNonZero;
    21272128
    2128 #if ABC_SMALL<2
    2129   CoinSimplexInt *  COIN_RESTRICT nextRow=NULL;
    2130   CoinSimplexInt *  COIN_RESTRICT lastRow=NULL;
     2129#if ABC_SMALL < 2
     2130  CoinSimplexInt *COIN_RESTRICT nextRow = NULL;
     2131  CoinSimplexInt *COIN_RESTRICT lastRow = NULL;
    21312132  CoinSimplexInt next;
    21322133  CoinSimplexInt last;
     
    21372138    next = nextRow[pivotRow];
    21382139    last = lastRow[pivotRow];
    2139    
     2140
    21402141    nextRow[last] = next;
    21412142    lastRow[next] = last;
    2142     numberInRowU[pivotRow]=0;
    2143   }
    2144 #endif 
     2143    numberInRowU[pivotRow] = 0;
     2144  }
     2145#endif
    21452146  //put in pivot
    21462147  //add row counts
    2147  
     2148
    21482149  int n = 0;
    2149   for (CoinSimplexInt i = 0; i < numberInColumnU2; i++ ) {
     2150  for (CoinSimplexInt i = 0; i < numberInColumnU2; i++) {
    21502151    CoinSimplexInt iRow = indexU2[i];
    2151     CoinFactorizationDouble value=elementU2[i];
    2152     assert (value);
    2153     if ( !TEST_LESS_THAN_TOLERANCE(value ) ) {
    2154       if ( iRow != pivotRow ) {
    2155         //modify by pivot
    2156         CoinFactorizationDouble value2 = value*pivotValue;
    2157         indexU2[n]=iRow;
    2158         elementU2[n++] = value2;
    2159 #if ABC_SMALL<2
    2160         if (gotUCopy()) {
    2161           CoinSimplexInt next = nextRow[iRow];
    2162           CoinSimplexInt iNumberInRow = numberInRowU[iRow];
    2163           CoinBigIndex space;
    2164           CoinBigIndex put = startRowU[iRow] + iNumberInRow;
    2165           space = startRowU[next] - put;
    2166           if ( space <= 0 ) {
    2167             getRowSpaceIterate ( iRow, iNumberInRow + 4 );
    2168             put = startRowU[iRow] + iNumberInRow;
    2169           } else if (next==numberRows_) {
    2170             lastEntryByRowU_=put+1;
    2171           }     
    2172           indexColumnU[put] = pivotRow;
     2152    CoinFactorizationDouble value = elementU2[i];
     2153    assert(value);
     2154    if (!TEST_LESS_THAN_TOLERANCE(value)) {
     2155      if (iRow != pivotRow) {
     2156        //modify by pivot
     2157        CoinFactorizationDouble value2 = value * pivotValue;
     2158        indexU2[n] = iRow;
     2159        elementU2[n++] = value2;
     2160#if ABC_SMALL < 2
     2161        if (gotUCopy()) {
     2162          CoinSimplexInt next = nextRow[iRow];
     2163          CoinSimplexInt iNumberInRow = numberInRowU[iRow];
     2164          CoinBigIndex space;
     2165          CoinBigIndex put = startRowU[iRow] + iNumberInRow;
     2166          space = startRowU[next] - put;
     2167          if (space <= 0) {
     2168            getRowSpaceIterate(iRow, iNumberInRow + 4);
     2169            put = startRowU[iRow] + iNumberInRow;
     2170          } else if (next == numberRows_) {
     2171            lastEntryByRowU_ = put + 1;
     2172          }
     2173          indexColumnU[put] = pivotRow;
    21732174#if CONVERTROW
    2174           convertRowToColumn[put] = i;
    2175 #endif
    2176           elementRowU[put] = value2;
    2177           numberInRowU[iRow] = iNumberInRow + 1;
    2178         }
     2175          convertRowToColumn[put] = i;
     2176#endif
     2177          elementRowU[put] = value2;
     2178          numberInRowU[iRow] = iNumberInRow + 1;
     2179        }
    21792180#endif
    21802181      } else {
    2181         //swap and save
    2182         indexU2[i]=indexU2[numberInColumnU2-1];
    2183         elementU2[i] = elementU2[numberInColumnU2-1];
    2184         numberInColumnU2--;
    2185         i--;
     2182        //swap and save
     2183        indexU2[i] = indexU2[numberInColumnU2 - 1];
     2184        elementU2[i] = elementU2[numberInColumnU2 - 1];
     2185        numberInColumnU2--;
     2186        i--;
    21862187      }
    21872188    } else {
    21882189      // swap
    2189       indexU2[i]=indexU2[numberInColumnU2-1];
    2190       elementU2[i] = elementU2[numberInColumnU2-1];
     2190      indexU2[i] = indexU2[numberInColumnU2 - 1];
     2191      elementU2[i] = elementU2[numberInColumnU2 - 1];
    21912192      numberInColumnU2--;
    21922193      i--;
    2193     }       
    2194   }       
    2195   numberInColumnU2=n;
     2194    }
     2195  }
     2196  numberInColumnU2 = n;
    21962197  //do permute
    21972198  permuteAddress_[numberRowsExtra_] = pivotRow;
     
    22002201
    22012202  //pivotColumnAddress_[pivotRow] = numberRowsExtra_;
    2202  
     2203
    22032204  numberU_++;
    22042205
    2205 #if ABC_SMALL<2
     2206#if ABC_SMALL < 2
    22062207  if (gotUCopy()) {
    22072208    //in at end
     
    22152216#endif
    22162217#ifndef ABC_USE_FUNCTION_POINTERS
    2217   numberInColumn[pivotRow]=numberInColumnU2;
     2218  numberInColumn[pivotRow] = numberInColumnU2;
    22182219#else
    22192220#if ABC_USE_FUNCTION_POINTERS
    2220   if (numberInColumnU2<9) {
    2221     scatter[pivotRow].functionPointer=AbcScatterLowSubtract[numberInColumnU2];
     2221  if (numberInColumnU2 < 9) {
     2222    scatter[pivotRow].functionPointer = AbcScatterLowSubtract[numberInColumnU2];
    22222223  } else {
    2223     scatter[pivotRow].functionPointer=AbcScatterHighSubtract[numberInColumnU2&3];
    2224   }
    2225 #endif
    2226   assert(scatter[pivotRow].offset==lastEntryByColumnUPlus_);
     2224    scatter[pivotRow].functionPointer = AbcScatterHighSubtract[numberInColumnU2 & 3];
     2225  }
     2226#endif
     2227  assert(scatter[pivotRow].offset == lastEntryByColumnUPlus_);
    22272228  //CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+lastEntryByColumnUPlus_;
    22282229  //CoinSimplexInt * COIN_RESTRICT indices = reinterpret_cast<CoinSimplexInt *>(area+numberInColumnU2);
    2229   if (numberInColumnU2<scatter[numberRows_].number) {
    2230     int offset=2*(scatter[numberRows_].number-numberInColumnU2);
     2230  if (numberInColumnU2 < scatter[numberRows_].number) {
     2231    int offset = 2 * (scatter[numberRows_].number - numberInColumnU2);
    22312232    indexU2 -= offset;
    22322233    //assert(indexU2-reinterpret_cast<int*>(area)>=0);
    2233     for (int i=0;i<numberInColumnU2;i++)
    2234       indexU2[i]=indexU2[i+offset];
    2235   }
    2236   scatter[pivotRow].number=numberInColumnU2;
     2234    for (int i = 0; i < numberInColumnU2; i++)
     2235      indexU2[i] = indexU2[i + offset];
     2236  }
     2237  scatter[pivotRow].number = numberInColumnU2;
    22372238  //CoinAbcMemcpy(indices,indexU2,numberInColumnU2);
    22382239  //CoinAbcMemcpy(area,elementU2,numberInColumnU2);
    2239   lastEntryByColumnUPlus_ += (3*numberInColumnU2+1)>>1;
     2240  lastEntryByColumnUPlus_ += (3 * numberInColumnU2 + 1) >> 1;
    22402241#endif
    22412242  totalElements_ += numberInColumnU2;
    22422243  lengthU_ += numberInColumnU2;
    2243 #if ABC_SMALL<2
    2244   CoinSimplexInt * COIN_RESTRICT nextColumn = nextColumnAddress_;
    2245   CoinSimplexInt * COIN_RESTRICT lastColumn = lastColumnAddress_;
     2244#if ABC_SMALL < 2
     2245  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumnAddress_;
     2246  CoinSimplexInt *COIN_RESTRICT lastColumn = lastColumnAddress_;
    22462247  if (gotRCopy()) {
    22472248    //column in at beginning (as empty)
     
    22652266  pivotRegion[pivotRow] = pivotValue;
    22662267#ifndef ABC_USE_FUNCTION_POINTERS
    2267   maximumU_ = CoinMax(maximumU_,startU+numberInColumnU2);
    2268 #else
    2269   maximumU_ = CoinMax(maximumU_,lastEntryByColumnUPlus_);
    2270 #endif
    2271   permuteLookup[pivotRow]=numberRowsExtra_;
    2272   permuteLookup[numberRowsExtra_]=pivotRow;
     2268  maximumU_ = CoinMax(maximumU_, startU + numberInColumnU2);
     2269#else
     2270  maximumU_ = CoinMax(maximumU_, lastEntryByColumnUPlus_);
     2271#endif
     2272  permuteLookup[pivotRow] = numberRowsExtra_;
     2273  permuteLookup[numberRowsExtra_] = pivotRow;
    22732274  //pivotColumnAddress_[pivotRow]=numberRowsExtra_;
    22742275  //pivotColumnAddress_[numberRowsExtra_]=pivotRow;
    2275   assert (pivotRow<numberRows_);
     2276  assert(pivotRow < numberRows_);
    22762277  // out of chain
    2277   CoinSimplexInt iLast=pivotLinkedBackwardsAddress_[pivotRow];
    2278   CoinSimplexInt iNext=pivotLinkedForwardsAddress_[pivotRow];
    2279   assert (pivotRow==pivotLinkedForwardsAddress_[iLast]);
    2280   assert (pivotRow==pivotLinkedBackwardsAddress_[iNext]);
    2281   pivotLinkedForwardsAddress_[iLast]=iNext;
    2282   pivotLinkedBackwardsAddress_[iNext]=iLast;
    2283   if (pivotRow==lastSlack_) {
     2278  CoinSimplexInt iLast = pivotLinkedBackwardsAddress_[pivotRow];
     2279  CoinSimplexInt iNext = pivotLinkedForwardsAddress_[pivotRow];
     2280  assert(pivotRow == pivotLinkedForwardsAddress_[iLast]);
     2281  assert(pivotRow == pivotLinkedBackwardsAddress_[iNext]);
     2282  pivotLinkedForwardsAddress_[iLast] = iNext;
     2283  pivotLinkedBackwardsAddress_[iNext] = iLast;
     2284  if (pivotRow == lastSlack_) {
    22842285    lastSlack_ = iLast;
    22852286  }
    2286   iLast=pivotLinkedBackwardsAddress_[numberRows_];
    2287   assert (numberRows_==pivotLinkedForwardsAddress_[iLast]);
    2288   pivotLinkedForwardsAddress_[iLast]=pivotRow;
    2289   pivotLinkedBackwardsAddress_[pivotRow]=iLast;
    2290   pivotLinkedBackwardsAddress_[numberRows_]=pivotRow;
    2291   pivotLinkedForwardsAddress_[pivotRow]=numberRows_;
    2292   assert (numberRows_>pivotLinkedForwardsAddress_[-1]);
    2293   assert (pivotLinkedBackwardsAddress_[numberRows_]>=0);
     2287  iLast = pivotLinkedBackwardsAddress_[numberRows_];
     2288  assert(numberRows_ == pivotLinkedForwardsAddress_[iLast]);
     2289  pivotLinkedForwardsAddress_[iLast] = pivotRow;
     2290  pivotLinkedBackwardsAddress_[pivotRow] = iLast;
     2291  pivotLinkedBackwardsAddress_[numberRows_] = pivotRow;
     2292  pivotLinkedForwardsAddress_[pivotRow] = numberRows_;
     2293  assert(numberRows_ > pivotLinkedForwardsAddress_[-1]);
     2294  assert(pivotLinkedBackwardsAddress_[numberRows_] >= 0);
    22942295  numberRowsExtra_++;
    22952296  numberGoodU_++;
    22962297  numberPivots_++;
    2297   if ( numberRowsExtra_ > numberRows_ + 50 ) {
     2298  if (numberRowsExtra_ > numberRows_ + 50) {
    22982299    CoinBigIndex extra = factorElements_ >> 1;
    2299    
    2300     if ( numberRowsExtra_ > numberRows_ + 100 + numberRows_ / 500 ) {
    2301       if ( extra < 2 * numberRows_ ) {
     2300
     2301    if (numberRowsExtra_ > numberRows_ + 100 + numberRows_ / 500) {
     2302      if (extra < 2 * numberRows_) {
    23022303        extra = 2 * numberRows_;
    2303       }       
     2304      }
    23042305    } else {
    2305       if ( extra < 5 * numberRows_ ) {
     2306      if (extra < 5 * numberRows_) {
    23062307        extra = 5 * numberRows_;
    2307       }       
    2308     }       
     2308      }
     2309    }
    23092310    CoinBigIndex added = totalElements_ - factorElements_;
    2310    
    2311     if ( added > extra && added > ( factorElements_ ) << 1 && !status
    2312          && 3*totalElements_ > 2*(lengthAreaU_+lengthAreaL_)) {
     2311
     2312    if (added > extra && added > (factorElements_) << 1 && !status
     2313      && 3 * totalElements_ > 2 * (lengthAreaU_ + lengthAreaL_)) {
    23132314      status = 3;
    2314       if ( messageLevel_ & 4 ) {
    2315         std::cout << "Factorization has "<< totalElements_
    2316                   << ", basis had " << factorElements_ <<std::endl;
    2317       }
    2318     }       
    2319   }
    2320 #if ABC_SMALL<2
    2321   if (gotRCopy()&&status<2) {
     2315      if (messageLevel_ & 4) {
     2316        std::cout << "Factorization has " << totalElements_
     2317                  << ", basis had " << factorElements_ << std::endl;
     2318      }
     2319    }
     2320  }
     2321#if ABC_SMALL < 2
     2322  if (gotRCopy() && status < 2) {
    23222323    //if (numberInColumnPlus&&status<2) {
    23232324    // we are going to put another copy of R in R
    2324     CoinFactorizationDouble * COIN_RESTRICT elementRR = elementRAddress_ + lengthAreaR_;
    2325     CoinSimplexInt * COIN_RESTRICT indexRowRR = indexRowRAddress_ + lengthAreaR_;
    2326     CoinBigIndex * COIN_RESTRICT startRR = startColumnRAddress_+maximumPivots_+1;
    2327     CoinSimplexInt pivotRow = numberRowsExtra_-1;
    2328     for (CoinBigIndex i = 0; i < numberNonZero; i++ ) {
     2325    CoinFactorizationDouble *COIN_RESTRICT elementRR = elementRAddress_ + lengthAreaR_;
     2326    CoinSimplexInt *COIN_RESTRICT indexRowRR = indexRowRAddress_ + lengthAreaR_;
     2327    CoinBigIndex *COIN_RESTRICT startRR = startColumnRAddress_ + maximumPivots_ + 1;
     2328    CoinSimplexInt pivotRow = numberRowsExtra_ - 1;
     2329    for (CoinBigIndex i = 0; i < numberNonZero; i++) {
    23292330      CoinSimplexInt jRow = regionIndex[i];
    2330       CoinFactorizationDouble value=region[jRow];
     2331      CoinFactorizationDouble value = region[jRow];
    23312332      elementR[putR] = value;
    23322333      indexRowR[putR] = jRow;
    23332334      putR++;
    2334       region[jRow]=0.0;
     2335      region[jRow] = 0.0;
    23352336      int iRow = permuteLookup[jRow];
    23362337      next = nextColumn[iRow];
    23372338      CoinBigIndex space;
    2338       if (next!=maximumRowsExtra_)
    2339         space = startRR[next]-startRR[iRow];
     2339      if (next != maximumRowsExtra_)
     2340        space = startRR[next] - startRR[iRow];
    23402341      else
    2341         space = lengthAreaR_-startRR[iRow];
     2342        space = lengthAreaR_ - startRR[iRow];
    23422343      CoinSimplexInt numberInR = numberInColumnPlus[iRow];
    2343       if (space>numberInR) {
    2344         // there is space
    2345         CoinBigIndex  put=startRR[iRow]+numberInR;
    2346         numberInColumnPlus[iRow]=numberInR+1;
    2347         indexRowRR[put]=pivotRow;
    2348         elementRR[put]=value;
    2349         //add 4 for luck
    2350         if (next==maximumRowsExtra_)
    2351           startRR[maximumRowsExtra_] = CoinMin(static_cast<CoinBigIndex> (put + 4) ,lengthAreaR_);
     2344      if (space > numberInR) {
     2345        // there is space
     2346        CoinBigIndex put = startRR[iRow] + numberInR;
     2347        numberInColumnPlus[iRow] = numberInR + 1;
     2348        indexRowRR[put] = pivotRow;
     2349        elementRR[put] = value;
     2350        //add 4 for luck
     2351        if (next == maximumRowsExtra_)
     2352          startRR[maximumRowsExtra_] = CoinMin(static_cast< CoinBigIndex >(put + 4), lengthAreaR_);
    23522353      } else {
    2353         // no space - do we shuffle?
    2354         if (!getColumnSpaceIterateR(iRow,value,pivotRow)) {
    2355           // printf("Need more space for R\n");
    2356           numberInColumnPlus_.conditionalDelete();
    2357           numberInColumnPlusAddress_=NULL;
    2358           setNoGotRCopy();
    2359           regionSparse->clear();
    2360 #if ABC_SMALL<0
    2361           abort();
    2362           status=3;
    2363 #endif
    2364           break;
    2365         }
    2366       }
    2367     }       
     2354        // no space - do we shuffle?
     2355        if (!getColumnSpaceIterateR(iRow, value, pivotRow)) {
     2356          // printf("Need more space for R\n");
     2357          numberInColumnPlus_.conditionalDelete();
     2358          numberInColumnPlusAddress_ = NULL;
     2359          setNoGotRCopy();
     2360          regionSparse->clear();
     2361#if ABC_SMALL < 0
     2362          abort();
     2363          status = 3;
     2364#endif
     2365          break;
     2366        }
     2367      }
     2368    }
    23682369  } else {
    23692370#endif
    2370     for (CoinBigIndex i = 0; i < numberNonZero; i++ ) {
     2371    for (CoinBigIndex i = 0; i < numberNonZero; i++) {
    23712372      CoinSimplexInt iRow = regionIndex[i];
    23722373      elementR[putR] = region[iRow];
    2373       region[iRow]=0.0;
     2374      region[iRow] = 0.0;
    23742375      indexRowR[putR] = iRow;
    23752376      putR++;
    2376     }       
    2377 #if ABC_SMALL<2
     2377    }
     2378#if ABC_SMALL < 2
    23782379  }
    23792380#endif
     
    25382539    }
    25392540  }
    2540 #endif 
     2541#endif
    25412542}
    25422543/* Replaces one Column to basis,
    25432544   partial update in vector */
    2544 void
    2545 CoinAbcTypeFactorization::replaceColumnPart3 ( const AbcSimplex * /*model*/,
    2546                                           CoinIndexedVector * regionSparse,
    2547                                                CoinIndexedVector * /*tableauColumn*/,
    2548                                                CoinIndexedVector * partialUpdate,
    2549                                           int pivotRow,
    2550 #ifdef ABC_LONG_FACTORIZATION
    2551                                                long
    2552 #endif
    2553                                           double alpha )
     2545void CoinAbcTypeFactorization::replaceColumnPart3(const AbcSimplex * /*model*/,
     2546  CoinIndexedVector *regionSparse,
     2547  CoinIndexedVector * /*tableauColumn*/,
     2548  CoinIndexedVector *partialUpdate,
     2549  int pivotRow,
     2550#ifdef ABC_LONG_FACTORIZATION
     2551  long
     2552#endif
     2553  double alpha)
    25542554{
    2555   assert (numberU_<=numberRowsExtra_);
     2555  assert(numberU_ <= numberRowsExtra_);
    25562556#ifndef ABC_USE_FUNCTION_POINTERS
    2557   CoinBigIndex * COIN_RESTRICT startColumnU = startColumnUAddress_;
    2558   CoinSimplexInt * COIN_RESTRICT numberInColumn = numberInColumnAddress_;
    2559   CoinFactorizationDouble * COIN_RESTRICT elementU = elementUAddress_;
    2560 #endif
    2561   CoinSimplexInt * COIN_RESTRICT indexRowR = indexRowRAddress_;
    2562 #if ABC_SMALL<2
    2563   CoinSimplexInt * COIN_RESTRICT numberInRowU = numberInRowAddress_;
    2564 #endif
    2565 #if ABC_SMALL<2
    2566   CoinSimplexInt * COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
    2567 #endif
    2568   CoinSimplexInt *  COIN_RESTRICT permuteLookup = pivotColumnAddress_;
    2569   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    2570  
     2557  CoinBigIndex *COIN_RESTRICT startColumnU = startColumnUAddress_;
     2558  CoinSimplexInt *COIN_RESTRICT numberInColumn = numberInColumnAddress_;
     2559  CoinFactorizationDouble *COIN_RESTRICT elementU = elementUAddress_;
     2560#endif
     2561  CoinSimplexInt *COIN_RESTRICT indexRowR = indexRowRAddress_;
     2562#if ABC_SMALL < 2
     2563  CoinSimplexInt *COIN_RESTRICT numberInRowU = numberInRowAddress_;
     2564#endif
     2565#if ABC_SMALL < 2
     2566  CoinSimplexInt *COIN_RESTRICT numberInColumnPlus = numberInColumnPlusAddress_;
     2567#endif
     2568  CoinSimplexInt *COIN_RESTRICT permuteLookup = pivotColumnAddress_;
     2569  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     2570
    25712571  CoinSimplexInt numberInColumnU2 = partialUpdate->getNumElements();
    25722572  //take out old pivot column
    2573  
     2573
    25742574#ifndef ABC_USE_FUNCTION_POINTERS
    25752575  totalElements_ -= numberInColumn[pivotRow];
    25762576  CoinBigIndex startU = startColumnU[numberRows_];
    2577   startColumnU[pivotRow]=startU;
    2578   CoinSimplexInt * COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
    2579   CoinFactorizationDouble * COIN_RESTRICT elementU2 = &elementUAddress_[startU];
    2580   numberInColumn[numberRows_]=numberInColumnU2;
    2581 #else
    2582   scatterStruct * COIN_RESTRICT scatter = scatterUColumn();
     2577  startColumnU[pivotRow] = startU;
     2578  CoinSimplexInt *COIN_RESTRICT indexU2 = &indexRowUAddress_[startU];
     2579  CoinFactorizationDouble *COIN_RESTRICT elementU2 = &elementUAddress_[startU];
     2580  numberInColumn[numberRows_] = numberInColumnU2;
     2581#else
     2582  scatterStruct *COIN_RESTRICT scatter = scatterUColumn();
    25832583#if ABC_USE_FUNCTION_POINTERS
    25842584  extern scatterUpdate AbcScatterLowSubtract[9];
    25852585  extern scatterUpdate AbcScatterHighSubtract[4];
    25862586#endif
    2587   CoinFactorizationDouble *  COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
     2587  CoinFactorizationDouble *COIN_RESTRICT elementUColumnPlus = elementUColumnPlusAddress_;
    25882588  CoinBigIndex startU = lastEntryByColumnUPlus_;
    25892589  totalElements_ -= scatter[pivotRow].number;
    25902590  CoinBigIndex saveStart = scatter[pivotRow].offset;
    25912591  CoinBigIndex saveEnd = scatter[pivotRow].number;
    2592   scatter[pivotRow].offset=startU;
    2593 
    2594   scatter[numberRows_].number=numberInColumnU2;
    2595   CoinFactorizationDouble * COIN_RESTRICT elementU2 = elementUColumnPlus+startU;
    2596   CoinSimplexInt * COIN_RESTRICT indexU2 = reinterpret_cast<CoinSimplexInt *>(elementU2+numberInColumnU2);
     2592  scatter[pivotRow].offset = startU;
     2593
     2594  scatter[numberRows_].number = numberInColumnU2;
     2595  CoinFactorizationDouble *COIN_RESTRICT elementU2 = elementUColumnPlus + startU;
     2596  CoinSimplexInt *COIN_RESTRICT indexU2 = reinterpret_cast< CoinSimplexInt * >(elementU2 + numberInColumnU2);
    25972597#endif
    25982598  // move
    2599   CoinSimplexInt * COIN_RESTRICT indexU2Save = partialUpdate->getIndices();
    2600   CoinFactorizationDouble * COIN_RESTRICT elementU2Save = denseVector(partialUpdate);
    2601   memcpy(indexU2,indexU2Save,numberInColumnU2*sizeof(CoinSimplexInt));
    2602   for (int i=0;i<numberInColumnU2;i++) {
    2603     int iRow=indexU2[i];
    2604     elementU2[i]=elementU2Save[iRow];
    2605     elementU2Save[iRow]=0.0;
     2599  CoinSimplexInt *COIN_RESTRICT indexU2Save = partialUpdate->getIndices();
     2600  CoinFactorizationDouble *COIN_RESTRICT elementU2Save = denseVector(partialUpdate);
     2601  memcpy(indexU2, indexU2Save, numberInColumnU2 * sizeof(CoinSimplexInt));
     2602  for (int i = 0; i < numberInColumnU2; i++) {
     2603    int iRow = indexU2[i];
     2604    elementU2[i] = elementU2Save[iRow];
     2605    elementU2Save[iRow] = 0.0;
    26062606  }
    26072607  //memcpy(elementU2,elementU2Save,numberInColumnU2*sizeof(double));
     
    26102610  //get entries in row (pivot not stored)
    26112611  CoinSimplexInt numberNonZero = 0;
    2612 #if ABC_SMALL<2
    2613   CoinSimplexInt * COIN_RESTRICT indexColumnU = indexColumnUAddress_;
     2612#if ABC_SMALL < 2
     2613  CoinSimplexInt *COIN_RESTRICT indexColumnU = indexColumnUAddress_;
    26142614#endif
    26152615#if CONVERTROW
    2616   CoinBigIndex * COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
    2617 #if CONVERTROW>2
    2618   CoinBigIndex * COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
    2619 #endif
    2620 #endif
    2621 #if ABC_SMALL<2
    2622   CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    2623   CoinBigIndex * COIN_RESTRICT startRowU = startRowUAddress_;
    2624 #endif
    2625   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
     2616  CoinBigIndex *COIN_RESTRICT convertRowToColumn = convertRowToColumnUAddress_;
     2617#if CONVERTROW > 2
     2618  CoinBigIndex *COIN_RESTRICT convertColumnToRow = convertColumnToRowUAddress_;
     2619#endif
     2620#endif
     2621#if ABC_SMALL < 2
     2622  CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowUAddress_;
     2623  CoinBigIndex *COIN_RESTRICT startRowU = startRowUAddress_;
     2624#endif
     2625  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    26262626  CoinFactorizationDouble pivotValue = 1.0;
    2627   CoinSimplexInt status=0;
     2627  CoinSimplexInt status = 0;
    26282628#ifndef ABC_USE_FUNCTION_POINTERS
    2629   CoinSimplexInt *  COIN_RESTRICT indexRowU = indexRowUAddress_;
    2630 #endif
    2631   CoinFactorizationDouble *  COIN_RESTRICT elementR = elementRAddress_;
     2629  CoinSimplexInt *COIN_RESTRICT indexRowU = indexRowUAddress_;
     2630#endif
     2631  CoinFactorizationDouble *COIN_RESTRICT elementR = elementRAddress_;
    26322632
    26332633#ifndef NDEBUG
     
    26362636#endif
    26372637#endif
    2638   int nInRow=9999999; // ? what if ABC_SMALL==0 or ABC_SMALL==1
    2639 #if ABC_SMALL<2
    2640   CoinBigIndex start=0;
    2641   CoinBigIndex end=0;
     2638  int nInRow = 9999999; // ? what if ABC_SMALL==0 or ABC_SMALL==1
     2639#if ABC_SMALL < 2
     2640  CoinBigIndex start = 0;
     2641  CoinBigIndex end = 0;
    26422642  if (gotUCopy()) {
    2643     start=startRowU[pivotRow];
    2644     nInRow=numberInRowU[pivotRow];
    2645     end= start + nInRow;
    2646   }
    2647 #endif
    2648   CoinFactorizationDouble * COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    2649   numberNonZero = regionSparse->getNumElements (  );
     2643    start = startRowU[pivotRow];
     2644    nInRow = numberInRowU[pivotRow];
     2645    end = start + nInRow;
     2646  }
     2647#endif
     2648  CoinFactorizationDouble *COIN_RESTRICT pivotRegion = pivotRegionAddress_;
     2649  numberNonZero = regionSparse->getNumElements();
    26502650  //CoinFactorizationDouble saveFromU = 0.0;
    26512651
    2652   instrument_do("CoinAbcFactorizationReplaceColumn",2*numberRows_+4*numberInColumnU2);
     2652  instrument_do("CoinAbcFactorizationReplaceColumn", 2 * numberRows_ + 4 * numberInColumnU2);
    26532653  pivotValue = 1.0 / alpha;
    2654 #if ABC_SMALL<2
     2654#if ABC_SMALL < 2
    26552655  if (gotUCopy()) {
    2656     for (CoinBigIndex i = start; i < end ; i ++ ) {
     2656    for (CoinBigIndex i = start; i < end; i++) {
    26572657      CoinSimplexInt jColumn = indexColumnU[i];
    26582658#ifndef ABC_USE_FUNCTION_POINTERS
     
    26632663      CoinBigIndex j;
    26642664      int number = numberInColumn[jColumn];
    2665       for (j=0;j<number;j++) {
    2666         if (indexRowU[j+startColumn]==pivotRow)
    2667           break;
    2668       }
    2669       assert (j<number);
     2665      for (j = 0; j < number; j++) {
     2666        if (indexRowU[j + startColumn] == pivotRow)
     2667          break;
     2668      }
     2669      assert(j < number);
    26702670      //assert (j==convertRowToColumn[i]); // temp
    26712671#endif
    26722672#ifdef CONVERTDEBUG
    2673       assert (fabs(elementU[j+startColumn]-elementRowU[i])<1.0e-4);
    2674 #endif     
     2673      assert(fabs(elementU[j + startColumn] - elementRowU[i]) < 1.0e-4);
     2674#endif
    26752675#else
    26762676      int number = scatter[jColumn].number;
    2677       CoinSimplexInt k = number-1;
    2678       scatter[jColumn].number=k;
    2679       CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+scatter[jColumn].offset;
    2680       CoinSimplexInt * COIN_RESTRICT indices = reinterpret_cast<CoinSimplexInt *>(area+k+1);
     2677      CoinSimplexInt k = number - 1;
     2678      scatter[jColumn].number = k;
     2679      CoinFactorizationDouble *COIN_RESTRICT area = elementUColumnPlus + scatter[jColumn].offset;
     2680      CoinSimplexInt *COIN_RESTRICT indices = reinterpret_cast< CoinSimplexInt * >(area + k + 1);
    26812681#if CONVERTROW
    26822682      CoinSimplexInt j = convertRowToColumn[i];
    26832683#else
    26842684      CoinSimplexInt j;
    2685       for (j=0;j<number;j++) {
    2686         if (indices[j]==pivotRow)
    2687           break;
    2688       }
    2689       assert (j<number);
     2685      for (j = 0; j < number; j++) {
     2686        if (indices[j] == pivotRow)
     2687          break;
     2688      }
     2689      assert(j < number);
    26902690      //assert (j==convertRowToColumn[i]); // temp
    26912691#endif
    26922692#ifdef CONVERTDEBUG
    2693       assert (fabs(area[j]-elementRowU[i])<1.0e-4);
    2694 #endif     
     2693      assert(fabs(area[j] - elementRowU[i]) < 1.0e-4);
     2694#endif
    26952695#endif
    26962696      // swap
    26972697#ifndef ABC_USE_FUNCTION_POINTERS
    2698       CoinSimplexInt k = numberInColumn[jColumn]-1;
    2699       numberInColumn[jColumn]=k;
    2700       CoinBigIndex k2 = k+startColumn;
    2701       int kRow2=indexRowU[k2];
    2702       indexRowU[j+startColumn]=kRow2;
    2703       CoinFactorizationDouble value2=elementU[k2];
    2704       elementU[j+startColumn]=value2;
    2705 #else
    2706       int kRow2=indices[k];
    2707       CoinFactorizationDouble value2=area[k];
     2698      CoinSimplexInt k = numberInColumn[jColumn] - 1;
     2699      numberInColumn[jColumn] = k;
     2700      CoinBigIndex k2 = k + startColumn;
     2701      int kRow2 = indexRowU[k2];
     2702      indexRowU[j + startColumn] = kRow2;
     2703      CoinFactorizationDouble value2 = elementU[k2];
     2704      elementU[j + startColumn] = value2;
     2705#else
     2706      int kRow2 = indices[k];
     2707      CoinFactorizationDouble value2 = area[k];
    27082708#if ABC_USE_FUNCTION_POINTERS
    2709       if (k<9) {
    2710         scatter[jColumn].functionPointer=AbcScatterLowSubtract[k];
     2709      if (k < 9) {
     2710        scatter[jColumn].functionPointer = AbcScatterLowSubtract[k];
    27112711      } else {
    2712         scatter[jColumn].functionPointer=AbcScatterHighSubtract[k&3];
     2712        scatter[jColumn].functionPointer = AbcScatterHighSubtract[k & 3];
    27132713      }
    27142714#endif
    27152715      // later more complicated swap to avoid move (don't think we can!)
    2716       indices[j]=kRow2;
    2717       area[j]=value2;
    2718       // move 
    2719       indices-=2;
    2720       for (int i=0;i<k;i++)
    2721         indices[i]=indices[i+2];
     2716      indices[j] = kRow2;
     2717      area[j] = value2;
     2718      // move
     2719      indices -= 2;
     2720      for (int i = 0; i < k; i++)
     2721        indices[i] = indices[i + 2];
    27222722#endif
    27232723      // move in row copy (slow - as other remark (but shouldn't need to))
    27242724      CoinBigIndex start2 = startRowU[kRow2];
    2725       int n=numberInRowU[kRow2];
     2725      int n = numberInRowU[kRow2];
    27262726      CoinBigIndex end2 = start2 + n;
    27272727#ifndef NDEBUG
    2728       bool found=false;
    2729 #endif
    2730       for (CoinBigIndex i2 = start2; i2 < end2 ; i2 ++ ) {
    2731         CoinSimplexInt iColumn2 = indexColumnU[i2];
    2732         if (jColumn==iColumn2) {
     2728      bool found = false;
     2729#endif
     2730      for (CoinBigIndex i2 = start2; i2 < end2; i2++) {
     2731        CoinSimplexInt iColumn2 = indexColumnU[i2];
     2732        if (jColumn == iColumn2) {
    27332733#if CONVERTROW
    2734           convertRowToColumn[i2] = j;
     2734          convertRowToColumn[i2] = j;
    27352735#endif
    27362736#ifndef NDEBUG
    2737           found=true;
    2738 #endif
    2739           break;
    2740         }
     2737          found = true;
     2738#endif
     2739          break;
     2740        }
    27412741      }
    27422742#ifndef NDEBUG
     
    27462746  } else {
    27472747#endif
    2748 #if ABC_SMALL>=0
    2749     assert(nInRow!=9999999); // ? what if ABC_SMALL==0 or ABC_SMALL==1
     2748#if ABC_SMALL >= 0
     2749    assert(nInRow != 9999999); // ? what if ABC_SMALL==0 or ABC_SMALL==1
    27502750    // no row copy
    2751     CoinBigIndex COIN_RESTRICT * deletedPosition = reinterpret_cast<CoinBigIndex *>(elementR+lengthR_);
    2752     CoinSimplexInt COIN_RESTRICT * deletedColumns = reinterpret_cast<CoinSimplexInt *>(indexRowR+lengthR_);
    2753     for (CoinSimplexInt i = 0; i < nInRow ; i ++ ) {
     2751    CoinBigIndex COIN_RESTRICT *deletedPosition = reinterpret_cast< CoinBigIndex * >(elementR + lengthR_);
     2752    CoinSimplexInt COIN_RESTRICT *deletedColumns = reinterpret_cast< CoinSimplexInt * >(indexRowR + lengthR_);
     2753    for (CoinSimplexInt i = 0; i < nInRow; i++) {
    27542754      CoinBigIndex j = deletedPosition[i];
    27552755      CoinSimplexInt jColumn = deletedColumns[i];
    27562756      // swap
    2757       CoinSimplexInt k = numberInColumn[jColumn]-1;
    2758       numberInColumn[jColumn]=k;
    2759       CoinBigIndex k2 = k+startColumnU[jColumn];
    2760       int kRow2=indexRowU[k2];
    2761       indexRowU[j]=kRow2;
    2762       CoinFactorizationDouble value2=elementU[k2];
    2763       elementU[j]=value2;
    2764     }
    2765 #endif
    2766 #if ABC_SMALL<2
    2767   }
    2768 #endif
    2769  #if ABC_SMALL<2
     2757      CoinSimplexInt k = numberInColumn[jColumn] - 1;
     2758      numberInColumn[jColumn] = k;
     2759      CoinBigIndex k2 = k + startColumnU[jColumn];
     2760      int kRow2 = indexRowU[k2];
     2761      indexRowU[j] = kRow2;
     2762      CoinFactorizationDouble value2 = elementU[k2];
     2763      elementU[j] = value2;
     2764    }
     2765#endif
     2766#if ABC_SMALL < 2
     2767  }
     2768#endif
     2769#if ABC_SMALL < 2
    27702770  if (gotUCopy()) {
    27712771    // Now zero out column of U
    27722772    //take out old pivot column
    27732773#ifdef ABC_USE_FUNCTION_POINTERS
    2774     CoinFactorizationDouble * COIN_RESTRICT elementU = elementUColumnPlus+saveStart;
    2775     saveStart=0;
    2776     CoinSimplexInt * COIN_RESTRICT indexRowU = reinterpret_cast<CoinSimplexInt *>(elementU+saveEnd);
    2777 #endif
    2778     for (CoinBigIndex i = saveStart; i < saveEnd ; i ++ ) {
     2774    CoinFactorizationDouble *COIN_RESTRICT elementU = elementUColumnPlus + saveStart;
     2775    saveStart = 0;
     2776    CoinSimplexInt *COIN_RESTRICT indexRowU = reinterpret_cast< CoinSimplexInt * >(elementU + saveEnd);
     2777#endif
     2778    for (CoinBigIndex i = saveStart; i < saveEnd; i++) {
    27792779      //elementU[i] = 0.0;
    27802780      // If too slow then reverse meaning of convertRowToColumn and use
    2781       int jRow=indexRowU[i];
     2781      int jRow = indexRowU[i];
    27822782      CoinBigIndex start = startRowU[jRow];
    27832783      CoinBigIndex end = start + numberInRowU[jRow];
    2784       for (CoinBigIndex j = start; j < end ; j ++ ) {
    2785         CoinSimplexInt jColumn = indexColumnU[j];
    2786         if (jColumn==pivotRow) {
    2787           // swap
    2788           numberInRowU[jRow]--;
    2789           elementRowU[j]=elementRowU[end-1];
     2784      for (CoinBigIndex j = start; j < end; j++) {
     2785        CoinSimplexInt jColumn = indexColumnU[j];
     2786        if (jColumn == pivotRow) {
     2787          // swap
     2788          numberInRowU[jRow]--;
     2789          elementRowU[j] = elementRowU[end - 1];
    27902790#if CONVERTROW
    2791           convertRowToColumn[j]=convertRowToColumn[end-1];
    2792 #endif
    2793           indexColumnU[j]=indexColumnU[end-1];
    2794           break;
    2795         }
    2796       }
    2797     }   
    2798   }
    2799 #endif   
     2791          convertRowToColumn[j] = convertRowToColumn[end - 1];
     2792#endif
     2793          indexColumnU[j] = indexColumnU[end - 1];
     2794          break;
     2795        }
     2796      }
     2797    }
     2798  }
     2799#endif
    28002800  //zero out pivot Row (before or after?)
    28012801  //add to R
    2802   CoinBigIndex * COIN_RESTRICT startColumnR = startColumnRAddress_;
     2802  CoinBigIndex *COIN_RESTRICT startColumnR = startColumnRAddress_;
    28032803  CoinBigIndex putR = lengthR_;
    28042804  CoinSimplexInt number = numberR_;
    2805  
    2806   startColumnR[number] = putR;  //for luck and first time
     2805
     2806  startColumnR[number] = putR; //for luck and first time
    28072807  number++;
    28082808  //assert (startColumnR+number-firstCountAddress_<( CoinMax(5*numberRows_,2*numberRows_+2*maximumPivots_)+2));
     
    28122812  totalElements_ += numberNonZero;
    28132813
    2814 #if ABC_SMALL<2
    2815   CoinSimplexInt *  COIN_RESTRICT nextRow=NULL;
    2816   CoinSimplexInt *  COIN_RESTRICT lastRow=NULL;
     2814#if ABC_SMALL < 2
     2815  CoinSimplexInt *COIN_RESTRICT nextRow = NULL;
     2816  CoinSimplexInt *COIN_RESTRICT lastRow = NULL;
    28172817  CoinSimplexInt next;
    28182818  CoinSimplexInt last;
     
    28232823    next = nextRow[pivotRow];
    28242824    last = lastRow[pivotRow];
    2825    
     2825
    28262826    nextRow[last] = next;
    28272827    lastRow[next] = last;
    2828     numberInRowU[pivotRow]=0;
    2829   }
    2830 #endif 
     2828    numberInRowU[pivotRow] = 0;
     2829  }
     2830#endif
    28312831  //put in pivot
    28322832  //add row counts
    2833  
     2833
    28342834  int n = 0;
    2835   for (CoinSimplexInt i = 0; i < numberInColumnU2; i++ ) {
     2835  for (CoinSimplexInt i = 0; i < numberInColumnU2; i++) {
    28362836    CoinSimplexInt iRow = indexU2[i];
    2837     CoinFactorizationDouble value=elementU2[i];
    2838     assert (value);
    2839     if ( !TEST_LESS_THAN_TOLERANCE(value ) ) {
    2840       if ( iRow != pivotRow ) {
    2841         //modify by pivot
    2842         CoinFactorizationDouble value2 = value*pivotValue;
    2843         indexU2[n]=iRow;
    2844         elementU2[n++] = value2;
    2845 #if ABC_SMALL<2
    2846         if (gotUCopy()) {
    2847           CoinSimplexInt next = nextRow[iRow];
    2848           CoinSimplexInt iNumberInRow = numberInRowU[iRow];
    2849           CoinBigIndex space;
    2850           CoinBigIndex put = startRowU[iRow] + iNumberInRow;
    2851           space = startRowU[next] - put;
    2852           if ( space <= 0 ) {
    2853             getRowSpaceIterate ( iRow, iNumberInRow + 4 );
    2854             put = startRowU[iRow] + iNumberInRow;
    2855           } else if (next==numberRows_) {
    2856             lastEntryByRowU_=put+1;
    2857           }     
    2858           indexColumnU[put] = pivotRow;
     2837    CoinFactorizationDouble value = elementU2[i];
     2838    assert(value);
     2839    if (!TEST_LESS_THAN_TOLERANCE(value)) {
     2840      if (iRow != pivotRow) {
     2841        //modify by pivot
     2842        CoinFactorizationDouble value2 = value * pivotValue;
     2843        indexU2[n] = iRow;
     2844        elementU2[n++] = value2;
     2845#if ABC_SMALL < 2
     2846        if (gotUCopy()) {
     2847          CoinSimplexInt next = nextRow[iRow];
     2848          CoinSimplexInt iNumberInRow = numberInRowU[iRow];
     2849          CoinBigIndex space;
     2850          CoinBigIndex put = startRowU[iRow] + iNumberInRow;
     2851          space = startRowU[next] - put;
     2852          if (space <= 0) {
     2853            getRowSpaceIterate(iRow, iNumberInRow + 4);
     2854            put = startRowU[iRow] + iNumberInRow;
     2855          } else if (next == numberRows_) {
     2856            lastEntryByRowU_ = put + 1;
     2857          }
     2858          indexColumnU[put] = pivotRow;
    28592859#if CONVERTROW
    2860           convertRowToColumn[put] = i;
    2861 #endif
    2862           elementRowU[put] = value2;
    2863           numberInRowU[iRow] = iNumberInRow + 1;
    2864         }
     2860          convertRowToColumn[put] = i;
     2861#endif
     2862          elementRowU[put] = value2;
     2863          numberInRowU[iRow] = iNumberInRow + 1;
     2864        }
    28652865#endif
    28662866      } else {
    2867         //swap and save
    2868         indexU2[i]=indexU2[numberInColumnU2-1];
    2869         elementU2[i] = elementU2[numberInColumnU2-1];
    2870         numberInColumnU2--;
    2871         i--;
     2867        //swap and save
     2868        indexU2[i] = indexU2[numberInColumnU2 - 1];
     2869        elementU2[i] = elementU2[numberInColumnU2 - 1];
     2870        numberInColumnU2--;
     2871        i--;
    28722872      }
    28732873    } else {
    28742874      // swap
    2875       indexU2[i]=indexU2[numberInColumnU2-1];
    2876       elementU2[i] = elementU2[numberInColumnU2-1];
     2875      indexU2[i] = indexU2[numberInColumnU2 - 1];
     2876      elementU2[i] = elementU2[numberInColumnU2 - 1];
    28772877      numberInColumnU2--;
    28782878      i--;
    2879     }       
    2880   }       
    2881   numberInColumnU2=n;
     2879    }
     2880  }
     2881  numberInColumnU2 = n;
    28822882  //do permute
    28832883  permuteAddress_[numberRowsExtra_] = pivotRow;
     
    28862886
    28872887  //pivotColumnAddress_[pivotRow] = numberRowsExtra_;
    2888  
     2888
    28892889  numberU_++;
    28902890
    2891 #if ABC_SMALL<2
     2891#if ABC_SMALL < 2
    28922892  if (gotUCopy()) {
    28932893    //in at end
     
    29012901#endif
    29022902#ifndef ABC_USE_FUNCTION_POINTERS
    2903   numberInColumn[pivotRow]=numberInColumnU2;
     2903  numberInColumn[pivotRow] = numberInColumnU2;
    29042904#else
    29052905#if ABC_USE_FUNCTION_POINTERS
    2906   if (numberInColumnU2<9) {
    2907     scatter[pivotRow].functionPointer=AbcScatterLowSubtract[numberInColumnU2];
     2906  if (numberInColumnU2 < 9) {
     2907    scatter[pivotRow].functionPointer = AbcScatterLowSubtract[numberInColumnU2];
    29082908  } else {
    2909     scatter[pivotRow].functionPointer=AbcScatterHighSubtract[numberInColumnU2&3];
    2910   }
    2911 #endif
    2912   assert(scatter[pivotRow].offset==lastEntryByColumnUPlus_);
     2909    scatter[pivotRow].functionPointer = AbcScatterHighSubtract[numberInColumnU2 & 3];
     2910  }
     2911#endif
     2912  assert(scatter[pivotRow].offset == lastEntryByColumnUPlus_);
    29132913  //CoinFactorizationDouble * COIN_RESTRICT area = elementUColumnPlus+lastEntryByColumnUPlus_;
    29142914  //CoinSimplexInt * COIN_RESTRICT indices = reinterpret_cast<CoinSimplexInt *>(area+numberInColumnU2);
    2915   if (numberInColumnU2<scatter[numberRows_].number) {
    2916     int offset=2*(scatter[numberRows_].number-numberInColumnU2);
     2915  if (numberInColumnU2 < scatter[numberRows_].number) {
     2916    int offset = 2 * (scatter[numberRows_].number - numberInColumnU2);
    29172917    indexU2 -= offset;
    29182918    //assert(indexU2-reinterpret_cast<int*>(area)>=0);
    2919     for (int i=0;i<numberInColumnU2;i++)
    2920       indexU2[i]=indexU2[i+offset];
    2921   }
    2922   scatter[pivotRow].number=numberInColumnU2;
     2919    for (int i = 0; i < numberInColumnU2; i++)
     2920      indexU2[i] = indexU2[i + offset];
     2921  }
     2922  scatter[pivotRow].number = numberInColumnU2;
    29232923  //CoinAbcMemcpy(indices,indexU2,numberInColumnU2);
    29242924  //CoinAbcMemcpy(area,elementU2,numberInColumnU2);
    2925   lastEntryByColumnUPlus_ += (3*numberInColumnU2+1)>>1;
     2925  lastEntryByColumnUPlus_ += (3 * numberInColumnU2 + 1) >> 1;
    29262926#endif
    29272927  totalElements_ += numberInColumnU2;
    29282928  lengthU_ += numberInColumnU2;
    2929 #if ABC_SMALL<2
    2930   CoinSimplexInt * COIN_RESTRICT nextColumn = nextColumnAddress_;
    2931   CoinSimplexInt * COIN_RESTRICT lastColumn = lastColumnAddress_;
     2929#if ABC_SMALL < 2
     2930  CoinSimplexInt *COIN_RESTRICT nextColumn = nextColumnAddress_;
     2931  CoinSimplexInt *COIN_RESTRICT lastColumn = lastColumnAddress_;
    29322932  if (gotRCopy()) {
    29332933    //column in at beginning (as empty)
     
    29512951  pivotRegion[pivotRow] = pivotValue;
    29522952#ifndef ABC_USE_FUNCTION_POINTERS
    2953   maximumU_ = CoinMax(maximumU_,startU+numberInColumnU2);
    2954 #else
    2955   maximumU_ = CoinMax(maximumU_,lastEntryByColumnUPlus_);
    2956 #endif
    2957   permuteLookup[pivotRow]=numberRowsExtra_;
    2958   permuteLookup[numberRowsExtra_]=pivotRow;
     2953  maximumU_ = CoinMax(maximumU_, startU + numberInColumnU2);
     2954#else
     2955  maximumU_ = CoinMax(maximumU_, lastEntryByColumnUPlus_);
     2956#endif
     2957  permuteLookup[pivotRow] = numberRowsExtra_;
     2958  permuteLookup[numberRowsExtra_] = pivotRow;
    29592959  //pivotColumnAddress_[pivotRow]=numberRowsExtra_;
    29602960  //pivotColumnAddress_[numberRowsExtra_]=pivotRow;
    2961   assert (pivotRow<numberRows_);
     2961  assert(pivotRow < numberRows_);
    29622962  // out of chain
    2963   CoinSimplexInt iLast=pivotLinkedBackwardsAddress_[pivotRow];
    2964   CoinSimplexInt iNext=pivotLinkedForwardsAddress_[pivotRow];
    2965   assert (pivotRow==pivotLinkedForwardsAddress_[iLast]);
    2966   assert (pivotRow==pivotLinkedBackwardsAddress_[iNext]);
    2967   pivotLinkedForwardsAddress_[iLast]=iNext;
    2968   pivotLinkedBackwardsAddress_[iNext]=iLast;
    2969   if (pivotRow==lastSlack_) {
     2963  CoinSimplexInt iLast = pivotLinkedBackwardsAddress_[pivotRow];
     2964  CoinSimplexInt iNext = pivotLinkedForwardsAddress_[pivotRow];
     2965  assert(pivotRow == pivotLinkedForwardsAddress_[iLast]);
     2966  assert(pivotRow == pivotLinkedBackwardsAddress_[iNext]);
     2967  pivotLinkedForwardsAddress_[iLast] = iNext;
     2968  pivotLinkedBackwardsAddress_[iNext] = iLast;
     2969  if (pivotRow == lastSlack_) {
    29702970    lastSlack_ = iLast;
    29712971  }
    2972   iLast=pivotLinkedBackwardsAddress_[numberRows_];
    2973   assert (numberRows_==pivotLinkedForwardsAddress_[iLast]);
    2974   pivotLinkedForwardsAddress_[iLast]=pivotRow;
    2975   pivotLinkedBackwardsAddress_[pivotRow]=iLast;
    2976   pivotLinkedBackwardsAddress_[numberRows_]=pivotRow;
    2977   pivotLinkedForwardsAddress_[pivotRow]=numberRows_;
    2978   assert (numberRows_>pivotLinkedForwardsAddress_[-1]);
    2979   assert (pivotLinkedBackwardsAddress_[numberRows_]>=0);
     2972  iLast = pivotLinkedBackwardsAddress_[numberRows_];
     2973  assert(numberRows_ == pivotLinkedForwardsAddress_[iLast]);
     2974  pivotLinkedForwardsAddress_[iLast] = pivotRow;
     2975  pivotLinkedBackwardsAddress_[pivotRow] = iLast;
     2976  pivotLinkedBackwardsAddress_[numberRows_] = pivotRow;
     2977  pivotLinkedForwardsAddress_[pivotRow] = numberRows_;
     2978  assert(numberRows_ > pivotLinkedForwardsAddress_[-1]);
     2979  assert(pivotLinkedBackwardsAddress_[numberRows_] >= 0);
    29802980  numberRowsExtra_++;
    29812981  numberGoodU_++;
    29822982  numberPivots_++;
    2983   if ( numberRowsExtra_ > numberRows_ + 50 ) {
     2983  if (numberRowsExtra_ > numberRows_ + 50) {
    29842984    CoinBigIndex extra = factorElements_ >> 1;
    2985    
    2986     if ( numberRowsExtra_ > numberRows_ + 100 + numberRows_ / 500 ) {
    2987       if ( extra < 2 * numberRows_ ) {
     2985
     2986    if (numberRowsExtra_ > numberRows_ + 100 + numberRows_ / 500) {
     2987      if (extra < 2 * numberRows_) {
    29882988        extra = 2 * numberRows_;
    2989       }       
     2989      }
    29902990    } else {
    2991       if ( extra < 5 * numberRows_ ) {
     2991      if (extra < 5 * numberRows_) {
    29922992        extra = 5 * numberRows_;
    2993       }       
    2994     }       
     2993      }
     2994    }
    29952995    CoinBigIndex added = totalElements_ - factorElements_;
    2996    
    2997     if ( added > extra && added > ( factorElements_ ) << 1 && !status
    2998          && 3*totalElements_ > 2*(lengthAreaU_+lengthAreaL_)) {
     2996
     2997    if (added > extra && added > (factorElements_) << 1 && !status
     2998      && 3 * totalElements_ > 2 * (lengthAreaU_ + lengthAreaL_)) {
    29992999      status = 3;
    3000       if ( messageLevel_ & 4 ) {
    3001         std::cout << "Factorization has "<< totalElements_
    3002                   << ", basis had " << factorElements_ <<std::endl;
    3003       }
    3004     }       
    3005   }
    3006 #if ABC_SMALL<2
    3007   if (gotRCopy()&&status<2) {
     3000      if (messageLevel_ & 4) {
     3001        std::cout << "Factorization has " << totalElements_
     3002                  << ", basis had " << factorElements_ << std::endl;
     3003      }
     3004    }
     3005  }
     3006#if ABC_SMALL < 2
     3007  if (gotRCopy() && status < 2) {
    30083008    //if (numberInColumnPlus&&status<2) {
    30093009    // we are going to put another copy of R in R
    3010     CoinFactorizationDouble * COIN_RESTRICT elementRR = elementRAddress_ + lengthAreaR_;
    3011     CoinSimplexInt * COIN_RESTRICT indexRowRR = indexRowRAddress_ + lengthAreaR_;
    3012     CoinBigIndex * COIN_RESTRICT startRR = startColumnRAddress_+maximumPivots_+1;
    3013     CoinSimplexInt pivotRow = numberRowsExtra_-1;
    3014     for (CoinBigIndex i = 0; i < numberNonZero; i++ ) {
     3010    CoinFactorizationDouble *COIN_RESTRICT elementRR = elementRAddress_ + lengthAreaR_;
     3011    CoinSimplexInt *COIN_RESTRICT indexRowRR = indexRowRAddress_ + lengthAreaR_;
     3012    CoinBigIndex *COIN_RESTRICT startRR = startColumnRAddress_ + maximumPivots_ + 1;
     3013    CoinSimplexInt pivotRow = numberRowsExtra_ - 1;
     3014    for (CoinBigIndex i = 0; i < numberNonZero; i++) {
    30153015      CoinSimplexInt jRow = regionIndex[i];
    3016       CoinFactorizationDouble value=region[jRow];
     3016      CoinFactorizationDouble value = region[jRow];
    30173017      elementR[putR] = value;
    30183018      indexRowR[putR] = jRow;
    30193019      putR++;
    3020       region[jRow]=0.0;
     3020      region[jRow] = 0.0;
    30213021      int iRow = permuteLookup[jRow];
    30223022      next = nextColumn[iRow];
    30233023      CoinBigIndex space;
    3024       if (next!=maximumRowsExtra_)
    3025         space = startRR[next]-startRR[iRow];
     3024      if (next != maximumRowsExtra_)
     3025        space = startRR[next] - startRR[iRow];
    30263026      else
    3027         space = lengthAreaR_-startRR[iRow];
     3027        space = lengthAreaR_ - startRR[iRow];
    30283028      CoinSimplexInt numberInR = numberInColumnPlus[iRow];
    3029       if (space>numberInR) {
    3030         // there is space
    3031         CoinBigIndex  put=startRR[iRow]+numberInR;
    3032         numberInColumnPlus[iRow]=numberInR+1;
    3033         indexRowRR[put]=pivotRow;
    3034         elementRR[put]=value;
    3035         //add 4 for luck
    3036         if (next==maximumRowsExtra_)
    3037           startRR[maximumRowsExtra_] = CoinMin(static_cast<CoinBigIndex> (put + 4) ,lengthAreaR_);
     3029      if (space > numberInR) {
     3030        // there is space
     3031        CoinBigIndex put = startRR[iRow] + numberInR;
     3032        numberInColumnPlus[iRow] = numberInR + 1;
     3033        indexRowRR[put] = pivotRow;
     3034        elementRR[put] = value;
     3035        //add 4 for luck
     3036        if (next == maximumRowsExtra_)
     3037          startRR[maximumRowsExtra_] = CoinMin(static_cast< CoinBigIndex >(put + 4), lengthAreaR_);
    30383038      } else {
    3039         // no space - do we shuffle?
    3040         if (!getColumnSpaceIterateR(iRow,value,pivotRow)) {
    3041           // printf("Need more space for R\n");
    3042           numberInColumnPlus_.conditionalDelete();
    3043           numberInColumnPlusAddress_=NULL;
    3044           setNoGotRCopy();
    3045           regionSparse->clear();
    3046 #if ABC_SMALL<0
    3047           abort();
    3048           status=3;
    3049 #endif
    3050           break;
    3051         }
    3052       }
    3053     }       
     3039        // no space - do we shuffle?
     3040        if (!getColumnSpaceIterateR(iRow, value, pivotRow)) {
     3041          // printf("Need more space for R\n");
     3042          numberInColumnPlus_.conditionalDelete();
     3043          numberInColumnPlusAddress_ = NULL;
     3044          setNoGotRCopy();
     3045          regionSparse->clear();
     3046#if ABC_SMALL < 0
     3047          abort();
     3048          status = 3;
     3049#endif
     3050          break;
     3051        }
     3052      }
     3053    }
    30543054  } else {
    30553055#endif
    3056     for (CoinBigIndex i = 0; i < numberNonZero; i++ ) {
     3056    for (CoinBigIndex i = 0; i < numberNonZero; i++) {
    30573057      CoinSimplexInt iRow = regionIndex[i];
    30583058      elementR[putR] = region[iRow];
    3059       region[iRow]=0.0;
     3059      region[iRow] = 0.0;
    30603060      indexRowR[putR] = iRow;
    30613061      putR++;
    3062     }       
    3063 #if ABC_SMALL<2
     3062    }
     3063#if ABC_SMALL < 2
    30643064  }
    30653065#endif
     
    31163116  regionSparse->setNumElements(0);
    31173117}
    3118 #if ABC_SMALL>=0
     3118#if ABC_SMALL >= 0
    31193119/* Combines BtranU and store which elements are to be deleted
    31203120 */
    3121 int
    3122 CoinAbcTypeFactorization::replaceColumnU ( CoinIndexedVector * regionSparse,
    3123                                    CoinBigIndex * deletedPosition,
    3124                                    CoinSimplexInt * deletedColumns,
    3125                                    CoinSimplexInt pivotRow)
     3121int CoinAbcTypeFactorization::replaceColumnU(CoinIndexedVector *regionSparse,
     3122  CoinBigIndex *deletedPosition,
     3123  CoinSimplexInt *deletedColumns,
     3124  CoinSimplexInt pivotRow)
    31263125{
    3127   instrument_start("CoinAbcFactorizationReplaceColumnU",numberRows_);
    3128   CoinSimplexDouble * COIN_RESTRICT region = regionSparse->denseVector();
    3129   int * COIN_RESTRICT regionIndex = regionSparse->getIndices();
     3126  instrument_start("CoinAbcFactorizationReplaceColumnU", numberRows_);
     3127  CoinSimplexDouble *COIN_RESTRICT region = regionSparse->denseVector();
     3128  int *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    31303129  const CoinBigIndex COIN_RESTRICT *startColumn = startColumnUAddress_;
    31313130  const CoinSimplexInt COIN_RESTRICT *indexRow = indexRowUAddress_;
     
    31333132  int numberNonZero = 0;
    31343133  const CoinSimplexInt COIN_RESTRICT *numberInColumn = numberInColumnAddress_;
    3135   int nPut=0;
    3136   const CoinSimplexInt *  COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
    3137   CoinSimplexInt jRow=pivotLinked[-1];
    3138   while (jRow!=numberRows_) {
    3139     assert (!region[jRow]);
     3134  int nPut = 0;
     3135  const CoinSimplexInt *COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
     3136  CoinSimplexInt jRow = pivotLinked[-1];
     3137  while (jRow != numberRows_) {
     3138    assert(!region[jRow]);
    31403139    CoinFactorizationDouble pivotValue = 0.0;
    31413140    instrument_add(numberInColumn[jRow]);
    3142     for (CoinBigIndex  j= startColumn[jRow] ;
    3143          j < startColumn[jRow]+numberInColumn[jRow]; j++ ) {
     3141    for (CoinBigIndex j = startColumn[jRow];
     3142         j < startColumn[jRow] + numberInColumn[jRow]; j++) {
    31443143      int iRow = indexRow[j];
    31453144      CoinFactorizationDouble value = element[j];
    3146       if (iRow!=pivotRow) {
    3147         pivotValue -= value * region[iRow];
     3145      if (iRow != pivotRow) {
     3146        pivotValue -= value * region[iRow];
    31483147      } else {
    3149         assert (!region[iRow]);
    3150         pivotValue += value;
    3151         deletedColumns[nPut]=jRow;
    3152         deletedPosition[nPut++]=j;
    3153       }
    3154     }       
    3155     if ( !TEST_LESS_THAN_TOLERANCE_REGISTER( pivotValue ) ) {
     3148        assert(!region[iRow]);
     3149        pivotValue += value;
     3150        deletedColumns[nPut] = jRow;
     3151        deletedPosition[nPut++] = j;
     3152      }
     3153    }
     3154    if (!TEST_LESS_THAN_TOLERANCE_REGISTER(pivotValue)) {
    31563155      regionIndex[numberNonZero++] = jRow;
    31573156      region[jRow] = pivotValue;
     
    31593158      region[jRow] = 0;
    31603159    }
    3161     jRow=pivotLinked[jRow];
     3160    jRow = pivotLinked[jRow];
    31623161  }
    31633162  regionSparse->setNumElements(numberNonZero);
     
    31673166/* Updates part of column transpose (BTRANU) by column
    31683167   assumes index is sorted i.e. region is correct */
    3169 void
    3170 CoinAbcTypeFactorization::updateColumnTransposeUByColumn ( CoinIndexedVector * regionSparse,
    3171                                                    CoinSimplexInt smallestIndex) const
     3168void CoinAbcTypeFactorization::updateColumnTransposeUByColumn(CoinIndexedVector *regionSparse,
     3169  CoinSimplexInt smallestIndex) const
    31723170{
    3173   instrument_start("CoinAbcFactorizationUpdateTransposeUByColumn",numberRows_);
    3174   CoinSimplexDouble * COIN_RESTRICT region = regionSparse->denseVector();
     3171  instrument_start("CoinAbcFactorizationUpdateTransposeUByColumn", numberRows_);
     3172  CoinSimplexDouble *COIN_RESTRICT region = regionSparse->denseVector();
    31753173  const CoinBigIndex COIN_RESTRICT *startColumn = startColumnUAddress_;
    31763174  const CoinSimplexInt COIN_RESTRICT *indexRow = indexRowUAddress_;
    31773175  const CoinFactorizationDouble COIN_RESTRICT *element = elementUAddress_;
    3178 #if ABC_SMALL<3
     3176#if ABC_SMALL < 3
    31793177  int numberNonZero = 0;
    3180   int * COIN_RESTRICT regionIndex = regionSparse->getIndices();
     3178  int *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    31813179#endif
    31823180  const CoinSimplexInt COIN_RESTRICT *numberInColumn = numberInColumnAddress_;
    31833181  //const CoinFactorizationDouble COIN_RESTRICT *pivotRegion = pivotRegionAddress_;
    3184   const CoinSimplexInt *  COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
    3185   CoinSimplexInt jRow=smallestIndex;
    3186   while (jRow!=numberRows_) {
     3182  const CoinSimplexInt *COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
     3183  CoinSimplexInt jRow = smallestIndex;
     3184  while (jRow != numberRows_) {
    31873185    CoinFactorizationDouble pivotValue = region[jRow];
    3188     CoinBigIndex start=startColumn[jRow];
     3186    CoinBigIndex start = startColumn[jRow];
    31893187    instrument_add(numberInColumn[jRow]);
    31903188#ifndef INLINE_IT2
    3191     for (CoinBigIndex  j= start ; j < start+numberInColumn[jRow]; j++ ) {
     3189    for (CoinBigIndex j = start; j < start + numberInColumn[jRow]; j++) {
    31923190      int iRow = indexRow[j];
    31933191      CoinFactorizationDouble value = element[j];
     
    31953193    }
    31963194#else
    3197     pivotValue+=CoinAbcGatherUpdate(numberInColumn[jRow],element+start,indexRow+start,region);
    3198 #endif       
    3199 #if ABC_SMALL<3
    3200     if ( !TEST_LESS_THAN_TOLERANCE_REGISTER( pivotValue )  ) {
     3195    pivotValue += CoinAbcGatherUpdate(numberInColumn[jRow], element + start, indexRow + start, region);
     3196#endif
     3197#if ABC_SMALL < 3
     3198    if (!TEST_LESS_THAN_TOLERANCE_REGISTER(pivotValue)) {
    32013199      regionIndex[numberNonZero++] = jRow;
    32023200      region[jRow] = pivotValue;
     
    32053203    }
    32063204#else
    3207       region[jRow] = pivotValue;
    3208 #endif       
    3209     jRow=pivotLinked[jRow];
    3210   }
    3211 #if ABC_SMALL<3
     3205    region[jRow] = pivotValue;
     3206#endif
     3207    jRow = pivotLinked[jRow];
     3208  }
     3209#if ABC_SMALL < 3
    32123210  regionSparse->setNumElements(numberNonZero);
    32133211#endif
     
    32173215//  updateColumnTranspose.  Updates one column transpose (BTRAN)
    32183216CoinSimplexInt
    3219 CoinAbcTypeFactorization::updateColumnTranspose ( CoinIndexedVector & regionSparse) const
     3217CoinAbcTypeFactorization::updateColumnTranspose(CoinIndexedVector &regionSparse) const
    32203218{
    3221   toLongArray(&regionSparse,0);
    3222   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    3223   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse.getIndices();
     3219  toLongArray(&regionSparse, 0);
     3220  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     3221  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse.getIndices();
    32243222  CoinSimplexInt numberNonZero = regionSparse.getNumElements();
    3225   const CoinFactorizationDouble * COIN_RESTRICT pivotRegion = pivotRegionAddress_;
     3223  const CoinFactorizationDouble *COIN_RESTRICT pivotRegion = pivotRegionAddress_;
    32263224
    32273225#ifndef ABC_ORDERED_FACTORIZATION
    32283226  // can I move this
    32293227#ifndef INLINE_IT3
    3230   for (CoinSimplexInt i = 0; i < numberNonZero; i ++ ) {
     3228  for (CoinSimplexInt i = 0; i < numberNonZero; i++) {
    32313229    CoinSimplexInt iRow = regionIndex[i];
    32323230    CoinSimplexDouble value = region[iRow];
     
    32353233  }
    32363234#else
    3237   multiplyIndexed(numberNonZero,pivotRegion,
    3238                   regionIndex,region);
     3235  multiplyIndexed(numberNonZero, pivotRegion,
     3236    regionIndex, region);
    32393237#endif
    32403238#else
     
    32453243  // Apply pivot region - could be combined for speed
    32463244  // Can only combine/move inside vector for sparse
    3247   CoinSimplexInt smallestIndex=pivotLinkedForwardsAddress_[-1];
    3248 #if ABC_SMALL<2
     3245  CoinSimplexInt smallestIndex = pivotLinkedForwardsAddress_[-1];
     3246#if ABC_SMALL < 2
    32493247  // copy of code inside transposeU
    3250   bool goSparse=false;
     3248  bool goSparse = false;
    32513249#else
    32523250#define goSparse false
    32533251#endif
    3254 #if ABC_SMALL<2
     3252#if ABC_SMALL < 2
    32553253  // Guess at number at end
    32563254  if (gotUCopy()) {
    3257     assert (btranAverageAfterU_);
    3258     CoinSimplexInt newNumber =
    3259       static_cast<CoinSimplexInt> (numberNonZero*btranAverageAfterU_*twiddleBtranFactor1());
    3260     if (newNumber< sparseThreshold_)
     3255    assert(btranAverageAfterU_);
     3256    CoinSimplexInt newNumber = static_cast< CoinSimplexInt >(numberNonZero * btranAverageAfterU_ * twiddleBtranFactor1());
     3257    if (newNumber < sparseThreshold_)
    32613258      goSparse = true;
    32623259  }
     
    32953292  }
    32963293#endif
    3297   if (numberNonZero<40&&(numberNonZero<<4)<numberRows_&&!goSparse) {
    3298     CoinSimplexInt *  COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
    3299     CoinSimplexInt smallest=numberRowsExtra_;
    3300     for (CoinSimplexInt j = 0; j < numberNonZero; j++ ) {
     3294  if (numberNonZero < 40 && (numberNonZero << 4) < numberRows_ && !goSparse) {
     3295    CoinSimplexInt *COIN_RESTRICT pivotRowForward = pivotColumnAddress_;
     3296    CoinSimplexInt smallest = numberRowsExtra_;
     3297    for (CoinSimplexInt j = 0; j < numberNonZero; j++) {
    33013298      CoinSimplexInt iRow = regionIndex[j];
    3302       if (pivotRowForward[iRow]<smallest) {
    3303         smallest=pivotRowForward[iRow];
    3304         smallestIndex=iRow;
    3305       }
    3306     }
    3307   }
    3308   updateColumnTransposeU ( &regionSparse,smallestIndex
    3309 #if ABC_SMALL<2
    3310                   ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
     3299      if (pivotRowForward[iRow] < smallest) {
     3300        smallest = pivotRowForward[iRow];
     3301        smallestIndex = iRow;
     3302      }
     3303    }
     3304  }
     3305  updateColumnTransposeU(&regionSparse, smallestIndex
     3306#if ABC_SMALL < 2
     3307    ,
     3308    reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
    33113309#endif
    33123310#if ABC_PARALLEL
    3313                     ,0
    3314 #endif
    3315                            );
     3311      ,
     3312    0
     3313#endif
     3314  );
    33163315  //row bits here
    3317   updateColumnTransposeR ( &regionSparse
    3318 #if ABC_SMALL<2
    3319                   ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
    3320 #endif
    3321                            );
     3316  updateColumnTransposeR(&regionSparse
     3317#if ABC_SMALL < 2
     3318    ,
     3319    reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
     3320#endif
     3321  );
    33223322  //  ******* L
    3323   updateColumnTransposeL ( &regionSparse
    3324 #if ABC_SMALL<2
    3325                   ,reinterpret_cast<CoinAbcStatistics &>(btranCountInput_)
     3323  updateColumnTransposeL(&regionSparse
     3324#if ABC_SMALL < 2
     3325    ,
     3326    reinterpret_cast< CoinAbcStatistics & >(btranCountInput_)
    33263327#endif
    33273328#if ABC_PARALLEL
    3328                                       ,0
    3329 #endif
    3330                            );
    3331 #if ABC_SMALL<3
     3329      ,
     3330    0
     3331#endif
     3332  );
     3333#if ABC_SMALL < 3
    33323334#ifdef ABC_ORDERED_FACTORIZATION
    33333335  // Permute out for Btran
     
    33373339  regionSparse.checkClean();
    33383340#endif
    3339   numberNonZero = regionSparse.getNumElements (  );
    3340 #else
    3341   numberNonZero=0;
    3342   for (CoinSimplexInt i=0;i<numberRows_;i++) {
    3343     CoinExponent expValue=ABC_EXPONENT(region[i]);
     3341  numberNonZero = regionSparse.getNumElements();
     3342#else
     3343  numberNonZero = 0;
     3344  for (CoinSimplexInt i = 0; i < numberRows_; i++) {
     3345    CoinExponent expValue = ABC_EXPONENT(region[i]);
    33443346    if (expValue) {
    33453347      if (!TEST_EXPONENT_LESS_THAN_TOLERANCE(expValue)) {
    3346         regionIndex[numberNonZero++]=i;
     3348        regionIndex[numberNonZero++] = i;
    33473349      } else {
    3348         region[i]=0.0;
     3350        region[i] = 0.0;
    33493351      }
    33503352    }
     
    33523354  regionSparse.setNumElements(numberNonZero);
    33533355#endif
    3354   fromLongArray(static_cast<int>(0));
     3356  fromLongArray(static_cast< int >(0));
    33553357  return numberNonZero;
    33563358}
    3357 #if ABC_SMALL<2
     3359#if ABC_SMALL < 2
    33583360
    33593361/* Updates part of column transpose (BTRANU) when densish,
    33603362   assumes index is sorted i.e. region is correct */
    3361 void
    3362 CoinAbcTypeFactorization::updateColumnTransposeUDensish
    3363                         ( CoinIndexedVector * regionSparse,
    3364                           CoinSimplexInt smallestIndex) const
     3363void CoinAbcTypeFactorization::updateColumnTransposeUDensish(CoinIndexedVector *regionSparse,
     3364  CoinSimplexInt smallestIndex) const
    33653365{
    3366   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    3367   CoinSimplexInt numberNonZero = regionSparse->getNumElements (  );
    3368  
    3369   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
    3370  
    3371   const CoinBigIndex * COIN_RESTRICT startRow = startRowUAddress_;
    3372   const CoinSimplexInt * COIN_RESTRICT indexColumn = indexColumnUAddress_;
    3373   const CoinSimplexInt * COIN_RESTRICT numberInRow = numberInRowAddress_;
    3374  
    3375   const CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    3376  
     3366  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     3367  CoinSimplexInt numberNonZero = regionSparse->getNumElements();
     3368
     3369  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
     3370
     3371  const CoinBigIndex *COIN_RESTRICT startRow = startRowUAddress_;
     3372  const CoinSimplexInt *COIN_RESTRICT indexColumn = indexColumnUAddress_;
     3373  const CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRowAddress_;
     3374
     3375  const CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowUAddress_;
     3376
    33773377  numberNonZero = 0;
    3378   const CoinSimplexInt *  COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
    3379   CoinSimplexInt jRow=smallestIndex ; //pivotLinked[-1];
    3380   instrument_start("CoinAbcFactorizationUpdateTransposeUDensish",numberRows_);
    3381   while (jRow>=0) {
     3378  const CoinSimplexInt *COIN_RESTRICT pivotLinked = pivotLinkedForwardsAddress_;
     3379  CoinSimplexInt jRow = smallestIndex; //pivotLinked[-1];
     3380  instrument_start("CoinAbcFactorizationUpdateTransposeUDensish", numberRows_);
     3381  while (jRow >= 0) {
    33823382    if (TEST_DOUBLE_NONZERO(region[jRow])) {
    33833383      CoinFactorizationDouble pivotValue = region[jRow];
    3384       if ( !TEST_LESS_THAN_UPDATE_TOLERANCE(pivotValue )  ) {
    3385         CoinSimplexInt numberIn = numberInRow[jRow];
    3386         instrument_add(numberIn);
    3387         if (TEST_INT_NONZERO(numberIn)) {
    3388           CoinBigIndex start = startRow[jRow];
    3389           CoinBigIndex end = start + numberIn;
     3384      if (!TEST_LESS_THAN_UPDATE_TOLERANCE(pivotValue)) {
     3385        CoinSimplexInt numberIn = numberInRow[jRow];
     3386        instrument_add(numberIn);
     3387        if (TEST_INT_NONZERO(numberIn)) {
     3388          CoinBigIndex start = startRow[jRow];
     3389          CoinBigIndex end = start + numberIn;
    33903390#ifndef INLINE_IT
    3391           for (CoinBigIndex j = start ; j < end; j ++ ) {
    3392             CoinSimplexInt iRow = indexColumn[j];
    3393             CoinFactorizationDouble value = elementRowU[j];
    3394             assert (value);
    3395             // i<iRow
    3396             region[iRow] -= value * pivotValue;
    3397           }
    3398 #else
    3399           CoinAbcScatterUpdate(end-start,pivotValue,elementRowU+start,indexColumn+start,region);
    3400 #endif   
    3401         }
    3402         regionIndex[numberNonZero++] = jRow;
     3391          for (CoinBigIndex j = start; j < end; j++) {
     3392            CoinSimplexInt iRow = indexColumn[j];
     3393            CoinFactorizationDouble value = elementRowU[j];
     3394            assert(value);
     3395            // i<iRow
     3396            region[iRow] -= value * pivotValue;
     3397          }
     3398#else
     3399          CoinAbcScatterUpdate(end - start, pivotValue, elementRowU + start, indexColumn + start, region);
     3400#endif
     3401        }
     3402        regionIndex[numberNonZero++] = jRow;
    34033403      } else {
    3404         region[jRow] = 0.0;
    3405       }       
    3406     }
    3407     jRow=pivotLinked[jRow];
     3404        region[jRow] = 0.0;
     3405      }
     3406    }
     3407    jRow = pivotLinked[jRow];
    34083408  }
    34093409  //set counts
    3410   regionSparse->setNumElements ( numberNonZero );
     3410  regionSparse->setNumElements(numberNonZero);
    34113411  instrument_end();
    34123412}
    34133413/* Updates part of column transpose (BTRANU) when sparse,
    34143414   assumes index is sorted i.e. region is correct */
    3415 void
    3416 CoinAbcTypeFactorization::updateColumnTransposeUSparse (
    3417                                                         CoinIndexedVector * regionSparse
     3415void CoinAbcTypeFactorization::updateColumnTransposeUSparse(
     3416  CoinIndexedVector *regionSparse
    34183417#if ABC_PARALLEL
    3419                                                 ,int whichSparse
    3420 #endif
    3421                                                          ) const
     3418  ,
     3419  int whichSparse
     3420#endif
     3421  ) const
    34223422{
    3423   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    3424   CoinSimplexInt numberNonZero = regionSparse->getNumElements (  );
    3425  
    3426   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
    3427   const CoinBigIndex * COIN_RESTRICT startRow = startRowUAddress_;
    3428   const CoinSimplexInt * COIN_RESTRICT indexColumn = indexColumnUAddress_;
    3429   const CoinSimplexInt * COIN_RESTRICT numberInRow = numberInRowAddress_;
    3430  
    3431   const CoinFactorizationDouble * COIN_RESTRICT elementRowU = elementRowUAddress_;
    3432  
     3423  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     3424  CoinSimplexInt numberNonZero = regionSparse->getNumElements();
     3425
     3426  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
     3427  const CoinBigIndex *COIN_RESTRICT startRow = startRowUAddress_;
     3428  const CoinSimplexInt *COIN_RESTRICT indexColumn = indexColumnUAddress_;
     3429  const CoinSimplexInt *COIN_RESTRICT numberInRow = numberInRowAddress_;
     3430
     3431  const CoinFactorizationDouble *COIN_RESTRICT elementRowU = elementRowUAddress_;
     3432
    34333433  // use sparse_ as temporary area
    34343434  // mark known to be zero
    34353435  //printf("PP 0_ %d %s\n",__LINE__,__FILE__);
    3436   CoinAbcStack * COIN_RESTRICT stackList = reinterpret_cast<CoinAbcStack *>(sparseAddress_);
    3437   CoinSimplexInt * COIN_RESTRICT list = listAddress_;
    3438   CoinCheckZero * COIN_RESTRICT mark = markRowAddress_;
     3436  CoinAbcStack *COIN_RESTRICT stackList = reinterpret_cast< CoinAbcStack * >(sparseAddress_);
     3437  CoinSimplexInt *COIN_RESTRICT list = listAddress_;
     3438  CoinCheckZero *COIN_RESTRICT mark = markRowAddress_;
    34393439#if ABC_PARALLEL
    34403440  //printf("PP %d %d %s\n",whichSparse,__LINE__,__FILE__);
    34413441  if (whichSparse) {
    34423442    //printf("alternative sparse\n");
    3443     int addAmount=whichSparse*sizeSparseArray_;
    3444     stackList=reinterpret_cast<CoinAbcStack *>(reinterpret_cast<char *>(stackList)+addAmount);
    3445     list=reinterpret_cast<CoinSimplexInt *>(reinterpret_cast<char *>(list)+addAmount);
    3446     mark=reinterpret_cast<CoinCheckZero *>(reinterpret_cast<char *>(mark)+addAmount);
     3443    int addAmount = whichSparse * sizeSparseArray_;
     3444    stackList = reinterpret_cast< CoinAbcStack * >(reinterpret_cast< char * >(stackList) + addAmount);
     3445    list = reinterpret_cast< CoinSimplexInt * >(reinterpret_cast< char * >(list) + addAmount);
     3446    mark = reinterpret_cast< CoinCheckZero * >(reinterpret_cast< char * >(mark) + addAmount);
    34473447  }
    34483448#endif
     
    34603460  }
    34613461#endif
    3462   nList=0;
    3463   for (CoinSimplexInt k=0;k<numberNonZero;k++) {
    3464     CoinSimplexInt kPivot=regionIndex[k];
    3465     stackList[0].stack=kPivot;
    3466     CoinSimplexInt jPivot=kPivot;
    3467     CoinBigIndex start=startRow[jPivot];
    3468     stackList[0].next=start+numberInRow[jPivot]-1;
    3469     stackList[0].start=start;
    3470     CoinSimplexInt nStack=1;
     3462  nList = 0;
     3463  for (CoinSimplexInt k = 0; k < numberNonZero; k++) {
     3464    CoinSimplexInt kPivot = regionIndex[k];
     3465    stackList[0].stack = kPivot;
     3466    CoinSimplexInt jPivot = kPivot;
     3467    CoinBigIndex start = startRow[jPivot];
     3468    stackList[0].next = start + numberInRow[jPivot] - 1;
     3469    stackList[0].start = start;
     3470    CoinSimplexInt nStack = 1;
    34713471    while (nStack) {
    34723472      /* take off stack */
    3473       kPivot=stackList[--nStack].stack;
    3474       if (mark[kPivot]!=1) {
     3473      kPivot = stackList[--nStack].stack;
     3474      if (mark[kPivot] != 1) {
    34753475#if 0
    34763476        CoinBigIndex j=stackList[nStack].next;
     
    34943494          stackList[nStack++].next=j;
    34953495#else
    3496         CoinBigIndex j=stackList[nStack].next;
    3497         if (j>=stackList[nStack].start) {
    3498           CoinSimplexInt kPivot3=indexColumn[j--];
    3499           /* put back on stack */
    3500           stackList[nStack++].next =j;
    3501           if (!mark[kPivot3]) {
    3502             /* and new one */
    3503             CoinBigIndex start=startRow[kPivot3];
    3504             j=start+numberInRow[kPivot3]-1;
    3505             stackList[nStack].stack=kPivot3;
    3506             stackList[nStack].start=start;
    3507             mark[kPivot3]=2;
    3508             stackList[nStack++].next=j;
    3509           }
    3510 #endif
    3511         } else {
    3512           // finished
    3513           list[nList++]=kPivot;
    3514           mark[kPivot]=1;
    3515         }
    3516       }
    3517     }
    3518   }
    3519   instrument_start("CoinAbcFactorizationUpdateTransposeUSparse",2*(numberNonZero+nList));
    3520   numberNonZero=0;
    3521   for (CoinSimplexInt i=nList-1;i>=0;i--) {
    3522     CoinSimplexInt iPivot = list[i];
    3523     assert (iPivot>=0&&iPivot<numberRows_);
    3524     mark[iPivot]=0;
    3525     CoinFactorizationDouble pivotValue = region[iPivot];
    3526     if ( !TEST_LESS_THAN_UPDATE_TOLERANCE(pivotValue )  ) {
    3527       CoinSimplexInt numberIn = numberInRow[iPivot];
    3528       instrument_add(numberIn);
    3529       if (TEST_INT_NONZERO(numberIn)) {
    3530         CoinBigIndex start = startRow[iPivot];
     3496        CoinBigIndex j = stackList[nStack].next;
     3497        if (j >= stackList[nStack].start) {
     3498          CoinSimplexInt kPivot3 = indexColumn[j--];
     3499          /* put back on stack */
     3500          stackList[nStack++].next = j;
     3501          if (!mark[kPivot3]) {
     3502            /* and new one */
     3503            CoinBigIndex start = startRow[kPivot3];
     3504            j = start + numberInRow[kPivot3] - 1;
     3505            stackList[nStack].stack = kPivot3;
     3506            stackList[nStack].start = start;
     3507            mark[kPivot3] = 2;
     3508            stackList[nStack++].next = j;
     3509          }
     3510#endif
     3511      } else {
     3512        // finished
     3513        list[nList++] = kPivot;
     3514        mark[kPivot] = 1;
     3515      }
     3516    }
     3517  }
     3518}
     3519instrument_start("CoinAbcFactorizationUpdateTransposeUSparse", 2 * (numberNonZero + nList));
     3520numberNonZero = 0;
     3521for (CoinSimplexInt i = nList - 1; i >= 0; i--) {
     3522  CoinSimplexInt iPivot = list[i];
     3523  assert(iPivot >= 0 && iPivot < numberRows_);
     3524  mark[iPivot] = 0;
     3525  CoinFactorizationDouble pivotValue = region[iPivot];
     3526  if (!TEST_LESS_THAN_UPDATE_TOLERANCE(pivotValue)) {
     3527    CoinSimplexInt numberIn = numberInRow[iPivot];
     3528    instrument_add(numberIn);
     3529    if (TEST_INT_NONZERO(numberIn)) {
     3530      CoinBigIndex start = startRow[iPivot];
    35313531#ifndef INLINE_IT
    3532         CoinBigIndex end = start + numberIn;
    3533         for (CoinBigIndex j=start ; j < end; j ++ ) {
    3534           CoinSimplexInt iRow = indexColumn[j];
    3535           CoinFactorizationDouble value = elementRowU[j];
    3536           region[iRow] -= value * pivotValue;
    3537         }
    3538 #else
    3539         CoinAbcScatterUpdate(numberIn,pivotValue,elementRowU+start,indexColumn+start,region);
    3540 #endif 
    3541       }   
    3542       regionIndex[numberNonZero++] = iPivot;
    3543     } else {
    3544       region[iPivot] = 0.0;
    3545     }       
    3546   }       
    3547   //set counts
    3548   regionSparse->setNumElements ( numberNonZero );
    3549   instrument_end_and_adjust(1.3);
     3532      CoinBigIndex end = start + numberIn;
     3533      for (CoinBigIndex j = start; j < end; j++) {
     3534        CoinSimplexInt iRow = indexColumn[j];
     3535        CoinFactorizationDouble value = elementRowU[j];
     3536        region[iRow] -= value * pivotValue;
     3537      }
     3538#else
     3539        CoinAbcScatterUpdate(numberIn, pivotValue, elementRowU + start, indexColumn + start, region);
     3540#endif
     3541    }
     3542    regionIndex[numberNonZero++] = iPivot;
     3543  } else {
     3544    region[iPivot] = 0.0;
     3545  }
     3546}
     3547//set counts
     3548regionSparse->setNumElements(numberNonZero);
     3549instrument_end_and_adjust(1.3);
    35503550}
    35513551#endif
     
    35533553//assumes index is sorted i.e. region is correct
    35543554//does not sort by sign
    3555 void
    3556 CoinAbcTypeFactorization::updateColumnTransposeU ( CoinIndexedVector * regionSparse,
    3557                                                    CoinSimplexInt smallestIndex
    3558 #if ABC_SMALL<2
    3559                        , CoinAbcStatistics & statistics
     3555void CoinAbcTypeFactorization::updateColumnTransposeU(CoinIndexedVector *regionSparse,
     3556  CoinSimplexInt smallestIndex
     3557#if ABC_SMALL < 2
     3558  ,
     3559  CoinAbcStatistics &statistics
    35603560#endif
    35613561#if ABC_PARALLEL
    3562                     ,int whichCpu
    3563 #endif
    3564                                                    ) const
     3562  ,
     3563  int whichCpu
     3564#endif
     3565  ) const
    35653566{
    3566 #if CILK_CONFLICT>0
     3567#if CILK_CONFLICT > 0
    35673568#if ABC_PARALLEL
    35683569  // for conflicts
    3569 #if CILK_CONFLICT>1
    3570   printf("file %s line %d which %d\n",__FILE__,__LINE__,whichCpu);
    3571 #endif
    3572   abc_assert((cilk_conflict&(1<<whichCpu))==0);
    3573   cilk_conflict |= (1<<whichCpu);
    3574 #else
    3575   abc_assert((cilk_conflict&(1<<0))==0);
    3576   cilk_conflict |= (1<<0);
    3577 #endif
    3578 #endif
    3579 #if ABC_SMALL<2
    3580   CoinSimplexInt number = regionSparse->getNumElements (  );
     3570#if CILK_CONFLICT > 1
     3571  printf("file %s line %d which %d\n", __FILE__, __LINE__, whichCpu);
     3572#endif
     3573  abc_assert((cilk_conflict & (1 << whichCpu)) == 0);
     3574  cilk_conflict |= (1 << whichCpu);
     3575#else
     3576  abc_assert((cilk_conflict & (1 << 0)) == 0);
     3577  cilk_conflict |= (1 << 0);
     3578#endif
     3579#endif
     3580#if ABC_SMALL < 2
     3581  CoinSimplexInt number = regionSparse->getNumElements();
    35813582  if (factorizationStatistics()) {
    35823583    statistics.numberCounts_++;
    3583     statistics.countInput_ += static_cast<CoinSimplexDouble> (number);
     3584    statistics.countInput_ += static_cast< CoinSimplexDouble >(number);
    35843585  }
    35853586  CoinSimplexInt goSparse;
     
    35873588  if (gotUCopy()) {
    35883589    if (gotSparse()) {
    3589       assert (statistics.averageAfterU_);
    3590       CoinSimplexInt newNumber = static_cast<CoinSimplexInt> (number*statistics.averageAfterU_*twiddleBtranFactor1());
    3591       if (newNumber< sparseThreshold_)
    3592         goSparse = 2;
     3590      assert(statistics.averageAfterU_);
     3591      CoinSimplexInt newNumber = static_cast< CoinSimplexInt >(number * statistics.averageAfterU_ * twiddleBtranFactor1());
     3592      if (newNumber < sparseThreshold_)
     3593        goSparse = 2;
    35933594      else
    3594         goSparse = 0;
     3595        goSparse = 0;
    35953596    } else {
    3596       goSparse=0;
    3597     }
    3598 #if ABC_SMALL>=0
     3597      goSparse = 0;
     3598    }
     3599#if ABC_SMALL >= 0
    35993600  } else {
    3600     goSparse=-1;
     3601    goSparse = -1;
    36013602#endif
    36023603  }
    36033604  //CoinIndexedVector temp(*regionSparse);
    36043605  switch (goSparse) {
    3605 #if ABC_SMALL>=0
     3606#if ABC_SMALL >= 0
    36063607  case -1: // no row copy
    3607     updateColumnTransposeUByColumn(regionSparse,smallestIndex);
     3608    updateColumnTransposeUByColumn(regionSparse, smallestIndex);
    36083609    break;
    36093610#endif
    36103611  case 0: // densish
    3611     updateColumnTransposeUDensish(regionSparse,smallestIndex);
     3612    updateColumnTransposeUDensish(regionSparse, smallestIndex);
    36123613    break;
    36133614  case 2: // sparse
    3614     {
    3615       updateColumnTransposeUSparse(regionSparse
     3615  {
     3616    updateColumnTransposeUSparse(regionSparse
    36163617#if ABC_PARALLEL
    3617                                       ,whichCpu
    3618 #endif
    3619                                    );
    3620     }
    3621     break;
    3622   }
    3623   if (factorizationStatistics()) 
    3624     statistics.countAfterU_ += static_cast<CoinSimplexDouble> (regionSparse->getNumElements());
    3625 #else
    3626   updateColumnTransposeUByColumn(regionSparse,smallestIndex);
    3627 #endif
    3628 #if CILK_CONFLICT>0
     3618      ,
     3619      whichCpu
     3620#endif
     3621    );
     3622  } break;
     3623  }
     3624  if (factorizationStatistics())
     3625    statistics.countAfterU_ += static_cast< CoinSimplexDouble >(regionSparse->getNumElements());
     3626#else
     3627  updateColumnTransposeUByColumn(regionSparse, smallestIndex);
     3628#endif
     3629#if CILK_CONFLICT > 0
    36293630#if ABC_PARALLEL
    36303631  // for conflicts
    3631   abc_assert((cilk_conflict&(1<<whichCpu))!=0);
    3632   cilk_conflict &= ~(1<<whichCpu);
    3633 #else
    3634   abc_assert((cilk_conflict&(1<<0))!=0);
    3635   cilk_conflict &= ~(1<<0);
     3632  abc_assert((cilk_conflict & (1 << whichCpu)) != 0);
     3633  cilk_conflict &= ~(1 << whichCpu);
     3634#else
     3635  abc_assert((cilk_conflict & (1 << 0)) != 0);
     3636  cilk_conflict &= ~(1 << 0);
    36363637#endif
    36373638#endif
     
    36403641/*  updateColumnTransposeLDensish. 
    36413642    Updates part of column transpose (BTRANL) dense by column */
    3642 void
    3643 CoinAbcTypeFactorization::updateColumnTransposeLDensish
    3644      ( CoinIndexedVector * regionSparse ) const
     3643void CoinAbcTypeFactorization::updateColumnTransposeLDensish(CoinIndexedVector *regionSparse) const
    36453644{
    3646   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
     3645  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
    36473646  CoinSimplexInt base;
    36483647  CoinSimplexInt first = -1;
    3649   const CoinSimplexInt * COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
     3648  const CoinSimplexInt *COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
    36503649  //const CoinSimplexInt * COIN_RESTRICT pivotLBackwardOrder = permuteAddress_;
    3651  
    3652 #if ABC_SMALL<3
    3653   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
    3654   CoinSimplexInt numberNonZero=0;
     3650
     3651#if ABC_SMALL < 3
     3652  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
     3653  CoinSimplexInt numberNonZero = 0;
    36553654#endif
    36563655  //scan
    3657   for (first=numberRows_-1;first>=0;first--) {
     3656  for (first = numberRows_ - 1; first >= 0; first--) {
    36583657#ifndef ABC_ORDERED_FACTORIZATION
    3659     if (region[pivotLOrder[first]]) 
     3658    if (region[pivotLOrder[first]])
    36603659      break;
    36613660#else
    3662     if (region[first]) 
     3661    if (region[first])
    36633662      break;
    36643663#endif
    36653664  }
    3666   instrument_start("CoinAbcFactorizationUpdateTransposeLDensish",first);
    3667   if ( first >= 0 ) {
     3665  instrument_start("CoinAbcFactorizationUpdateTransposeLDensish", first);
     3666  if (first >= 0) {
    36683667    base = baseL_;
    3669     const CoinBigIndex * COIN_RESTRICT startColumn = startColumnLAddress_;
    3670     const CoinSimplexInt * COIN_RESTRICT indexRow = indexRowLAddress_;
    3671     const CoinFactorizationDouble * COIN_RESTRICT element = elementLAddress_;
     3668    const CoinBigIndex *COIN_RESTRICT startColumn = startColumnLAddress_;
     3669    const CoinSimplexInt *COIN_RESTRICT indexRow = indexRowLAddress_;
     3670    const CoinFactorizationDouble *COIN_RESTRICT element = elementLAddress_;
    36723671    CoinSimplexInt last = baseL_ + numberL_;
    3673    
    3674     if ( first >= last ) {
     3672
     3673    if (first >= last) {
    36753674      first = last - 1;
    3676     } 
    3677     CoinBigIndex end = startColumn[first+1];
    3678     for (CoinSimplexInt k = first ; k >= base; k-- ) {
     3675    }
     3676    CoinBigIndex end = startColumn[first + 1];
     3677    for (CoinSimplexInt k = first; k >= base; k--) {
    36793678#ifndef ABC_ORDERED_FACTORIZATION
    3680       CoinSimplexInt i=pivotLOrder[k];
    3681 #else
    3682       CoinSimplexInt i=k;
     3679      CoinSimplexInt i = pivotLOrder[k];
     3680#else
     3681      CoinSimplexInt i = k;
    36833682#endif
    36843683      CoinFactorizationDouble pivotValue = region[i];
    36853684#ifndef INLINE_IT2
    3686       CoinBigIndex j=end-1;
    3687       end=startColumn[k];
    3688       instrument_add(j-end);
    3689       for (  ; j >= end; j-- ) {
    3690         CoinSimplexInt iRow = indexRow[j];
    3691         CoinFactorizationDouble value = element[j];
    3692         pivotValue -= value * region[iRow];
    3693       }       
    3694 #else
    3695       CoinBigIndex start=startColumn[k];
    3696       instrument_add(end-start);
    3697       pivotValue+=CoinAbcGatherUpdate(end-start,element+start,indexRow+start,region);
    3698       end=start;
    3699 #endif
    3700 #if ABC_SMALL<3
    3701       if ( !TEST_LESS_THAN_TOLERANCE_REGISTER(pivotValue )  ) {
    3702         region[i] = pivotValue;
    3703         regionIndex[numberNonZero++] = i;
    3704       } else { 
    3705         region[i] = 0.0;
    3706       }
    3707 #else
    3708         region[i] = pivotValue;
    3709 #endif       
    3710     }       
    3711 #if ABC_SMALL<3
     3685      CoinBigIndex j = end - 1;
     3686      end = startColumn[k];
     3687      instrument_add(j - end);
     3688      for (; j >= end; j--) {
     3689        CoinSimplexInt iRow = indexRow[j];
     3690        CoinFactorizationDouble value = element[j];
     3691        pivotValue -= value * region[iRow];
     3692      }
     3693#else
     3694      CoinBigIndex start = startColumn[k];
     3695      instrument_add(end - start);
     3696      pivotValue += CoinAbcGatherUpdate(end - start, element + start, indexRow + start, region);
     3697      end = start;
     3698#endif
     3699#if ABC_SMALL < 3
     3700      if (!TEST_LESS_THAN_TOLERANCE_REGISTER(pivotValue)) {
     3701        region[i] = pivotValue;
     3702        regionIndex[numberNonZero++] = i;
     3703      } else {
     3704        region[i] = 0.0;
     3705      }
     3706#else
     3707      region[i] = pivotValue;
     3708#endif
     3709    }
     3710#if ABC_SMALL < 3
    37123711    //may have stopped early
    3713     if ( first < base ) {
     3712    if (first < base) {
    37143713      base = first + 1;
    37153714    }
    3716    
    3717     for (CoinSimplexInt k = base-1 ; k >= 0; k-- ) {
     3715
     3716    for (CoinSimplexInt k = base - 1; k >= 0; k--) {
    37183717#ifndef ABC_ORDERED_FACTORIZATION
    3719       CoinSimplexInt i=pivotLOrder[k];
    3720 #else
    3721       CoinSimplexInt i=k;
    3722 #endif
    3723       CoinExponent expValue=ABC_EXPONENT(region[i]);
     3718      CoinSimplexInt i = pivotLOrder[k];
     3719#else
     3720      CoinSimplexInt i = k;
     3721#endif
     3722      CoinExponent expValue = ABC_EXPONENT(region[i]);
    37243723      if (expValue) {
    3725         if (!TEST_EXPONENT_LESS_THAN_TOLERANCE(expValue)) {
    3726           regionIndex[numberNonZero++] = i;
    3727         } else {
    3728           region[i] = 0.0;
    3729         }       
    3730       }
    3731     }
    3732 #endif
    3733   } 
    3734 #if ABC_SMALL<3
     3724        if (!TEST_EXPONENT_LESS_THAN_TOLERANCE(expValue)) {
     3725          regionIndex[numberNonZero++] = i;
     3726        } else {
     3727          region[i] = 0.0;
     3728        }
     3729      }
     3730    }
     3731#endif
     3732  }
     3733#if ABC_SMALL < 3
    37353734  //set counts
    3736   regionSparse->setNumElements ( numberNonZero );
     3735  regionSparse->setNumElements(numberNonZero);
    37373736#endif
    37383737  instrument_end();
    37393738}
    3740 #if ABC_SMALL<2
     3739#if ABC_SMALL < 2
    37413740/*  updateColumnTransposeLByRow.
    37423741    Updates part of column transpose (BTRANL) densish but by row */
    3743 void
    3744 CoinAbcTypeFactorization::updateColumnTransposeLByRow
    3745     ( CoinIndexedVector * regionSparse ) const
     3742void CoinAbcTypeFactorization::updateColumnTransposeLByRow(CoinIndexedVector *regionSparse) const
    37463743{
    3747   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    3748   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
     3744  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     3745  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
    37493746  CoinSimplexInt numberNonZero;
    3750  
     3747
    37513748  // use row copy of L
    3752   const CoinFactorizationDouble *  COIN_RESTRICT element = elementByRowLAddress_;
    3753   const CoinBigIndex *  COIN_RESTRICT startRow = startRowLAddress_;
    3754   const CoinSimplexInt *  COIN_RESTRICT column = indexColumnLAddress_;
    3755   const CoinSimplexInt * COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
    3756   numberNonZero=0;
    3757   instrument_start("CoinAbcFactorizationUpdateTransposeLByRow",numberRows_+numberSlacks_);
     3749  const CoinFactorizationDouble *COIN_RESTRICT element = elementByRowLAddress_;
     3750  const CoinBigIndex *COIN_RESTRICT startRow = startRowLAddress_;
     3751  const CoinSimplexInt *COIN_RESTRICT column = indexColumnLAddress_;
     3752  const CoinSimplexInt *COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
     3753  numberNonZero = 0;
     3754  instrument_start("CoinAbcFactorizationUpdateTransposeLByRow", numberRows_ + numberSlacks_);
    37583755  // down to slacks
    3759   for (CoinSimplexInt k = numberRows_-1 ; k >= numberSlacks_; k-- ) {
     3756  for (CoinSimplexInt k = numberRows_ - 1; k >= numberSlacks_; k--) {
    37603757#ifndef ABC_ORDERED_FACTORIZATION
    3761     CoinSimplexInt i=pivotLOrder[k];
    3762 #else
    3763     CoinSimplexInt i=k;
     3758    CoinSimplexInt i = pivotLOrder[k];
     3759#else
     3760    CoinSimplexInt i = k;
    37643761#endif
    37653762    if (TEST_DOUBLE_NONZERO(region[i])) {
    37663763      CoinFactorizationDouble pivotValue = region[i];
    3767       if ( !TEST_LESS_THAN_TOLERANCE(pivotValue )  ) {
    3768         regionIndex[numberNonZero++] = i;
    3769         CoinBigIndex start=startRow[i];
    3770         CoinBigIndex end=startRow[i+1];
    3771         instrument_add(end-start);
    3772         if (TEST_INT_NONZERO(end-start)) {
     3764      if (!TEST_LESS_THAN_TOLERANCE(pivotValue)) {
     3765        regionIndex[numberNonZero++] = i;
     3766        CoinBigIndex start = startRow[i];
     3767        CoinBigIndex end = startRow[i + 1];
     3768        instrument_add(end - start);
     3769        if (TEST_INT_NONZERO(end - start)) {
    37733770#ifndef INLINE_IT
    3774           for (CoinBigIndex j = end-1;j >= start; j--) {
    3775             CoinSimplexInt iRow = column[j];
    3776             CoinFactorizationDouble value = element[j];
    3777             region[iRow] -= pivotValue*value;
    3778           }
    3779 #else
    3780           CoinAbcScatterUpdate(end-start,pivotValue,element+start,column+start,region);
    3781 #endif
    3782         }
     3771          for (CoinBigIndex j = end - 1; j >= start; j--) {
     3772            CoinSimplexInt iRow = column[j];
     3773            CoinFactorizationDouble value = element[j];
     3774            region[iRow] -= pivotValue * value;
     3775          }
     3776#else
     3777          CoinAbcScatterUpdate(end - start, pivotValue, element + start, column + start, region);
     3778#endif
     3779        }
    37833780      } else {
    3784         region[i] = 0.0;
    3785       }     
    3786     }
    3787   }
    3788   for (CoinSimplexInt k = numberSlacks_-1 ; k >= 0; k-- ) {
     3781        region[i] = 0.0;
     3782      }
     3783    }
     3784  }
     3785  for (CoinSimplexInt k = numberSlacks_ - 1; k >= 0; k--) {
    37893786#ifndef ABC_ORDERED_FACTORIZATION
    3790     CoinSimplexInt i=pivotLOrder[k];
    3791 #else
    3792     CoinSimplexInt i=k;
    3793 #endif
    3794     CoinExponent expValue=ABC_EXPONENT(region[i]);
     3787    CoinSimplexInt i = pivotLOrder[k];
     3788#else
     3789    CoinSimplexInt i = k;
     3790#endif
     3791    CoinExponent expValue = ABC_EXPONENT(region[i]);
    37953792    if (expValue) {
    37963793      if (!TEST_EXPONENT_LESS_THAN_TOLERANCE(expValue)) {
    3797         regionIndex[numberNonZero++]=i;
     3794        regionIndex[numberNonZero++] = i;
    37983795      } else {
    3799         region[i] = 0.0;
    3800       }     
     3796        region[i] = 0.0;
     3797      }
    38013798    }
    38023799  }
    38033800  //set counts
    3804   regionSparse->setNumElements ( numberNonZero );
     3801  regionSparse->setNumElements(numberNonZero);
    38053802  instrument_end();
    38063803}
    38073804/*  updateColumnTransposeLSparse.
    38083805    Updates part of column transpose (BTRANL) sparse */
    3809 void
    3810 CoinAbcTypeFactorization::updateColumnTransposeLSparse ( CoinIndexedVector * regionSparse
     3806void CoinAbcTypeFactorization::updateColumnTransposeLSparse(CoinIndexedVector *regionSparse
    38113807#if ABC_PARALLEL
    3812                                                 ,int whichSparse
    3813 #endif
    3814                                                          ) const
     3808  ,
     3809  int whichSparse
     3810#endif
     3811  ) const
    38153812{
    3816   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    3817   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
    3818   CoinSimplexInt numberNonZero = regionSparse->getNumElements (  );
    3819  
     3813  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     3814  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
     3815  CoinSimplexInt numberNonZero = regionSparse->getNumElements();
     3816
    38203817  // use row copy of L
    3821   const CoinFactorizationDouble *  COIN_RESTRICT element = elementByRowLAddress_;
    3822   const CoinBigIndex *  COIN_RESTRICT startRow = startRowLAddress_;
    3823   const CoinSimplexInt *  COIN_RESTRICT column = indexColumnLAddress_;
     3818  const CoinFactorizationDouble *COIN_RESTRICT element = elementByRowLAddress_;
     3819  const CoinBigIndex *COIN_RESTRICT startRow = startRowLAddress_;
     3820  const CoinSimplexInt *COIN_RESTRICT column = indexColumnLAddress_;
    38243821  // use sparse_ as temporary area
    38253822  // mark known to be zero
    38263823  //printf("PP 0_ %d %s\n",__LINE__,__FILE__);
    3827   CoinAbcStack * COIN_RESTRICT stackList = reinterpret_cast<CoinAbcStack *>(sparseAddress_);
    3828   CoinSimplexInt * COIN_RESTRICT list = listAddress_;
    3829   CoinCheckZero * COIN_RESTRICT mark = markRowAddress_;
     3824  CoinAbcStack *COIN_RESTRICT stackList = reinterpret_cast< CoinAbcStack * >(sparseAddress_);
     3825  CoinSimplexInt *COIN_RESTRICT list = listAddress_;
     3826  CoinCheckZero *COIN_RESTRICT mark = markRowAddress_;
    38303827#if ABC_PARALLEL
    38313828  //printf("PP %d %d %s\n",whichSparse,__LINE__,__FILE__);
    38323829  if (whichSparse) {
    3833     int addAmount=whichSparse*sizeSparseArray_;
     3830    int addAmount = whichSparse * sizeSparseArray_;
    38343831    //printf("alternative sparse\n");
    3835     stackList=reinterpret_cast<CoinAbcStack *>(reinterpret_cast<char *>(stackList)+addAmount);
    3836     list=reinterpret_cast<CoinSimplexInt *>(reinterpret_cast<char *>(list)+addAmount);
    3837     mark=reinterpret_cast<CoinCheckZero *>(reinterpret_cast<char *>(mark)+addAmount);
     3832    stackList = reinterpret_cast< CoinAbcStack * >(reinterpret_cast< char * >(stackList) + addAmount);
     3833    list = reinterpret_cast< CoinSimplexInt * >(reinterpret_cast< char * >(list) + addAmount);
     3834    mark = reinterpret_cast< CoinCheckZero * >(reinterpret_cast< char * >(mark) + addAmount);
    38383835  }
    38393836#endif
    38403837#ifndef NDEBUG
    3841   for (CoinSimplexInt i=0;i<numberRows_;i++) {
     3838  for (CoinSimplexInt i = 0; i < numberRows_; i++) {
    38423839#if 0
    38433840    assert (!mark[i]);
    38443841#else
    38453842    if (mark[i]) {
    3846       printf("HHHHHHHHHHelp2 %d %d\n",i,mark[i]);
     3843      printf("HHHHHHHHHHelp2 %d %d\n", i, mark[i]);
    38473844      usleep(10000000);
    38483845    }
     
    38523849  CoinSimplexInt nList;
    38533850  CoinSimplexInt number = numberNonZero;
    3854   nList=0;
    3855   for (CoinSimplexInt k=0;k<number;k++) {
    3856     CoinSimplexInt kPivot=regionIndex[k];
     3851  nList = 0;
     3852  for (CoinSimplexInt k = 0; k < number; k++) {
     3853    CoinSimplexInt kPivot = regionIndex[k];
    38573854    //CoinSimplexInt iPivot=pivotLBackwardOrder[kPivot];
    3858     if(!mark[kPivot]&&region[kPivot]) {
    3859       stackList[0].stack=kPivot;
    3860       stackList[0].start=startRow[kPivot];
    3861       CoinBigIndex j=startRow[kPivot+1]-1;
    3862       CoinSimplexInt nStack=0;
    3863       while (nStack>=0) {
    3864         /* take off stack */
    3865         if (j>=stackList[nStack].start) {
    3866           CoinSimplexInt jPivot=column[j--];
    3867           /* put back on stack */
    3868           stackList[nStack].next =j;
    3869           if (!mark[jPivot]) {
    3870             /* and new one */
    3871             kPivot=jPivot;
    3872             //iPivot=pivotLBackwardOrder[kPivot];
    3873             j = startRow[kPivot+1]-1;
    3874             stackList[++nStack].stack=kPivot;
    3875             mark[kPivot]=1;
    3876             stackList[nStack].start=startRow[kPivot];
    3877             stackList[nStack].next=j;
    3878           }
    3879         } else {
    3880           /* finished so mark */
    3881           list[nList++]=kPivot;
    3882           mark[kPivot]=1;
    3883           --nStack;
    3884           if (nStack>=0) {
    3885             kPivot=stackList[nStack].stack;
    3886             j=stackList[nStack].next;
    3887           }
    3888         }
    3889       }
    3890     }
    3891   }
    3892   instrument_start("CoinAbcFactorizationUpdateTransposeLSparse",2*(numberNonZero+nList));
    3893   numberNonZero=0;
    3894   for (CoinSimplexInt i=nList-1;i>=0;i--) {
     3855    if (!mark[kPivot] && region[kPivot]) {
     3856      stackList[0].stack = kPivot;
     3857      stackList[0].start = startRow[kPivot];
     3858      CoinBigIndex j = startRow[kPivot + 1] - 1;
     3859      CoinSimplexInt nStack = 0;
     3860      while (nStack >= 0) {
     3861        /* take off stack */
     3862        if (j >= stackList[nStack].start) {
     3863          CoinSimplexInt jPivot = column[j--];
     3864          /* put back on stack */
     3865          stackList[nStack].next = j;
     3866          if (!mark[jPivot]) {
     3867            /* and new one */
     3868            kPivot = jPivot;
     3869            //iPivot=pivotLBackwardOrder[kPivot];
     3870            j = startRow[kPivot + 1] - 1;
     3871            stackList[++nStack].stack = kPivot;
     3872            mark[kPivot] = 1;
     3873            stackList[nStack].start = startRow[kPivot];
     3874            stackList[nStack].next = j;
     3875          }
     3876        } else {
     3877          /* finished so mark */
     3878          list[nList++] = kPivot;
     3879          mark[kPivot] = 1;
     3880          --nStack;
     3881          if (nStack >= 0) {
     3882            kPivot = stackList[nStack].stack;
     3883            j = stackList[nStack].next;
     3884          }
     3885        }
     3886      }
     3887    }
     3888  }
     3889  instrument_start("CoinAbcFactorizationUpdateTransposeLSparse", 2 * (numberNonZero + nList));
     3890  numberNonZero = 0;
     3891  for (CoinSimplexInt i = nList - 1; i >= 0; i--) {
    38953892    CoinSimplexInt iPivot = list[i];
    38963893    //CoinSimplexInt kPivot=pivotLOrder[iPivot];
    3897     mark[iPivot]=0;
     3894    mark[iPivot] = 0;
    38983895    CoinFactorizationDouble pivotValue = region[iPivot];
    3899     if ( !TEST_LESS_THAN_TOLERANCE(pivotValue )  ) {
     3896    if (!TEST_LESS_THAN_TOLERANCE(pivotValue)) {
    39003897      regionIndex[numberNonZero++] = iPivot;
    3901       CoinBigIndex start=startRow[iPivot];
    3902       CoinBigIndex end=startRow[iPivot+1];
    3903       instrument_add(end-start);
     3898      CoinBigIndex start = startRow[iPivot];
     3899      CoinBigIndex end = startRow[iPivot + 1];
     3900      instrument_add(end - start);
    39043901#ifndef INLINE_IT
    39053902      CoinBigIndex j;
    3906       for ( j = start; j < end; j ++ ) {
    3907         CoinSimplexInt iRow = column[j];
    3908         CoinFactorizationDouble value = element[j];
    3909         region[iRow] -= value * pivotValue;
    3910       }
    3911 #else
    3912       CoinAbcScatterUpdate(end-start,pivotValue,element+start,column+start,region);
     3903      for (j = start; j < end; j++) {
     3904        CoinSimplexInt iRow = column[j];
     3905        CoinFactorizationDouble value = element[j];
     3906        region[iRow] -= value * pivotValue;
     3907      }
     3908#else
     3909      CoinAbcScatterUpdate(end - start, pivotValue, element + start, column + start, region);
    39133910#endif
    39143911    } else {
    3915       region[iPivot]=0.0;
     3912      region[iPivot] = 0.0;
    39163913    }
    39173914  }
    39183915  //set counts
    3919   regionSparse->setNumElements ( numberNonZero );
     3916  regionSparse->setNumElements(numberNonZero);
    39203917  instrument_end_and_adjust(1.3);
    39213918}
    39223919#endif
    39233920//  updateColumnTransposeL.  Updates part of column transpose (BTRANL)
    3924 void
    3925 CoinAbcTypeFactorization::updateColumnTransposeL ( CoinIndexedVector * regionSparse
    3926 #if ABC_SMALL<2
    3927                        , CoinAbcStatistics & statistics
     3921void CoinAbcTypeFactorization::updateColumnTransposeL(CoinIndexedVector *regionSparse
     3922#if ABC_SMALL < 2
     3923  ,
     3924  CoinAbcStatistics &statistics
    39283925#endif
    39293926#if ABC_PARALLEL
    3930                                       ,int whichSparse
    3931 #endif
    3932                                                    ) const
     3927  ,
     3928  int whichSparse
     3929#endif
     3930  ) const
    39333931{
    3934 #if CILK_CONFLICT>0
     3932#if CILK_CONFLICT > 0
    39353933#if ABC_PARALLEL
    39363934  // for conflicts
    3937 #if CILK_CONFLICT>1
    3938   printf("file %s line %d which %d\n",__FILE__,__LINE__,whichSparse);
    3939 #endif
    3940   abc_assert((cilk_conflict&(1<<whichSparse))==0);
    3941   cilk_conflict |= (1<<whichSparse);
    3942 #else
    3943   abc_assert((cilk_conflict&(1<<0))==0);
    3944   cilk_conflict |= (1<<0);
    3945 #endif
    3946 #endif
    3947 #if ABC_SMALL<3
    3948   CoinSimplexInt number = regionSparse->getNumElements (  );
     3935#if CILK_CONFLICT > 1
     3936  printf("file %s line %d which %d\n", __FILE__, __LINE__, whichSparse);
     3937#endif
     3938  abc_assert((cilk_conflict & (1 << whichSparse)) == 0);
     3939  cilk_conflict |= (1 << whichSparse);
     3940#else
     3941  abc_assert((cilk_conflict & (1 << 0)) == 0);
     3942  cilk_conflict |= (1 << 0);
     3943#endif
     3944#endif
     3945#if ABC_SMALL < 3
     3946  CoinSimplexInt number = regionSparse->getNumElements();
    39493947#endif
    39503948  if (!numberL_
    3951 #if ABC_SMALL<4
    3952       &&!numberDense_
    3953 #endif
    3954       ) {
    3955 #if ABC_SMALL<3
    3956     if (number>=numberRows_) {
     3949#if ABC_SMALL < 4
     3950    && !numberDense_
     3951#endif
     3952  ) {
     3953#if ABC_SMALL < 3
     3954    if (number >= numberRows_) {
    39573955      // need scan
    39583956      regionSparse->setNumElements(0);
     
    39603958    }
    39613959#endif
    3962 #if CILK_CONFLICT>0
     3960#if CILK_CONFLICT > 0
    39633961#if ABC_PARALLEL
    39643962    // for conflicts
    3965     abc_assert((cilk_conflict&(1<<whichSparse))!=0);
    3966     cilk_conflict &= ~(1<<whichSparse);
    3967 #else
    3968     abc_assert((cilk_conflict&(1<<0))!=0);
    3969     cilk_conflict &= ~(1<<0);
     3963    abc_assert((cilk_conflict & (1 << whichSparse)) != 0);
     3964    cilk_conflict &= ~(1 << whichSparse);
     3965#else
     3966    abc_assert((cilk_conflict & (1 << 0)) != 0);
     3967    cilk_conflict &= ~(1 << 0);
    39703968#endif
    39713969#endif
    39723970    return;
    39733971  }
    3974 #if ABC_SMALL<2
     3972#if ABC_SMALL < 2
    39753973  CoinSimplexInt goSparse;
    39763974  // Guess at number at end
    39773975  // we may need to rethink on dense
    39783976  if (gotLCopy()) {
    3979     assert (statistics.averageAfterL_);
    3980     CoinSimplexInt newNumber = static_cast<CoinSimplexInt> (number*statistics.averageAfterL_*twiddleBtranFactor1());
    3981     if (newNumber< sparseThreshold_)
     3977    assert(statistics.averageAfterL_);
     3978    CoinSimplexInt newNumber = static_cast< CoinSimplexInt >(number * statistics.averageAfterL_ * twiddleBtranFactor1());
     3979    if (newNumber < sparseThreshold_)
    39823980      goSparse = 2;
    3983     else if (2*newNumber< numberRows_)
     3981    else if (2 * newNumber < numberRows_)
    39843982      goSparse = 0;
    39853983    else
    39863984      goSparse = -1;
    39873985  } else {
    3988     goSparse=-1;
    3989   }
    3990 #endif
    3991 #if ABC_SMALL<4
    3992 #if ABC_DENSE_CODE>0
     3986    goSparse = -1;
     3987  }
     3988#endif
     3989#if ABC_SMALL < 4
     3990#if ABC_DENSE_CODE > 0
    39933991  if (numberDense_) {
    39943992    //take off list
    3995     CoinSimplexInt lastSparse = numberRows_-numberDense_;
    3996     CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    3997     const CoinSimplexInt * COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
    3998     CoinFactorizationDouble *  COIN_RESTRICT denseArea = denseAreaAddress_;
    3999     CoinFactorizationDouble * COIN_RESTRICT denseRegion =
    4000       denseArea+leadingDimension_*numberDense_;
    4001     CoinSimplexInt *  COIN_RESTRICT densePermute=
    4002       reinterpret_cast<CoinSimplexInt *>(denseRegion+FACTOR_CPU*numberDense_);
     3993    CoinSimplexInt lastSparse = numberRows_ - numberDense_;
     3994    CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     3995    const CoinSimplexInt *COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
     3996    CoinFactorizationDouble *COIN_RESTRICT denseArea = denseAreaAddress_;
     3997    CoinFactorizationDouble *COIN_RESTRICT denseRegion = denseArea + leadingDimension_ * numberDense_;
     3998    CoinSimplexInt *COIN_RESTRICT densePermute = reinterpret_cast< CoinSimplexInt * >(denseRegion + FACTOR_CPU * numberDense_);
    40033999#if ABC_PARALLEL
    40044000    //printf("PP %d %d %s\n",whichSparse,__LINE__,__FILE__);
    40054001    if (whichSparse)
    4006       denseRegion+=whichSparse*numberDense_;
    4007 #endif
    4008     CoinFactorizationDouble * COIN_RESTRICT densePut =
    4009       denseRegion-lastSparse;
    4010     CoinZeroN(denseRegion,numberDense_);
    4011     bool doDense=false;
    4012 #if ABC_SMALL<3
     4002      denseRegion += whichSparse * numberDense_;
     4003#endif
     4004    CoinFactorizationDouble *COIN_RESTRICT densePut = denseRegion - lastSparse;
     4005    CoinZeroN(denseRegion, numberDense_);
     4006    bool doDense = false;
     4007#if ABC_SMALL < 3
    40134008    CoinSimplexInt number = regionSparse->getNumElements();
    4014     CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
    4015     const CoinSimplexInt * COIN_RESTRICT pivotLBackwardOrder = permuteAddress_;
    4016     CoinSimplexInt i=0;
    4017 #if ABC_SMALL<0
    4018     assert (number<=numberRows_);
    4019 #else
    4020     if (number<=numberRows_) {
    4021 #endif
    4022       while (i<number) {
    4023         CoinSimplexInt iRow = regionIndex[i];
     4009    CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
     4010    const CoinSimplexInt *COIN_RESTRICT pivotLBackwardOrder = permuteAddress_;
     4011    CoinSimplexInt i = 0;
     4012#if ABC_SMALL < 0
     4013    assert(number <= numberRows_);
     4014#else
     4015    if (number <= numberRows_) {
     4016#endif
     4017    while (i < number) {
     4018      CoinSimplexInt iRow = regionIndex[i];
    40244019#ifndef ABC_ORDERED_FACTORIZATION
    4025         CoinSimplexInt jRow = pivotLBackwardOrder[iRow];
    4026 #else
    4027         CoinSimplexInt jRow=iRow;
    4028 #endif
    4029         if (jRow>=lastSparse) {
    4030           doDense=true;
    4031           regionIndex[i] = regionIndex[--number];
    4032           densePut[jRow]=region[iRow];
    4033           region[iRow]=0.0;
    4034         } else {
    4035           i++;
    4036         }
    4037       }
    4038 #endif
    4039 #if ABC_SMALL>=0
    4040 #if ABC_SMALL<3
    4041     } else {
    4042 #endif
    4043       for (CoinSimplexInt jRow=lastSparse;jRow<numberRows_;jRow++) {
    4044         CoinSimplexInt iRow = pivotLOrder[jRow];
    4045         if (region[iRow]) {
    4046           doDense=true;
    4047           densePut[jRow]=region[iRow];
    4048           region[iRow]=0.0;
    4049         }
    4050       }
    4051 #if ABC_SMALL<3
    4052       // numbers are all wrong - do a scan
    4053       regionSparse->setNumElements(0);
    4054       scan(regionSparse);
    4055       number=regionSparse->getNumElements();
    4056     }
    4057 #endif
    4058 #endif
    4059     if (doDense) {
    4060       instrument_do("CoinAbcFactorizationDenseTranspose",0.25*numberDense_*numberDense_);
    4061 #if ABC_DENSE_CODE==1
     4020      CoinSimplexInt jRow = pivotLBackwardOrder[iRow];
     4021#else
     4022        CoinSimplexInt jRow = iRow;
     4023#endif
     4024      if (jRow >= lastSparse) {
     4025        doDense = true;
     4026        regionIndex[i] = regionIndex[--number];
     4027        densePut[jRow] = region[iRow];
     4028        region[iRow] = 0.0;
     4029      } else {
     4030        i++;
     4031      }
     4032    }
     4033#endif
     4034#if ABC_SMALL >= 0
     4035#if ABC_SMALL < 3
     4036  } else {
     4037#endif
     4038    for (CoinSimplexInt jRow = lastSparse; jRow < numberRows_; jRow++) {
     4039      CoinSimplexInt iRow = pivotLOrder[jRow];
     4040      if (region[iRow]) {
     4041        doDense = true;
     4042        densePut[jRow] = region[iRow];
     4043        region[iRow] = 0.0;
     4044      }
     4045    }
     4046#if ABC_SMALL < 3
     4047    // numbers are all wrong - do a scan
     4048    regionSparse->setNumElements(0);
     4049    scan(regionSparse);
     4050    number = regionSparse->getNumElements();
     4051  }
     4052#endif
     4053#endif
     4054  if (doDense) {
     4055    instrument_do("CoinAbcFactorizationDenseTranspose", 0.25 * numberDense_ * numberDense_);
     4056#if ABC_DENSE_CODE == 1
    40624057#ifndef CLAPACK
    4063       char trans = 'T';
    4064       CoinSimplexInt ione=1;
    4065       CoinSimplexInt info;
    4066       F77_FUNC(dgetrs,DGETRS)(&trans,&numberDense_,&ione,denseArea,&leadingDimension_,
    4067                               densePermute,denseRegion,&numberDense_,&info,1);
    4068 #else
    4069       clapack_dgetrs(CblasColMajor, CblasTrans,numberDense_,1,
    4070                      denseArea, leadingDimension_,densePermute,denseRegion,numberDense_);
    4071 #endif
    4072 #elif ABC_DENSE_CODE==2
    4073       CoinAbcDgetrs('T',numberDense_,denseArea,denseRegion);
    4074       short * COIN_RESTRICT forBtran = reinterpret_cast<short *>(densePermute+numberDense_)+numberDense_-lastSparse;
     4058    char trans = 'T';
     4059    CoinSimplexInt ione = 1;
     4060    CoinSimplexInt info;
     4061    F77_FUNC(dgetrs, DGETRS)
     4062    (&trans, &numberDense_, &ione, denseArea, &leadingDimension_,
     4063      densePermute, denseRegion, &numberDense_, &info, 1);
     4064#else
     4065        clapack_dgetrs(CblasColMajor, CblasTrans, numberDense_, 1,
     4066          denseArea, leadingDimension_, densePermute, denseRegion, numberDense_);
     4067#endif
     4068#elif ABC_DENSE_CODE == 2
     4069      CoinAbcDgetrs('T', numberDense_, denseArea, denseRegion);
     4070      short *COIN_RESTRICT forBtran = reinterpret_cast< short * >(densePermute + numberDense_) + numberDense_ - lastSparse;
    40754071      pivotLOrder += lastSparse; // adjust
    40764072#endif
    4077       for (CoinSimplexInt i=lastSparse;i<numberRows_;i++) {
    4078         CoinSimplexDouble value = densePut[i];
    4079         if (value) {
    4080           if (!TEST_LESS_THAN_TOLERANCE(value)) {
    4081 #if ABC_DENSE_CODE!=2
    4082             CoinSimplexInt iRow=pivotLOrder[i];
    4083 #else
    4084             CoinSimplexInt iRow=pivotLOrder[forBtran[i]];
    4085 #endif
    4086             region[iRow]=value;
    4087 #if ABC_SMALL<3
    4088             regionIndex[number++] = iRow;
    4089 #endif
    4090           }
    4091         }
    4092       }
    4093 #if ABC_SMALL<3
    4094       regionSparse->setNumElements(number);
    4095 #endif
    4096     }
    4097   }
    4098   //printRegion(*regionSparse,"After BtranL");
    4099 #endif
    4100 #endif
    4101 #if ABC_SMALL<2
    4102   switch (goSparse) {
    4103   case -1: // No row copy
    4104     updateColumnTransposeLDensish(regionSparse);
    4105     break;
    4106   case 0: // densish but by row
    4107     updateColumnTransposeLByRow(regionSparse);
    4108     break;
    4109   case 2: // sparse
    4110     updateColumnTransposeLSparse(regionSparse
     4073    for (CoinSimplexInt i = lastSparse; i < numberRows_; i++) {
     4074      CoinSimplexDouble value = densePut[i];
     4075      if (value) {
     4076        if (!TEST_LESS_THAN_TOLERANCE(value)) {
     4077#if ABC_DENSE_CODE != 2
     4078          CoinSimplexInt iRow = pivotLOrder[i];
     4079#else
     4080            CoinSimplexInt iRow = pivotLOrder[forBtran[i]];
     4081#endif
     4082          region[iRow] = value;
     4083#if ABC_SMALL < 3
     4084          regionIndex[number++] = iRow;
     4085#endif
     4086        }
     4087      }
     4088    }
     4089#if ABC_SMALL < 3
     4090    regionSparse->setNumElements(number);
     4091#endif
     4092  }
     4093}
     4094//printRegion(*regionSparse,"After BtranL");
     4095#endif
     4096#endif
     4097#if ABC_SMALL < 2
     4098switch (goSparse) {
     4099case -1: // No row copy
     4100  updateColumnTransposeLDensish(regionSparse);
     4101  break;
     4102case 0: // densish but by row
     4103  updateColumnTransposeLByRow(regionSparse);
     4104  break;
     4105case 2: // sparse
     4106  updateColumnTransposeLSparse(regionSparse
    41114107#if ABC_PARALLEL
    4112                                       ,whichSparse
    4113 #endif
    4114                                  );
    4115     break;
    4116   }
     4108    ,
     4109    whichSparse
     4110#endif
     4111  );
     4112  break;
     4113}
    41174114#else
    41184115  updateColumnTransposeLDensish(regionSparse);
    41194116#endif
    4120 #if CILK_CONFLICT>0
     4117#if CILK_CONFLICT > 0
    41214118#if ABC_PARALLEL
    4122   // for conflicts
    4123   abc_assert((cilk_conflict&(1<<whichSparse))!=0);
    4124   cilk_conflict &= ~(1<<whichSparse);
    4125 #else
    4126   abc_assert((cilk_conflict&(1<<0))!=0);
    4127   cilk_conflict &= ~(1<<0);
     4119// for conflicts
     4120abc_assert((cilk_conflict & (1 << whichSparse)) != 0);
     4121cilk_conflict &= ~(1 << whichSparse);
     4122#else
     4123  abc_assert((cilk_conflict & (1 << 0)) != 0);
     4124  cilk_conflict &= ~(1 << 0);
    41284125#endif
    41294126#endif
    41304127}
    4131 #if ABC_SMALL>=0
     4128#if ABC_SMALL >= 0
    41324129// Updates part of column transpose (BTRANR) when dense
    4133 void
    4134 CoinAbcTypeFactorization::updateColumnTransposeRDensish( CoinIndexedVector * regionSparse ) const
     4130void CoinAbcTypeFactorization::updateColumnTransposeRDensish(CoinIndexedVector *regionSparse) const
    41354131{
    4136   const CoinBigIndex *  COIN_RESTRICT startColumn = startColumnRAddress_-numberRows_;
    4137   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    4138 #if ABC_SMALL<3
     4132  const CoinBigIndex *COIN_RESTRICT startColumn = startColumnRAddress_ - numberRows_;
     4133  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     4134#if ABC_SMALL < 3
    41394135#ifdef ABC_DEBUG
    41404136  regionSparse->checkClean();
    41414137#endif
    41424138#endif
    4143   instrument_start("CoinAbcFactorizationUpdateTransposeRDensish",numberRows_);
    4144   CoinSimplexInt last = numberRowsExtra_-1;
    4145   const CoinSimplexInt * COIN_RESTRICT indexRow = indexRowRAddress_;
    4146   const CoinFactorizationDouble * COIN_RESTRICT element = elementRAddress_;
    4147   const CoinSimplexInt *  COIN_RESTRICT pivotRowBack = pivotColumnAddress_;
    4148   for (CoinSimplexInt i = last ; i >= numberRows_; i-- ) {
    4149     CoinSimplexInt putRow=pivotRowBack[i];
     4139  instrument_start("CoinAbcFactorizationUpdateTransposeRDensish", numberRows_);
     4140  CoinSimplexInt last = numberRowsExtra_ - 1;
     4141  const CoinSimplexInt *COIN_RESTRICT indexRow = indexRowRAddress_;
     4142  const CoinFactorizationDouble *COIN_RESTRICT element = elementRAddress_;
     4143  const CoinSimplexInt *COIN_RESTRICT pivotRowBack = pivotColumnAddress_;
     4144  for (CoinSimplexInt i = last; i >= numberRows_; i--) {
     4145    CoinSimplexInt putRow = pivotRowBack[i];
    41504146    CoinFactorizationDouble pivotValue = region[putRow];
    4151     if ( pivotValue ) {
    4152       CoinBigIndex start=startColumn[i];
    4153       CoinBigIndex end=startColumn[i+1];
    4154       instrument_add(end-start);
     4147    if (pivotValue) {
     4148      CoinBigIndex start = startColumn[i];
     4149      CoinBigIndex end = startColumn[i + 1];
     4150      instrument_add(end - start);
    41554151#ifndef INLINE_IT
    4156       for (CoinBigIndex j = start; j < end; j++ ) {
    4157         CoinFactorizationDouble value = element[j];
    4158         CoinSimplexInt iRow = indexRow[j];
    4159         assert (iRow<numberRows_);
    4160         region[iRow] -= value * pivotValue;
    4161       }
    4162 #else
    4163       CoinAbcScatterUpdate(end-start,pivotValue,element+start,indexRow+start,region);
     4152      for (CoinBigIndex j = start; j < end; j++) {
     4153        CoinFactorizationDouble value = element[j];
     4154        CoinSimplexInt iRow = indexRow[j];
     4155        assert(iRow < numberRows_);
     4156        region[iRow] -= value * pivotValue;
     4157      }
     4158#else
     4159      CoinAbcScatterUpdate(end - start, pivotValue, element + start, indexRow + start, region);
    41644160#endif
    41654161      region[putRow] = pivotValue;
     
    41694165}
    41704166#endif
    4171 #if ABC_SMALL<2
     4167#if ABC_SMALL < 2
    41724168// Updates part of column transpose (BTRANR) when sparse
    4173 void
    4174 CoinAbcTypeFactorization::updateColumnTransposeRSparse
    4175 ( CoinIndexedVector * regionSparse ) const
     4169void CoinAbcTypeFactorization::updateColumnTransposeRSparse(CoinIndexedVector *regionSparse) const
    41764170{
    4177   CoinFactorizationDouble * COIN_RESTRICT region = denseVector(regionSparse);
    4178   CoinSimplexInt * COIN_RESTRICT regionIndex = regionSparse->getIndices (  );
    4179   CoinSimplexInt numberNonZero = regionSparse->getNumElements (  );
    4180   instrument_start("CoinAbcFactorizationUpdateTransposeRSparse",numberRows_);
    4181 
    4182 #if ABC_SMALL<3
     4171  CoinFactorizationDouble *COIN_RESTRICT region = denseVector(regionSparse);
     4172  CoinSimplexInt *COIN_RESTRICT regionIndex = regionSparse->getIndices();
     4173  CoinSimplexInt numberNonZero = regionSparse->getNumElements();
     4174  instrument_start("CoinAbcFactorizationUpdateTransposeRSparse", numberRows_);
     4175
     4176#if ABC_SMALL < 3
    41834177#ifdef ABC_DEBUG
    41844178  regionSparse->checkClean();
    41854179#endif
    41864180#endif
    4187   CoinSimplexInt last = numberRowsExtra_-1;
    4188  
    4189   const CoinSimplexInt * COIN_RESTRICT indexRow = indexRowRAddress_;
    4190   const CoinFactorizationDouble * COIN_RESTRICT element = elementRAddress_;
    4191   const CoinBigIndex *  COIN_RESTRICT startColumn = startColumnRAddress_-numberRows_;
     4181  CoinSimplexInt last = numberRowsExtra_ - 1;
     4182
     4183  const CoinSimplexInt *COIN_RESTRICT indexRow = indexRowRAddress_;
     4184  const CoinFactorizationDouble *COIN_RESTRICT element = elementRAddress_;
     4185  const CoinBigIndex *COIN_RESTRICT startColumn = startColumnRAddress_ - numberRows_;
    41924186  //move using lookup
    4193   const CoinSimplexInt *  COIN_RESTRICT pivotRowBack = pivotColumnAddress_;
     4187  const CoinSimplexInt *COIN_RESTRICT pivotRowBack = pivotColumnAddress_;
    41944188  // still need to do in correct order (for now)
    4195   for (CoinSimplexInt i = last ; i >= numberRows_; i-- ) {
     4189  for (CoinSimplexInt i = last; i >= numberRows_; i--) {
    41964190    CoinSimplexInt putRow = pivotRowBack[i];
    41974191    CoinFactorizationDouble pivotValue = region[putRow];
    4198     if ( pivotValue ) {
    4199       instrument_add(startColumn[i+1]-startColumn[i]);
    4200       for (CoinBigIndex j = startColumn[i]; j < startColumn[i+1]; j++ ) {
    4201         CoinFactorizationDouble value = element[j];
    4202         CoinSimplexInt iRow = indexRow[j];
    4203         assert (iRow<numberRows_);
    4204         bool oldValue = (TEST_DOUBLE_REALLY_NONZERO(region[iRow]));
    4205         CoinFactorizationDouble newValue = region[iRow] - value * pivotValue;
    4206         if (oldValue) {
    4207           if (newValue)
    4208             region[iRow]=newValue;
    4209           else
    4210             region[iRow]=COIN_INDEXED_REALLY_TINY_ELEMENT;
    4211         } else if (!TEST_LESS_THAN_TOLERANCE_REGISTER(newValue)) {
    4212           region[iRow] = newValue;
    4213           regionIndex[numberNonZero++]=iRow;
    4214         }
     4192    if (pivotValue) {
     4193      instrument_add(startColumn[i + 1] - startColumn[i]);
     4194      for (CoinBigIndex j = startColumn[i]; j < startColumn[i + 1]; j++) {
     4195        CoinFactorizationDouble value = element[j];
     4196        CoinSimplexInt iRow = indexRow[j];
     4197        assert(iRow < numberRows_);
     4198        bool oldValue = (TEST_DOUBLE_REALLY_NONZERO(region[iRow]));
     4199        CoinFactorizationDouble newValue = region[iRow] - value * pivotValue;
     4200        if (oldValue) {
     4201          if (newValue)
     4202            region[iRow] = newValue;
     4203          else
     4204            region[iRow] = COIN_INDEXED_REALLY_TINY_ELEMENT;
     4205        } else if (!TEST_LESS_THAN_TOLERANCE_REGISTER(newValue)) {
     4206          region[iRow] = newValue;
     4207          regionIndex[numberNonZero++] = iRow;
     4208        }
    42154209      }
    42164210      region[putRow] = pivotValue;
     
    42224216#endif
    42234217//  updateColumnTransposeR.  Updates part of column (FTRANR)
    4224 void
    4225 CoinAbcTypeFactorization::updateColumnTransposeR ( CoinIndexedVector * regionSparse
    4226 #if ABC_SMALL<2
    4227                                                    , CoinAbcStatistics & statistics
    4228 #endif
    4229                                                    ) const
     4218void CoinAbcTypeFactorization::updateColumnTransposeR(CoinIndexedVector *regionSparse
     4219#if ABC_SMALL < 2
     4220  ,
     4221  CoinAbcStatistics &statistics
     4222#endif
     4223  ) const
    42304224{
    4231   if (numberRowsExtra_==numberRows_)
     4225  if (numberRowsExtra_ == numberRows_)
    42324226    return;
    4233 #if ABC_SMALL<3
    4234   CoinSimplexInt numberNonZero = regionSparse->getNumElements (  );
     4227#if ABC_SMALL < 3
     4228  CoinSimplexInt numberNonZero = regionSparse->getNumElements();
    42354229  if (numberNonZero) {
    42364230#endif
    4237 #if ABC_SMALL<3
    4238     const CoinBigIndex *  COIN_RESTRICT startColumn = startColumnRAddress_-numberRows_;
     4231#if ABC_SMALL < 3
     4232    const CoinBigIndex *COIN_RESTRICT startColumn = startColumnRAddress_ - numberRows_;
    42394233#endif
    42404234    // Size of R
    4241     instrument_do("CoinAbcFactorizationTransposeR",startColumnRAddress_[numberR_]);
    4242 #if ABC_SMALL<2
     4235    instrument_do("CoinAbcFactorizationTransposeR", startColumnRAddress_[numberR_]);
     4236#if ABC_SMALL < 2
    42434237    if (startColumn[numberRowsExtra_]) {
    4244 #if ABC_SMALL>=0
    4245       if (numberNonZero < ((sparseThreshold_<<2)*twiddleBtranFactor2())
    4246           ||(!numberL_&&gotLCopy()&&gotRCopy())) {
    4247 #endif
    4248         updateColumnTransposeRSparse ( regionSparse );
    4249         if (factorizationStatistics())
    4250           statistics.countAfterR_ += regionSparse->getNumElements();
    4251 #if ABC_SMALL>=0
     4238#if ABC_SMALL >= 0
     4239      if (numberNonZero < ((sparseThreshold_ << 2) * twiddleBtranFactor2())
     4240        || (!numberL_ && gotLCopy() && gotRCopy())) {
     4241#endif
     4242        updateColumnTransposeRSparse(regionSparse);
     4243        if (factorizationStatistics())
     4244          statistics.countAfterR_ += regionSparse->getNumElements();
     4245#if ABC_SMALL >= 0
    42524246      } else {
    4253         updateColumnTransposeRDensish ( regionSparse );
    4254         // we have lost indices
    4255         // make sure won't try and go sparse again
    4256         if (factorizationStatistics())
    4257           statistics.countAfterR_ += CoinMin((numberNonZero<<1),numberRows_);
    4258         // temp +2 (was +1)
    4259         regionSparse->setNumElements (numberRows_+2);
     4247        updateColumnTransposeRDensish(regionSparse);
     4248        // we have lost indices
     4249        // make sure won't try and go sparse again
     4250        if (factorizationStatistics())
     4251          statistics.countAfterR_ += CoinMin((numberNonZero << 1), numberRows_);
     4252        // temp +2 (was +1)
     4253        regionSparse->setNumElements(numberRows_ + 2);
    42604254      }
    42614255#endif
    42624256    } else {
    4263       if (factorizationStatistics()) 
    4264         statistics.countAfterR_ += numberNonZero;
    4265     }
    4266 #else
    4267     updateColumnTransposeRDensish ( regionSparse );
    4268 #if ABC_SMALL<3
    4269     // we have lost indices
    4270     // make sure won't try and go sparse again
    4271     // temp +2 (was +1)
    4272     regionSparse->setNumElements (numberRows_+2);
    4273 #endif
    4274 #endif
    4275 #if ABC_SMALL<3
     4257      if (factorizationStatistics())
     4258        statistics.countAfterR_ += numberNonZero;
     4259    }
     4260#else
     4261  updateColumnTransposeRDensish(regionSparse);
     4262#if ABC_SMALL < 3
     4263  // we have lost indices
     4264  // make sure won't try and go sparse again
     4265  // temp +2 (was +1)
     4266  regionSparse->setNumElements(numberRows_ + 2);
     4267#endif
     4268#endif
     4269#if ABC_SMALL < 3
    42764270  }
    42774271#endif
    42784272}
    42794273// Update partial Ftran by R update
    4280 void
    4281 CoinAbcTypeFactorization::updatePartialUpdate(CoinIndexedVector & partialUpdate)
     4274void CoinAbcTypeFactorization::updatePartialUpdate(CoinIndexedVector &partialUpdate)
    42824275{
    4283   CoinSimplexDouble * COIN_RESTRICT region = partialUpdate.denseVector (  );
    4284   CoinSimplexInt * COIN_RESTRICT regionIndex = partialUpdate.getIndices (  );
    4285   CoinSimplexInt numberNonZero = partialUpdate.getNumElements (  );
    4286   const CoinSimplexInt *  COIN_RESTRICT indexRow = indexRowRAddress_;
    4287   const CoinFactorizationDouble *  COIN_RESTRICT element = elementRAddress_;
    4288   const CoinSimplexInt * pivotRowBack = pivotColumnAddress_;
    4289   const CoinBigIndex *  COIN_RESTRICT startColumn = startColumnRAddress_-numberRows_;
    4290   CoinBigIndex start = startColumn[numberRowsExtra_-1];
     4276  CoinSimplexDouble *COIN_RESTRICT region = partialUpdate.denseVector();
     4277  CoinSimplexInt *COIN_RESTRICT regionIndex = partialUpdate.getIndices();
     4278  CoinSimplexInt numberNonZero = partialUpdate.getNumElements();
     4279  const CoinSimplexInt *COIN_RESTRICT indexRow = indexRowRAddress_;
     4280  const CoinFactorizationDouble *COIN_RESTRICT element = elementRAddress_;
     4281  const CoinSimplexInt *pivotRowBack = pivotColumnAddress_;
     4282  const CoinBigIndex *COIN_RESTRICT startColumn = startColumnRAddress_ - numberRows_;
     4283  CoinBigIndex start = startColumn[numberRowsExtra_ - 1];
    42914284  CoinBigIndex end = startColumn[numberRowsExtra_];
    4292   CoinSimplexInt iRow =pivotRowBack[numberRowsExtra_-1];
     4285  CoinSimplexInt iRow = pivotRowBack[numberRowsExtra_ - 1];
    42934286  CoinFactorizationDouble pivotValue = region[iRow];
    4294   for (CoinBigIndex j = start; j < end; j ++ ) {
     4287  for (CoinBigIndex j = start; j < end; j++) {
    42954288    CoinFactorizationDouble value = element[j];
    42964289    CoinSimplexInt jRow = indexRow[j];
     
    42984291    pivotValue -= value;
    42994292  }
    4300   if ( !TEST_LESS_THAN_TOLERANCE_REGISTER(pivotValue ) ) {
     4293  if (!TEST_LESS_THAN_TOLERANCE_REGISTER(pivotValue)) {
    43014294    if (!region[iRow])
    43024295      regionIndex[numberNonZero++] = iRow;
     
    43134306#endif
    43144307#ifdef FACTORS_HERE
    4315 double ftranTwiddleFactor1X=1.0;
    4316 double ftranTwiddleFactor2X=1.0;
    4317 double ftranFTTwiddleFactor1X=1.0;
    4318 double ftranFTTwiddleFactor2X=1.0;
    4319 double btranTwiddleFactor1X=1.0;
    4320 double btranTwiddleFactor2X=1.0;
    4321 double ftranFullTwiddleFactor1X=1.0;
    4322 double ftranFullTwiddleFactor2X=1.0;
    4323 double btranFullTwiddleFactor1X=1.0;
    4324 double btranFullTwiddleFactor2X=1.0;
    4325 double denseThresholdX=31;
    4326 double twoThresholdX=1000;
    4327 double minRowsSparse=300;
    4328 double largeRowsSparse=10000;
    4329 double mediumRowsDivider=6;
    4330 double mediumRowsMinCount=500;
    4331 double largeRowsCount=1000;
     4308double ftranTwiddleFactor1X = 1.0;
     4309double ftranTwiddleFactor2X = 1.0;
     4310double ftranFTTwiddleFactor1X = 1.0;
     4311double ftranFTTwiddleFactor2X = 1.0;
     4312double btranTwiddleFactor1X = 1.0;
     4313double btranTwiddleFactor2X = 1.0;
     4314double ftranFullTwiddleFactor1X = 1.0;
     4315double ftranFullTwiddleFactor2X = 1.0;
     4316double btranFullTwiddleFactor1X = 1.0;
     4317double btranFullTwiddleFactor2X = 1.0;
     4318double denseThresholdX = 31;
     4319double twoThresholdX = 1000;
     4320double minRowsSparse = 300;
     4321double largeRowsSparse = 10000;
     4322double mediumRowsDivider = 6;
     4323double mediumRowsMinCount = 500;
     4324double largeRowsCount = 1000;
    43324325#else
    43334326extern double ftranTwiddleFactor1X;
     
    43574350#endif
    43584351//  makes a row copy of L
    4359 void
    4360 CoinAbcTypeFactorization::goSparse2 ( )
     4352void CoinAbcTypeFactorization::goSparse2()
    43614353{
    4362 #if ABC_SMALL<2
    4363 #if ABC_SMALL>=0
    4364   if (numberRows_>minRowsSparse) {
    4365 #endif
    4366     if (numberRows_<largeRowsSparse) {
    4367       sparseThreshold_=CoinMin(numberRows_/mediumRowsDivider,mediumRowsMinCount);
    4368       sparseThreshold_=CoinMin(numberRows_/6,500);
     4354#if ABC_SMALL < 2
     4355#if ABC_SMALL >= 0
     4356  if (numberRows_ > minRowsSparse) {
     4357#endif
     4358    if (numberRows_ < largeRowsSparse) {
     4359      sparseThreshold_ = CoinMin(numberRows_ / mediumRowsDivider, mediumRowsMinCount);
     4360      sparseThreshold_ = CoinMin(numberRows_ / 6, 500);
    43694361    } else {
    4370       sparseThreshold_=CoinMax(largeRowsCount,numberRows_>>3);
    4371       sparseThreshold_=500;
     4362      sparseThreshold_ = CoinMax(largeRowsCount, numberRows_ >> 3);
     4363      sparseThreshold_ = 500;
    43724364    }
    43734365#if FACTORIZATION_STATISTICS
    4374     ftranTwiddleFactor1_=ftranTwiddleFactor1X;
    4375     ftranTwiddleFactor2_=ftranTwiddleFactor2X;
    4376     ftranFTTwiddleFactor1_=ftranFTTwiddleFactor1X;
    4377     ftranFTTwiddleFactor2_=ftranFTTwiddleFactor2X;
    4378     btranTwiddleFactor1_=btranTwiddleFactor1X;
    4379     btranTwiddleFactor2_=btranTwiddleFactor2X;
    4380     ftranFullTwiddleFactor1_=ftranFullTwiddleFactor1X;
    4381     ftranFullTwiddleFactor2_=ftranFullTwiddleFactor2X;
    4382     btranFullTwiddleFactor1_=btranFullTwiddleFactor1X;
    4383     btranFullTwiddleFactor2_=btranFullTwiddleFactor2X;
     4366    ftranTwiddleFactor1_ = ftranTwiddleFactor1X;
     4367    ftranTwiddleFactor2_ = ftranTwiddleFactor2X;
     4368    ftranFTTwiddleFactor1_ = ftranFTTwiddleFactor1X;
     4369    ftranFTTwiddleFactor2_ = ftranFTTwiddleFactor2X;
     4370    btranTwiddleFactor1_ = btranTwiddleFactor1X;
     4371    btranTwiddleFactor2_ = btranTwiddleFactor2X;
     4372    ftranFullTwiddleFactor1_ = ftranFullTwiddleFactor1X;
     4373    ftranFullTwiddleFactor2_ = ftranFullTwiddleFactor2X;
     4374    btranFullTwiddleFactor1_ = btranFullTwiddleFactor1X;
     4375    btranFullTwiddleFactor2_ = btranFullTwiddleFactor2X;
    43844376#endif
    43854377    setYesGotLCopy();
     
    43874379    setYesGotSparse();
    43884380    // allow for stack, list, next, starts and char map of mark
    4389     CoinSimplexInt nRowIndex = (numberRows_+CoinSizeofAsInt(CoinSimplexInt)-1)/
    4390       CoinSizeofAsInt(char);
    4391     CoinSimplexInt nInBig = static_cast<CoinSimplexInt>(sizeof(CoinBigIndex)/sizeof(CoinSimplexInt));
    4392     assert (nInBig>=1);
    4393     sizeSparseArray_ = (2+2*nInBig)*numberRows_ + nRowIndex ;
    4394     sparse_.conditionalNew(FACTOR_CPU*sizeSparseArray_);
     4381    CoinSimplexInt nRowIndex = (numberRows_ + CoinSizeofAsInt(CoinSimplexInt) - 1) / CoinSizeofAsInt(char);
     4382    CoinSimplexInt nInBig = static_cast< CoinSimplexInt >(sizeof(CoinBigIndex) / sizeof(CoinSimplexInt));
     4383    assert(nInBig >= 1);
     4384    sizeSparseArray_ = (2 + 2 * nInBig) * numberRows_ + nRowIndex;
     4385    sparse_.conditionalNew(FACTOR_CPU * sizeSparseArray_);
    43954386    sparseAddress_ = sparse_.array();
    43964387    // zero out mark
    4397     CoinAbcStack * stackList = reinterpret_cast<CoinAbcStack *>(sparseAddress_);
    4398     listAddress_ = reinterpret_cast<CoinSimplexInt *>(stackList+numberRows_);
    4399     markRowAddress_ = reinterpret_cast<CoinCheckZero *> (listAddress_ + numberRows_);
    4400     assert(reinterpret_cast<CoinCheckZero *>(sparseAddress_+(2+2*nInBig)*numberRows_)==markRowAddress_);
    4401     CoinAbcMemset0(markRowAddress_,nRowIndex);
     4388    CoinAbcStack *stackList = reinterpret_cast< CoinAbcStack * >(sparseAddress_);
     4389    listAddress_ = reinterpret_cast< CoinSimplexInt * >(stackList + numberRows_);
     4390    markRowAddress_ = reinterpret_cast< CoinCheckZero * >(listAddress_ + numberRows_);
     4391    assert(reinterpret_cast< CoinCheckZero * >(sparseAddress_ + (2 + 2 * nInBig) * numberRows_) == markRowAddress_);
     4392    CoinAbcMemset0(markRowAddress_, nRowIndex);
    44024393#if ABC_PARALLEL
    44034394    //printf("PP 0__ %d %s\n",__LINE__,__FILE__);
    44044395    // convert to bytes
    4405     sizeSparseArray_*=sizeof(CoinSimplexInt);
    4406     char * mark=reinterpret_cast<char *>(reinterpret_cast<char *>(markRowAddress_)+sizeSparseArray_);
    4407     for (int i=1;i<FACTOR_CPU;i++) {
    4408       CoinAbcMemset0(mark,nRowIndex);
    4409       mark=reinterpret_cast<char *>(reinterpret_cast<char *>(mark)+sizeSparseArray_);
     4396    sizeSparseArray_ *= sizeof(CoinSimplexInt);
     4397    char *mark = reinterpret_cast< char * >(reinterpret_cast< char * >(markRowAddress_) + sizeSparseArray_);
     4398    for (int i = 1; i < FACTOR_CPU; i++) {
     4399      CoinAbcMemset0(mark, nRowIndex);
     4400      mark = reinterpret_cast< char * >(reinterpret_cast< char * >(mark) + sizeSparseArray_);
    44104401    }
    44114402#endif
    44124403    elementByRowL_.conditionalDelete();
    44134404    indexColumnL_.conditionalDelete();
    4414     startRowL_.conditionalNew(numberRows_+1);
     4405    startRowL_.conditionalNew(numberRows_ + 1);
    44154406    if (lengthAreaL_) {
    44164407      elementByRowL_.conditionalNew(lengthAreaL_);
    44174408      indexColumnL_.conditionalNew(lengthAreaL_);
    44184409    }
    4419     elementByRowLAddress_=elementByRowL_.array();
    4420     indexColumnLAddress_=indexColumnL_.array();
    4421     startRowLAddress_=startRowL_.array();
     4410    elementByRowLAddress_ = elementByRowL_.array();
     4411    indexColumnLAddress_ = indexColumnL_.array();
     4412    startRowLAddress_ = startRowL_.array();
    44224413    // counts
    4423     CoinBigIndex * COIN_RESTRICT startRowL = startRowLAddress_;
    4424     CoinZeroN(startRowL,numberRows_);
    4425     const CoinBigIndex * startColumnL = startColumnLAddress_;
    4426     CoinFactorizationDouble * COIN_RESTRICT elementL = elementLAddress_;
    4427     const CoinSimplexInt * indexRowL = indexRowLAddress_;
    4428     for (CoinSimplexInt i=baseL_;i<baseL_+numberL_;i++) {
    4429       for (CoinBigIndex j=startColumnL[i];j<startColumnL[i+1];j++) {
    4430         CoinSimplexInt iRow = indexRowL[j];
    4431         startRowL[iRow]++;
    4432       }
    4433     }
    4434     const CoinSimplexInt * COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
     4414    CoinBigIndex *COIN_RESTRICT startRowL = startRowLAddress_;
     4415    CoinZeroN(startRowL, numberRows_);
     4416    const CoinBigIndex *startColumnL = startColumnLAddress_;
     4417    CoinFactorizationDouble *COIN_RESTRICT elementL = elementLAddress_;
     4418    const CoinSimplexInt *indexRowL = indexRowLAddress_;
     4419    for (CoinSimplexInt i = baseL_; i < baseL_ + numberL_; i++) {
     4420      for (CoinBigIndex j = startColumnL[i]; j < startColumnL[i + 1]; j++) {
     4421        CoinSimplexInt iRow = indexRowL[j];
     4422        startRowL[iRow]++;
     4423      }
     4424    }
     4425    const CoinSimplexInt *COIN_RESTRICT pivotLOrder = pivotLOrderAddress_;
    44354426    // convert count to lasts
    4436     CoinBigIndex count=0;
    4437     for (CoinSimplexInt i=0;i<numberRows_;i++) {
    4438       CoinSimplexInt numberInRow=startRowL[i];
     4427    CoinBigIndex count = 0;
     4428    for (CoinSimplexInt i = 0; i < numberRows_; i++) {
     4429      CoinSimplexInt numberInRow = startRowL[i];
    44394430      count += numberInRow;
    4440       startRowL[i]=count;
    4441     }
    4442     startRowL[numberRows_]=count;
     4431      startRowL[i] = count;
     4432    }
     4433    startRowL[numberRows_] = count;
    44434434    // now insert
    4444     CoinFactorizationDouble * COIN_RESTRICT elementByRowL = elementByRowLAddress_;
    4445     CoinSimplexInt * COIN_RESTRICT indexColumnL = indexColumnLAddress_;
    4446     for (CoinSimplexInt i=baseL_+numberL_-1;i>=baseL_;i--) {
     4435    CoinFactorizationDouble *COIN_RESTRICT elementByRowL = elementByRowLAddress_;
     4436    CoinSimplexInt *COIN_RESTRICT indexColumnL = indexColumnLAddress_;
     4437    for (CoinSimplexInt i = baseL_ + numberL_ - 1; i >= baseL_; i--) {
    44474438#ifndef ABC_ORDERED_FACTORIZATION
    4448       CoinSimplexInt iPivot=pivotLOrder[i];
    4449 #else
    4450       CoinSimplexInt iPivot=i;
    4451 #endif
    4452       for (CoinBigIndex j=startColumnL[i];j<startColumnL[i+1];j++) {
    4453         CoinSimplexInt iRow = indexRowL[j];
    4454         CoinBigIndex start = startRowL[iRow]-1;
    4455         startRowL[iRow]=start;
    4456         elementByRowL[start]=elementL[j];
    4457         indexColumnL[start]=iPivot;
    4458       }
    4459     }
    4460 #if ABC_SMALL>=0
     4439      CoinSimplexInt iPivot = pivotLOrder[i];
     4440#else
     4441    CoinSimplexInt iPivot = i;
     4442#endif
     4443      for (CoinBigIndex j = startColumnL[i]; j < startColumnL[i + 1]; j++) {
     4444        CoinSimplexInt iRow = indexRowL[j];
     4445        CoinBigIndex start = startRowL[iRow] - 1;
     4446        startRowL[iRow] = start;
     4447        elementByRowL[start] = elementL[j];
     4448        indexColumnL[start] = iPivot;
     4449      }
     4450    }
     4451#if ABC_SMALL >= 0
    44614452  } else {
    4462     sparseThreshold_=0;
     4453    sparseThreshold_ = 0;
    44634454    setNoGotLCopy();
    44644455    //setYesGotUCopy();
     
    44724463//  set sparse threshold
    44734464void
    4474 CoinAbcTypeFactorization::sparseThreshold ( CoinSimplexInt /*value*/ )
     4465  CoinAbcTypeFactorization::sparseThreshold(CoinSimplexInt /*value*/)
    44754466{
    44764467  return;
     
    44944485#endif
    44954486}
    4496 void CoinAbcTypeFactorization::maximumPivots (  CoinSimplexInt value )
     4487void CoinAbcTypeFactorization::maximumPivots(CoinSimplexInt value)
    44974488{
    4498   if (value>0) {
     4489  if (value > 0) {
    44994490    if (numberRows_)
    4500       maximumMaximumPivots_=CoinMax(maximumMaximumPivots_,value);
     4491      maximumMaximumPivots_ = CoinMax(maximumMaximumPivots_, value);
    45014492    else
    4502       maximumMaximumPivots_=value;
    4503     maximumPivots_=value;
     4493      maximumMaximumPivots_ = value;
     4494    maximumPivots_ = value;
    45044495  }
    45054496  //printf("max %d maxmax %d\n",maximumPivots_,maximumMaximumPivots_);
    45064497}
    4507 void CoinAbcTypeFactorization::messageLevel (  CoinSimplexInt value )
     4498void CoinAbcTypeFactorization::messageLevel(CoinSimplexInt value)
    45084499{
    4509   if (value>0&&value<16) {
    4510     messageLevel_=value;
     4500  if (value > 0 && value < 16) {
     4501    messageLevel_ = value;
    45114502  }
    45124503}
     
    45144505void CoinAbcTypeFactorization::resetStatistics()
    45154506{
    4516 #if ABC_SMALL<2
     4507#if ABC_SMALL < 2
    45174508  setStatistics(true);
    45184509
    45194510  /// Below are all to collect
    4520   ftranCountInput_=0.0;
    4521   ftranCountAfterL_=0.0;
    4522   ftranCountAfterR_=0.0;
    4523   ftranCountAfterU_=0.0;
    4524   ftranFTCountInput_=0.0;
    4525   ftranFTCountAfterL_=0.0;
    4526   ftranFTCountAfterR_=0.0;
    4527   ftranFTCountAfterU_=0.0;
    4528   btranCountInput_=0.0;
    4529   btranCountAfterU_=0.0;
    4530   btranCountAfterR_=0.0;
    4531   btranCountAfterL_=0.0;
    4532   ftranFullCountInput_=0.0;
    4533   ftranFullCountAfterL_=0.0;
    4534   ftranFullCountAfterR_=0.0;
    4535   ftranFullCountAfterU_=0.0;
    4536   btranFullCountInput_=0.0;
    4537   btranFullCountAfterL_=0.0;
    4538   btranFullCountAfterR_=0.0;
    4539   btranFullCountAfterU_=0.0;
     4511  ftranCountInput_ = 0.0;
     4512  ftranCountAfterL_ = 0.0;
     4513  ftranCountAfterR_ = 0.0;
     4514  ftranCountAfterU_ = 0.0;
     4515  ftranFTCountInput_ = 0.0;
     4516  ftranFTCountAfterL_ = 0.0;
     4517  ftranFTCountAfterR_ = 0.0;
     4518  ftranFTCountAfterU_ = 0.0;
     4519  btranCountInput_ = 0.0;
     4520  btranCountAfterU_ = 0.0;
     4521  btranCountAfterR_ = 0.0;
     4522  btranCountAfterL_ = 0.0;
     4523  ftranFullCountInput_ = 0.0;
     4524  ftranFullCountAfterL_ = 0.0;
     4525  ftranFullCountAfterR_ = 0.0;
     4526  ftranFullCountAfterU_ = 0.0;
     4527  btranFullCountInput_ = 0.0;
     4528  btranFullCountAfterL_ = 0.0;
     4529  btranFullCountAfterR_ = 0.0;
     4530  btranFullCountAfterU_ = 0.0;
    45404531
    45414532  /// We can roll over factorizations
    4542   numberFtranCounts_=0;
    4543   numberFtranFTCounts_=0;
    4544   numberBtranCounts_=0;
    4545   numberFtranFullCounts_=0;
    4546   numberFtranFullCounts_=0;
    4547 
    4548   /// While these are averages collected over last 
    4549   ftranAverageAfterL_=INITIAL_AVERAGE;
    4550   ftranAverageAfterR_=INITIAL_AVERAGE;
    4551   ftranAverageAfterU_=INITIAL_AVERAGE;
    4552   ftranFTAverageAfterL_=INITIAL_AVERAGE;
    4553   ftranFTAverageAfterR_=INITIAL_AVERAGE;
    4554   ftranFTAverageAfterU_=INITIAL_AVERAGE;
    4555   btranAverageAfterU_=INITIAL_AVERAGE;
    4556   btranAverageAfterR_=INITIAL_AVERAGE;
    4557   btranAverageAfterL_=INITIAL_AVERAGE;
    4558   ftranFullAverageAfterL_=INITIAL_AVERAGE;
    4559   ftranFullAverageAfterR_=INITIAL_AVERAGE;
    4560   ftranFullAverageAfterU_=INITIAL_AVERAGE;
    4561   btranFullAverageAfterL_=INITIAL_AVERAGE;
    4562   btranFullAverageAfterR_=INITIAL_AVERAGE;
    4563   btranFullAverageAfterU_=INITIAL_AVERAGE;
    4564 #endif 
     4533  numberFtranCounts_ = 0;
     4534  numberFtranFTCounts_ = 0;
     4535  numberBtranCounts_ = 0;
     4536  numberFtranFullCounts_ = 0;
     4537  numberFtranFullCounts_ = 0;
     4538
     4539  /// While these are averages collected over last
     4540  ftranAverageAfterL_ = INITIAL_AVERAGE;
     4541  ftranAverageAfterR_ = INITIAL_AVERAGE;
     4542  ftranAverageAfterU_ = INITIAL_AVERAGE;
     4543  ftranFTAverageAfterL_ = INITIAL_AVERAGE;
     4544  ftranFTAverageAfterR_ = INITIAL_AVERAGE;
     4545  ftranFTAverageAfterU_ = INITIAL_AVERAGE;
     4546  btranAverageAfterU_ = INITIAL_AVERAGE;
     4547  btranAverageAfterR_ = INITIAL_AVERAGE;
     4548  btranAverageAfterL_ = INITIAL_AVERAGE;
     4549  ftranFullAverageAfterL_ = INITIAL_AVERAGE;
     4550  ftranFullAverageAfterR_ = INITIAL_AVERAGE;
     4551  ftranFullAverageAfterU_ = INITIAL_AVERAGE;
     4552  btranFullAverageAfterL_ = INITIAL_AVERAGE;
     4553  btranFullAverageAfterR_ = INITIAL_AVERAGE;
     4554  btranFullAverageAfterU_ = INITIAL_AVERAGE;
     4555#endif
    45654556}
    45664557// See if worth going sparse
    4567 void
    4568 CoinAbcTypeFactorization::checkSparse()
     4558void CoinAbcTypeFactorization::checkSparse()
    45694559{
    4570 #if ABC_SMALL<2
     4560#if ABC_SMALL < 2
    45714561  // See if worth going sparse and when
    4572   if (numberFtranCounts_>50) {
    4573     ftranCountInput_= CoinMax(ftranCountInput_,1.0);
    4574     ftranAverageAfterL_ = CoinMax(ftranCountAfterL_/ftranCountInput_,INITIAL_AVERAGE2);
    4575     ftranAverageAfterR_ = CoinMax(ftranCountAfterR_/ftranCountAfterL_,INITIAL_AVERAGE2);
    4576     ftranAverageAfterU_ = CoinMax(ftranCountAfterU_/ftranCountAfterR_,INITIAL_AVERAGE2);
    4577     ftranFTCountInput_= CoinMax(ftranFTCountInput_,INITIAL_AVERAGE2);
    4578     ftranFTAverageAfterL_ = CoinMax(ftranFTCountAfterL_/ftranFTCountInput_,INITIAL_AVERAGE2);
    4579     ftranFTAverageAfterR_ = CoinMax(ftranFTCountAfterR_/ftranFTCountAfterL_,INITIAL_AVERAGE2);
    4580     ftranFTAverageAfterU_ = CoinMax(ftranFTCountAfterU_/ftranFTCountAfterR_,INITIAL_AVERAGE2);
    4581     if (btranCountInput_&&btranCountAfterU_&&btranCountAfterR_) {
    4582       btranAverageAfterU_ = CoinMax(btranCountAfterU_/btranCountInput_,INITIAL_AVERAGE2);
    4583       btranAverageAfterR_ = CoinMax(btranCountAfterR_/btranCountAfterU_,INITIAL_AVERAGE2);
    4584       btranAverageAfterL_ = CoinMax(btranCountAfterL_/btranCountAfterR_,INITIAL_AVERAGE2);
     4562  if (numberFtranCounts_ > 50) {
     4563    ftranCountInput_ = CoinMax(ftranCountInput_, 1.0);
     4564    ftranAverageAfterL_ = CoinMax(ftranCountAfterL_ / ftranCountInput_, INITIAL_AVERAGE2);
     4565    ftranAverageAfterR_ = CoinMax(ftranCountAfterR_ / ftranCountAfterL_, INITIAL_AVERAGE2);
     4566    ftranAverageAfterU_ = CoinMax(ftranCountAfterU_ / ftranCountAfterR_, INITIAL_AVERAGE2);
     4567    ftranFTCountInput_ = CoinMax(ftranFTCountInput_, INITIAL_AVERAGE2);
     4568    ftranFTAverageAfterL_ = CoinMax(ftranFTCountAfterL_ / ftranFTCountInput_, INITIAL_AVERAGE2);
     4569    ftranFTAverageAfterR_ = CoinMax(ftranFTCountAfterR_ / ftranFTCountAfterL_, INITIAL_AVERAGE2);
     4570    ftranFTAverageAfterU_ = CoinMax(ftranFTCountAfterU_ / ftranFTCountAfterR_, INITIAL_AVERAGE2);
     4571    if (btranCountInput_ && btranCountAfterU_ && btranCountAfterR_) {
     4572      btranAverageAfterU_ = CoinMax(btranCountAfterU_ / btranCountInput_, INITIAL_AVERAGE2);
     4573      btranAverageAfterR_ = CoinMax(btranCountAfterR_ / btranCountAfterU_, INITIAL_AVERAGE2);
     4574      btranAverageAfterL_ = CoinMax(btranCountAfterL_ / btranCountAfterR_, INITIAL_AVERAGE2);
    45854575    } else {
    45864576      // we have not done any useful btrans (values pass?)
     
    45924582      btranFullCountAfterU_ = INITIAL_AVERAGE2;
    45934583    }
    4594     ftranFullCountInput_= CoinMax(ftranFullCountInput_,1.0);
    4595     ftranFullAverageAfterL_ = CoinMax(ftranFullCountAfterL_/ftranFullCountInput_,INITIAL_AVERAGE2);
    4596     ftranFullAverageAfterR_ = CoinMax(ftranFullCountAfterR_/ftranFullCountAfterL_,INITIAL_AVERAGE2);
    4597     ftranFullAverageAfterU_ = CoinMax(ftranFullCountAfterU_/ftranFullCountAfterR_,INITIAL_AVERAGE2);
    4598     btranFullCountInput_= CoinMax(btranFullCountInput_,1.0);
    4599     btranFullAverageAfterL_ = CoinMax(btranFullCountAfterL_/btranFullCountInput_,INITIAL_AVERAGE2);
    4600     btranFullAverageAfterR_ = CoinMax(btranFullCountAfterR_/btranFullCountAfterL_,INITIAL_AVERAGE2);
    4601     btranFullAverageAfterU_ = CoinMax(btranFullCountAfterU_/btranFullCountAfterR_,INITIAL_AVERAGE2);
     4584    ftranFullCountInput_ = CoinMax(ftranFullCountInput_, 1.0);
     4585    ftranFullAverageAfterL_ = CoinMax(ftranFullCountAfterL_ / ftranFullCountInput_, INITIAL_AVERAGE2);
     4586    ftranFullAverageAfterR_ = CoinMax(ftranFullCountAfterR_ / ftranFullCountAfterL_, INITIAL_AVERAGE2);
     4587    ftranFullAverageAfterU_ = CoinMax(ftranFullCountAfterU_ / ftranFullCountAfterR_, INITIAL_AVERAGE2);
     4588    btranFullCountInput_ = CoinMax(btranFullCountInput_, 1.0);
     4589    btranFullAverageAfterL_ = CoinMax(btranFullCountAfterL_ / btranFullCountInput_, INITIAL_AVERAGE2);
     4590    btranFullAverageAfterR_ = CoinMax(btranFullCountAfterR_ / btranFullCountAfterL_, INITIAL_AVERAGE2);
     4591    btranFullAverageAfterU_ = CoinMax(btranFullCountAfterU_ / btranFullCountAfterR_, INITIAL_AVERAGE2);
    46024592  }
    46034593  // scale back
    4604  
     4594
    46054595  ftranCountInput_ *= AVERAGE_SCALE_BACK;
    46064596  ftranCountAfterL_ *= AVERAGE_SCALE_BACK;
     
    46264616}
    46274617// Condition number - product of pivots after factorization
    4628 CoinSimplexDouble 
     4618CoinSimplexDouble
    46294619CoinAbcTypeFactorization::conditionNumber() const
    46304620{
    46314621  CoinSimplexDouble condition = 1.0;
    4632   const CoinFactorizationDouble * pivotRegion = pivotRegionAddress_;
    4633   for (CoinSimplexInt i=0;i<numberRows_;i++) {
     4622  const CoinFactorizationDouble *pivotRegion = pivotRegionAddress_;
     4623  for (CoinSimplexInt i = 0; i < numberRows_; i++) {
    46344624    condition *= pivotRegion[i];
    46354625  }
    4636   condition = CoinMax(fabs(condition),1.0e-50);
    4637   return 1.0/condition;
     4626  condition = CoinMax(fabs(condition), 1.0e-50);
     4627  return 1.0 / condition;
    46384628}
    46394629#ifndef NDEBUG
    4640 void
    4641 CoinAbcTypeFactorization::checkMarkArrays() const
     4630void CoinAbcTypeFactorization::checkMarkArrays() const
    46424631{
    4643   CoinCheckZero * COIN_RESTRICT mark = markRowAddress_;
    4644   for (CoinSimplexInt i=0;i<numberRows_;i++) {
    4645     assert (!mark[i]);
     4632  CoinCheckZero *COIN_RESTRICT mark = markRowAddress_;
     4633  for (CoinSimplexInt i = 0; i < numberRows_; i++) {
     4634    assert(!mark[i]);
    46464635  }
    46474636#if ABC_PARALLEL
    4648   mark=reinterpret_cast<CoinCheckZero *>(reinterpret_cast<char *>(mark)+sizeSparseArray_);
    4649   for (CoinSimplexInt i=0;i<numberRows_;i++) {
    4650     assert (!mark[i]);
    4651   }
    4652   for (int i=1;i<FACTOR_CPU;i++) {
    4653     for (CoinSimplexInt i=0;i<numberRows_;i++) {
    4654       assert (!mark[i]);
    4655     }
    4656     mark=reinterpret_cast<CoinCheckZero *>(reinterpret_cast<char *>(mark)+sizeSparseArray_);
     4637  mark = reinterpret_cast< CoinCheckZero * >(reinterpret_cast< char * >(mark) + sizeSparseArray_);
     4638  for (CoinSimplexInt i = 0; i < numberRows_; i++) {
     4639    assert(!mark[i]);
     4640  }
     4641  for (int i = 1; i < FACTOR_CPU; i++) {
     4642    for (CoinSimplexInt i = 0; i < numberRows_; i++) {
     4643      assert(!mark[i]);
     4644    }
     4645    mark = reinterpret_cast< CoinCheckZero * >(reinterpret_cast< char * >(mark) + sizeSparseArray_);
    46574646  }
    46584647#endif
     
    46604649#endif
    46614650#endif
     4651
     4652/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     4653*/
Note: See TracChangeset for help on using the changeset viewer.