Clp 1.16.9
Loading...
Searching...
No Matches
AbcSimplexDual.hpp
Go to the documentation of this file.
1/* $Id: AbcSimplexDual.hpp 1910 2013-01-27 02:00:13Z stefan $ */
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
23typedef struct {
24 double theta;
25 double totalThru;
26 double useThru;
32 double thruThis;
36 int block;
49class AbcSimplexDual : public AbcSimplex {
50
51public:
52
144 int dual();
153 int strongBranching(int numberVariables, const int * variables,
154 double * newLower, double * newUpper,
155 double ** outputSolution,
156 int * outputStatus, int * outputIterations,
157 bool stopOnFirstInfeasible = true,
158 bool alwaysFinish = false,
159 int startFinishOptions = 0);
162 int numberColumns, bool solveLp = false);
166
183#if ABC_PARALLEL==1
184 int whileIteratingThread();
185#endif
186#if ABC_PARALLEL==2
187 int whileIteratingCilk();
188#endif
200#if ABC_PARALLEL==1
202 void createDualPricingVectorThread();
203 int getTableauColumnFlipAndStartReplaceThread();
204 void getTableauColumnPart1Thread();
205#endif
206#if ABC_PARALLEL==2
208 void createDualPricingVectorCilk();
209 int getTableauColumnFlipAndStartReplaceCilk();
210 void getTableauColumnPart1Cilk();
211#endif
223 //void updateDualsInValuesPass(CoinIndexedVector * array,
224 // double theta);
232 void flipBack(int number);
239 void dualColumn1(bool doAll=false);
245 double dualColumn1A();
247 double dualColumn1B();
266 void checkPossibleCleanup(CoinIndexedVector * array);
281 int changeBounds(int initialize, double & changeCost);
284 bool changeBound( int iSequence);
286 void originalBound(int iSequence);
289 int checkUnbounded(CoinIndexedVector & ray, double changeCost);
299 void statusOfProblemInDual(int type);
307 int whatNext();
311 int bounceTolerances(int type);
313 void perturb(double factor);
315 void perturbB(double factor,int type);
317 int makeNonFreeVariablesDualFeasible(bool changeCosts=false);
318 int fastDual(bool alwaysFinish = false);
322
335 //int dual2(int ifValuesPass,int startFinishOptions=0);
336 int resetFakeBounds(int type);
337
339};
340#if ABC_PARALLEL==1
341void * abc_parallelManager(void * simplex);
342#endif
343#endif
This solves LPs using the dual simplex method.
int dual()
Dual algorithm.
void perturb(double factor)
Perturbs problem.
int whatNext()
Fast iterations.
void getTableauColumnPart1Serial()
void updatePrimalSolution()
void replaceColumnPart3()
int bounceTolerances(int type)
Does something about fake tolerances.
void dualPivotColumn()
int fastDual(bool alwaysFinish=false)
int getTableauColumnFlipAndStartReplaceSerial()
void checkReplacePart1a()
int whileIteratingSerial()
This has the flow between re-factorizations Broken out for clarity and will be used by strong branchi...
bool checkCutoff(bool computeObjective)
see if cutoff reached
void statusOfProblemInDual(int type)
Refactorizes if necessary Checks if finished.
void dualColumn2()
Chooses incoming Puts flipped ones in list If necessary will modify costs.
void dualColumn2Most(dualColumnResult &result)
double dualColumn1A()
Array has tableau row (row section) Just does slack part Returns guess at upper theta (infinite if no...
int resetFakeBounds(int type)
int nextSuperBasic()
Get next free , -1 if none.
double dualColumn1B()
Do all given tableau row.
void createDualPricingVectorSerial()
Create dual pricing vector.
void checkReplacePart1b()
AbcSimplexFactorization * setupForStrongBranching(char *arrays, int numberRows, int numberColumns, bool solveLp=false)
This does first part of StrongBranching.
void dualPivotRow()
Chooses dual pivot row Would be faster with separate region to scan and will have this (with square o...
void cleanupAfterStrongBranching(AbcSimplexFactorization *factorization)
This cleans up after strong branching.
int whileIteratingParallel(int numberIterations)
void dualColumn2First(dualColumnResult &result)
void startupSolve()
Startup part of dual.
void getTableauColumnPart2()
int whileIterating3()
void originalBound(int iSequence)
Restores bound to original bound.
void checkPossibleCleanup(CoinIndexedVector *array)
This sees what is best thing to do in branch and bound cleanup If sequenceIn_ < 0 then can't do anyth...
bool changeBound(int iSequence)
As changeBounds but just changes new bounds for a single variable.
void whileIterating2()
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 makeNonFreeVariablesDualFeasible(bool changeCosts=false)
Make non free variables dual feasible by moving to a bound.
void dualColumn1(bool doAll=false)
Array has tableau row (row section) Puts candidates for rows in list Returns guess at upper theta (in...
int checkUnbounded(CoinIndexedVector &ray, double changeCost)
Checks if tentative optimal actually means unbounded in dual Returns -3 if not, 2 if is unbounded.
int changeBounds(int initialize, double &changeCost)
Checks if any fake bounds active - if so returns number and modifies updatedDualBound_ and everything...
void finishSolve()
Ending part of dual.
int pivotResultPart1()
Pivot in a variable and choose an outgoing one.
void perturbB(double factor, int type)
Perturbs problem B.
int flipBounds()
The duals are updated by the given arrays.
int numberAtFakeBound()
Checks number of variables at fake bounds.
void flipBack(int number)
Undo a flip.
void dualColumn2(dualColumnResult &result)
Chooses part of incoming Puts flipped ones in list If necessary will modify costs.
void updateDualsInDual()
The duals are updated.
void checkReplacePart1()
This just implements AbcFactorization when an AbcMatrix object is passed.
void computeObjective()
Computes nonbasic cost and total cost.
AbcSimplexFactorization * factorization() const
factorization
Definition: AbcSimplex.hpp:199
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:772
int numberColumns() const
Definition: ClpModel.hpp:325
int numberRows() const
Number of rows.
Definition: ClpModel.hpp:315
int numberIterations() const
Number of iterations.
Definition: ClpModel.hpp:363