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

    r1910 r2385  
    1515//#############################################################################
    1616
    17 void
    18 AbcWarmStart::setSize(int ns, int na)
     17void AbcWarmStart::setSize(int ns, int na)
    1918{
    20   CoinWarmStartBasis::setSize(ns,na);
    21   delete [] extraInformation_;
    22   extraInformation_=NULL;
    23   typeExtraInformation_=0;
     19  CoinWarmStartBasis::setSize(ns, na);
     20  delete[] extraInformation_;
     21  extraInformation_ = NULL;
     22  typeExtraInformation_ = 0;
    2423}
    2524
    26 void
    27 AbcWarmStart::assignBasisStatus(int ns, int na, char*& sStat,
    28                                 char*& aStat)
     25void AbcWarmStart::assignBasisStatus(int ns, int na, char *&sStat,
     26  char *&aStat)
    2927{
    30   CoinWarmStartBasis::assignBasisStatus(ns,na,sStat,aStat);
    31   delete [] extraInformation_;
    32   extraInformation_=NULL;
    33   typeExtraInformation_=0;
     28  CoinWarmStartBasis::assignBasisStatus(ns, na, sStat, aStat);
     29  delete[] extraInformation_;
     30  extraInformation_ = NULL;
     31  typeExtraInformation_ = 0;
    3432}
    35 AbcWarmStart::AbcWarmStart(AbcSimplex * model,int type) :
    36   CoinWarmStartBasis(model->numberColumns(),model->numberRows(),
     33AbcWarmStart::AbcWarmStart(AbcSimplex *model, int type)
     34  : CoinWarmStartBasis(model->numberColumns(), model->numberRows(),
    3735#ifdef CLP_WARMSTART
    38                      reinterpret_cast<const char *>(model->statusArray()),
    39                      reinterpret_cast<const char *>(model->statusArray()+model->numberColumns())
     36      reinterpret_cast< const char * >(model->statusArray()),
     37      reinterpret_cast< const char * >(model->statusArray() + model->numberColumns())
    4038#else
    41                      reinterpret_cast<const char *>(model->statusArray()+model->maximumAbcNumberRows()),
    42                      reinterpret_cast<const char *>(model->statusArray())
     39      reinterpret_cast< const char * >(model->statusArray() + model->maximumAbcNumberRows()),
     40      reinterpret_cast< const char * >(model->statusArray())
    4341#endif
    44                      ),
    45   typeExtraInformation_(type),
    46   lengthExtraInformation_(0),
    47   extraInformation_(NULL),
    48   model_(model),
    49   organizer_(NULL),
    50   previousBasis_(NULL),
    51   nextBasis_(NULL),
    52   stamp_(-1),
    53   numberValidRows_(0)
     42        )
     43  , typeExtraInformation_(type)
     44  , lengthExtraInformation_(0)
     45  , extraInformation_(NULL)
     46  , model_(model)
     47  , organizer_(NULL)
     48  , previousBasis_(NULL)
     49  , nextBasis_(NULL)
     50  , stamp_(-1)
     51  , numberValidRows_(0)
    5452{
    55   assert (!typeExtraInformation_);
     53  assert(!typeExtraInformation_);
    5654}
    5755
    58 AbcWarmStart::AbcWarmStart(const AbcWarmStart& rhs) :
    59   CoinWarmStartBasis(rhs),
    60   typeExtraInformation_(rhs.typeExtraInformation_),
    61   lengthExtraInformation_(rhs.lengthExtraInformation_),
    62   extraInformation_(NULL),
    63   model_(rhs.model_),
    64   organizer_(rhs.organizer_),
    65   previousBasis_(NULL),
    66   nextBasis_(NULL),
    67   stamp_(-1),
    68   numberValidRows_(0)
     56AbcWarmStart::AbcWarmStart(const AbcWarmStart &rhs)
     57  : CoinWarmStartBasis(rhs)
     58  , typeExtraInformation_(rhs.typeExtraInformation_)
     59  , lengthExtraInformation_(rhs.lengthExtraInformation_)
     60  , extraInformation_(NULL)
     61  , model_(rhs.model_)
     62  , organizer_(rhs.organizer_)
     63  , previousBasis_(NULL)
     64  , nextBasis_(NULL)
     65  , stamp_(-1)
     66  , numberValidRows_(0)
    6967{
    7068  if (typeExtraInformation_)
    71     extraInformation_=CoinCopyOfArray(rhs.extraInformation_,lengthExtraInformation_);
     69    extraInformation_ = CoinCopyOfArray(rhs.extraInformation_, lengthExtraInformation_);
    7270}
    7371
    74 AbcWarmStart&
    75 AbcWarmStart::operator=(const AbcWarmStart& rhs)
     72AbcWarmStart &
     73AbcWarmStart::operator=(const AbcWarmStart &rhs)
    7674{
    7775  if (this != &rhs) {
    7876    CoinWarmStartBasis::operator=(rhs);
    79     delete [] extraInformation_;
    80     extraInformation_=NULL;
     77    delete[] extraInformation_;
     78    extraInformation_ = NULL;
    8179    typeExtraInformation_ = rhs.typeExtraInformation_;
    8280    lengthExtraInformation_ = rhs.lengthExtraInformation_;
     
    8886    numberValidRows_ = 0;
    8987    if (typeExtraInformation_)
    90       extraInformation_=CoinCopyOfArray(rhs.extraInformation_,lengthExtraInformation_);
     88      extraInformation_ = CoinCopyOfArray(rhs.extraInformation_, lengthExtraInformation_);
    9189  }
    9290  return *this;
    9391}
    9492
    95 // Resizes
    96 void
    97 AbcWarmStart::resize (int newNumberRows, int newNumberColumns)
     93// Resizes
     94void AbcWarmStart::resize(int newNumberRows, int newNumberColumns)
    9895{
    99   if (newNumberRows==numArtificial_&&newNumberColumns==numStructural_)
     96  if (newNumberRows == numArtificial_ && newNumberColumns == numStructural_)
    10097    return;
    101   CoinWarmStartBasis::resize(newNumberRows,newNumberColumns);
    102   delete [] extraInformation_;
    103   extraInformation_=NULL;
    104   typeExtraInformation_=0;
     98  CoinWarmStartBasis::resize(newNumberRows, newNumberColumns);
     99  delete[] extraInformation_;
     100  extraInformation_ = NULL;
     101  typeExtraInformation_ = 0;
    105102}
    106103
     
    111108  need to preprocess the target indices to satisfy the conditions.
    112109*/
    113 void AbcWarmStart::compressRows (int tgtCnt, const int *tgts)
     110void AbcWarmStart::compressRows(int tgtCnt, const int *tgts)
    114111{
    115112  if (!tgtCnt)
    116113    return;
    117   CoinWarmStartBasis::compressRows(tgtCnt,tgts);
    118   delete [] extraInformation_;
    119   extraInformation_=NULL;
    120   typeExtraInformation_=0;
    121 } 
     114  CoinWarmStartBasis::compressRows(tgtCnt, tgts);
     115  delete[] extraInformation_;
     116  extraInformation_ = NULL;
     117  typeExtraInformation_ = 0;
     118}
    122119
    123120/*
     
    126123  an ascending list without duplicates, suitable for compressRows.
    127124*/
    128 void
    129 AbcWarmStart::deleteRows (int rawTgtCnt, const int *rawTgts)
     125void AbcWarmStart::deleteRows(int rawTgtCnt, const int *rawTgts)
    130126{
    131   if (rawTgtCnt <= 0) return ;
    132   CoinWarmStartBasis::deleteRows(rawTgtCnt,rawTgts);
    133   delete [] extraInformation_;
    134   extraInformation_=NULL;
    135   typeExtraInformation_=0;
     127  if (rawTgtCnt <= 0)
     128    return;
     129  CoinWarmStartBasis::deleteRows(rawTgtCnt, rawTgts);
     130  delete[] extraInformation_;
     131  extraInformation_ = NULL;
     132  typeExtraInformation_ = 0;
    136133}
    137134// Deletes columns
    138 void
    139 AbcWarmStart::deleteColumns(int number, const int * which)
     135void AbcWarmStart::deleteColumns(int number, const int *which)
    140136{
    141   CoinWarmStartBasis::deleteColumns(number,which);
    142   delete [] extraInformation_;
    143   extraInformation_=NULL;
    144   typeExtraInformation_=0;
     137  CoinWarmStartBasis::deleteColumns(number, which);
     138  delete[] extraInformation_;
     139  extraInformation_ = NULL;
     140  typeExtraInformation_ = 0;
    145141}
    146 AbcWarmStart::AbcWarmStart() :
    147   CoinWarmStartBasis(),
    148   typeExtraInformation_(0),
    149   lengthExtraInformation_(0),
    150   extraInformation_(NULL),
    151   model_(NULL),
    152   organizer_(NULL),
    153   previousBasis_(NULL),
    154   nextBasis_(NULL),
    155   stamp_(-1),
    156   numberValidRows_(0)
     142AbcWarmStart::AbcWarmStart()
     143  : CoinWarmStartBasis()
     144  , typeExtraInformation_(0)
     145  , lengthExtraInformation_(0)
     146  , extraInformation_(NULL)
     147  , model_(NULL)
     148  , organizer_(NULL)
     149  , previousBasis_(NULL)
     150  , nextBasis_(NULL)
     151  , stamp_(-1)
     152  , numberValidRows_(0)
    157153{
    158154}
     
    161157  delete[] extraInformation_;
    162158}
     159
     160/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     161*/
Note: See TracChangeset for help on using the changeset viewer.