Loading...
Searching...
No Matches
AbcSimplexDual.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2002, International Business Machines
// Corporation and others, Copyright (C) 2012, FasterCoin. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
/*
Authors
John Forrest
*/
#ifndef AbcSimplexDual_H
#define AbcSimplexDual_H
#include "AbcSimplex.hpp"
#if 0
#undef ABC_PARALLEL
#define ABC_PARALLEL 2
#undef cilk_for
#undef cilk_spawn
#undef cilk_sync
#include <cilk/cilk.h>
#endif
typedef struct {
double theta;
double totalThru;
double useThru;
double bestEverPivot;
double increaseInObjective;
double tentativeTheta;
double lastPivotValue;
double thisPivotValue;
double thruThis;
double increaseInThis;
int lastSequence;
int sequence;
int block;
int numberSwapped;
int numberRemaining;
int numberLastSwapped;
bool modifyCosts;
} dualColumnResult;
class AbcSimplexDual : public AbcSimplex {
public:
int dual();
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);
AbcSimplexFactorization *setupForStrongBranching(char *arrays, int numberRows,
int numberColumns, bool solveLp = false);
void cleanupAfterStrongBranching(AbcSimplexFactorization *factorization);
int whileIteratingSerial();
#if ABC_PARALLEL == 1
int whileIteratingThread();
#endif
#if ABC_PARALLEL == 2
int whileIteratingCilk();
#endif
void whileIterating2();
int whileIteratingParallel(int numberIterations);
int whileIterating3();
void updatePrimalSolution();
int noPivotRow();
int noPivotColumn();
void dualPivotColumn();
void createDualPricingVectorSerial();
int getTableauColumnFlipAndStartReplaceSerial();
void getTableauColumnPart1Serial();
#if ABC_PARALLEL == 1
void createDualPricingVectorThread();
int getTableauColumnFlipAndStartReplaceThread();
void getTableauColumnPart1Thread();
#endif
#if ABC_PARALLEL == 2
void createDualPricingVectorCilk();
int getTableauColumnFlipAndStartReplaceCilk();
void getTableauColumnPart1Cilk();
#endif
void getTableauColumnPart2();
int checkReplace();
void replaceColumnPart3();
void checkReplacePart1();
void checkReplacePart1a();
void checkReplacePart1b();
void updateDualsInDual();
//void updateDualsInValuesPass(CoinIndexedVector * array,
// double theta);
int flipBounds();
void flipBack(int number);
void dualColumn1(bool doAll = false);
double dualColumn1A();
double dualColumn1B();
void dualColumn2();
void dualColumn2Most(dualColumnResult &result);
void dualColumn2First(dualColumnResult &result);
void dualColumn2(dualColumnResult &result);
void checkPossibleCleanup(CoinIndexedVector *array);
void dualPivotRow();
int changeBounds(int initialize, double &changeCost);
bool changeBound(int iSequence);
void originalBound(int iSequence);
int checkUnbounded(CoinIndexedVector &ray, double changeCost);
void statusOfProblemInDual(int type);
int whatNext();
bool checkCutoff(bool computeObjective);
int bounceTolerances(int type);
void perturb(double factor);
void perturbB(double factor, int type);
int makeNonFreeVariablesDualFeasible(bool changeCosts = false);
int fastDual(bool alwaysFinish = false);
int numberAtFakeBound();
int pivotResultPart1();
int nextSuperBasic();
void startupSolve();
void finishSolve();
void gutsOfDual();
//int dual2(int ifValuesPass,int startFinishOptions=0);
int resetFakeBounds(int type);
};
#if ABC_PARALLEL == 1
void *abc_parallelManager(void *simplex);
#endif
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
AbcSimplex.hpp
type
CbcOrClpParameterType type() const
type
Definition CbcOrClpParam.hpp:462
AbcSimplexDual
This solves LPs using the dual simplex method.
Definition AbcSimplexDual.hpp:49
AbcSimplexDual::dual
int dual()
Dual algorithm.
AbcSimplexDual::perturb
void perturb(double factor)
Perturbs problem.
AbcSimplexDual::whatNext
int whatNext()
Fast iterations.
AbcSimplexDual::getTableauColumnPart1Serial
void getTableauColumnPart1Serial()
AbcSimplexDual::updatePrimalSolution
void updatePrimalSolution()
AbcSimplexDual::replaceColumnPart3
void replaceColumnPart3()
AbcSimplexDual::bounceTolerances
int bounceTolerances(int type)
Does something about fake tolerances.
AbcSimplexDual::dualPivotColumn
void dualPivotColumn()
AbcSimplexDual::fastDual
int fastDual(bool alwaysFinish=false)
AbcSimplexDual::getTableauColumnFlipAndStartReplaceSerial
int getTableauColumnFlipAndStartReplaceSerial()
AbcSimplexDual::checkReplacePart1a
void checkReplacePart1a()
AbcSimplexDual::whileIteratingSerial
int whileIteratingSerial()
This has the flow between re-factorizations Broken out for clarity and will be used by strong branchi...
AbcSimplexDual::checkCutoff
bool checkCutoff(bool computeObjective)
see if cutoff reached
AbcSimplexDual::statusOfProblemInDual
void statusOfProblemInDual(int type)
Refactorizes if necessary Checks if finished.
AbcSimplexDual::dualColumn2
void dualColumn2()
Chooses incoming Puts flipped ones in list If necessary will modify costs.
AbcSimplexDual::dualColumn2Most
void dualColumn2Most(dualColumnResult &result)
AbcSimplexDual::dualColumn1A
double dualColumn1A()
Array has tableau row (row section) Just does slack part Returns guess at upper theta (infinite if no...
AbcSimplexDual::noPivotRow
int noPivotRow()
AbcSimplexDual::resetFakeBounds
int resetFakeBounds(int type)
AbcSimplexDual::nextSuperBasic
int nextSuperBasic()
Get next free , -1 if none.
AbcSimplexDual::dualColumn1B
double dualColumn1B()
Do all given tableau row.
AbcSimplexDual::createDualPricingVectorSerial
void createDualPricingVectorSerial()
Create dual pricing vector.
AbcSimplexDual::checkReplacePart1b
void checkReplacePart1b()
AbcSimplexDual::setupForStrongBranching
AbcSimplexFactorization * setupForStrongBranching(char *arrays, int numberRows, int numberColumns, bool solveLp=false)
This does first part of StrongBranching.
AbcSimplexDual::dualPivotRow
void dualPivotRow()
Chooses dual pivot row Would be faster with separate region to scan and will have this (with square o...
AbcSimplexDual::cleanupAfterStrongBranching
void cleanupAfterStrongBranching(AbcSimplexFactorization *factorization)
This cleans up after strong branching.
AbcSimplexDual::whileIteratingParallel
int whileIteratingParallel(int numberIterations)
AbcSimplexDual::checkReplace
int checkReplace()
AbcSimplexDual::dualColumn2First
void dualColumn2First(dualColumnResult &result)
AbcSimplexDual::startupSolve
void startupSolve()
Startup part of dual.
AbcSimplexDual::getTableauColumnPart2
void getTableauColumnPart2()
AbcSimplexDual::whileIterating3
int whileIterating3()
AbcSimplexDual::originalBound
void originalBound(int iSequence)
Restores bound to original bound.
AbcSimplexDual::checkPossibleCleanup
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...
AbcSimplexDual::changeBound
bool changeBound(int iSequence)
As changeBounds but just changes new bounds for a single variable.
AbcSimplexDual::whileIterating2
void whileIterating2()
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.
AbcSimplexDual::makeNonFreeVariablesDualFeasible
int makeNonFreeVariablesDualFeasible(bool changeCosts=false)
Make non free variables dual feasible by moving to a bound.
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::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::gutsOfDual
void gutsOfDual()
AbcSimplexDual::changeBounds
int changeBounds(int initialize, double &changeCost)
Checks if any fake bounds active - if so returns number and modifies updatedDualBound_ and everything...
AbcSimplexDual::finishSolve
void finishSolve()
Ending part of dual.
AbcSimplexDual::pivotResultPart1
int pivotResultPart1()
Pivot in a variable and choose an outgoing one.
AbcSimplexDual::noPivotColumn
int noPivotColumn()
AbcSimplexDual::perturbB
void perturbB(double factor, int type)
Perturbs problem B.
AbcSimplexDual::flipBounds
int flipBounds()
The duals are updated by the given arrays.
AbcSimplexDual::numberAtFakeBound
int numberAtFakeBound()
Checks number of variables at fake bounds.
AbcSimplexDual::flipBack
void flipBack(int number)
Undo a flip.
AbcSimplexDual::dualColumn2
void dualColumn2(dualColumnResult &result)
Chooses part of incoming Puts flipped ones in list If necessary will modify costs.
AbcSimplexDual::updateDualsInDual
void updateDualsInDual()
The duals are updated.
AbcSimplexDual::checkReplacePart1
void checkReplacePart1()
AbcSimplexFactorization
This just implements AbcFactorization when an AbcMatrix object is passed.
Definition AbcSimplexFactorization.hpp:26
AbcSimplex::computeObjective
void computeObjective()
Computes nonbasic cost and total cost.
AbcSimplex::AbcSimplex
AbcSimplex(bool emptyMessages=false)
Default constructor.
AbcSimplex::factorization
AbcSimplexFactorization * factorization() const
factorization
Definition AbcSimplex.hpp:200
ClpModel::ray
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition ClpModel.hpp:864
ClpModel::numberColumns
int numberColumns() const
Definition ClpModel.hpp:332
ClpModel::numberRows
int numberRows() const
Number of rows.
Definition ClpModel.hpp:319
ClpModel::numberIterations
int numberIterations() const
Number of iterations.
Definition ClpModel.hpp:378
dualColumnResult
Definition AbcSimplexDual.hpp:23
dualColumnResult::increaseInThis
double increaseInThis
Definition AbcSimplexDual.hpp:33
dualColumnResult::numberRemaining
int numberRemaining
Definition AbcSimplexDual.hpp:38
dualColumnResult::modifyCosts
bool modifyCosts
Definition AbcSimplexDual.hpp:40
dualColumnResult::sequence
int sequence
Definition AbcSimplexDual.hpp:35
dualColumnResult::numberLastSwapped
int numberLastSwapped
Definition AbcSimplexDual.hpp:39
dualColumnResult::lastPivotValue
double lastPivotValue
Definition AbcSimplexDual.hpp:30
dualColumnResult::bestEverPivot
double bestEverPivot
Definition AbcSimplexDual.hpp:27
dualColumnResult::totalThru
double totalThru
Definition AbcSimplexDual.hpp:25
dualColumnResult::lastSequence
int lastSequence
Definition AbcSimplexDual.hpp:34
dualColumnResult::useThru
double useThru
Definition AbcSimplexDual.hpp:26
dualColumnResult::block
int block
Definition AbcSimplexDual.hpp:36
dualColumnResult::theta
double theta
Definition AbcSimplexDual.hpp:24
dualColumnResult::thisPivotValue
double thisPivotValue
Definition AbcSimplexDual.hpp:31
dualColumnResult::thruThis
double thruThis
Definition AbcSimplexDual.hpp:32
dualColumnResult::increaseInObjective
double increaseInObjective
Definition AbcSimplexDual.hpp:28
dualColumnResult::numberSwapped
int numberSwapped
Definition AbcSimplexDual.hpp:37
dualColumnResult::tentativeTheta
double tentativeTheta
Definition AbcSimplexDual.hpp:29