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

    r2235 r2385  
    66#ifndef ClpFactorization_H
    77#define ClpFactorization_H
    8 
    98
    109#include "CoinPragma.hpp"
     
    3534class ClpFactorization
    3635#ifndef CLP_MULTIPLE_FACTORIZATIONS
    37      : public CoinFactorization
     36  : public CoinFactorization
    3837#endif
    3938{
    4039
    41      //friend class CoinFactorization;
     40  //friend class CoinFactorization;
    4241
    4342public:
    44      /**@name factorization */
    45      //@{
    46      /** When part of LP - given by basic variables.
     43  /**@name factorization */
     44  //@{
     45  /** When part of LP - given by basic variables.
    4746     Actually does factorization.
    4847     Arrays passed in have non negative value to say basic.
     
    5352     and ones thrown out have -1
    5453     returns 0 -okay, -1 singular, -2 too many in basis, -99 memory */
    55      int factorize (ClpSimplex * model, int solveType, bool valuesPass);
    56      //@}
    57 
    58 
    59      /**@name Constructors, destructor */
    60      //@{
    61      /** Default constructor. */
    62      ClpFactorization();
    63      /** Destructor */
    64      ~ClpFactorization();
    65      //@}
    66 
    67      /**@name Copy method */
    68      //@{
    69      /** The copy constructor from an CoinFactorization. */
    70      ClpFactorization(const CoinFactorization&);
    71      /** The copy constructor. */
    72      ClpFactorization(const ClpFactorization&, int denseIfSmaller = 0);
     54  int factorize(ClpSimplex *model, int solveType, bool valuesPass);
     55  //@}
     56
     57  /**@name Constructors, destructor */
     58  //@{
     59  /** Default constructor. */
     60  ClpFactorization();
     61  /** Destructor */
     62  ~ClpFactorization();
     63  //@}
     64
     65  /**@name Copy method */
     66  //@{
     67  /** The copy constructor from an CoinFactorization. */
     68  ClpFactorization(const CoinFactorization &);
     69  /** The copy constructor. */
     70  ClpFactorization(const ClpFactorization &, int denseIfSmaller = 0);
    7371#ifdef CLP_MULTIPLE_FACTORIZATIONS
    74      /** The copy constructor from an CoinOtherFactorization. */
    75      ClpFactorization(const CoinOtherFactorization&);
    76 #endif
    77      ClpFactorization& operator=(const ClpFactorization&);
    78      //@}
    79 
    80      /*  **** below here is so can use networkish basis */
    81      /**@name rank one updates which do exist */
    82      //@{
    83 
    84      /** Replaces one Column to basis,
     72  /** The copy constructor from an CoinOtherFactorization. */
     73  ClpFactorization(const CoinOtherFactorization &);
     74#endif
     75  ClpFactorization &operator=(const ClpFactorization &);
     76  //@}
     77
     78  /*  **** below here is so can use networkish basis */
     79  /**@name rank one updates which do exist */
     80  //@{
     81
     82  /** Replaces one Column to basis,
    8583      returns 0=OK, 1=Probably OK, 2=singular, 3=no room
    8684         If checkBeforeModifying is true will do all accuracy checks
     
    8987         after factorization and thereafter re-factorize
    9088      partial update already in U */
    91      int replaceColumn ( const ClpSimplex * model,
    92                          CoinIndexedVector * regionSparse,
    93                          CoinIndexedVector * tableauColumn,
    94                          int pivotRow,
    95                          double pivotCheck ,
    96                          bool checkBeforeModifying = false,
    97                          double acceptablePivot = 1.0e-8);
     89  int replaceColumn(const ClpSimplex *model,
     90    CoinIndexedVector *regionSparse,
     91    CoinIndexedVector *tableauColumn,
     92    int pivotRow,
     93    double pivotCheck,
     94    bool checkBeforeModifying = false,
     95    double acceptablePivot = 1.0e-8);
    9896#if ABOCA_LITE_FACTORIZATION
    9997  /// Does btranU part of replaceColumn (skipping entries)
    100   void replaceColumn1(CoinIndexedVector * regionSparse, int pivotRow);
     98  void replaceColumn1(CoinIndexedVector *regionSparse, int pivotRow);
    10199  /// Does replaceColumn - having already done btranU
    102   int replaceColumn2 ( CoinIndexedVector * regionSparse,
    103                       int pivotRow,
    104                        double pivotCheck);
    105 #endif
    106      //@}
    107 
    108      /**@name various uses of factorization (return code number elements)
     100  int replaceColumn2(CoinIndexedVector *regionSparse,
     101    int pivotRow,
     102    double pivotCheck);
     103#endif
     104  //@}
     105
     106  /**@name various uses of factorization (return code number elements)
    109107      which user may want to know about */
    110      //@{
    111      /** Updates one column (FTRAN) from region2
     108  //@{
     109  /** Updates one column (FTRAN) from region2
    112110         Tries to do FT update
    113111         number returned is negative if no room
    114112         region1 starts as zero and is zero at end */
    115      int updateColumnFT ( CoinIndexedVector * regionSparse,
    116                           CoinIndexedVector * regionSparse2);
    117      /** Updates one column (FTRAN) from region2
     113  int updateColumnFT(CoinIndexedVector *regionSparse,
     114    CoinIndexedVector *regionSparse2);
     115  /** Updates one column (FTRAN) from region2
    118116         region1 starts as zero and is zero at end */
    119      int updateColumn ( CoinIndexedVector * regionSparse,
    120                         CoinIndexedVector * regionSparse2,
    121                         bool noPermute = false) const;
    122      /** Updates one column (FTRAN) from region2
     117  int updateColumn(CoinIndexedVector *regionSparse,
     118    CoinIndexedVector *regionSparse2,
     119    bool noPermute = false) const;
     120  /** Updates one column (FTRAN) from region2
    123121         Tries to do FT update
    124122         number returned is negative if no room.
    125123         Also updates region3
    126124         region1 starts as zero and is zero at end */
    127      int updateTwoColumnsFT ( CoinIndexedVector * regionSparse1,
    128                               CoinIndexedVector * regionSparse2,
    129                               CoinIndexedVector * regionSparse3,
    130                               bool noPermuteRegion3 = false) ;
    131      /// For debug (no statistics update)
    132      int updateColumnForDebug ( CoinIndexedVector * regionSparse,
    133                                 CoinIndexedVector * regionSparse2,
    134                                 bool noPermute = false) const;
    135      /** Updates one column (BTRAN) from region2
     125  int updateTwoColumnsFT(CoinIndexedVector *regionSparse1,
     126    CoinIndexedVector *regionSparse2,
     127    CoinIndexedVector *regionSparse3,
     128    bool noPermuteRegion3 = false);
     129  /// For debug (no statistics update)
     130  int updateColumnForDebug(CoinIndexedVector *regionSparse,
     131    CoinIndexedVector *regionSparse2,
     132    bool noPermute = false) const;
     133  /** Updates one column (BTRAN) from region2
    136134         region1 starts as zero and is zero at end */
    137      int updateColumnTranspose ( CoinIndexedVector * regionSparse,
    138                                  CoinIndexedVector * regionSparse2) const;
    139      /** Updates two columns (BTRAN) from regionSparse2 and 3
     135  int updateColumnTranspose(CoinIndexedVector *regionSparse,
     136    CoinIndexedVector *regionSparse2) const;
     137  /** Updates two columns (BTRAN) from regionSparse2 and 3
    140138         regionSparse starts as zero and is zero at end
    141139         Note - if regionSparse2 packed on input - will be packed on output - same for 3
    142140     */
    143      void updateTwoColumnsTranspose ( CoinIndexedVector * regionSparse,
    144                                       CoinIndexedVector * regionSparse2,
    145                                       CoinIndexedVector * regionSparse3) const;
    146      //@}
     141  void updateTwoColumnsTranspose(CoinIndexedVector *regionSparse,
     142    CoinIndexedVector *regionSparse2,
     143    CoinIndexedVector *regionSparse3) const;
     144  //@}
    147145#ifdef CLP_MULTIPLE_FACTORIZATIONS
    148      /**@name Lifted from CoinFactorization */
    149      //@{
    150      /// Total number of elements in factorization
    151      inline int numberElements (  ) const {
    152           if (coinFactorizationA_) return coinFactorizationA_->numberElements();
    153           else return coinFactorizationB_->numberElements() ;
    154      }
    155      /// Returns address of permute region
    156      inline int *permute (  ) const {
    157           if (coinFactorizationA_) return coinFactorizationA_->permute();
    158           else return coinFactorizationB_->permute() ;
    159      }
    160      /// Returns address of pivotColumn region (also used for permuting)
    161      inline int *pivotColumn (  ) const {
    162           if (coinFactorizationA_) return coinFactorizationA_->pivotColumn();
    163           else return coinFactorizationB_->permute() ;
    164      }
    165      /// Maximum number of pivots between factorizations
    166      inline int maximumPivots (  ) const {
    167           if (coinFactorizationA_) return coinFactorizationA_->maximumPivots();
    168           else return coinFactorizationB_->maximumPivots() ;
    169      }
    170      /// Set maximum number of pivots between factorizations
    171      inline void maximumPivots (  int value) {
    172           if (coinFactorizationA_) coinFactorizationA_->maximumPivots(value);
    173           else coinFactorizationB_->maximumPivots(value);
    174      }
    175      /// Returns number of pivots since factorization
    176      inline int pivots (  ) const {
    177           if (coinFactorizationA_) return coinFactorizationA_->pivots();
    178           else return coinFactorizationB_->pivots() ;
    179      }
    180      /// Whether larger areas needed
    181      inline double areaFactor (  ) const {
    182           if (coinFactorizationA_) return coinFactorizationA_->areaFactor();
    183           else return 0.0 ;
    184      }
    185      /// Set whether larger areas needed
    186      inline void areaFactor ( double value) {
    187           if (coinFactorizationA_) coinFactorizationA_->areaFactor(value);
    188      }
    189      /// Zero tolerance
    190      inline double zeroTolerance (  ) const {
    191           if (coinFactorizationA_) return coinFactorizationA_->zeroTolerance();
    192           else return coinFactorizationB_->zeroTolerance() ;
    193      }
    194      /// Set zero tolerance
    195      inline void zeroTolerance (  double value) {
    196           if (coinFactorizationA_) coinFactorizationA_->zeroTolerance(value);
    197           else coinFactorizationB_->zeroTolerance(value);
    198      }
    199      /// Set tolerances to safer of existing and given
    200      void saferTolerances (  double zeroTolerance, double pivotTolerance);
    201      /**  get sparse threshold */
    202      inline int sparseThreshold ( ) const {
    203           if (coinFactorizationA_) return coinFactorizationA_->sparseThreshold();
    204           else return 0 ;
    205      }
    206      /**  Set sparse threshold */
    207      inline void sparseThreshold ( int value) {
    208           if (coinFactorizationA_) coinFactorizationA_->sparseThreshold(value);
    209      }
    210      /// Returns status
    211      inline int status (  ) const {
    212           if (coinFactorizationA_) return coinFactorizationA_->status();
    213           else return coinFactorizationB_->status() ;
    214      }
    215      /// Sets status
    216      inline void setStatus (  int value) {
    217           if (coinFactorizationA_) coinFactorizationA_->setStatus(value);
    218           else coinFactorizationB_->setStatus(value) ;
    219      }
    220      /// Returns number of dense rows
    221      inline int numberDense() const {
    222           if (coinFactorizationA_) return coinFactorizationA_->numberDense();
    223           else return 0 ;
    224      }
     146  /**@name Lifted from CoinFactorization */
     147  //@{
     148  /// Total number of elements in factorization
     149  inline int numberElements() const
     150  {
     151    if (coinFactorizationA_)
     152      return coinFactorizationA_->numberElements();
     153    else
     154      return coinFactorizationB_->numberElements();
     155  }
     156  /// Returns address of permute region
     157  inline int *permute() const
     158  {
     159    if (coinFactorizationA_)
     160      return coinFactorizationA_->permute();
     161    else
     162      return coinFactorizationB_->permute();
     163  }
     164  /// Returns address of pivotColumn region (also used for permuting)
     165  inline int *pivotColumn() const
     166  {
     167    if (coinFactorizationA_)
     168      return coinFactorizationA_->pivotColumn();
     169    else
     170      return coinFactorizationB_->permute();
     171  }
     172  /// Maximum number of pivots between factorizations
     173  inline int maximumPivots() const
     174  {
     175    if (coinFactorizationA_)
     176      return coinFactorizationA_->maximumPivots();
     177    else
     178      return coinFactorizationB_->maximumPivots();
     179  }
     180  /// Set maximum number of pivots between factorizations
     181  inline void maximumPivots(int value)
     182  {
     183    if (coinFactorizationA_)
     184      coinFactorizationA_->maximumPivots(value);
     185    else
     186      coinFactorizationB_->maximumPivots(value);
     187  }
     188  /// Returns number of pivots since factorization
     189  inline int pivots() const
     190  {
     191    if (coinFactorizationA_)
     192      return coinFactorizationA_->pivots();
     193    else
     194      return coinFactorizationB_->pivots();
     195  }
     196  /// Whether larger areas needed
     197  inline double areaFactor() const
     198  {
     199    if (coinFactorizationA_)
     200      return coinFactorizationA_->areaFactor();
     201    else
     202      return 0.0;
     203  }
     204  /// Set whether larger areas needed
     205  inline void areaFactor(double value)
     206  {
     207    if (coinFactorizationA_)
     208      coinFactorizationA_->areaFactor(value);
     209  }
     210  /// Zero tolerance
     211  inline double zeroTolerance() const
     212  {
     213    if (coinFactorizationA_)
     214      return coinFactorizationA_->zeroTolerance();
     215    else
     216      return coinFactorizationB_->zeroTolerance();
     217  }
     218  /// Set zero tolerance
     219  inline void zeroTolerance(double value)
     220  {
     221    if (coinFactorizationA_)
     222      coinFactorizationA_->zeroTolerance(value);
     223    else
     224      coinFactorizationB_->zeroTolerance(value);
     225  }
     226  /// Set tolerances to safer of existing and given
     227  void saferTolerances(double zeroTolerance, double pivotTolerance);
     228  /**  get sparse threshold */
     229  inline int sparseThreshold() const
     230  {
     231    if (coinFactorizationA_)
     232      return coinFactorizationA_->sparseThreshold();
     233    else
     234      return 0;
     235  }
     236  /**  Set sparse threshold */
     237  inline void sparseThreshold(int value)
     238  {
     239    if (coinFactorizationA_)
     240      coinFactorizationA_->sparseThreshold(value);
     241  }
     242  /// Returns status
     243  inline int status() const
     244  {
     245    if (coinFactorizationA_)
     246      return coinFactorizationA_->status();
     247    else
     248      return coinFactorizationB_->status();
     249  }
     250  /// Sets status
     251  inline void setStatus(int value)
     252  {
     253    if (coinFactorizationA_)
     254      coinFactorizationA_->setStatus(value);
     255    else
     256      coinFactorizationB_->setStatus(value);
     257  }
     258  /// Returns number of dense rows
     259  inline int numberDense() const
     260  {
     261    if (coinFactorizationA_)
     262      return coinFactorizationA_->numberDense();
     263    else
     264      return 0;
     265  }
    225266#if 1
    226      /// Returns number in U area
    227      inline CoinBigIndex numberElementsU (  ) const {
    228           if (coinFactorizationA_) return coinFactorizationA_->numberElementsU();
    229           else return -1 ;
    230      }
    231      /// Returns number in L area
    232      inline CoinBigIndex numberElementsL (  ) const {
    233           if (coinFactorizationA_) return coinFactorizationA_->numberElementsL();
    234           else return -1 ;
    235      }
    236      /// Returns number in R area
    237      inline CoinBigIndex numberElementsR (  ) const {
    238           if (coinFactorizationA_) return coinFactorizationA_->numberElementsR();
    239           else return 0 ;
    240      }
    241 #endif
    242      bool timeToRefactorize() const;
    243 #if CLP_FACTORIZATION_NEW_TIMING>1
    244      void statsRefactor(char when) const;
    245 #endif
    246      /// Level of detail of messages
    247      inline int messageLevel (  ) const {
    248           if (coinFactorizationA_) return coinFactorizationA_->messageLevel();
    249           else return 1 ;
    250      }
    251      /// Set level of detail of messages
    252      inline void messageLevel (  int value) {
    253           if (coinFactorizationA_) coinFactorizationA_->messageLevel(value);
    254      }
    255      /// Get rid of all memory
    256      inline void clearArrays() {
    257           if (coinFactorizationA_)
    258                coinFactorizationA_->clearArrays();
    259           else if (coinFactorizationB_)
    260                coinFactorizationB_->clearArrays();
    261      }
    262      /// Number of Rows after factorization
    263      inline int numberRows (  ) const {
    264           if (coinFactorizationA_) return coinFactorizationA_->numberRows();
    265           else return coinFactorizationB_->numberRows() ;
    266      }
    267      /// Gets dense threshold
    268      inline int denseThreshold() const {
    269           if (coinFactorizationA_) return coinFactorizationA_->denseThreshold();
    270           else return 0 ;
    271      }
    272      /// Sets dense threshold
    273      inline void setDenseThreshold(int value) {
    274           if (coinFactorizationA_) coinFactorizationA_->setDenseThreshold(value);
    275      }
    276      /// Pivot tolerance
    277      inline double pivotTolerance (  ) const {
    278           if (coinFactorizationA_) return coinFactorizationA_->pivotTolerance();
    279           else if (coinFactorizationB_) return coinFactorizationB_->pivotTolerance();
    280           return 1.0e-8 ;
    281      }
    282      /// Set pivot tolerance
    283      inline void pivotTolerance (  double value) {
    284           if (coinFactorizationA_) coinFactorizationA_->pivotTolerance(value);
    285           else if (coinFactorizationB_) coinFactorizationB_->pivotTolerance(value);
    286      }
    287      /// Allows change of pivot accuracy check 1.0 == none >1.0 relaxed
    288      inline void relaxAccuracyCheck(double value) {
    289           if (coinFactorizationA_) coinFactorizationA_->relaxAccuracyCheck(value);
    290      }
    291      /** Array persistence flag
     267  /// Returns number in U area
     268  inline CoinBigIndex numberElementsU() const
     269  {
     270    if (coinFactorizationA_)
     271      return coinFactorizationA_->numberElementsU();
     272    else
     273      return -1;
     274  }
     275  /// Returns number in L area
     276  inline CoinBigIndex numberElementsL() const
     277  {
     278    if (coinFactorizationA_)
     279      return coinFactorizationA_->numberElementsL();
     280    else
     281      return -1;
     282  }
     283  /// Returns number in R area
     284  inline CoinBigIndex numberElementsR() const
     285  {
     286    if (coinFactorizationA_)
     287      return coinFactorizationA_->numberElementsR();
     288    else
     289      return 0;
     290  }
     291#endif
     292  bool timeToRefactorize() const;
     293#if CLP_FACTORIZATION_NEW_TIMING > 1
     294  void statsRefactor(char when) const;
     295#endif
     296  /// Level of detail of messages
     297  inline int messageLevel() const
     298  {
     299    if (coinFactorizationA_)
     300      return coinFactorizationA_->messageLevel();
     301    else
     302      return 1;
     303  }
     304  /// Set level of detail of messages
     305  inline void messageLevel(int value)
     306  {
     307    if (coinFactorizationA_)
     308      coinFactorizationA_->messageLevel(value);
     309  }
     310  /// Get rid of all memory
     311  inline void clearArrays()
     312  {
     313    if (coinFactorizationA_)
     314      coinFactorizationA_->clearArrays();
     315    else if (coinFactorizationB_)
     316      coinFactorizationB_->clearArrays();
     317  }
     318  /// Number of Rows after factorization
     319  inline int numberRows() const
     320  {
     321    if (coinFactorizationA_)
     322      return coinFactorizationA_->numberRows();
     323    else
     324      return coinFactorizationB_->numberRows();
     325  }
     326  /// Gets dense threshold
     327  inline int denseThreshold() const
     328  {
     329    if (coinFactorizationA_)
     330      return coinFactorizationA_->denseThreshold();
     331    else
     332      return 0;
     333  }
     334  /// Sets dense threshold
     335  inline void setDenseThreshold(int value)
     336  {
     337    if (coinFactorizationA_)
     338      coinFactorizationA_->setDenseThreshold(value);
     339  }
     340  /// Pivot tolerance
     341  inline double pivotTolerance() const
     342  {
     343    if (coinFactorizationA_)
     344      return coinFactorizationA_->pivotTolerance();
     345    else if (coinFactorizationB_)
     346      return coinFactorizationB_->pivotTolerance();
     347    return 1.0e-8;
     348  }
     349  /// Set pivot tolerance
     350  inline void pivotTolerance(double value)
     351  {
     352    if (coinFactorizationA_)
     353      coinFactorizationA_->pivotTolerance(value);
     354    else if (coinFactorizationB_)
     355      coinFactorizationB_->pivotTolerance(value);
     356  }
     357  /// Allows change of pivot accuracy check 1.0 == none >1.0 relaxed
     358  inline void relaxAccuracyCheck(double value)
     359  {
     360    if (coinFactorizationA_)
     361      coinFactorizationA_->relaxAccuracyCheck(value);
     362  }
     363  /** Array persistence flag
    292364         If 0 then as now (delete/new)
    293365         1 then only do arrays if bigger needed
    294366         2 as 1 but give a bit extra if bigger needed
    295367     */
    296      inline int persistenceFlag() const {
    297           if (coinFactorizationA_) return coinFactorizationA_->persistenceFlag();
    298           else return 0 ;
    299      }
    300      inline void setPersistenceFlag(int value) {
    301           if (coinFactorizationA_) coinFactorizationA_->setPersistenceFlag(value);
    302      }
    303      /// Delete all stuff (leaves as after CoinFactorization())
    304      inline void almostDestructor() {
    305           if (coinFactorizationA_)
    306                coinFactorizationA_->almostDestructor();
    307           else if (coinFactorizationB_)
    308                coinFactorizationB_->clearArrays();
    309      }
    310      /// Returns areaFactor but adjusted for dense
    311      inline double adjustedAreaFactor() const {
    312           if (coinFactorizationA_) return coinFactorizationA_->adjustedAreaFactor();
    313           else return 0.0 ;
    314      }
    315      inline void setBiasLU(int value) {
    316           if (coinFactorizationA_) coinFactorizationA_->setBiasLU(value);
    317      }
    318      /// true if Forrest Tomlin update, false if PFI
    319      inline void setForrestTomlin(bool value) {
    320           if (coinFactorizationA_) coinFactorizationA_->setForrestTomlin(value);
    321      }
    322      /// Sets default values
    323      inline void setDefaultValues() {
    324           if (coinFactorizationA_) {
    325                // row activities have negative sign
     368  inline int persistenceFlag() const
     369  {
     370    if (coinFactorizationA_)
     371      return coinFactorizationA_->persistenceFlag();
     372    else
     373      return 0;
     374  }
     375  inline void setPersistenceFlag(int value)
     376  {
     377    if (coinFactorizationA_)
     378      coinFactorizationA_->setPersistenceFlag(value);
     379  }
     380  /// Delete all stuff (leaves as after CoinFactorization())
     381  inline void almostDestructor()
     382  {
     383    if (coinFactorizationA_)
     384      coinFactorizationA_->almostDestructor();
     385    else if (coinFactorizationB_)
     386      coinFactorizationB_->clearArrays();
     387  }
     388  /// Returns areaFactor but adjusted for dense
     389  inline double adjustedAreaFactor() const
     390  {
     391    if (coinFactorizationA_)
     392      return coinFactorizationA_->adjustedAreaFactor();
     393    else
     394      return 0.0;
     395  }
     396  inline void setBiasLU(int value)
     397  {
     398    if (coinFactorizationA_)
     399      coinFactorizationA_->setBiasLU(value);
     400  }
     401  /// true if Forrest Tomlin update, false if PFI
     402  inline void setForrestTomlin(bool value)
     403  {
     404    if (coinFactorizationA_)
     405      coinFactorizationA_->setForrestTomlin(value);
     406  }
     407  /// Sets default values
     408  inline void setDefaultValues()
     409  {
     410    if (coinFactorizationA_) {
     411      // row activities have negative sign
    326412#ifndef COIN_FAST_CODE
    327                coinFactorizationA_->slackValue(-1.0);
    328 #endif
    329                coinFactorizationA_->zeroTolerance(1.0e-13);
    330           }
    331      }
    332      /// If nonzero force use of 1,dense 2,small 3,osl
    333      void forceOtherFactorization(int which);
    334      /// Get switch to osl if number rows <= this
    335      inline int goOslThreshold() const {
    336           return goOslThreshold_;
    337      }
    338      /// Set switch to osl if number rows <= this
    339      inline void setGoOslThreshold(int value) {
    340           goOslThreshold_ = value;
    341      }
    342      /// Get switch to dense if number rows <= this
    343      inline int goDenseThreshold() const {
    344           return goDenseThreshold_;
    345      }
    346      /// Set switch to dense if number rows <= this
    347      inline void setGoDenseThreshold(int value) {
    348           goDenseThreshold_ = value;
    349      }
    350      /// Get switch to small if number rows <= this
    351      inline int goSmallThreshold() const {
    352           return goSmallThreshold_;
    353      }
    354      /// Set switch to small if number rows <= this
    355      inline void setGoSmallThreshold(int value) {
    356           goSmallThreshold_ = value;
    357      }
    358      /// Go over to dense or small code if small enough
    359      void goDenseOrSmall(int numberRows) ;
    360      /// Sets factorization
    361      void setFactorization(ClpFactorization & factorization);
    362      /// Return 1 if dense code
    363      inline int isDenseOrSmall() const {
    364           return coinFactorizationB_ ? 1 : 0;
    365      }
    366      /// Return coinFactorizationA_
    367      inline CoinFactorization * coinFactorization() const {
    368           return coinFactorizationA_;
    369      }
     413      coinFactorizationA_->slackValue(-1.0);
     414#endif
     415      coinFactorizationA_->zeroTolerance(1.0e-13);
     416    }
     417  }
     418  /// If nonzero force use of 1,dense 2,small 3,osl
     419  void forceOtherFactorization(int which);
     420  /// Get switch to osl if number rows <= this
     421  inline int goOslThreshold() const
     422  {
     423    return goOslThreshold_;
     424  }
     425  /// Set switch to osl if number rows <= this
     426  inline void setGoOslThreshold(int value)
     427  {
     428    goOslThreshold_ = value;
     429  }
     430  /// Get switch to dense if number rows <= this
     431  inline int goDenseThreshold() const
     432  {
     433    return goDenseThreshold_;
     434  }
     435  /// Set switch to dense if number rows <= this
     436  inline void setGoDenseThreshold(int value)
     437  {
     438    goDenseThreshold_ = value;
     439  }
     440  /// Get switch to small if number rows <= this
     441  inline int goSmallThreshold() const
     442  {
     443    return goSmallThreshold_;
     444  }
     445  /// Set switch to small if number rows <= this
     446  inline void setGoSmallThreshold(int value)
     447  {
     448    goSmallThreshold_ = value;
     449  }
     450  /// Go over to dense or small code if small enough
     451  void goDenseOrSmall(int numberRows);
     452  /// Sets factorization
     453  void setFactorization(ClpFactorization &factorization);
     454  /// Return 1 if dense code
     455  inline int isDenseOrSmall() const
     456  {
     457    return coinFactorizationB_ ? 1 : 0;
     458  }
     459  /// Return coinFactorizationA_
     460  inline CoinFactorization *coinFactorization() const
     461  {
     462    return coinFactorizationA_;
     463  }
    370464#else
    371      inline bool timeToRefactorize() const {
    372           return (pivots() * 3 > maximumPivots() * 2 &&
    373                   numberElementsR() * 3 > (numberElementsL() + numberElementsU()) * 2 + 1000 &&
    374                   !numberDense());
    375      }
    376      /// Sets default values
    377      inline void setDefaultValues() {
    378           // row activities have negative sign
     465  inline bool timeToRefactorize() const
     466  {
     467    return (pivots() * 3 > maximumPivots() * 2 && numberElementsR() * 3 > (numberElementsL() + numberElementsU()) * 2 + 1000 && !numberDense());
     468  }
     469  /// Sets default values
     470  inline void setDefaultValues()
     471  {
     472    // row activities have negative sign
    379473#ifndef COIN_FAST_CODE
    380           slackValue(-1.0);
    381 #endif
    382           zeroTolerance(1.0e-13);
    383      }
    384      /// Go over to dense code
    385      inline void goDense() {}
    386 #endif
    387      //@}
    388 
    389      /**@name other stuff */
    390      //@{
    391      /** makes a row copy of L for speed and to allow very sparse problems */
    392      void goSparse();
    393      /// Cleans up i.e. gets rid of network basis
    394      void cleanUp();
    395      /// Says whether to redo pivot order
    396      bool needToReorder() const;
    397      /// To switch statistics on or off
    398      inline void doStatistics(bool trueFalse) const
    399      { doStatistics_ = trueFalse;}
     474    slackValue(-1.0);
     475#endif
     476    zeroTolerance(1.0e-13);
     477  }
     478  /// Go over to dense code
     479  inline void goDense() {}
     480#endif
     481  //@}
     482
     483  /**@name other stuff */
     484  //@{
     485  /** makes a row copy of L for speed and to allow very sparse problems */
     486  void goSparse();
     487  /// Cleans up i.e. gets rid of network basis
     488  void cleanUp();
     489  /// Says whether to redo pivot order
     490  bool needToReorder() const;
     491  /// To switch statistics on or off
     492  inline void doStatistics(bool trueFalse) const
     493  {
     494    doStatistics_ = trueFalse;
     495  }
    400496#ifndef SLIM_CLP
    401      /// Says if a network basis
    402      inline bool networkBasis() const {
    403           return (networkBasis_ != NULL);
    404      }
     497  /// Says if a network basis
     498  inline bool networkBasis() const
     499  {
     500    return (networkBasis_ != NULL);
     501  }
    405502#else
    406      /// Says if a network basis
    407      inline bool networkBasis() const {
    408           return false;
    409      }
    410 #endif
    411      /// Fills weighted row list
    412      void getWeights(int * weights) const;
    413      //@}
    414 
    415 ////////////////// data //////////////////
     503  /// Says if a network basis
     504  inline bool networkBasis() const
     505  {
     506    return false;
     507  }
     508#endif
     509  /// Fills weighted row list
     510  void getWeights(int *weights) const;
     511  //@}
     512
     513  ////////////////// data //////////////////
    416514private:
    417 
    418      /**@name data */
    419      //@{
    420      /// Pointer to network basis
     515  /**@name data */
     516  //@{
     517  /// Pointer to network basis
    421518#ifndef SLIM_CLP
    422      ClpNetworkBasis * networkBasis_;
     519  ClpNetworkBasis *networkBasis_;
    423520#endif
    424521#ifdef CLP_MULTIPLE_FACTORIZATIONS
    425      /// Pointer to CoinFactorization
    426      CoinFactorization * coinFactorizationA_;
    427      /// Pointer to CoinOtherFactorization
    428      CoinOtherFactorization * coinFactorizationB_;
     522  /// Pointer to CoinFactorization
     523  CoinFactorization *coinFactorizationA_;
     524  /// Pointer to CoinOtherFactorization
     525  CoinOtherFactorization *coinFactorizationB_;
    429526#ifdef CLP_REUSE_ETAS
    430      /// Pointer to model
    431      ClpSimplex * model_;
    432 #endif
    433      /// If nonzero force use of 1,dense 2,small 3,osl
    434      int forceB_;
    435      /// Switch to osl if number rows <= this
    436      int goOslThreshold_;
    437      /// Switch to small if number rows <= this
    438      int goSmallThreshold_;
    439      /// Switch to dense if number rows <= this
    440      int goDenseThreshold_;
     527  /// Pointer to model
     528  ClpSimplex *model_;
     529#endif
     530  /// If nonzero force use of 1,dense 2,small 3,osl
     531  int forceB_;
     532  /// Switch to osl if number rows <= this
     533  int goOslThreshold_;
     534  /// Switch to small if number rows <= this
     535  int goSmallThreshold_;
     536  /// Switch to dense if number rows <= this
     537  int goDenseThreshold_;
    441538#endif
    442539#ifdef CLP_FACTORIZATION_NEW_TIMING
    443      /// For guessing when to re-factorize
    444      mutable double shortestAverage_;
    445      mutable double totalInR_;
    446      mutable double totalInIncreasingU_;
    447      mutable int endLengthU_;
    448      mutable int lastNumberPivots_;
    449      mutable int effectiveStartNumberU_;
    450 #endif
    451      /// To switch statistics on or off
    452      mutable bool doStatistics_;
    453      //@}
     540  /// For guessing when to re-factorize
     541  mutable double shortestAverage_;
     542  mutable double totalInR_;
     543  mutable double totalInIncreasingU_;
     544  mutable int endLengthU_;
     545  mutable int lastNumberPivots_;
     546  mutable int effectiveStartNumberU_;
     547#endif
     548  /// To switch statistics on or off
     549  mutable bool doStatistics_;
     550  //@}
    454551};
    455  
    456 #endif
     552
     553#endif
     554
     555/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     556*/
Note: See TracChangeset for help on using the changeset viewer.