Clp  1.16.11
AbcSimplexPrimal.hpp
Go to the documentation of this file.
1 /* $Id: AbcSimplexPrimal.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 AbcSimplexPrimal_H
12 #define AbcSimplexPrimal_H
13 
14 #include "AbcSimplex.hpp"
15 
23 class AbcSimplexPrimal : public AbcSimplex {
24 
25 public:
26 
115  int primal(int ifValuesPass = 0, int startFinishOptions = 0);
117 
120  void alwaysOptimal(bool onOff);
122  bool alwaysOptimal() const;
127  void exactOutgoing(bool onOff);
128  bool exactOutgoing() const;
130 
145  int whileIterating(int valuesOption);
146 
165  int pivotResult(int ifValuesPass = 0);
166  int pivotResult4(int ifValuesPass = 0);
167 
168 
173  int updatePrimalsInPrimal(CoinIndexedVector * rowArray,
174  double theta,
175  double & objectiveChange,
176  int valuesPass);
180  void updatePrimalsInPrimal(CoinIndexedVector & rowArray,
181  double theta,bool valuesPass);
184  void createUpdateDuals(CoinIndexedVector & rowArray,
185  const double * originalCost,
186  const double extraCost[4],
187  double & objectiveChange,
188  int valuesPass);
191  double updateMinorCandidate(const CoinIndexedVector & updateBy,
192  CoinIndexedVector & candidate,
193  int sequenceIn);
195  void updatePartialUpdate(CoinIndexedVector & partialUpdate);
197  int doFTUpdate(CoinIndexedVector * vector[4]);
206  void primalRow(CoinIndexedVector * rowArray,
207  CoinIndexedVector * rhsArray,
208  CoinIndexedVector * spareArray,
209  int valuesPass);
210  typedef struct {
211  double theta_;
212  double alpha_;
213  double saveDualIn_;
214  double dualIn_;
215  double lowerIn_;
216  double upperIn_;
217  double valueIn_;
220  double dualOut_;
221  double lowerOut_;
222  double upperOut_;
223  double valueOut_;
228  } pivotStruct;
229  void primalRow(CoinIndexedVector * rowArray,
230  CoinIndexedVector * rhsArray,
231  CoinIndexedVector * spareArray,
232  pivotStruct & stuff);
240  void primalColumn(CoinPartitionedVector * updateArray,
241  CoinPartitionedVector * spareRow2,
242  CoinPartitionedVector * spareColumn1);
243 
246  int checkUnbounded(CoinIndexedVector * ray, CoinIndexedVector * spare,
247  double changeCost);
257  void statusOfProblemInPrimal(int type);
259  void perturb(int type);
261  bool unPerturb();
263  int unflag();
269  int nextSuperBasic(int superBasicType, CoinIndexedVector * columnArray);
270 
272  void primalRay(CoinIndexedVector * rowArray);
274  void clearAll();
275 
277  int lexSolve();
278 
280 };
281 #endif
282 
AbcSimplexPrimal::pivotStruct::dualOut_
double dualOut_
Definition: AbcSimplexPrimal.hpp:220
ClpSimplex::theta
double theta() const
Theta (pivot change)
Definition: ClpSimplex.hpp:1182
AbcSimplexPrimal::primalRow
void primalRow(CoinIndexedVector *rowArray, CoinIndexedVector *rhsArray, CoinIndexedVector *spareArray, pivotStruct &stuff)
AbcSimplexPrimal::clearAll
void clearAll()
Clears all bits and clears rowArray[1] etc.
ClpSimplex::rowArray
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:727
ClpSimplex::columnArray
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:731
AbcSimplexPrimal::pivotStruct::alpha_
double alpha_
Definition: AbcSimplexPrimal.hpp:212
AbcSimplexPrimal
This solves LPs using the primal simplex method.
Definition: AbcSimplexPrimal.hpp:23
AbcSimplexPrimal::pivotResult4
int pivotResult4(int ifValuesPass=0)
AbcSimplexPrimal::pivotStruct::sequenceIn_
int sequenceIn_
Definition: AbcSimplexPrimal.hpp:218
AbcSimplexPrimal::whileIterating
int whileIterating(int valuesOption)
This has the flow between re-factorizations.
ClpModel::ray
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:772
AbcSimplexPrimal::primal
int primal(int ifValuesPass=0, int startFinishOptions=0)
Primal algorithm.
AbcSimplexPrimal::checkUnbounded
int checkUnbounded(CoinIndexedVector *ray, CoinIndexedVector *spare, double changeCost)
Checks if tentative optimal actually means unbounded in primal Returns -3 if not, 2 if is unbounded.
AbcSimplexPrimal::updatePrimalsInPrimal
int updatePrimalsInPrimal(CoinIndexedVector *rowArray, double theta, double &objectiveChange, int valuesPass)
The primals are updated by the given array.
AbcSimplexPrimal::pivotStruct::valuesPass_
int valuesPass_
Definition: AbcSimplexPrimal.hpp:227
AbcSimplexPrimal::pivotStruct::theta_
double theta_
Definition: AbcSimplexPrimal.hpp:211
AbcSimplexPrimal::lexSolve
int lexSolve()
Sort of lexicographic resolve.
AbcSimplexPrimal::primalRay
void primalRay(CoinIndexedVector *rowArray)
Create primal ray.
AbcSimplexPrimal::updatePrimalsInPrimal
void updatePrimalsInPrimal(CoinIndexedVector &rowArray, double theta, bool valuesPass)
The primals are updated by the given array.
AbcSimplexPrimal::pivotStruct::pivotRow_
int pivotRow_
Definition: AbcSimplexPrimal.hpp:226
AbcSimplexPrimal::pivotStruct
Definition: AbcSimplexPrimal.hpp:210
AbcSimplexPrimal::alwaysOptimal
bool alwaysOptimal() const
AbcSimplexPrimal::pivotStruct::lowerOut_
double lowerOut_
Definition: AbcSimplexPrimal.hpp:221
AbcSimplexPrimal::nextSuperBasic
int nextSuperBasic(int superBasicType, CoinIndexedVector *columnArray)
Get next superbasic -1 if none, Normal type is 1 If type is 3 then initializes sorted list if 2 uses ...
AbcSimplex
Definition: AbcSimplex.hpp:62
AbcSimplexPrimal::primalRow
void primalRow(CoinIndexedVector *rowArray, CoinIndexedVector *rhsArray, CoinIndexedVector *spareArray, int valuesPass)
Row array has pivot column This chooses pivot row.
AbcSimplexPrimal::exactOutgoing
void exactOutgoing(bool onOff)
Normally outgoing variables can go out to slightly negative values (but within tolerance) - this is t...
AbcSimplexPrimal::pivotStruct::directionOut_
int directionOut_
Definition: AbcSimplexPrimal.hpp:225
AbcSimplexPrimal::pivotResult
int pivotResult(int ifValuesPass=0)
Do last half of an iteration.
AbcSimplexPrimal::pivotStruct::saveDualIn_
double saveDualIn_
Definition: AbcSimplexPrimal.hpp:213
AbcSimplexPrimal::pivotStruct::upperIn_
double upperIn_
Definition: AbcSimplexPrimal.hpp:216
AbcSimplexPrimal::pivotStruct::dualIn_
double dualIn_
Definition: AbcSimplexPrimal.hpp:214
AbcSimplexPrimal::unflag
int unflag()
Unflag all variables and return number unflagged.
AbcSimplexPrimal::perturb
void perturb(int type)
Perturbs problem (method depends on perturbation())
AbcSimplexPrimal::createUpdateDuals
void createUpdateDuals(CoinIndexedVector &rowArray, const double *originalCost, const double extraCost[4], double &objectiveChange, int valuesPass)
After rowArray will have cost changes for use next iteration.
AbcSimplexPrimal::pivotStruct::directionIn_
int directionIn_
Definition: AbcSimplexPrimal.hpp:219
AbcSimplex.hpp
AbcSimplexPrimal::pivotStruct::sequenceOut_
int sequenceOut_
Definition: AbcSimplexPrimal.hpp:224
AbcSimplexPrimal::pivotStruct::valueIn_
double valueIn_
Definition: AbcSimplexPrimal.hpp:217
AbcSimplexPrimal::updateMinorCandidate
double updateMinorCandidate(const CoinIndexedVector &updateBy, CoinIndexedVector &candidate, int sequenceIn)
Update minor candidate vector - new reduced cost returned later try and get change in reduced cost (t...
AbcSimplexPrimal::pivotStruct::upperOut_
double upperOut_
Definition: AbcSimplexPrimal.hpp:222
AbcSimplexPrimal::updatePartialUpdate
void updatePartialUpdate(CoinIndexedVector &partialUpdate)
Update partial Ftran by R update.
AbcSimplexPrimal::unPerturb
bool unPerturb()
Take off effect of perturbation and say whether to try dual.
AbcSimplexPrimal::pivotStruct::valueOut_
double valueOut_
Definition: AbcSimplexPrimal.hpp:223
AbcSimplexPrimal::statusOfProblemInPrimal
void statusOfProblemInPrimal(int type)
Refactorizes if necessary Checks if finished.
AbcSimplexPrimal::exactOutgoing
bool exactOutgoing() const
AbcSimplex::sequenceIn
int sequenceIn() const
Return sequence In or Out.
Definition: AbcSimplex.hpp:596
AbcSimplexPrimal::pivotStruct::lowerIn_
double lowerIn_
Definition: AbcSimplexPrimal.hpp:215
AbcSimplexPrimal::primalColumn
void primalColumn(CoinPartitionedVector *updateArray, CoinPartitionedVector *spareRow2, CoinPartitionedVector *spareColumn1)
Chooses primal pivot column updateArray has cost updates (also use pivotRow_ from last iteration) Wou...
AbcSimplexPrimal::doFTUpdate
int doFTUpdate(CoinIndexedVector *vector[4])
Do FT update as separate function for minor iterations (nonzero return code on problems)