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

formatting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Clp/src/ClpSimplexDual.hpp

    r2293 r2385  
    2424
    2525public:
    26 
    27      /**@name Description of algorithm */
    28      //@{
    29      /** Dual algorithm
     26  /**@name Description of algorithm */
     27  //@{
     28  /** Dual algorithm
    3029
    3130         Method
     
    116115     */
    117116
    118      int dual(int ifValuesPass, int startFinishOptions = 0);
    119      /** For strong branching.  On input lower and upper are new bounds
     117  int dual(int ifValuesPass, int startFinishOptions = 0);
     118  /** For strong branching.  On input lower and upper are new bounds
    120119         while on output they are change in objective function values
    121120         (>1.0e50 infeasible).
     
    125124         status and number of iterations
    126125     */
    127      int strongBranching(int numberVariables, const int * variables,
    128                          double * newLower, double * newUpper,
    129                          double ** outputSolution,
    130                          int * outputStatus, int * outputIterations,
    131                          bool stopOnFirstInfeasible = true,
    132                          bool alwaysFinish = false,
    133                          int startFinishOptions = 0);
    134      /// This does first part of StrongBranching
    135      ClpFactorization * setupForStrongBranching(char * arrays, int numberRows,
    136                int numberColumns, bool solveLp = false);
    137      /// This cleans up after strong branching
    138      void cleanupAfterStrongBranching(ClpFactorization * factorization);
    139      //@}
    140 
    141      /**@name Functions used in dual */
    142      //@{
    143      /** This has the flow between re-factorizations
     126  int strongBranching(int numberVariables, const int *variables,
     127    double *newLower, double *newUpper,
     128    double **outputSolution,
     129    int *outputStatus, int *outputIterations,
     130    bool stopOnFirstInfeasible = true,
     131    bool alwaysFinish = false,
     132    int startFinishOptions = 0);
     133  /// This does first part of StrongBranching
     134  ClpFactorization *setupForStrongBranching(char *arrays, int numberRows,
     135    int numberColumns, bool solveLp = false);
     136  /// This cleans up after strong branching
     137  void cleanupAfterStrongBranching(ClpFactorization *factorization);
     138  //@}
     139
     140  /**@name Functions used in dual */
     141  //@{
     142  /** This has the flow between re-factorizations
    144143         Broken out for clarity and will be used by strong branching
    145144
     
    154153         If givenPi not NULL then in values pass
    155154      */
    156      int whileIterating(double * & givenPi, int ifValuesPass);
    157      /** The duals are updated by the given arrays.
     155  int whileIterating(double *&givenPi, int ifValuesPass);
     156  /** The duals are updated by the given arrays.
    158157         Returns number of infeasibilities.
    159158         After rowArray and columnArray will just have those which
     
    162161         The output vector has movement of primal
    163162         solution (row length array) */
    164      int updateDualsInDual(CoinIndexedVector * rowArray,
    165                            CoinIndexedVector * columnArray,
    166                            CoinIndexedVector * outputArray,
    167                            double theta,
    168                            double & objectiveChange,
    169                            bool fullRecompute);
    170      /** The duals are updated by the given arrays.
     163  int updateDualsInDual(CoinIndexedVector *rowArray,
     164    CoinIndexedVector *columnArray,
     165    CoinIndexedVector *outputArray,
     166    double theta,
     167    double &objectiveChange,
     168    bool fullRecompute);
     169  /** The duals are updated by the given arrays.
    171170         This is in values pass - so no changes to primal is made
    172171     */
    173      void updateDualsInValuesPass(CoinIndexedVector * rowArray,
    174                                   CoinIndexedVector * columnArray,
    175                                   double theta);
    176      /** While updateDualsInDual sees what effect is of flip
     172  void updateDualsInValuesPass(CoinIndexedVector *rowArray,
     173    CoinIndexedVector *columnArray,
     174    double theta);
     175  /** While updateDualsInDual sees what effect is of flip
    177176         this does actual flipping.
    178177     */
    179      void flipBounds(CoinIndexedVector * rowArray,
    180                      CoinIndexedVector * columnArray);
    181      /**
     178  void flipBounds(CoinIndexedVector *rowArray,
     179    CoinIndexedVector *columnArray);
     180  /**
    182181         Row array has row part of pivot row
    183182         Column array has column part.
     
    190189         Returns best possible pivot value
    191190     */
    192      double dualColumn(CoinIndexedVector * rowArray,
    193                        CoinIndexedVector * columnArray,
    194                        CoinIndexedVector * spareArray,
    195                        CoinIndexedVector * spareArray2,
    196                        double accpetablePivot,
    197                        CoinBigIndex * dubiousWeights);
    198      /// Does first bit of dualColumn
    199      int dualColumn0(const CoinIndexedVector * rowArray,
    200                      const CoinIndexedVector * columnArray,
    201                      CoinIndexedVector * spareArray,
    202                      double acceptablePivot,
    203                      double & upperReturn, double & badFree);
    204      /**
     191  double dualColumn(CoinIndexedVector *rowArray,
     192    CoinIndexedVector *columnArray,
     193    CoinIndexedVector *spareArray,
     194    CoinIndexedVector *spareArray2,
     195    double accpetablePivot,
     196    CoinBigIndex *dubiousWeights);
     197  /// Does first bit of dualColumn
     198  int dualColumn0(const CoinIndexedVector *rowArray,
     199    const CoinIndexedVector *columnArray,
     200    CoinIndexedVector *spareArray,
     201    double acceptablePivot,
     202    double &upperReturn, double &badFree);
     203  /**
    205204         Row array has row part of pivot row
    206205         Column array has column part.
     
    208207         if sequenceIn==sequenceOut can change dual on chosen row and leave variable in basis
    209208     */
    210      void checkPossibleValuesMove(CoinIndexedVector * rowArray,
    211                                   CoinIndexedVector * columnArray,
    212                                   double acceptablePivot);
    213      /**
     209  void checkPossibleValuesMove(CoinIndexedVector *rowArray,
     210    CoinIndexedVector *columnArray,
     211    double acceptablePivot);
     212  /**
    214213         Row array has row part of pivot row
    215214         Column array has column part.
     
    217216         If sequenceIn_ < 0 then can't do anything
    218217     */
    219      void checkPossibleCleanup(CoinIndexedVector * rowArray,
    220                                CoinIndexedVector * columnArray,
    221                                double acceptablePivot);
    222      /**
     218  void checkPossibleCleanup(CoinIndexedVector *rowArray,
     219    CoinIndexedVector *columnArray,
     220    double acceptablePivot);
     221  /**
    223222         This sees if we can move duals in dual values pass.
    224223         This is done before any pivoting
    225224     */
    226      void doEasyOnesInValuesPass(double * givenReducedCosts);
    227      /**
     225  void doEasyOnesInValuesPass(double *givenReducedCosts);
     226  /**
    228227         Chooses dual pivot row
    229228         Would be faster with separate region to scan
     
    234233         selected
    235234     */
    236      void dualRow(int alreadyChosen);
    237      /** Checks if any fake bounds active - if so returns number and modifies
     235  void dualRow(int alreadyChosen);
     236  /** Checks if any fake bounds active - if so returns number and modifies
    238237         updatedDualBound_ and everything.
    239238         Free variables will be left as free
     
    244243         If 2 sets to original (just changed)
    245244     */
    246      int changeBounds(int initialize, CoinIndexedVector * outputArray,
    247                       double & changeCost);
    248      /// Just checks if any fake bounds active - if so returns number
    249      int checkFakeBounds() const;
    250      /** As changeBounds but just changes new bounds for a single variable.
     245  int changeBounds(int initialize, CoinIndexedVector *outputArray,
     246    double &changeCost);
     247  /// Just checks if any fake bounds active - if so returns number
     248  int checkFakeBounds() const;
     249  /** As changeBounds but just changes new bounds for a single variable.
    251250         Returns true if change */
    252      bool changeBound( int iSequence);
    253      /// Restores bound to original bound
    254      void originalBound(int iSequence);
    255      /** Checks if tentative optimal actually means unbounded in dual
     251  bool changeBound(int iSequence);
     252  /// Restores bound to original bound
     253  void originalBound(int iSequence);
     254  /** Checks if tentative optimal actually means unbounded in dual
    256255         Returns -3 if not, 2 if is unbounded */
    257      int checkUnbounded(CoinIndexedVector * ray, CoinIndexedVector * spare,
    258                         double changeCost);
    259      /**  Refactorizes if necessary
     256  int checkUnbounded(CoinIndexedVector *ray, CoinIndexedVector *spare,
     257    double changeCost);
     258  /**  Refactorizes if necessary
    260259          Checks if finished.  Updates status.
    261260          lastCleaned refers to iteration at which some objective/feasibility
     
    266265           - 2 restoring from saved
    267266     */
    268      void statusOfProblemInDual(int & lastCleaned, int type,
    269                                 double * givenDjs, ClpDataSave & saveData,
    270                                 int ifValuesPass);
    271      /** Perturbs problem (method depends on perturbation())
     267  void statusOfProblemInDual(int &lastCleaned, int type,
     268    double *givenDjs, ClpDataSave &saveData,
     269    int ifValuesPass);
     270  /** Perturbs problem (method depends on perturbation())
    272271         returns nonzero if should go to dual */
    273      int perturb();
    274      /** Fast iterations.  Misses out a lot of initialization.
     272  int perturb();
     273  /** Fast iterations.  Misses out a lot of initialization.
    275274         Normally stops on maximum iterations, first re-factorization
    276275         or tentative optimum.  If looks interesting then continues as
    277276         normal.  Returns 0 if finished properly, 1 otherwise.
    278277     */
    279      int fastDual(bool alwaysFinish = false);
    280      /** Checks number of variables at fake bounds.  This is used by fastDual
     278  int fastDual(bool alwaysFinish = false);
     279  /** Checks number of variables at fake bounds.  This is used by fastDual
    281280         so can exit gracefully before end */
    282      int numberAtFakeBound();
    283 
    284      /** Pivot in a variable and choose an outgoing one.  Assumes dual
     281  int numberAtFakeBound();
     282
     283  /** Pivot in a variable and choose an outgoing one.  Assumes dual
    285284         feasible - will not go through a reduced cost.  Returns step length in theta
    286285         Return codes as before but -1 means no acceptable pivot
    287286     */
    288      int pivotResultPart1();
    289      /** Get next free , -1 if none */
    290      int nextSuperBasic();
    291      /** Startup part of dual (may be extended to other algorithms)
     287  int pivotResultPart1();
     288  /** Get next free , -1 if none */
     289  int nextSuperBasic();
     290  /** Startup part of dual (may be extended to other algorithms)
    292291         returns 0 if good, 1 if bad */
    293      int startupSolve(int ifValuesPass, double * saveDuals, int startFinishOptions);
    294      void finishSolve(int startFinishOptions);
    295      void gutsOfDual(int ifValuesPass, double * & saveDuals, int initialStatus,
    296                      ClpDataSave & saveData);
    297      //int dual2(int ifValuesPass,int startFinishOptions=0);
    298      void resetFakeBounds(int type);
    299 
    300      //@}
     292  int startupSolve(int ifValuesPass, double *saveDuals, int startFinishOptions);
     293  void finishSolve(int startFinishOptions);
     294  void gutsOfDual(int ifValuesPass, double *&saveDuals, int initialStatus,
     295    ClpDataSave &saveData);
     296  //int dual2(int ifValuesPass,int startFinishOptions=0);
     297  void resetFakeBounds(int type);
     298
     299  //@}
    301300};
    302301#endif
     302
     303/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
     304*/
Note: See TracChangeset for help on using the changeset viewer.