Loading...
Searching...
No Matches
ClpSimplexOther.hpp
Go to the documentation of this file.
/* $Id$ */
// Copyright (C) 2004, International Business Machines
// Corporation and others. All Rights Reserved.
// This code is licensed under the terms of the Eclipse Public License (EPL).
/*
Authors
John Forrest
*/
#ifndef ClpSimplexOther_H
#define ClpSimplexOther_H
#include "ClpSimplex.hpp"
class ClpSimplexOther : public ClpSimplex {
public:
void dualRanging(int numberCheck, const int *which,
double *costIncrease, int *sequenceIncrease,
double *costDecrease, int *sequenceDecrease,
double *valueIncrease = NULL, double *valueDecrease = NULL);
void primalRanging(int numberCheck, const int *which,
double *valueIncrease, int *sequenceIncrease,
double *valueDecrease, int *sequenceDecrease);
int parametrics(double startingTheta, double &endingTheta, double reportIncrement,
const double *changeLowerBound, const double *changeUpperBound,
const double *changeLowerRhs, const double *changeUpperRhs,
const double *changeObjective);
int parametrics(const char *dataFile);
int parametrics(double startingTheta, double &endingTheta,
const double *changeLowerBound, const double *changeUpperBound,
const double *changeLowerRhs, const double *changeUpperRhs);
int parametricsObj(double startingTheta, double &endingTheta,
const double *changeObjective);
double bestPivot(bool justColumns = false);
typedef struct {
double startingTheta;
double endingTheta;
double maxTheta;
double acceptableMaxTheta; // if this far then within tolerances
double *lowerChange; // full array of lower bound changes
int *lowerList; // list of lower bound changes
double *upperChange; // full array of upper bound changes
int *upperList; // list of upper bound changes
char *markDone; // mark which ones looked at
int *backwardBasic; // from sequence to pivot row
int *lowerActive;
double *lowerGap;
double *lowerCoefficient;
int *upperActive;
double *upperGap;
double *upperCoefficient;
int unscaledChangesOffset;
bool firstIteration; // so can update rhs for accuracy
} parametricsData;
private:
int parametricsLoop(parametricsData &paramData, double reportIncrement,
const double *changeLower, const double *changeUpper,
const double *changeObjective, ClpDataSave &data,
bool canTryQuick);
int parametricsLoop(parametricsData &paramData,
ClpDataSave &data, bool canSkipFactorization = false);
int parametricsObjLoop(parametricsData &paramData,
ClpDataSave &data, bool canSkipFactorization = false);
void statusOfProblemInParametrics(int type, ClpDataSave &saveData);
void statusOfProblemInParametricsObj(int type, ClpDataSave &saveData);
int whileIterating(parametricsData &paramData, double reportIncrement,
const double *changeObjective);
int nextTheta(int type, double maxTheta, parametricsData &paramData,
const double *changeObjective);
int whileIteratingObj(parametricsData &paramData);
int nextThetaObj(double maxTheta, parametricsData &paramData);
void originalBound(int iSequence, double theta, const double *changeLower,
const double *changeUpper);
double computeRhsEtc(parametricsData &paramData);
void redoInternalArrays();
void checkDualRatios(CoinIndexedVector *rowArray,
CoinIndexedVector *columnArray,
double &costIncrease, int &sequenceIncrease, double &alphaIncrease,
double &costDecrease, int &sequenceDecrease, double &alphaDecrease);
void checkPrimalRatios(CoinIndexedVector *rowArray,
int direction);
double primalRanging1(int whichIn, int whichOther);
public:
int writeBasis(const char *filename,
bool writeValues = false,
int formatType = 0) const;
int readBasis(const char *filename);
ClpSimplex *dualOfModel(double fractionRowRanges = 1.0, double fractionColumnRanges = 1.0) const;
int restoreFromDual(const ClpSimplex *dualProblem,
bool checkAccuracy = false);
int setInDual(ClpSimplex *dualProblem);
ClpSimplex *crunch(double *rhs, int *whichRows, int *whichColumns,
int &nBound, bool moreBounds = false, bool tightenBounds = false);
void afterCrunch(const ClpSimplex &small,
const int *whichRows, const int *whichColumns,
int nBound);
ClpSimplex *gubVersion(int *whichRows, int *whichColumns,
int neededGub,
int factorizationFrequency = 50);
void setGubBasis(ClpSimplex &original, const int *whichRows,
const int *whichColumns);
void getGubBasis(ClpSimplex &original, const int *whichRows,
const int *whichColumns) const;
void cleanupAfterPostsolve();
int tightenIntegerBounds(double *rhsSpace);
int expandKnapsack(int knapsackRow, int &numberOutput,
double *buildObj, CoinBigIndex *buildStart,
int *buildRow, double *buildElement, int reConstruct = -1) const;
char *guess(int mode) const;
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
type
CbcOrClpParameterType type() const
type
Definition CbcOrClpParam.hpp:462
ClpSimplex.hpp
ClpDataSave
This is a tiny class where data can be saved round calls.
Definition ClpModel.hpp:1402
ClpSimplexOther
This is for Simplex stuff which is neither dual nor primal.
Definition ClpSimplexOther.hpp:23
ClpSimplexOther::dualRanging
void dualRanging(int numberCheck, const int *which, double *costIncrease, int *sequenceIncrease, double *costDecrease, int *sequenceDecrease, double *valueIncrease=NULL, double *valueDecrease=NULL)
Dual ranging.
ClpSimplexOther::redoInternalArrays
void redoInternalArrays()
Redo lower_ from rowLower_ etc.
ClpSimplexOther::setInDual
int setInDual(ClpSimplex *dualProblem)
Sets solution in dualized problem non-zero return code indicates minor problems.
ClpSimplexOther::guess
char * guess(int mode) const
Create a string of commands to guess at best strategy for model At present mode is ignored.
ClpSimplexOther::gubVersion
ClpSimplex * gubVersion(int *whichRows, int *whichColumns, int neededGub, int factorizationFrequency=50)
Returns gub version of model or NULL whichRows has to be numberRows whichColumns has to be numberRows...
ClpSimplexOther::originalBound
void originalBound(int iSequence, double theta, const double *changeLower, const double *changeUpper)
Restores bound to original bound.
ClpSimplexOther::checkDualRatios
void checkDualRatios(CoinIndexedVector *rowArray, CoinIndexedVector *columnArray, double &costIncrease, int &sequenceIncrease, double &alphaIncrease, double &costDecrease, int &sequenceDecrease, double &alphaDecrease)
Row array has row part of pivot row Column array has column part.
ClpSimplexOther::dualOfModel
ClpSimplex * dualOfModel(double fractionRowRanges=1.0, double fractionColumnRanges=1.0) const
Creates dual of a problem if looks plausible (defaults will always create model) fractionRowRanges is...
ClpSimplexOther::parametricsObj
int parametricsObj(double startingTheta, double &endingTheta, const double *changeObjective)
ClpSimplexOther::setGubBasis
void setGubBasis(ClpSimplex &original, const int *whichRows, const int *whichColumns)
Sets basis from original.
ClpSimplexOther::checkPrimalRatios
void checkPrimalRatios(CoinIndexedVector *rowArray, int direction)
Row array has pivot column This is used in primal ranging.
ClpSimplexOther::cleanupAfterPostsolve
void cleanupAfterPostsolve()
Quick try at cleaning up duals if postsolve gets wrong.
ClpSimplexOther::parametrics
int parametrics(const char *dataFile)
Version of parametrics which reads from file See CbcClpParam.cpp for details of format Returns -2 if ...
ClpSimplexOther::nextTheta
int nextTheta(int type, double maxTheta, parametricsData &paramData, const double *changeObjective)
Computes next theta and says if objective or bounds (0= bounds, 1 objective, -1 none).
ClpSimplexOther::expandKnapsack
int expandKnapsack(int knapsackRow, int &numberOutput, double *buildObj, CoinBigIndex *buildStart, int *buildRow, double *buildElement, int reConstruct=-1) const
Expands out all possible combinations for a knapsack If buildObj NULL then just computes space needed...
ClpSimplexOther::crunch
ClpSimplex * crunch(double *rhs, int *whichRows, int *whichColumns, int &nBound, bool moreBounds=false, bool tightenBounds=false)
Does very cursory presolve.
ClpSimplexOther::statusOfProblemInParametrics
void statusOfProblemInParametrics(int type, ClpDataSave &saveData)
Refactorizes if necessary Checks if finished.
ClpSimplexOther::restoreFromDual
int restoreFromDual(const ClpSimplex *dualProblem, bool checkAccuracy=false)
Restores solution from dualized problem non-zero return code indicates minor problems.
ClpSimplexOther::statusOfProblemInParametricsObj
void statusOfProblemInParametricsObj(int type, ClpDataSave &saveData)
ClpSimplexOther::computeRhsEtc
double computeRhsEtc(parametricsData &paramData)
Compute new rowLower_ etc (return negative if infeasible - otherwise largest change).
ClpSimplexOther::whileIteratingObj
int whileIteratingObj(parametricsData &paramData)
ClpSimplexOther::tightenIntegerBounds
int tightenIntegerBounds(double *rhsSpace)
Tightens integer bounds - returns number tightened or -1 if infeasible.
ClpSimplexOther::nextThetaObj
int nextThetaObj(double maxTheta, parametricsData &paramData)
ClpSimplexOther::parametrics
int parametrics(double startingTheta, double &endingTheta, const double *changeLowerBound, const double *changeUpperBound, const double *changeLowerRhs, const double *changeUpperRhs)
Parametrics This is an initial slow version.
ClpSimplexOther::whileIterating
int whileIterating(parametricsData &paramData, double reportIncrement, const double *changeObjective)
This has the flow between re-factorizations.
ClpSimplexOther::parametrics
int parametrics(double startingTheta, double &endingTheta, double reportIncrement, const double *changeLowerBound, const double *changeUpperBound, const double *changeLowerRhs, const double *changeUpperRhs, const double *changeObjective)
Parametrics This is an initial slow version.
ClpSimplexOther::parametricsLoop
int parametricsLoop(parametricsData &paramData, ClpDataSave &data, bool canSkipFactorization=false)
ClpSimplexOther::parametricsObjLoop
int parametricsObjLoop(parametricsData &paramData, ClpDataSave &data, bool canSkipFactorization=false)
ClpSimplexOther::primalRanging
void primalRanging(int numberCheck, const int *which, double *valueIncrease, int *sequenceIncrease, double *valueDecrease, int *sequenceDecrease)
Primal ranging.
ClpSimplexOther::primalRanging1
double primalRanging1(int whichIn, int whichOther)
Returns new value of whichOther when whichIn enters basis.
ClpSimplexOther::getGubBasis
void getGubBasis(ClpSimplex &original, const int *whichRows, const int *whichColumns) const
Restores basis to original.
ClpSimplexOther::readBasis
int readBasis(const char *filename)
Read a basis from the given filename.
ClpSimplexOther::bestPivot
double bestPivot(bool justColumns=false)
Finds best possible pivot.
ClpSimplexOther::afterCrunch
void afterCrunch(const ClpSimplex &small, const int *whichRows, const int *whichColumns, int nBound)
After very cursory presolve.
ClpSimplexOther::writeBasis
int writeBasis(const char *filename, bool writeValues=false, int formatType=0) const
Write the basis in MPS format to the specified file.
ClpSimplexOther::parametricsLoop
int parametricsLoop(parametricsData &paramData, double reportIncrement, const double *changeLower, const double *changeUpper, const double *changeObjective, ClpDataSave &data, bool canTryQuick)
Parametrics - inner loop This first attempt is when reportIncrement non zero and may not report endin...
ClpSimplex::theta
double theta() const
Theta (pivot change).
Definition ClpSimplex.hpp:1365
ClpSimplex::saveData
ClpDataSave saveData()
Save data.
ClpSimplex::rowArray
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5).
Definition ClpSimplex.hpp:815
ClpSimplex::ClpSimplex
ClpSimplex(bool emptyMessages=false)
Default constructor.
ClpSimplex::columnArray
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5).
Definition ClpSimplex.hpp:820
ClpSimplex::factorizationFrequency
int factorizationFrequency() const
Factorization frequency.
ClpSimplexOther::parametricsData
Definition ClpSimplexOther.hpp:106
ClpSimplexOther::parametricsData::upperCoefficient
double * upperCoefficient
Definition ClpSimplexOther.hpp:122
ClpSimplexOther::parametricsData::firstIteration
bool firstIteration
Definition ClpSimplexOther.hpp:124
ClpSimplexOther::parametricsData::endingTheta
double endingTheta
Definition ClpSimplexOther.hpp:108
ClpSimplexOther::parametricsData::upperGap
double * upperGap
Definition ClpSimplexOther.hpp:121
ClpSimplexOther::parametricsData::backwardBasic
int * backwardBasic
Definition ClpSimplexOther.hpp:116
ClpSimplexOther::parametricsData::lowerCoefficient
double * lowerCoefficient
Definition ClpSimplexOther.hpp:119
ClpSimplexOther::parametricsData::markDone
char * markDone
Definition ClpSimplexOther.hpp:115
ClpSimplexOther::parametricsData::upperList
int * upperList
Definition ClpSimplexOther.hpp:114
ClpSimplexOther::parametricsData::maxTheta
double maxTheta
Definition ClpSimplexOther.hpp:109
ClpSimplexOther::parametricsData::startingTheta
double startingTheta
Definition ClpSimplexOther.hpp:107
ClpSimplexOther::parametricsData::lowerActive
int * lowerActive
Definition ClpSimplexOther.hpp:117
ClpSimplexOther::parametricsData::lowerList
int * lowerList
Definition ClpSimplexOther.hpp:112
ClpSimplexOther::parametricsData::upperChange
double * upperChange
Definition ClpSimplexOther.hpp:113
ClpSimplexOther::parametricsData::upperActive
int * upperActive
Definition ClpSimplexOther.hpp:120
ClpSimplexOther::parametricsData::lowerGap
double * lowerGap
Definition ClpSimplexOther.hpp:118
ClpSimplexOther::parametricsData::lowerChange
double * lowerChange
Definition ClpSimplexOther.hpp:111
ClpSimplexOther::parametricsData::unscaledChangesOffset
int unscaledChangesOffset
Definition ClpSimplexOther.hpp:123
ClpSimplexOther::parametricsData::acceptableMaxTheta
double acceptableMaxTheta
Definition ClpSimplexOther.hpp:110