Loading...
Searching...
No Matches
AbcSimplexPrimal.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 AbcSimplexPrimal_H
#define AbcSimplexPrimal_H
#include "AbcSimplex.hpp"
class AbcSimplexPrimal : public AbcSimplex {
public:
int primal(int ifValuesPass = 0, int startFinishOptions = 0);
void alwaysOptimal(bool onOff);
bool alwaysOptimal() const;
void exactOutgoing(bool onOff);
bool exactOutgoing() const;
int whileIterating(int valuesOption);
int pivotResult(int ifValuesPass = 0);
int pivotResult4(int ifValuesPass = 0);
int updatePrimalsInPrimal(CoinIndexedVector *rowArray,
double theta,
double &objectiveChange,
int valuesPass);
void updatePrimalsInPrimal(CoinIndexedVector &rowArray,
double theta, bool valuesPass);
void createUpdateDuals(CoinIndexedVector &rowArray,
const double *originalCost,
const double extraCost[4],
double &objectiveChange,
int valuesPass);
double updateMinorCandidate(const CoinIndexedVector &updateBy,
CoinIndexedVector &candidate,
int sequenceIn);
void updatePartialUpdate(CoinIndexedVector &partialUpdate);
int doFTUpdate(CoinIndexedVector *vector[4]);
void primalRow(CoinIndexedVector *rowArray,
CoinIndexedVector *rhsArray,
CoinIndexedVector *spareArray,
int valuesPass);
typedef struct {
double theta_;
double alpha_;
double saveDualIn_;
double dualIn_;
double lowerIn_;
double upperIn_;
double valueIn_;
int sequenceIn_;
int directionIn_;
double dualOut_;
double lowerOut_;
double upperOut_;
double valueOut_;
int sequenceOut_;
int directionOut_;
int pivotRow_;
int valuesPass_;
} pivotStruct;
void primalRow(CoinIndexedVector *rowArray,
CoinIndexedVector *rhsArray,
CoinIndexedVector *spareArray,
pivotStruct &stuff);
void primalColumn(CoinPartitionedVector *updateArray,
CoinPartitionedVector *spareRow2,
CoinPartitionedVector *spareColumn1);
int checkUnbounded(CoinIndexedVector *ray, CoinIndexedVector *spare,
double changeCost);
void statusOfProblemInPrimal(int type);
void perturb(int type);
bool unPerturb();
int unflag();
int nextSuperBasic(int superBasicType, CoinIndexedVector *columnArray);
void primalRay(CoinIndexedVector *rowArray);
void clearAll();
int lexSolve();
};
#endif
/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
*/
AbcSimplex.hpp
type
CbcOrClpParameterType type() const
type
Definition CbcOrClpParam.hpp:462
AbcSimplexPrimal
This solves LPs using the primal simplex method.
Definition AbcSimplexPrimal.hpp:23
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::exactOutgoing
bool exactOutgoing() const
AbcSimplexPrimal::updatePrimalsInPrimal
void updatePrimalsInPrimal(CoinIndexedVector &rowArray, double theta, bool valuesPass)
The primals are updated by the given array.
AbcSimplexPrimal::doFTUpdate
int doFTUpdate(CoinIndexedVector *vector[4])
Do FT update as separate function for minor iterations (nonzero return code on problems).
AbcSimplexPrimal::pivotResult4
int pivotResult4(int ifValuesPass=0)
AbcSimplexPrimal::statusOfProblemInPrimal
void statusOfProblemInPrimal(int type)
Refactorizes if necessary Checks if finished.
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 ...
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::primalRow
void primalRow(CoinIndexedVector *rowArray, CoinIndexedVector *rhsArray, CoinIndexedVector *spareArray, int valuesPass)
Row array has pivot column This chooses pivot row.
AbcSimplexPrimal::primalRow
void primalRow(CoinIndexedVector *rowArray, CoinIndexedVector *rhsArray, CoinIndexedVector *spareArray, pivotStruct &stuff)
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::exactOutgoing
void exactOutgoing(bool onOff)
Normally outgoing variables can go out to slightly negative values (but within tolerance) - this is t...
AbcSimplexPrimal::primal
int primal(int ifValuesPass=0, int startFinishOptions=0)
Primal algorithm.
AbcSimplexPrimal::alwaysOptimal
void alwaysOptimal(bool onOff)
Do not change infeasibility cost and always say optimal.
AbcSimplexPrimal::perturb
void perturb(int type)
Perturbs problem (method depends on perturbation()).
AbcSimplexPrimal::clearAll
void clearAll()
Clears all bits and clears rowArray[1] etc.
AbcSimplexPrimal::updatePartialUpdate
void updatePartialUpdate(CoinIndexedVector &partialUpdate)
Update partial Ftran by R update.
AbcSimplexPrimal::primalRay
void primalRay(CoinIndexedVector *rowArray)
Create primal ray.
AbcSimplexPrimal::alwaysOptimal
bool alwaysOptimal() const
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::updatePrimalsInPrimal
int updatePrimalsInPrimal(CoinIndexedVector *rowArray, double theta, double &objectiveChange, int valuesPass)
The primals are updated by the given array.
AbcSimplexPrimal::pivotResult
int pivotResult(int ifValuesPass=0)
Do last half of an iteration.
AbcSimplexPrimal::unflag
int unflag()
Unflag all variables and return number unflagged.
AbcSimplexPrimal::whileIterating
int whileIterating(int valuesOption)
This has the flow between re-factorizations.
AbcSimplexPrimal::unPerturb
bool unPerturb()
Take off effect of perturbation and say whether to try dual.
AbcSimplexPrimal::lexSolve
int lexSolve()
Sort of lexicographic resolve.
AbcSimplex::sequenceIn
int sequenceIn() const
Return sequence In or Out.
Definition AbcSimplex.hpp:693
AbcSimplex::AbcSimplex
AbcSimplex(bool emptyMessages=false)
Default constructor.
ClpModel::ray
double * ray() const
For advanced users - no need to delete - sign not changed.
Definition ClpModel.hpp:864
ClpSimplex::theta
double theta() const
Theta (pivot change).
Definition ClpSimplex.hpp:1365
ClpSimplex::rowArray
CoinIndexedVector * rowArray(int index) const
Useful row length arrays (0,1,2,3,4,5).
Definition ClpSimplex.hpp:815
ClpSimplex::columnArray
CoinIndexedVector * columnArray(int index) const
Useful column length arrays (0,1,2,3,4,5).
Definition ClpSimplex.hpp:820
AbcSimplexPrimal::pivotStruct
Definition AbcSimplexPrimal.hpp:208
AbcSimplexPrimal::pivotStruct::alpha_
double alpha_
Definition AbcSimplexPrimal.hpp:210
AbcSimplexPrimal::pivotStruct::upperIn_
double upperIn_
Definition AbcSimplexPrimal.hpp:214
AbcSimplexPrimal::pivotStruct::valueIn_
double valueIn_
Definition AbcSimplexPrimal.hpp:215
AbcSimplexPrimal::pivotStruct::theta_
double theta_
Definition AbcSimplexPrimal.hpp:209
AbcSimplexPrimal::pivotStruct::valuesPass_
int valuesPass_
Definition AbcSimplexPrimal.hpp:225
AbcSimplexPrimal::pivotStruct::sequenceOut_
int sequenceOut_
Definition AbcSimplexPrimal.hpp:222
AbcSimplexPrimal::pivotStruct::valueOut_
double valueOut_
Definition AbcSimplexPrimal.hpp:221
AbcSimplexPrimal::pivotStruct::dualOut_
double dualOut_
Definition AbcSimplexPrimal.hpp:218
AbcSimplexPrimal::pivotStruct::sequenceIn_
int sequenceIn_
Definition AbcSimplexPrimal.hpp:216
AbcSimplexPrimal::pivotStruct::pivotRow_
int pivotRow_
Definition AbcSimplexPrimal.hpp:224
AbcSimplexPrimal::pivotStruct::directionOut_
int directionOut_
Definition AbcSimplexPrimal.hpp:223
AbcSimplexPrimal::pivotStruct::saveDualIn_
double saveDualIn_
Definition AbcSimplexPrimal.hpp:211
AbcSimplexPrimal::pivotStruct::lowerOut_
double lowerOut_
Definition AbcSimplexPrimal.hpp:219
AbcSimplexPrimal::pivotStruct::upperOut_
double upperOut_
Definition AbcSimplexPrimal.hpp:220
AbcSimplexPrimal::pivotStruct::directionIn_
int directionIn_
Definition AbcSimplexPrimal.hpp:217
AbcSimplexPrimal::pivotStruct::lowerIn_
double lowerIn_
Definition AbcSimplexPrimal.hpp:213
AbcSimplexPrimal::pivotStruct::dualIn_
double dualIn_
Definition AbcSimplexPrimal.hpp:212