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

formatting

File:
1 edited

Legend:

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

    r1910 r2385  
    1818//:class CoinAbcDenseFactorization.  Deals with Factorization and Updates
    1919//  CoinAbcDenseFactorization.  Constructor
    20 CoinAbcDenseFactorization::CoinAbcDenseFactorization (  )
     20CoinAbcDenseFactorization::CoinAbcDenseFactorization()
    2121  : CoinAbcAnyFactorization()
    2222{
     
    2424}
    2525
    26 /// Copy constructor 
    27 CoinAbcDenseFactorization::CoinAbcDenseFactorization ( const CoinAbcDenseFactorization &other)
     26/// Copy constructor
     27CoinAbcDenseFactorization::CoinAbcDenseFactorization(const CoinAbcDenseFactorization &other)
    2828  : CoinAbcAnyFactorization(other)
    2929{
     
    3232}
    3333// Clone
    34 CoinAbcAnyFactorization * 
    35 CoinAbcDenseFactorization::clone() const 
     34CoinAbcAnyFactorization *
     35CoinAbcDenseFactorization::clone() const
    3636{
    3737  return new CoinAbcDenseFactorization(*this);
     
    4040void CoinAbcDenseFactorization::gutsOfDestructor()
    4141{
    42   delete [] elements_;
    43   delete [] pivotRow_;
    44   delete [] workArea_;
     42  delete[] elements_;
     43  delete[] pivotRow_;
     44  delete[] workArea_;
    4545  elements_ = NULL;
    4646  pivotRow_ = NULL;
     
    4949  numberGoodU_ = 0;
    5050  status_ = -1;
    51   maximumRows_=0;
    52 #if ABC_PARALLEL==2
    53   parallelMode_=0;
    54 #endif
    55   maximumSpace_=0;
    56   maximumRowsAdjusted_=0;
    57   solveMode_=0;
     51  maximumRows_ = 0;
     52#if ABC_PARALLEL == 2
     53  parallelMode_ = 0;
     54#endif
     55  maximumSpace_ = 0;
     56  maximumRowsAdjusted_ = 0;
     57  solveMode_ = 0;
    5858}
    5959void CoinAbcDenseFactorization::gutsOfInitialize()
     
    6262  minimumPivotTolerance_ = 1.0e-1;
    6363  zeroTolerance_ = 1.0e-13;
    64   areaFactor_=1.0;
    65   numberDense_=0;
    66   maximumPivots_=200;
    67   relaxCheck_=1.0;
     64  areaFactor_ = 1.0;
     65  numberDense_ = 0;
     66  maximumPivots_ = 200;
     67  relaxCheck_ = 1.0;
    6868  numberRows_ = 0;
    6969  numberGoodU_ = 0;
     
    7171  numberSlacks_ = 0;
    7272  numberPivots_ = 0;
    73   maximumRows_=0;
    74 #if ABC_PARALLEL==2
    75   parallelMode_=0;
    76 #endif
    77   maximumSpace_=0;
    78   maximumRowsAdjusted_=0;
     73  maximumRows_ = 0;
     74#if ABC_PARALLEL == 2
     75  parallelMode_ = 0;
     76#endif
     77  maximumSpace_ = 0;
     78  maximumRowsAdjusted_ = 0;
    7979  elements_ = NULL;
    8080  pivotRow_ = NULL;
    8181  workArea_ = NULL;
    82   solveMode_=0;
     82  solveMode_ = 0;
    8383}
    8484//  ~CoinAbcDenseFactorization.  Destructor
    85 CoinAbcDenseFactorization::~CoinAbcDenseFactorization (  )
     85CoinAbcDenseFactorization::~CoinAbcDenseFactorization()
    8686{
    8787  gutsOfDestructor();
    8888}
    8989//  =
    90 CoinAbcDenseFactorization & CoinAbcDenseFactorization::operator = ( const CoinAbcDenseFactorization & other ) {
    91   if (this != &other) {   
     90CoinAbcDenseFactorization &CoinAbcDenseFactorization::operator=(const CoinAbcDenseFactorization &other)
     91{
     92  if (this != &other) {
    9293    gutsOfDestructor();
    9394    gutsOfInitialize();
     
    102103  minimumPivotTolerance_ = other.minimumPivotTolerance_;
    103104  zeroTolerance_ = other.zeroTolerance_;
    104   areaFactor_=other.areaFactor_;
    105   numberDense_=other.numberDense_;
     105  areaFactor_ = other.areaFactor_;
     106  numberDense_ = other.numberDense_;
    106107  relaxCheck_ = other.relaxCheck_;
    107108  numberRows_ = other.numberRows_;
    108109  maximumRows_ = other.maximumRows_;
    109 #if ABC_PARALLEL==2
    110   parallelMode_=other.parallelMode_;
     110#if ABC_PARALLEL == 2
     111  parallelMode_ = other.parallelMode_;
    111112#endif
    112113  maximumSpace_ = other.maximumSpace_;
     
    120121  numberSlacks_ = other.numberSlacks_;
    121122  if (other.pivotRow_) {
    122     pivotRow_ = new int [2*maximumRowsAdjusted_+maximumPivots_];
    123     CoinMemcpyN(other.pivotRow_,(2*maximumRowsAdjusted_+numberPivots_),pivotRow_);
    124     elements_ = new CoinFactorizationDouble [maximumSpace_];
    125     CoinMemcpyN(other.elements_,(maximumRowsAdjusted_+numberPivots_)*maximumRowsAdjusted_,elements_);
    126     workArea_ = new CoinFactorizationDouble [maximumRowsAdjusted_*WORK_MULT];
    127     CoinZeroN(workArea_,maximumRowsAdjusted_*WORK_MULT);
     123    pivotRow_ = new int[2 * maximumRowsAdjusted_ + maximumPivots_];
     124    CoinMemcpyN(other.pivotRow_, (2 * maximumRowsAdjusted_ + numberPivots_), pivotRow_);
     125    elements_ = new CoinFactorizationDouble[maximumSpace_];
     126    CoinMemcpyN(other.elements_, (maximumRowsAdjusted_ + numberPivots_) * maximumRowsAdjusted_, elements_);
     127    workArea_ = new CoinFactorizationDouble[maximumRowsAdjusted_ * WORK_MULT];
     128    CoinZeroN(workArea_, maximumRowsAdjusted_ * WORK_MULT);
    128129  } else {
    129130    elements_ = NULL;
     
    135136//  getAreas.  Gets space for a factorization
    136137//called by constructors
    137 void
    138 CoinAbcDenseFactorization::getAreas ( int numberOfRows,
    139                                       int /*numberOfColumns*/,
    140                          CoinBigIndex ,
    141                          CoinBigIndex  )
     138void CoinAbcDenseFactorization::getAreas(int numberOfRows,
     139  int /*numberOfColumns*/,
     140  CoinBigIndex,
     141  CoinBigIndex)
    142142{
    143143
    144144  numberRows_ = numberOfRows;
    145   numberDense_=numberRows_;
    146   if ((numberRows_&(BLOCKING8-1))!=0)
    147     numberDense_ += (BLOCKING8-(numberRows_&(BLOCKING8-1)));
    148   CoinBigIndex size = numberDense_*(2*numberDense_+CoinMax(maximumPivots_,(numberDense_+1)>>1));
    149   if (size>maximumSpace_) {
    150     delete [] elements_;
    151     elements_ = new CoinFactorizationDouble [size];
     145  numberDense_ = numberRows_;
     146  if ((numberRows_ & (BLOCKING8 - 1)) != 0)
     147    numberDense_ += (BLOCKING8 - (numberRows_ & (BLOCKING8 - 1)));
     148  CoinBigIndex size = numberDense_ * (2 * numberDense_ + CoinMax(maximumPivots_, (numberDense_ + 1) >> 1));
     149  if (size > maximumSpace_) {
     150    delete[] elements_;
     151    elements_ = new CoinFactorizationDouble[size];
    152152    maximumSpace_ = size;
    153153  }
    154   if (numberRows_>maximumRows_) {
     154  if (numberRows_ > maximumRows_) {
    155155    maximumRows_ = numberRows_;
    156156    maximumRowsAdjusted_ = maximumRows_;
    157     if ((maximumRows_&(BLOCKING8-1))!=0)
    158       maximumRowsAdjusted_ += (BLOCKING8-(maximumRows_&(BLOCKING8-1)));
    159     delete [] pivotRow_;
    160     delete [] workArea_;
    161     pivotRow_ = new int [2*maximumRowsAdjusted_+maximumPivots_];
    162     workArea_ = new CoinFactorizationDouble [maximumRowsAdjusted_*WORK_MULT];
    163   }
    164 }
    165 
    166 //  preProcess. 
    167 void
    168 CoinAbcDenseFactorization::preProcess ()
    169 {
    170   CoinBigIndex put = numberDense_*numberDense_;
    171   CoinFactorizationDouble * COIN_RESTRICT area = elements_+maximumSpace_-put;
    172   CoinAbcMemset0(area,put);
    173   int *indexRow = reinterpret_cast<int *> (elements_+numberRows_*numberRows_);
    174   CoinBigIndex * starts = reinterpret_cast<CoinBigIndex *> (pivotRow_);
    175   CoinFactorizationDouble * COIN_RESTRICT column = area;
     157    if ((maximumRows_ & (BLOCKING8 - 1)) != 0)
     158      maximumRowsAdjusted_ += (BLOCKING8 - (maximumRows_ & (BLOCKING8 - 1)));
     159    delete[] pivotRow_;
     160    delete[] workArea_;
     161    pivotRow_ = new int[2 * maximumRowsAdjusted_ + maximumPivots_];
     162    workArea_ = new CoinFactorizationDouble[maximumRowsAdjusted_ * WORK_MULT];
     163  }
     164}
     165
     166//  preProcess.
     167void CoinAbcDenseFactorization::preProcess()
     168{
     169  CoinBigIndex put = numberDense_ * numberDense_;
     170  CoinFactorizationDouble *COIN_RESTRICT area = elements_ + maximumSpace_ - put;
     171  CoinAbcMemset0(area, put);
     172  int *indexRow = reinterpret_cast< int * >(elements_ + numberRows_ * numberRows_);
     173  CoinBigIndex *starts = reinterpret_cast< CoinBigIndex * >(pivotRow_);
     174  CoinFactorizationDouble *COIN_RESTRICT column = area;
    176175  //if (solveMode_==10)
    177176  //solveMode_=1;
    178   if ((solveMode_%10)!=0) {
    179     for (int i=0;i<numberRows_;i++) {
    180       for (CoinBigIndex j=starts[i];j<starts[i+1];j++) {
    181         int iRow = indexRow[j];
    182         int iBlock=iRow>>3;
    183         iRow=iRow&(BLOCKING8-1);
    184         column[iRow+BLOCKING8X8*iBlock]=elements_[j];
    185       }
    186       if ((i&(BLOCKING8-1))!=(BLOCKING8-1))
    187         column += BLOCKING8;
     177  if ((solveMode_ % 10) != 0) {
     178    for (int i = 0; i < numberRows_; i++) {
     179      for (CoinBigIndex j = starts[i]; j < starts[i + 1]; j++) {
     180        int iRow = indexRow[j];
     181        int iBlock = iRow >> 3;
     182        iRow = iRow & (BLOCKING8 - 1);
     183        column[iRow + BLOCKING8X8 * iBlock] = elements_[j];
     184      }
     185      if ((i & (BLOCKING8 - 1)) != (BLOCKING8 - 1))
     186        column += BLOCKING8;
    188187      else
    189         column += numberDense_*BLOCKING8-(BLOCKING8-1)*BLOCKING8;
    190     }
    191     for (int i=numberRows_;i<numberDense_;i++) {
     188        column += numberDense_ * BLOCKING8 - (BLOCKING8 - 1) * BLOCKING8;
     189    }
     190    for (int i = numberRows_; i < numberDense_; i++) {
    192191      int iRow = i;
    193       int iBlock=iRow>>3;
    194       iRow=iRow&(BLOCKING8-1);
    195       column[iRow+BLOCKING8X8*iBlock]=1.0;
    196       if ((i&(BLOCKING8-1))!=(BLOCKING8-1))
    197         column += BLOCKING8;
     192      int iBlock = iRow >> 3;
     193      iRow = iRow & (BLOCKING8 - 1);
     194      column[iRow + BLOCKING8X8 * iBlock] = 1.0;
     195      if ((i & (BLOCKING8 - 1)) != (BLOCKING8 - 1))
     196        column += BLOCKING8;
    198197      //else
    199198      //column += numberDense_*BLOCKING8-(BLOCKING8-1)*BLOCKING8;
     
    201200  } else {
    202201    // first or bad
    203     for (int i=0;i<numberRows_;i++) {
    204       for (CoinBigIndex j=starts[i];j<starts[i+1];j++) {
    205         int iRow = indexRow[j];
    206         column[iRow]=elements_[j];
     202    for (int i = 0; i < numberRows_; i++) {
     203      for (CoinBigIndex j = starts[i]; j < starts[i + 1]; j++) {
     204        int iRow = indexRow[j];
     205        column[iRow] = elements_[j];
    207206      }
    208207      column += numberDense_;
    209208    }
    210     for (int i=numberRows_;i<numberDense_;i++) {
    211       column[i]=1.0;
     209    for (int i = numberRows_; i < numberDense_; i++) {
     210      column[i] = 1.0;
    212211      column += numberDense_;
    213212    }
     
    216215
    217216//Does factorization
    218 int
    219 CoinAbcDenseFactorization::factor (AbcSimplex * /*model*/)
    220 {
    221   numberPivots_=0;
    222   // ? take out
     217int CoinAbcDenseFactorization::factor(AbcSimplex * /*model*/)
     218{
     219  numberPivots_ = 0;
     220  // ? take out
    223221  //printf("Debug non lapack dense factor\n");
    224222  //solveMode_&=~1;
    225   CoinBigIndex put = numberDense_*numberDense_;
    226   CoinFactorizationDouble * COIN_RESTRICT area = elements_+maximumSpace_-put;
    227   if ((solveMode_%10)!=0) {
     223  CoinBigIndex put = numberDense_ * numberDense_;
     224  CoinFactorizationDouble *COIN_RESTRICT area = elements_ + maximumSpace_ - put;
     225  if ((solveMode_ % 10) != 0) {
    228226    // save last start
    229     CoinBigIndex lastStart=pivotRow_[numberRows_];
    230     status_=CoinAbcDgetrf(numberDense_,numberDense_,area,numberDense_,pivotRow_+numberDense_
    231 #if ABC_PARALLEL==2
    232                           ,parallelMode_
    233 #endif
    234                           );
     227    CoinBigIndex lastStart = pivotRow_[numberRows_];
     228    status_ = CoinAbcDgetrf(numberDense_, numberDense_, area, numberDense_, pivotRow_ + numberDense_
     229#if ABC_PARALLEL == 2
     230      ,
     231      parallelMode_
     232#endif
     233    );
    235234    // need to check size of pivots
    236     if(!status_) {
     235    if (!status_) {
    237236      // OK
    238       solveMode_=1+10*(solveMode_/10);
    239       numberGoodU_=numberRows_;
    240       CoinZeroN(workArea_,2*numberRows_);
     237      solveMode_ = 1 + 10 * (solveMode_ / 10);
     238      numberGoodU_ = numberRows_;
     239      CoinZeroN(workArea_, 2 * numberRows_);
    241240#if 0 //ndef NDEBUG
    242241      const CoinFactorizationDouble * column = area;
     
    252251      return 0;
    253252    } else {
    254       solveMode_=10*(solveMode_/10);
     253      solveMode_ = 10 * (solveMode_ / 10);
    255254      // redo matrix
    256255      // last start
    257       pivotRow_[numberRows_]=lastStart;
     256      pivotRow_[numberRows_] = lastStart;
    258257      preProcess();
    259258    }
    260259  }
    261   status_=0;
    262   for (int j=0;j<numberRows_;j++) {
    263     pivotRow_[j+numberDense_]=j;
    264   }
    265   CoinFactorizationDouble * elements = area;
    266   numberGoodU_=0;
    267   for (int i=0;i<numberRows_;i++) {
     260  status_ = 0;
     261  for (int j = 0; j < numberRows_; j++) {
     262    pivotRow_[j + numberDense_] = j;
     263  }
     264  CoinFactorizationDouble *elements = area;
     265  numberGoodU_ = 0;
     266  for (int i = 0; i < numberRows_; i++) {
    268267    int iRow = -1;
    269268    // Find largest
    270     double largest=zeroTolerance_;
    271     for (int j=i;j<numberRows_;j++) {
     269    double largest = zeroTolerance_;
     270    for (int j = i; j < numberRows_; j++) {
    272271      double value = fabs(elements[j]);
    273       if (value>largest) {
    274         largest=value;
    275         iRow=j;
    276       }
    277     }
    278     if (iRow>=0) {
    279       if (iRow!=i) {
    280         // swap
    281         assert (iRow>i);
    282         CoinFactorizationDouble * elementsA = area;
    283         for (int k=0;k<=i;k++) {
    284           // swap
    285           CoinFactorizationDouble value = elementsA[i];
    286           elementsA[i]=elementsA[iRow];
    287           elementsA[iRow]=value;
    288           elementsA += numberDense_;
    289         }
    290         int iPivot = pivotRow_[i+numberDense_];
    291         pivotRow_[i+numberDense_]=pivotRow_[iRow+numberDense_];
    292         pivotRow_[iRow+numberDense_]=iPivot;
    293       }
    294       CoinFactorizationDouble pivotValue = 1.0/elements[i];
    295       elements[i]=pivotValue;
    296       for (int j=i+1;j<numberRows_;j++) {
    297         elements[j] *= pivotValue;
     272      if (value > largest) {
     273        largest = value;
     274        iRow = j;
     275      }
     276    }
     277    if (iRow >= 0) {
     278      if (iRow != i) {
     279        // swap
     280        assert(iRow > i);
     281        CoinFactorizationDouble *elementsA = area;
     282        for (int k = 0; k <= i; k++) {
     283          // swap
     284          CoinFactorizationDouble value = elementsA[i];
     285          elementsA[i] = elementsA[iRow];
     286          elementsA[iRow] = value;
     287          elementsA += numberDense_;
     288        }
     289        int iPivot = pivotRow_[i + numberDense_];
     290        pivotRow_[i + numberDense_] = pivotRow_[iRow + numberDense_];
     291        pivotRow_[iRow + numberDense_] = iPivot;
     292      }
     293      CoinFactorizationDouble pivotValue = 1.0 / elements[i];
     294      elements[i] = pivotValue;
     295      for (int j = i + 1; j < numberRows_; j++) {
     296        elements[j] *= pivotValue;
    298297      }
    299298      // Update rest
    300       CoinFactorizationDouble * elementsA = elements;
    301       for (int k=i+1;k<numberRows_;k++) {
    302         elementsA += numberDense_;
    303         // swap
    304         if (iRow!=i) {
    305           CoinFactorizationDouble value = elementsA[i];
    306           elementsA[i]=elementsA[iRow];
    307           elementsA[iRow]=value;
    308         }
    309         CoinFactorizationDouble value = elementsA[i];
    310         for (int j=i+1;j<numberRows_;j++) {
    311           elementsA[j] -= value * elements[j];
    312         }
     299      CoinFactorizationDouble *elementsA = elements;
     300      for (int k = i + 1; k < numberRows_; k++) {
     301        elementsA += numberDense_;
     302        // swap
     303        if (iRow != i) {
     304          CoinFactorizationDouble value = elementsA[i];
     305          elementsA[i] = elementsA[iRow];
     306          elementsA[iRow] = value;
     307        }
     308        CoinFactorizationDouble value = elementsA[i];
     309        for (int j = i + 1; j < numberRows_; j++) {
     310          elementsA[j] -= value * elements[j];
     311        }
    313312      }
    314313    } else {
    315       status_=-1;
     314      status_ = -1;
    316315      break;
    317316    }
     
    319318    elements += numberDense_;
    320319  }
    321   for (int j=0;j<numberRows_;j++) {
    322     int k = pivotRow_[j+numberDense_];
    323     pivotRow_[k]=j;
     320  for (int j = 0; j < numberRows_; j++) {
     321    int k = pivotRow_[j + numberDense_];
     322    pivotRow_[k] = j;
    324323  }
    325324  //assert (status_);
     
    333332}
    334333// Makes a non-singular basis by replacing variables
    335 void
    336 CoinAbcDenseFactorization::makeNonSingular(int * sequence)
     334void CoinAbcDenseFactorization::makeNonSingular(int *sequence)
    337335{
    338336  // Replace bad ones by correct slack
    339   int * workArea = reinterpret_cast<int *> (workArea_);
     337  int *workArea = reinterpret_cast< int * >(workArea_);
    340338  int i;
    341   for ( i=0;i<numberRows_;i++)
    342     workArea[i]=-1;
    343   for ( i=0;i<numberGoodU_;i++) {
    344     int iOriginal = pivotRow_[i+numberDense_];
    345     workArea[iOriginal]=i;
     339  for (i = 0; i < numberRows_; i++)
     340    workArea[i] = -1;
     341  for (i = 0; i < numberGoodU_; i++) {
     342    int iOriginal = pivotRow_[i + numberDense_];
     343    workArea[iOriginal] = i;
    346344    //workArea[i]=iOriginal;
    347345  }
    348   int lastRow=-1;
    349   for ( i=0;i<numberRows_;i++) {
    350     if (workArea[i]==-1) {
    351       lastRow=i;
     346  int lastRow = -1;
     347  for (i = 0; i < numberRows_; i++) {
     348    if (workArea[i] == -1) {
     349      lastRow = i;
    352350      break;
    353351    }
    354352  }
    355   assert (lastRow>=0);
    356   for ( i=numberGoodU_;i<numberRows_;i++) {
    357     assert (lastRow<numberRows_);
     353  assert(lastRow >= 0);
     354  for (i = numberGoodU_; i < numberRows_; i++) {
     355    assert(lastRow < numberRows_);
    358356    // Put slack in basis
    359     sequence[i]=lastRow;
     357    sequence[i] = lastRow;
    360358    lastRow++;
    361     for (;lastRow<numberRows_;lastRow++) {
    362       if (workArea[lastRow]==-1)
    363         break;
     359    for (; lastRow < numberRows_; lastRow++) {
     360      if (workArea[lastRow] == -1)
     361        break;
    364362    }
    365363  }
     
    367365//#define DENSE_PERMUTE
    368366// Does post processing on valid factorization - putting variables on correct rows
    369 void
    370 CoinAbcDenseFactorization::postProcess(const int * sequence, int * pivotVariable)
    371 {
    372   if ((solveMode_%10)==0) {
    373     for (int i=0;i<numberRows_;i++) {
     367void CoinAbcDenseFactorization::postProcess(const int *sequence, int *pivotVariable)
     368{
     369  if ((solveMode_ % 10) == 0) {
     370    for (int i = 0; i < numberRows_; i++) {
    374371      int k = sequence[i];
    375372#ifdef DENSE_PERMUTE
    376       pivotVariable[pivotRow_[i+numberDense_]]=k;
     373      pivotVariable[pivotRow_[i + numberDense_]] = k;
    377374#else
    378375      //pivotVariable[pivotRow_[i]]=k;
    379376      //pivotVariable[pivotRow_[i]]=k;
    380       pivotVariable[i]=k;
    381       k=pivotRow_[i];
    382       pivotRow_[i] = pivotRow_[i+numberDense_];
    383       pivotRow_[i+numberDense_]=k;
     377      pivotVariable[i] = k;
     378      k = pivotRow_[i];
     379      pivotRow_[i] = pivotRow_[i + numberDense_];
     380      pivotRow_[i + numberDense_] = k;
    384381#endif
    385382    }
    386383  } else {
    387384    // lapack
    388     for (int i=0;i<numberRows_;i++) {
     385    for (int i = 0; i < numberRows_; i++) {
    389386      int k = sequence[i];
    390       pivotVariable[i]=k;
     387      pivotVariable[i] = k;
    391388    }
    392389  }
     
    395392   returns 0=OK, 1=Probably OK, 2=singular, 3=no room
    396393   partial update already in U */
    397 int
    398 CoinAbcDenseFactorization::replaceColumn ( CoinIndexedVector * regionSparse,
    399                                         int pivotRow,
    400                                         double pivotCheck ,
    401                                         bool /*skipBtranU*/,
    402                                        double /*acceptablePivot*/)
    403 {
    404   if (numberPivots_==maximumPivots_)
     394int CoinAbcDenseFactorization::replaceColumn(CoinIndexedVector *regionSparse,
     395  int pivotRow,
     396  double pivotCheck,
     397  bool /*skipBtranU*/,
     398  double /*acceptablePivot*/)
     399{
     400  if (numberPivots_ == maximumPivots_)
    405401    return 3;
    406   CoinFactorizationDouble * elements = elements_ + numberDense_*numberPivots_;
    407   double *region = regionSparse->denseVector (  );
    408   int *regionIndex = regionSparse->getIndices (  );
    409   int numberNonZero = regionSparse->getNumElements (  );
     402  CoinFactorizationDouble *elements = elements_ + numberDense_ * numberPivots_;
     403  double *region = regionSparse->denseVector();
     404  int *regionIndex = regionSparse->getIndices();
     405  int numberNonZero = regionSparse->getNumElements();
    410406  int i;
    411   memset(elements,0,numberRows_*sizeof(CoinFactorizationDouble));
     407  memset(elements, 0, numberRows_ * sizeof(CoinFactorizationDouble));
    412408  CoinFactorizationDouble pivotValue = pivotCheck;
    413   if (fabs(pivotValue)<zeroTolerance_)
     409  if (fabs(pivotValue) < zeroTolerance_)
    414410    return 2;
    415   pivotValue = 1.0/pivotValue;
    416   if ((solveMode_%10)==0) {
     411  pivotValue = 1.0 / pivotValue;
     412  if ((solveMode_ % 10) == 0) {
    417413    if (regionSparse->packedMode()) {
    418       for (i=0;i<numberNonZero;i++) {
    419         int iRow = regionIndex[i];
    420         double value = region[i];
     414      for (i = 0; i < numberNonZero; i++) {
     415        int iRow = regionIndex[i];
     416        double value = region[i];
    421417#ifdef DENSE_PERMUTE
    422         iRow = pivotRow_[iRow]; // permute
    423 #endif
    424         elements[iRow] = value;;
     418        iRow = pivotRow_[iRow]; // permute
     419#endif
     420        elements[iRow] = value;
     421        ;
    425422      }
    426423    } else {
    427424      // not packed! - from user pivot?
    428       for (i=0;i<numberNonZero;i++) {
    429         int iRow = regionIndex[i];
    430         double value = region[iRow];
     425      for (i = 0; i < numberNonZero; i++) {
     426        int iRow = regionIndex[i];
     427        double value = region[iRow];
    431428#ifdef DENSE_PERMUTE
    432         iRow = pivotRow_[iRow]; // permute
    433 #endif
    434         elements[iRow] = value;;
     429        iRow = pivotRow_[iRow]; // permute
     430#endif
     431        elements[iRow] = value;
     432        ;
    435433      }
    436434    }
    437435    int realPivotRow = pivotRow_[pivotRow];
    438     elements[realPivotRow]=pivotValue;
    439     pivotRow_[2*numberDense_+numberPivots_]=realPivotRow;
     436    elements[realPivotRow] = pivotValue;
     437    pivotRow_[2 * numberDense_ + numberPivots_] = realPivotRow;
    440438  } else {
    441439    // lapack
    442440    if (regionSparse->packedMode()) {
    443       for (i=0;i<numberNonZero;i++) {
    444         int iRow = regionIndex[i];
    445         double value = region[i];
    446         elements[iRow] = value;;
     441      for (i = 0; i < numberNonZero; i++) {
     442        int iRow = regionIndex[i];
     443        double value = region[i];
     444        elements[iRow] = value;
     445        ;
    447446      }
    448447    } else {
    449448      // not packed! - from user pivot?
    450       for (i=0;i<numberNonZero;i++) {
    451         int iRow = regionIndex[i];
    452         double value = region[iRow];
    453         elements[iRow] = value;;
    454       }
    455     }
    456     elements[pivotRow]=pivotValue;
    457     pivotRow_[2*numberDense_+numberPivots_]=pivotRow;
     449      for (i = 0; i < numberNonZero; i++) {
     450        int iRow = regionIndex[i];
     451        double value = region[iRow];
     452        elements[iRow] = value;
     453        ;
     454      }
     455    }
     456    elements[pivotRow] = pivotValue;
     457    pivotRow_[2 * numberDense_ + numberPivots_] = pivotRow;
    458458  }
    459459  numberPivots_++;
     
    462462/* Checks if can replace one Column to basis,
    463463   returns 0=OK, 1=Probably OK, 2=singular, 3=no room, 5 max pivots */
    464 int
    465 CoinAbcDenseFactorization::checkReplacePart2 ( int pivotRow,
    466                                                double btranAlpha,
    467                                                double ftranAlpha,
    468 #ifdef ABC_LONG_FACTORIZATION
    469                                                long
    470 #endif
    471                                                double ftAlpha,
    472                                                double acceptablePivot)
    473 {
    474   if (numberPivots_==maximumPivots_)
     464int CoinAbcDenseFactorization::checkReplacePart2(int pivotRow,
     465  double btranAlpha,
     466  double ftranAlpha,
     467#ifdef ABC_LONG_FACTORIZATION
     468  long
     469#endif
     470  double ftAlpha,
     471  double acceptablePivot)
     472{
     473  if (numberPivots_ == maximumPivots_)
    475474    return 3;
    476   if (fabs(ftranAlpha)<zeroTolerance_)
     475  if (fabs(ftranAlpha) < zeroTolerance_)
    477476    return 2;
    478477  return 0;
     
    480479/* Replaces one Column to basis,
    481480   partial update already in U */
    482 void
    483 CoinAbcDenseFactorization::replaceColumnPart3 ( const AbcSimplex * model,
    484                                            CoinIndexedVector * regionSparse,
    485                                            CoinIndexedVector * tableauColumn,
    486                                            int pivotRow,
    487 #ifdef ABC_LONG_FACTORIZATION
    488                                                 long
    489 #endif
    490                                            double alpha )
    491 {
    492   CoinFactorizationDouble * elements = elements_ + numberDense_*numberPivots_;
    493   double *region = tableauColumn->denseVector (  );
    494   int *regionIndex = tableauColumn->getIndices (  );
    495   int numberNonZero = tableauColumn->getNumElements (  );
     481void CoinAbcDenseFactorization::replaceColumnPart3(const AbcSimplex *model,
     482  CoinIndexedVector *regionSparse,
     483  CoinIndexedVector *tableauColumn,
     484  int pivotRow,
     485#ifdef ABC_LONG_FACTORIZATION
     486  long
     487#endif
     488  double alpha)
     489{
     490  CoinFactorizationDouble *elements = elements_ + numberDense_ * numberPivots_;
     491  double *region = tableauColumn->denseVector();
     492  int *regionIndex = tableauColumn->getIndices();
     493  int numberNonZero = tableauColumn->getNumElements();
    496494  int i;
    497   memset(elements,0,numberRows_*sizeof(CoinFactorizationDouble));
    498   double pivotValue = 1.0/alpha;
    499   if ((solveMode_%10)==0) {
     495  memset(elements, 0, numberRows_ * sizeof(CoinFactorizationDouble));
     496  double pivotValue = 1.0 / alpha;
     497  if ((solveMode_ % 10) == 0) {
    500498    if (tableauColumn->packedMode()) {
    501       for (i=0;i<numberNonZero;i++) {
    502         int iRow = regionIndex[i];
    503         double value = region[i];
     499      for (i = 0; i < numberNonZero; i++) {
     500        int iRow = regionIndex[i];
     501        double value = region[i];
    504502#ifdef DENSE_PERMUTE
    505         iRow = pivotRow_[iRow]; // permute
    506 #endif
    507         elements[iRow] = value;;
     503        iRow = pivotRow_[iRow]; // permute
     504#endif
     505        elements[iRow] = value;
     506        ;
    508507      }
    509508    } else {
    510509      // not packed! - from user pivot?
    511       for (i=0;i<numberNonZero;i++) {
    512         int iRow = regionIndex[i];
    513         double value = region[iRow];
     510      for (i = 0; i < numberNonZero; i++) {
     511        int iRow = regionIndex[i];
     512        double value = region[iRow];
    514513#ifdef DENSE_PERMUTE
    515         iRow = pivotRow_[iRow]; // permute
    516 #endif
    517         elements[iRow] = value;;
     514        iRow = pivotRow_[iRow]; // permute
     515#endif
     516        elements[iRow] = value;
     517        ;
    518518      }
    519519    }
    520520    int realPivotRow = pivotRow_[pivotRow];
    521     elements[realPivotRow]=pivotValue;
    522     pivotRow_[2*numberDense_+numberPivots_]=realPivotRow;
     521    elements[realPivotRow] = pivotValue;
     522    pivotRow_[2 * numberDense_ + numberPivots_] = realPivotRow;
    523523  } else {
    524524    // lapack
    525525    if (tableauColumn->packedMode()) {
    526       for (i=0;i<numberNonZero;i++) {
    527         int iRow = regionIndex[i];
    528         double value = region[i];
    529         elements[iRow] = value;;
     526      for (i = 0; i < numberNonZero; i++) {
     527        int iRow = regionIndex[i];
     528        double value = region[i];
     529        elements[iRow] = value;
     530        ;
    530531      }
    531532    } else {
    532533      // not packed! - from user pivot?
    533       for (i=0;i<numberNonZero;i++) {
    534         int iRow = regionIndex[i];
    535         double value = region[iRow];
    536         elements[iRow] = value;;
    537       }
    538     }
    539     elements[pivotRow]=pivotValue;
    540     pivotRow_[2*numberDense_+numberPivots_]=pivotRow;
     534      for (i = 0; i < numberNonZero; i++) {
     535        int iRow = regionIndex[i];
     536        double value = region[iRow];
     537        elements[iRow] = value;
     538        ;
     539      }
     540    }
     541    elements[pivotRow] = pivotValue;
     542    pivotRow_[2 * numberDense_ + numberPivots_] = pivotRow;
    541543  }
    542544  numberPivots_++;
    543545}
    544 static void 
    545 CoinAbcDlaswp1(double * COIN_RESTRICT a,int m, int * ipiv)
    546 {
    547   for (int i=0;i<m;i++) {
    548     int ip=ipiv[i];
    549     if (ip!=i) {
    550       double temp=a[i];
    551       a[i]=a[ip];
    552       a[ip]=temp;
    553     }
    554   }
    555 }
    556 static void 
    557 CoinAbcDlaswp1Backwards(double * COIN_RESTRICT a,int m, int * ipiv)
    558 {
    559   for (int i=m-1;i>=0;i--) {
    560     int ip=ipiv[i];
    561     if (ip!=i) {
    562       double temp=a[i];
    563       a[i]=a[ip];
    564       a[ip]=temp;
     546static void
     547CoinAbcDlaswp1(double *COIN_RESTRICT a, int m, int *ipiv)
     548{
     549  for (int i = 0; i < m; i++) {
     550    int ip = ipiv[i];
     551    if (ip != i) {
     552      double temp = a[i];
     553      a[i] = a[ip];
     554      a[ip] = temp;
     555    }
     556  }
     557}
     558static void
     559CoinAbcDlaswp1Backwards(double *COIN_RESTRICT a, int m, int *ipiv)
     560{
     561  for (int i = m - 1; i >= 0; i--) {
     562    int ip = ipiv[i];
     563    if (ip != i) {
     564      double temp = a[i];
     565      a[i] = a[ip];
     566      a[ip] = temp;
    565567    }
    566568  }
     
    568570/* This version has same effect as above with FTUpdate==false
    569571   so number returned is always >=0 */
    570 int
    571 CoinAbcDenseFactorization::updateColumn (CoinIndexedVector & regionSparse) const
    572 {
    573   double *region = regionSparse.denseVector (  );
    574   CoinBigIndex put = numberDense_*numberDense_;
    575   CoinFactorizationDouble * COIN_RESTRICT area = elements_+maximumSpace_-put;
    576   CoinFactorizationDouble * COIN_RESTRICT elements = area;
    577   if ((solveMode_%10)==0) {
     572int CoinAbcDenseFactorization::updateColumn(CoinIndexedVector &regionSparse) const
     573{
     574  double *region = regionSparse.denseVector();
     575  CoinBigIndex put = numberDense_ * numberDense_;
     576  CoinFactorizationDouble *COIN_RESTRICT area = elements_ + maximumSpace_ - put;
     577  CoinFactorizationDouble *COIN_RESTRICT elements = area;
     578  if ((solveMode_ % 10) == 0) {
    578579    // base factorization L
    579     for (int i=0;i<numberRows_;i++) {
     580    for (int i = 0; i < numberRows_; i++) {
    580581      double value = region[i];
    581       for (int j=i+1;j<numberRows_;j++) {
    582         region[j] -= value*elements[j];
     582      for (int j = i + 1; j < numberRows_; j++) {
     583        region[j] -= value * elements[j];
    583584      }
    584585      elements += numberDense_;
    585586    }
    586     elements = area+numberRows_*numberDense_;
     587    elements = area + numberRows_ * numberDense_;
    587588    // base factorization U
    588     for (int i=numberRows_-1;i>=0;i--) {
     589    for (int i = numberRows_ - 1; i >= 0; i--) {
    589590      elements -= numberDense_;
    590       CoinFactorizationDouble value = region[i]*elements[i];
     591      CoinFactorizationDouble value = region[i] * elements[i];
    591592      region[i] = value;
    592       for (int j=0;j<i;j++) {
    593         region[j] -= value*elements[j];
     593      for (int j = 0; j < i; j++) {
     594        region[j] -= value * elements[j];
    594595      }
    595596    }
    596597  } else {
    597     CoinAbcDlaswp1(region,numberRows_,pivotRow_+numberDense_);
    598     CoinAbcDgetrs('N',numberDense_,area,region);
     598    CoinAbcDlaswp1(region, numberRows_, pivotRow_ + numberDense_);
     599    CoinAbcDgetrs('N', numberDense_, area, region);
    599600  }
    600601  // now updates
    601602  elements = elements_;
    602   for (int i=0;i<numberPivots_;i++) {
    603     int iPivot = pivotRow_[i+2*numberDense_];
    604     CoinFactorizationDouble value = region[iPivot]*elements[iPivot];
    605     for (int j=0;j<numberRows_;j++) {
    606       region[j] -= value*elements[j];
     603  for (int i = 0; i < numberPivots_; i++) {
     604    int iPivot = pivotRow_[i + 2 * numberDense_];
     605    CoinFactorizationDouble value = region[iPivot] * elements[iPivot];
     606    for (int j = 0; j < numberRows_; j++) {
     607      region[j] -= value * elements[j];
    607608    }
    608609    region[iPivot] = value;
     
    610611  }
    611612  regionSparse.setNumElements(0);
    612   regionSparse.scan(0,numberRows_);
     613  regionSparse.scan(0, numberRows_);
    613614  return 0;
    614615}
    615616
    616617/* Updates one column for dual steepest edge weights (FTRAN) */
    617 void
    618 CoinAbcDenseFactorization::updateWeights ( CoinIndexedVector & regionSparse) const
     618void CoinAbcDenseFactorization::updateWeights(CoinIndexedVector &regionSparse) const
    619619{
    620620  updateColumn(regionSparse);
    621621}
    622622
    623 int
    624 CoinAbcDenseFactorization::updateTwoColumnsFT(CoinIndexedVector & regionSparse2,
    625                                               CoinIndexedVector & regionSparse3)
     623int CoinAbcDenseFactorization::updateTwoColumnsFT(CoinIndexedVector &regionSparse2,
     624  CoinIndexedVector &regionSparse3)
    626625{
    627626  updateColumn(regionSparse2);
     
    634633   Note - if regionSparse2 packed on input - will be packed on output
    635634*/
    636 int
    637 CoinAbcDenseFactorization::updateColumnTranspose ( CoinIndexedVector & regionSparse2) const
    638 {
    639   double *region = regionSparse2.denseVector (  );
    640   CoinFactorizationDouble * elements = elements_+numberDense_*numberPivots_;
     635int CoinAbcDenseFactorization::updateColumnTranspose(CoinIndexedVector &regionSparse2) const
     636{
     637  double *region = regionSparse2.denseVector();
     638  CoinFactorizationDouble *elements = elements_ + numberDense_ * numberPivots_;
    641639  // updates
    642   for (int i=numberPivots_-1;i>=0;i--) {
     640  for (int i = numberPivots_ - 1; i >= 0; i--) {
    643641    elements -= numberDense_;
    644     int iPivot = pivotRow_[i+2*numberDense_];
     642    int iPivot = pivotRow_[i + 2 * numberDense_];
    645643    CoinFactorizationDouble value = region[iPivot]; //*elements[iPivot];
    646     for (int j=0;j<iPivot;j++) {
    647       value -= region[j]*elements[j];
    648     }
    649     for (int j=iPivot+1;j<numberRows_;j++) {
    650       value -= region[j]*elements[j];
    651     }
    652     region[iPivot] = value*elements[iPivot];
    653   }
    654   CoinBigIndex put = numberDense_*numberDense_;
    655   CoinFactorizationDouble * COIN_RESTRICT area = elements_+maximumSpace_-put;
    656   if ((solveMode_%10)==0) {
     644    for (int j = 0; j < iPivot; j++) {
     645      value -= region[j] * elements[j];
     646    }
     647    for (int j = iPivot + 1; j < numberRows_; j++) {
     648      value -= region[j] * elements[j];
     649    }
     650    region[iPivot] = value * elements[iPivot];
     651  }
     652  CoinBigIndex put = numberDense_ * numberDense_;
     653  CoinFactorizationDouble *COIN_RESTRICT area = elements_ + maximumSpace_ - put;
     654  if ((solveMode_ % 10) == 0) {
    657655    // base factorization U
    658656    elements = area;
    659     for (int i=0;i<numberRows_;i++) {
     657    for (int i = 0; i < numberRows_; i++) {
    660658      //CoinFactorizationDouble value = region[i]*elements[i];
    661659      CoinFactorizationDouble value = region[i];
    662       for (int j=0;j<i;j++) {
    663         value -= region[j]*elements[j];
     660      for (int j = 0; j < i; j++) {
     661        value -= region[j] * elements[j];
    664662      }
    665663      //region[i] = value;
    666       region[i] = value*elements[i];
     664      region[i] = value * elements[i];
    667665      elements += numberDense_;
    668666    }
    669667    // base factorization L
    670     elements = area+numberDense_*numberRows_;
    671     for (int i=numberRows_-1;i>=0;i--) {
     668    elements = area + numberDense_ * numberRows_;
     669    for (int i = numberRows_ - 1; i >= 0; i--) {
    672670      elements -= numberDense_;
    673671      CoinFactorizationDouble value = region[i];
    674       for (int j=i+1;j<numberRows_;j++) {
    675         value -= region[j]*elements[j];
     672      for (int j = i + 1; j < numberRows_; j++) {
     673        value -= region[j] * elements[j];
    676674      }
    677675      region[i] = value;
    678676    }
    679677  } else {
    680     CoinAbcDgetrs('T',numberDense_,area,region);
    681     CoinAbcDlaswp1Backwards(region,numberRows_,pivotRow_+numberDense_);
     678    CoinAbcDgetrs('T', numberDense_, area, region);
     679    CoinAbcDlaswp1Backwards(region, numberRows_, pivotRow_ + numberDense_);
    682680  }
    683681  regionSparse2.setNumElements(0);
    684   regionSparse2.scan(0,numberRows_);
     682  regionSparse2.scan(0, numberRows_);
    685683  return 0;
    686684}
    687685/* Updates one column (FTRAN) */
    688 void
    689 CoinAbcAnyFactorization::updateColumnCpu ( CoinIndexedVector & regionSparse,int whichCpu) const
    690 { updateColumn(regionSparse);}
     686void CoinAbcAnyFactorization::updateColumnCpu(CoinIndexedVector &regionSparse, int whichCpu) const
     687{
     688  updateColumn(regionSparse);
     689}
    691690/* Updates one column (BTRAN) */
    692 void
    693 CoinAbcAnyFactorization::updateColumnTransposeCpu ( CoinIndexedVector & regionSparse,int whichCpu) const
    694 { updateColumnTranspose(regionSparse);}
     691void CoinAbcAnyFactorization::updateColumnTransposeCpu(CoinIndexedVector &regionSparse, int whichCpu) const
     692{
     693  updateColumnTranspose(regionSparse);
     694}
    695695// Default constructor
    696 CoinAbcAnyFactorization::CoinAbcAnyFactorization (  )
    697    :  pivotTolerance_(1.0e-1),
    698       minimumPivotTolerance_(1.0e-1),
    699       zeroTolerance_(1.0e-13),
    700       relaxCheck_(1.0),
    701       factorElements_(0),
    702       numberRows_(0),
    703       numberGoodU_(0),
    704       maximumPivots_(200),
    705       numberPivots_(0),
    706       status_(-1),
    707       solveMode_(0)
    708 {
    709 }
    710 // Copy constructor 
    711 CoinAbcAnyFactorization::CoinAbcAnyFactorization ( const CoinAbcAnyFactorization &other)
    712    :  pivotTolerance_(other.pivotTolerance_),
    713       minimumPivotTolerance_(other.minimumPivotTolerance_),
    714   zeroTolerance_(other.zeroTolerance_),
    715   relaxCheck_(other.relaxCheck_),
    716   factorElements_(other.factorElements_),
    717   numberRows_(other.numberRows_),
    718   numberGoodU_(other.numberGoodU_),
    719   maximumPivots_(other.maximumPivots_),
    720   numberPivots_(other.numberPivots_),
    721       status_(other.status_),
    722       solveMode_(other.solveMode_)
     696CoinAbcAnyFactorization::CoinAbcAnyFactorization()
     697  : pivotTolerance_(1.0e-1)
     698  , minimumPivotTolerance_(1.0e-1)
     699  , zeroTolerance_(1.0e-13)
     700  , relaxCheck_(1.0)
     701  , factorElements_(0)
     702  , numberRows_(0)
     703  , numberGoodU_(0)
     704  , maximumPivots_(200)
     705  , numberPivots_(0)
     706  , status_(-1)
     707  , solveMode_(0)
     708{
     709}
     710// Copy constructor
     711CoinAbcAnyFactorization::CoinAbcAnyFactorization(const CoinAbcAnyFactorization &other)
     712  : pivotTolerance_(other.pivotTolerance_)
     713  , minimumPivotTolerance_(other.minimumPivotTolerance_)
     714  , zeroTolerance_(other.zeroTolerance_)
     715  , relaxCheck_(other.relaxCheck_)
     716  , factorElements_(other.factorElements_)
     717  , numberRows_(other.numberRows_)
     718  , numberGoodU_(other.numberGoodU_)
     719  , maximumPivots_(other.maximumPivots_)
     720  , numberPivots_(other.numberPivots_)
     721  , status_(other.status_)
     722  , solveMode_(other.solveMode_)
    723723{
    724724}
    725725// Destructor
    726 CoinAbcAnyFactorization::~CoinAbcAnyFactorization (  )
     726CoinAbcAnyFactorization::~CoinAbcAnyFactorization()
    727727{
    728728}
    729729// = copy
    730 CoinAbcAnyFactorization & CoinAbcAnyFactorization::operator = ( const CoinAbcAnyFactorization & other )
    731 {
    732   if (this != &other) {   
     730CoinAbcAnyFactorization &CoinAbcAnyFactorization::operator=(const CoinAbcAnyFactorization &other)
     731{
     732  if (this != &other) {
    733733    pivotTolerance_ = other.pivotTolerance_;
    734734    minimumPivotTolerance_ = other.minimumPivotTolerance_;
     
    745745  return *this;
    746746}
    747 void CoinAbcAnyFactorization::pivotTolerance (  double value )
    748 {
    749   if (value>0.0&&value<=1.0) {
    750     pivotTolerance_=CoinMax(value,minimumPivotTolerance_);
    751   }
    752 }
    753 void CoinAbcAnyFactorization::minimumPivotTolerance (  double value )
    754 {
    755   if (value>0.0&&value<=1.0) {
    756     minimumPivotTolerance_=value;
    757   }
    758 }
    759 void CoinAbcAnyFactorization::zeroTolerance (  double value )
    760 {
    761   if (value>0.0&&value<1.0) {
    762     zeroTolerance_=value;
    763   }
    764 }
    765 void
    766 CoinAbcAnyFactorization::maximumPivots (  int value )
    767 {
    768   if (value>maximumPivots_) {
    769     delete [] pivotRow_;
    770     int n=maximumRows_;
    771     if ((n&(BLOCKING8-1))!=0)
    772     n += (BLOCKING8-(n&(BLOCKING8-1)));
    773     pivotRow_ = new int[2*n+value];
     747void CoinAbcAnyFactorization::pivotTolerance(double value)
     748{
     749  if (value > 0.0 && value <= 1.0) {
     750    pivotTolerance_ = CoinMax(value, minimumPivotTolerance_);
     751  }
     752}
     753void CoinAbcAnyFactorization::minimumPivotTolerance(double value)
     754{
     755  if (value > 0.0 && value <= 1.0) {
     756    minimumPivotTolerance_ = value;
     757  }
     758}
     759void CoinAbcAnyFactorization::zeroTolerance(double value)
     760{
     761  if (value > 0.0 && value < 1.0) {
     762    zeroTolerance_ = value;
     763  }
     764}
     765void CoinAbcAnyFactorization::maximumPivots(int value)
     766{
     767  if (value > maximumPivots_) {
     768    delete[] pivotRow_;
     769    int n = maximumRows_;
     770    if ((n & (BLOCKING8 - 1)) != 0)
     771      n += (BLOCKING8 - (n & (BLOCKING8 - 1)));
     772    pivotRow_ = new int[2 * n + value];
    774773  }
    775774  maximumPivots_ = value;
    776775}
    777776// Number of entries in each row
    778 int *
    779 CoinAbcAnyFactorization::numberInRow() const
    780 { return reinterpret_cast<int *> (workArea_);}
     777int *CoinAbcAnyFactorization::numberInRow() const
     778{
     779  return reinterpret_cast< int * >(workArea_);
     780}
    781781// Number of entries in each column
    782 int *
    783 CoinAbcAnyFactorization::numberInColumn() const
    784 { return (reinterpret_cast<int *> (workArea_))+numberRows_;}
     782int *CoinAbcAnyFactorization::numberInColumn() const
     783{
     784  return (reinterpret_cast< int * >(workArea_)) + numberRows_;
     785}
    785786// Returns array to put basis starts in
    786 CoinBigIndex * 
     787CoinBigIndex *
    787788CoinAbcAnyFactorization::starts() const
    788 { return reinterpret_cast<CoinBigIndex *> (pivotRow_);}
     789{
     790  return reinterpret_cast< CoinBigIndex * >(pivotRow_);
     791}
    789792// Returns array to put basis elements in
    790 CoinFactorizationDouble * 
     793CoinFactorizationDouble *
    791794CoinAbcAnyFactorization::elements() const
    792 { return elements_;}
    793 // Returns pivot row
    794 int *
    795 CoinAbcAnyFactorization::pivotRow() const
    796 { return pivotRow_;}
     795{
     796  return elements_;
     797}
     798// Returns pivot row
     799int *CoinAbcAnyFactorization::pivotRow() const
     800{
     801  return pivotRow_;
     802}
    797803// Returns work area
    798 CoinFactorizationDouble * 
     804CoinFactorizationDouble *
    799805CoinAbcAnyFactorization::workArea() const
    800 { return workArea_;}
     806{
     807  return workArea_;
     808}
    801809// Returns int work area
    802 int *
    803 CoinAbcAnyFactorization::intWorkArea() const
    804 { return reinterpret_cast<int *> (workArea_);}
     810int *CoinAbcAnyFactorization::intWorkArea() const
     811{
     812  return reinterpret_cast< int * >(workArea_);
     813}
    805814// Returns permute back
    806 int *
    807 CoinAbcAnyFactorization::permuteBack() const
    808 { return pivotRow_+numberRows_;}
     815int *CoinAbcAnyFactorization::permuteBack() const
     816{
     817  return pivotRow_ + numberRows_;
     818}
    809819// Returns pivot column
    810 int *
    811 CoinAbcAnyFactorization::pivotColumn() const
    812 { return permute();}
     820int *CoinAbcAnyFactorization::pivotColumn() const
     821{
     822  return permute();
     823}
    813824// Returns true if wants tableauColumn in replaceColumn
    814 bool
    815 CoinAbcAnyFactorization::wantsTableauColumn() const
    816 { return true;}
     825bool CoinAbcAnyFactorization::wantsTableauColumn() const
     826{
     827  return true;
     828}
    817829/* Useful information for factorization
    818830   0 - iteration number
    819831   whereFrom is 0 for factorize and 1 for replaceColumn
    820832*/
    821 void
    822 CoinAbcAnyFactorization::setUsefulInformation(const int * ,int )
    823 { }
     833void CoinAbcAnyFactorization::setUsefulInformation(const int *, int)
     834{
     835}
     836
     837/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     838*/
Note: See TracChangeset for help on using the changeset viewer.