ClpSimplexDual.hpp
Go to the documentation of this file.
1 /* $Id: ClpSimplexDual.hpp 1525 2010-02-26 17:27:59Z mjs $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others. All Rights Reserved.
4 
5 /*
6  Authors
7 
8  John Forrest
9 
10  */
11 #ifndef ClpSimplexDual_H
12 #define ClpSimplexDual_H
13 
14 #include "ClpSimplex.hpp"
15 
23 class ClpSimplexDual : public ClpSimplex {
24 
25 public:
26 
118  int dual(int ifValuesPass, int startFinishOptions = 0);
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);
136  int numberColumns, bool solveLp = false);
140 
156  int whileIterating(double * & givenPi, int ifValuesPass);
164  int updateDualsInDual(CoinIndexedVector * rowArray,
165  CoinIndexedVector * columnArray,
166  CoinIndexedVector * outputArray,
167  double theta,
168  double & objectiveChange,
169  bool fullRecompute);
173  void updateDualsInValuesPass(CoinIndexedVector * rowArray,
174  CoinIndexedVector * columnArray,
175  double theta);
179  void flipBounds(CoinIndexedVector * rowArray,
180  CoinIndexedVector * columnArray);
192  double dualColumn(CoinIndexedVector * rowArray,
193  CoinIndexedVector * columnArray,
194  CoinIndexedVector * spareArray,
195  CoinIndexedVector * spareArray2,
196  double accpetablePivot,
197  CoinBigIndex * dubiousWeights);
199  int dualColumn0(const CoinIndexedVector * rowArray,
200  const CoinIndexedVector * columnArray,
201  CoinIndexedVector * spareArray,
202  double acceptablePivot,
203  double & upperReturn, double &bestReturn, double & badFree);
210  void checkPossibleValuesMove(CoinIndexedVector * rowArray,
211  CoinIndexedVector * columnArray,
212  double acceptablePivot);
219  void checkPossibleCleanup(CoinIndexedVector * rowArray,
220  CoinIndexedVector * columnArray,
221  double acceptablePivot);
226  void doEasyOnesInValuesPass(double * givenReducedCosts);
236  void dualRow(int alreadyChosen);
246  int changeBounds(int initialize, CoinIndexedVector * outputArray,
247  double & changeCost);
250  bool changeBound( int iSequence);
252  void originalBound(int iSequence);
255  int checkUnbounded(CoinIndexedVector * ray, CoinIndexedVector * spare,
256  double changeCost);
266  void statusOfProblemInDual(int & lastCleaned, int type,
267  double * givenDjs, ClpDataSave & saveData,
268  int ifValuesPass);
271  int perturb();
277  int fastDual(bool alwaysFinish = false);
280  int numberAtFakeBound();
281 
287  int pivotResult();
289  int nextSuperBasic();
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 
300 };
301 #endif
ClpDataSave saveData()
Save data.
ClpFactorization * setupForStrongBranching(char *arrays, int numberRows, int numberColumns, bool solveLp=false)
This does first part of StrongBranching.
This solves LPs using the dual simplex method.
This is a tiny class where data can be saved round calls.
Definition: ClpModel.hpp:1217
int pivotResult()
Pivot in a variable and choose an outgoing one.
int changeBounds(int initialize, CoinIndexedVector *outputArray, double &changeCost)
Checks if any fake bounds active - if so returns number and modifies updatedDualBound_ and everything...
void originalBound(int iSequence)
Restores bound to original bound.
int strongBranching(int numberVariables, const int *variables, double *newLower, double *newUpper, double **outputSolution, int *outputStatus, int *outputIterations, bool stopOnFirstInfeasible=true, bool alwaysFinish=false, int startFinishOptions=0)
For strong branching.
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:309
void finishSolve(int startFinishOptions)
This has the flow between re-factorizations Broken out for clarity and will be used by strong branchi...
int checkUnbounded(CoinIndexedVector *ray, CoinIndexedVector *spare, double changeCost)
Checks if tentative optimal actually means unbounded in dual Returns -3 if not, 2 if is unbounded...
void checkPossibleValuesMove(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray, double acceptablePivot)
Row array has row part of pivot row Column array has column part.
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:618
double theta() const
Theta (pivot change)
int numberColumns() const
Number of rows.
Definition: ClpModel.hpp:319
void doEasyOnesInValuesPass(double *givenReducedCosts)
This sees if we can move duals in dual values pass.
void gutsOfDual(int ifValuesPass, double *&saveDuals, int initialStatus, ClpDataSave &saveData)
This has the flow between re-factorizations Broken out for clarity and will be used by strong branchi...
int dualColumn0(const CoinIndexedVector *rowArray, const CoinIndexedVector *columnArray, CoinIndexedVector *spareArray, double acceptablePivot, double &upperReturn, double &bestReturn, double &badFree)
Does first bit of dualColumn.
void checkPossibleCleanup(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray, double acceptablePivot)
Row array has row part of pivot row Column array has column part.
This solves LPs using the simplex method.
Definition: ClpSimplex.hpp:49
int whileIterating(double *&givenPi, int ifValuesPass)
This has the flow between re-factorizations Broken out for clarity and will be used by strong branchi...
int updateDualsInDual(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray, CoinIndexedVector *outputArray, double theta, double &objectiveChange, bool fullRecompute)
The duals are updated by the given arrays.
void flipBounds(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray)
While updateDualsInDual sees what effect is of flip this does actual flipping.
void resetFakeBounds(int type)
This has the flow between re-factorizations Broken out for clarity and will be used by strong branchi...
int fastDual(bool alwaysFinish=false)
Fast iterations.
void dualRow(int alreadyChosen)
Chooses dual pivot row Would be faster with separate region to scan and will have this (with square o...
bool changeBound(int iSequence)
As changeBounds but just changes new bounds for a single variable.
int numberAtFakeBound()
Checks number of variables at fake bounds.
void updateDualsInValuesPass(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray, double theta)
The duals are updated by the given arrays.
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:614
int startupSolve(int ifValuesPass, double *saveDuals, int startFinishOptions)
Startup part of dual (may be extended to other algorithms) returns 0 if good, 1 if bad...
int nextSuperBasic()
Get next free , -1 if none.
int perturb()
Perturbs problem (method depends on perturbation()) returns nonzero if should go to dual...
ClpFactorization * factorization() const
factorization
Definition: ClpSimplex.hpp:496
int dual(int ifValuesPass, int startFinishOptions=0)
Dual algorithm.
This just implements CoinFactorization when an ClpMatrixBase object is passed.
void statusOfProblemInDual(int &lastCleaned, int type, double *givenDjs, ClpDataSave &saveData, int ifValuesPass)
Refactorizes if necessary Checks if finished.
double dualColumn(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray, CoinIndexedVector *spareArray, CoinIndexedVector *spareArray2, double accpetablePivot, CoinBigIndex *dubiousWeights)
Row array has row part of pivot row Column array has column part.
void cleanupAfterStrongBranching(ClpFactorization *factorization)
This cleans up after strong branching.