Cbc  2.10.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbcSimplexPrimal.hpp
Go to the documentation of this file.
1 /* $Id: AbcSimplexPrimal.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 AbcSimplexPrimal_H
12 #define AbcSimplexPrimal_H
13 
14 #include "AbcSimplex.hpp"
15 
23 class AbcSimplexPrimal : public AbcSimplex {
24 
25 public:
114  int primal(int ifValuesPass = 0, int startFinishOptions = 0);
116 
119  void alwaysOptimal(bool onOff);
121  bool alwaysOptimal() const;
126  void exactOutgoing(bool onOff);
127  bool exactOutgoing() const;
129 
144  int whileIterating(int valuesOption);
145 
164  int pivotResult(int ifValuesPass = 0);
165  int pivotResult4(int ifValuesPass = 0);
166 
172  double theta,
173  double &objectiveChange,
174  int valuesPass);
179  double theta, bool valuesPass);
182  void createUpdateDuals(CoinIndexedVector &rowArray,
183  const double *originalCost,
184  const double extraCost[4],
185  double &objectiveChange,
186  int valuesPass);
189  double updateMinorCandidate(const CoinIndexedVector &updateBy,
190  CoinIndexedVector &candidate,
191  int sequenceIn);
193  void updatePartialUpdate(CoinIndexedVector &partialUpdate);
195  int doFTUpdate(CoinIndexedVector *vector[4]);
204  void primalRow(CoinIndexedVector *rowArray,
205  CoinIndexedVector *rhsArray,
206  CoinIndexedVector *spareArray,
207  int valuesPass);
208  typedef struct {
209  double theta_;
210  double alpha_;
211  double saveDualIn_;
212  double dualIn_;
213  double lowerIn_;
214  double upperIn_;
215  double valueIn_;
218  double dualOut_;
219  double lowerOut_;
220  double upperOut_;
221  double valueOut_;
226  } pivotStruct;
227  void primalRow(CoinIndexedVector *rowArray,
228  CoinIndexedVector *rhsArray,
229  CoinIndexedVector *spareArray,
230  pivotStruct &stuff);
238  void primalColumn(CoinPartitionedVector *updateArray,
239  CoinPartitionedVector *spareRow2,
240  CoinPartitionedVector *spareColumn1);
241 
245  double changeCost);
255  void statusOfProblemInPrimal(int type);
257  void perturb(int type);
259  bool unPerturb();
261  int unflag();
267  int nextSuperBasic(int superBasicType, CoinIndexedVector *columnArray);
268 
270  void primalRay(CoinIndexedVector *rowArray);
272  void clearAll();
273 
275  int lexSolve();
276 
278 };
279 #endif
280 
281 /* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
282 */
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition: ClpModel.hpp:863
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...
bool unPerturb()
Take off effect of perturbation and say whether to try dual.
double theta() const
Theta (pivot change)
int lexSolve()
Sort of lexicographic resolve.
bool alwaysOptimal() const
void primalColumn(CoinPartitionedVector *updateArray, CoinPartitionedVector *spareRow2, CoinPartitionedVector *spareColumn1)
Chooses primal pivot column updateArray has cost updates (also use pivotRow_ from last iteration) Wou...
int unflag()
Unflag all variables and return number unflagged.
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...
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.
void primalRow(CoinIndexedVector *rowArray, CoinIndexedVector *rhsArray, CoinIndexedVector *spareArray, int valuesPass)
Row array has pivot column This chooses pivot row.
void statusOfProblemInPrimal(int type)
Refactorizes if necessary Checks if finished.
int sequenceIn() const
Return sequence In or Out.
Definition: AbcSimplex.hpp:693
void primalRay(CoinIndexedVector *rowArray)
Create primal ray.
void updatePartialUpdate(CoinIndexedVector &partialUpdate)
Update partial Ftran by R update.
bool exactOutgoing() const
void perturb(int type)
Perturbs problem (method depends on perturbation())
Indexed Vector.
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:820
int primal(int ifValuesPass=0, int startFinishOptions=0)
Primal algorithm.
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 ...
int doFTUpdate(CoinIndexedVector *vector[4])
Do FT update as separate function for minor iterations (nonzero return code on problems) ...
int updatePrimalsInPrimal(CoinIndexedVector *rowArray, double theta, double &objectiveChange, int valuesPass)
The primals are updated by the given array.
void clearAll()
Clears all bits and clears rowArray[1] etc.
int whileIterating(int valuesOption)
This has the flow between re-factorizations.
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5)
Definition: ClpSimplex.hpp:815
int pivotResult(int ifValuesPass=0)
Do last half of an iteration.
int pivotResult4(int ifValuesPass=0)
This solves LPs using the primal simplex method.