Cgl 0.60.2

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbcSimplexDual.hpp
Go to the documentation of this file.
1 /* $Id: AbcSimplexDual.hpp 2385 2019-01-06 19:43:06Z unxusr $ */
2 // Copyright (C) 2002, International Business Machines
3 // Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved.
4 // This code is licensed under the terms of the Eclipse Public License (EPL).
5 /*
6 Authors
7
8 John Forrest
9
10 */
11 #ifndef AbcSimplexDual_H
12 #define AbcSimplexDual_H
13
14 #include "AbcSimplex.hpp"
15 #if 0
16 #undef ABC_PARALLEL
17 #define ABC_PARALLEL 2
18 #undef cilk_for
19 #undef cilk_spawn
20 #undef cilk_sync
21 #include <cilk/cilk.h>
22 #endif
23 typedef struct {
24 double theta;
25 double totalThru;
26 double useThru;
27 double bestEverPivot;
28 double increaseInObjective;
29 double tentativeTheta;
30 double lastPivotValue;
31 double thisPivotValue;
32 double thruThis;
33 double increaseInThis;
34 int lastSequence;
35 int sequence;
36 int block;
37 int numberSwapped;
38 int numberRemaining;
39 int numberLastSwapped;
40 bool modifyCosts;
41 } dualColumnResult;
49 class AbcSimplexDual : public AbcSimplex {
50
51 public:
143 int dual();
152 int strongBranching(int numberVariables, const int *variables,
153 double *newLower, double *newUpper,
154 double **outputSolution,
155 int *outputStatus, int *outputIterations,
156 bool stopOnFirstInfeasible = true,
157 bool alwaysFinish = false,
158 int startFinishOptions = 0);
160 AbcSimplexFactorization *setupForStrongBranching(char *arrays, int numberRows,
161 int numberColumns, bool solveLp = false);
163 void cleanupAfterStrongBranching(AbcSimplexFactorization *factorization);
165
181 int whileIteratingSerial();
182 #if ABC_PARALLEL == 1
183 int whileIteratingThread();
184 #endif
185 #if ABC_PARALLEL == 2
186 int whileIteratingCilk();
187 #endif
188 void whileIterating2();
189 int whileIteratingParallel(int numberIterations);
190 int whileIterating3();
191 void updatePrimalSolution();
192 int noPivotRow();
193 int noPivotColumn();
194 void dualPivotColumn();
196 void createDualPricingVectorSerial();
197 int getTableauColumnFlipAndStartReplaceSerial();
198 void getTableauColumnPart1Serial();
199 #if ABC_PARALLEL == 1
200 void createDualPricingVectorThread();
202 int getTableauColumnFlipAndStartReplaceThread();
203 void getTableauColumnPart1Thread();
204 #endif
205 #if ABC_PARALLEL == 2
206 void createDualPricingVectorCilk();
208 int getTableauColumnFlipAndStartReplaceCilk();
209 void getTableauColumnPart1Cilk();
210 #endif
211 void getTableauColumnPart2();
212 int checkReplace();
213 void replaceColumnPart3();
214 void checkReplacePart1();
215 void checkReplacePart1a();
216 void checkReplacePart1b();
218 void updateDualsInDual();
222 //void updateDualsInValuesPass(CoinIndexedVector * array,
223 // double theta);
228 int flipBounds();
231 void flipBack(int number);
238 void dualColumn1(bool doAll = false);
244 double dualColumn1A();
246 double dualColumn1B();
252 void dualColumn2();
253 void dualColumn2Most(dualColumnResult &result);
254 void dualColumn2First(dualColumnResult &result);
260 void dualColumn2(dualColumnResult &result);
265 void checkPossibleCleanup(CoinIndexedVector *array);
272 void dualPivotRow();
280 int changeBounds(int initialize, double &changeCost);
283 bool changeBound(int iSequence);
285 void originalBound(int iSequence);
288 int checkUnbounded(CoinIndexedVector &ray, double changeCost);
298 void statusOfProblemInDual(int type);
304 int whatNext();
308 bool checkCutoff(bool computeObjective);
310 int bounceTolerances(int type);
312 void perturb(double factor);
314 void perturbB(double factor, int type);
316 int makeNonFreeVariablesDualFeasible(bool changeCosts = false);
317 int fastDual(bool alwaysFinish = false);
320 int numberAtFakeBound();
321
326 int pivotResultPart1();
328 int nextSuperBasic();
330 void startupSolve();
332 void finishSolve();
333 void gutsOfDual();
334 //int dual2(int ifValuesPass,int startFinishOptions=0);
335 int resetFakeBounds(int type);
336
338 };
339 #if ABC_PARALLEL == 1
340 void *abc_parallelManager(void *simplex);
341 #endif
342 #endif
343
344 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
345 */
ClpModel::ray
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:859
AbcSimplexDual::gutsOfDual
void gutsOfDual()
AbcSimplexDual::perturbB
void perturbB(double factor, int type)
Perturbs problem B.
AbcSimplexDual::dualPivotColumn
void dualPivotColumn()
AbcSimplexDual::noPivotRow
int noPivotRow()
AbcSimplexFactorization
This just implements AbcFactorization when an AbcMatrix object is passed.
Definition: AbcSimplexFactorization.hpp:26
AbcSimplexDual::checkReplacePart1b
void checkReplacePart1b()
AbcSimplex
Definition: AbcSimplex.hpp:62
AbcSimplexDual::replaceColumnPart3
void replaceColumnPart3()
AbcSimplexDual::whileIterating2
void whileIterating2()
AbcSimplexDual::changeBound
bool changeBound(int iSequence)
As changeBounds but just changes new bounds for a single variable.
AbcSimplex::computeObjective
void computeObjective()
Computes nonbasic cost and total cost.
AbcSimplexDual::dualColumn2Most
void dualColumn2Most(dualColumnResult &result)
AbcSimplexDual::cleanupAfterStrongBranching
void cleanupAfterStrongBranching(AbcSimplexFactorization *factorization)
This cleans up after strong branching.
AbcSimplexDual::getTableauColumnPart1Serial
void getTableauColumnPart1Serial()
AbcSimplexDual
This solves LPs using the dual simplex method.
Definition: AbcSimplexDual.hpp:49
AbcSimplexDual::createDualPricingVectorSerial
void createDualPricingVectorSerial()
Create dual pricing vector.
AbcSimplexDual::checkReplacePart1
void checkReplacePart1()
AbcSimplex.hpp
AbcSimplexDual::updateDualsInDual
void updateDualsInDual()
The duals are updated.
AbcSimplexDual::makeNonFreeVariablesDualFeasible
int makeNonFreeVariablesDualFeasible(bool changeCosts=false)
Make non free variables dual feasible by moving to a bound.
ClpModel::numberColumns
int numberColumns() const
Definition: ClpModel.hpp:328
dualColumnResult::thruThis
double thruThis
Definition: AbcSimplexDual.hpp:32
dualColumnResult::lastPivotValue
double lastPivotValue
Definition: AbcSimplexDual.hpp:30
AbcSimplexDual::dual
int dual()
Dual algorithm.
AbcSimplexDual::updatePrimalSolution
void updatePrimalSolution()
dualColumnResult
Definition: AbcSimplexDual.hpp:23
dualColumnResult::useThru
double useThru
Definition: AbcSimplexDual.hpp:26
AbcSimplexDual::dualPivotRow
void dualPivotRow()
Chooses dual pivot row Would be faster with separate region to scan and will have this (with square o...
dualColumnResult::modifyCosts
bool modifyCosts
Definition: AbcSimplexDual.hpp:40
AbcSimplexDual::dualColumn1
void dualColumn1(bool doAll=false)
Array has tableau row (row section) Puts candidates for rows in list Returns guess at upper theta (in...
AbcSimplexDual::dualColumn1B
double dualColumn1B()
Do all given tableau row.
CoinIndexedVector
Indexed Vector.
Definition: CoinIndexedVector.hpp:104
dualColumnResult::block
int block
Definition: AbcSimplexDual.hpp:36
dualColumnResult::totalThru
double totalThru
Definition: AbcSimplexDual.hpp:25
dualColumnResult::theta
double theta
Definition: AbcSimplexDual.hpp:24
AbcSimplexDual::statusOfProblemInDual
void statusOfProblemInDual(int type)
Refactorizes if necessary Checks if finished.
AbcSimplexDual::checkPossibleCleanup
void checkPossibleCleanup(CoinIndexedVector *array)
This sees what is best thing to do in branch and bound cleanup If sequenceIn_ &lt; 0 then can&#39;t do anythi...
AbcSimplexDual::dualColumn2First
void dualColumn2First(dualColumnResult &result)
dualColumnResult::increaseInThis
double increaseInThis
Definition: AbcSimplexDual.hpp:33
dualColumnResult::sequence
int sequence
Definition: AbcSimplexDual.hpp:35
dualColumnResult::bestEverPivot
double bestEverPivot
Definition: AbcSimplexDual.hpp:27
dualColumnResult::tentativeTheta
double tentativeTheta
Definition: AbcSimplexDual.hpp:29
AbcSimplexDual::finishSolve
void finishSolve()
Ending part of dual.
AbcSimplexDual::resetFakeBounds
int resetFakeBounds(int type)
dualColumnResult::increaseInObjective
double increaseInObjective
Definition: AbcSimplexDual.hpp:28
AbcSimplexDual::whileIterating3
int whileIterating3()
AbcSimplexDual::perturb
void perturb(double factor)
Perturbs problem.
AbcSimplexDual::dualColumn2
void dualColumn2()
Chooses incoming Puts flipped ones in list If necessary will modify costs.
AbcSimplexDual::getTableauColumnPart2
void getTableauColumnPart2()
AbcSimplexDual::setupForStrongBranching
AbcSimplexFactorization * setupForStrongBranching(char *arrays, int numberRows, int numberColumns, bool solveLp=false)
This does first part of StrongBranching.
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
AbcSimplexDual::whileIteratingParallel
int whileIteratingParallel(int numberIterations)
AbcSimplexDual::bounceTolerances
int bounceTolerances(int type)
Does something about fake tolerances.
AbcSimplexDual::originalBound
void originalBound(int iSequence)
Restores bound to original bound.
dualColumnResult::numberLastSwapped
int numberLastSwapped
Definition: AbcSimplexDual.hpp:39
AbcSimplexDual::whatNext
int whatNext()
Fast iterations.
AbcSimplexDual::numberAtFakeBound
int numberAtFakeBound()
Checks number of variables at fake bounds.
AbcSimplex::factorization
AbcSimplexFactorization * factorization() const
factorization
Definition: AbcSimplex.hpp:200
AbcSimplexDual::noPivotColumn
int noPivotColumn()
AbcSimplexDual::getTableauColumnFlipAndStartReplaceSerial
int getTableauColumnFlipAndStartReplaceSerial()
AbcSimplexDual::checkReplacePart1a
void checkReplacePart1a()
AbcSimplexDual::pivotResultPart1
int pivotResultPart1()
Pivot in a variable and choose an outgoing one.
dualColumnResult::numberRemaining
int numberRemaining
Definition: AbcSimplexDual.hpp:38
dualColumnResult::numberSwapped
int numberSwapped
Definition: AbcSimplexDual.hpp:37
AbcSimplexDual::startupSolve
void startupSolve()
Startup part of dual.
AbcSimplexDual::whileIteratingSerial
int whileIteratingSerial()
This has the flow between re-factorizations Broken out for clarity and will be used by strong branchi...
AbcSimplexDual::flipBounds
int flipBounds()
The duals are updated by the given arrays.
ClpModel::numberIterations
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:374
AbcSimplexDual::nextSuperBasic
int nextSuperBasic()
Get next free , -1 if none.
dualColumnResult::thisPivotValue
double thisPivotValue
Definition: AbcSimplexDual.hpp:31
AbcSimplexDual::dualColumn1A
double dualColumn1A()
Array has tableau row (row section) Just does slack part Returns guess at upper theta (infinite if no...
AbcSimplexDual::checkReplace
int checkReplace()
AbcSimplexDual::flipBack
void flipBack(int number)
Undo a flip.
dualColumnResult::lastSequence
int lastSequence
Definition: AbcSimplexDual.hpp:34
AbcSimplexDual::checkCutoff
bool checkCutoff(bool computeObjective)
see if cutoff reached
AbcSimplexDual::changeBounds
int changeBounds(int initialize, double &changeCost)
Checks if any fake bounds active - if so returns number and modifies updatedDualBound_ and everything...
AbcSimplexDual::checkUnbounded
int checkUnbounded(CoinIndexedVector &ray, double changeCost)
Checks if tentative optimal actually means unbounded in dual Returns -3 if not, 2 if is unbounded...
AbcSimplexDual::fastDual
int fastDual(bool alwaysFinish=false)
AbcSimplexDual::strongBranching
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.