#include <DippyDecompApp.h>
Private Attributes | |
const string | m_classTag |
Class id tag (for log / debugging). | |
PyObject * | m_pProb |
The various model constraint systems used for different algos. | |
int | m_numCols |
bool | m_pySolveRelaxed |
Flags for Python callbacks. | |
bool | m_pyIsUserFeasible |
bool | m_pyGenerateCuts |
bool | m_pyHeuristics |
bool | m_pyInitVars |
Helper functions (public). | |
| |
PyObject * | m_rowList |
map< PyObject *, int > | m_rowIndices |
PyObject * | m_colList |
map< PyObject *, int > | m_colIndices |
PyObject * | m_relaxedKeys |
map< PyObject *, int > | m_relaxIndices |
void | addPuLPProb (PyObject *p) |
void | createModels () |
Create model parts. | |
virtual DecompSolverStatus | solveRelaxed (const int whichBlock, const double *redCostX, const double convexDual, DecompVarList &varList) |
Initialize the dual vector for PhaseII of PC. | |
bool | APPisUserFeasible (const double *x, const int n_cols, const double tolZero) |
Method to determine if the solution (x) is feasible to the original model. | |
virtual int | generateCuts (const double *x, DecompCutList &newCuts) |
Initialize the dual vector for PhaseII of PC. | |
int | APPheuristics (const double *xhat, const double *origCost, vector< DecompSolution * > &xhatIPFeas) |
int | generateInitVars (DecompVarList &initVars) |
Initialize the dual vector for PhaseII of PC. | |
DippyDecompApp (UtilParameters &utilParam, PyObject *p) | |
virtual | ~DippyDecompApp () |
A DecompApp that links Python to DIP.
Definition at line 25 of file DippyDecompApp.h.
DippyDecompApp::DippyDecompApp | ( | UtilParameters & | utilParam, | |
PyObject * | p | |||
) | [inline] |
Definition at line 79 of file DippyDecompApp.h.
References addPuLPProb(), createModels(), UtilParameters::GetSetting(), m_pyGenerateCuts, m_pyHeuristics, m_pyInitVars, m_pyIsUserFeasible, and m_pySolveRelaxed.
virtual DippyDecompApp::~DippyDecompApp | ( | ) | [inline, virtual] |
Definition at line 92 of file DippyDecompApp.h.
References DecompAppModel::getModel(), m_colList, DecompApp::m_modelCore, DecompApp::m_modelRelax, DecompApp::m_objective, m_pProb, m_relaxedKeys, m_rowList, and DecompAppModel::setModel().
void DippyDecompApp::addPuLPProb | ( | PyObject * | p | ) | [inline] |
void DippyDecompApp::createModels | ( | ) |
virtual DecompSolverStatus DippyDecompApp::solveRelaxed | ( | const int | whichBlock, | |
const double * | redCostX, | |||
const double | target, | |||
DecompVarList & | varList | |||
) | [virtual] |
Initialize the dual vector for PhaseII of PC.
The user is passed a reference to the internal data and can manipulate it directly.
This is only called when dual stabilization is used, i.e., when m_param.DualStab > 0, at the first iteration of PhaseII of PC. The vector is immediately smoothed with the initial restricted master duals. By default, the restricted mater is used as the initial dual and, therefore, no smoothing occurs in the first iteration.
Reimplemented from DecompApp.
bool DippyDecompApp::APPisUserFeasible | ( | const double * | x, | |
const int | numCols, | |||
const double | tolZero | |||
) | [virtual] |
Method to determine if the solution (x) is feasible to the original model.
For explicitly defined model components, like the model core constraints (A''), the feasibility of the solution is automatically checked against the constraints. In the case when the relaxed problem constraints (A') are explicitly defined - these are also checked automatically.
However, for some applications, a valid feasible constraint system cannot be explicitly defined (even for the core set of constraints). For example, think of the case of TSP, where A'' is defined as the subtour elimination constraints. These constraints are implicitly defined by deriving the method DecompApp::generateCuts. Therefore, the framework cannot automatically tell if a solution is feasible by checking against the constraint system. In this case, the user must provide this method.
[in] | x | The solution point to check. |
Reimplemented from DecompApp.
virtual int DippyDecompApp::generateCuts | ( | const double * | x, | |
DecompCutList & | newCuts | |||
) | [virtual] |
Initialize the dual vector for PhaseII of PC.
The user is passed a reference to the internal data and can manipulate it directly.
This is only called when dual stabilization is used, i.e., when m_param.DualStab > 0, at the first iteration of PhaseII of PC. The vector is immediately smoothed with the initial restricted master duals. By default, the restricted mater is used as the initial dual and, therefore, no smoothing occurs in the first iteration.
Reimplemented from DecompApp.
int DippyDecompApp::APPheuristics | ( | const double * | xhat, | |
const double * | origCost, | |||
vector< DecompSolution * > & | xhatIPFeas | |||
) |
int DippyDecompApp::generateInitVars | ( | DecompVarList & | initVars | ) | [virtual] |
Initialize the dual vector for PhaseII of PC.
The user is passed a reference to the internal data and can manipulate it directly.
This is only called when dual stabilization is used, i.e., when m_param.DualStab > 0, at the first iteration of PhaseII of PC. The vector is immediately smoothed with the initial restricted master duals. By default, the restricted mater is used as the initial dual and, therefore, no smoothing occurs in the first iteration.
Reimplemented from DecompApp.
const string DippyDecompApp::m_classTag [private] |
Class id tag (for log / debugging).
Reimplemented from DecompApp.
Definition at line 28 of file DippyDecompApp.h.
PyObject* DippyDecompApp::m_pProb [private] |
The various model constraint systems used for different algos.
Definition at line 32 of file DippyDecompApp.h.
Referenced by addPuLPProb(), and ~DippyDecompApp().
int DippyDecompApp::m_numCols [private] |
Definition at line 34 of file DippyDecompApp.h.
bool DippyDecompApp::m_pySolveRelaxed [private] |
Flags for Python callbacks.
Definition at line 37 of file DippyDecompApp.h.
Referenced by DippyDecompApp().
bool DippyDecompApp::m_pyIsUserFeasible [private] |
Definition at line 38 of file DippyDecompApp.h.
Referenced by DippyDecompApp().
bool DippyDecompApp::m_pyGenerateCuts [private] |
Definition at line 39 of file DippyDecompApp.h.
Referenced by DippyDecompApp().
bool DippyDecompApp::m_pyHeuristics [private] |
Definition at line 40 of file DippyDecompApp.h.
Referenced by DippyDecompApp().
bool DippyDecompApp::m_pyInitVars [private] |
Definition at line 41 of file DippyDecompApp.h.
Referenced by DippyDecompApp().
PyObject* DippyDecompApp::m_rowList |
Definition at line 70 of file DippyDecompApp.h.
Referenced by ~DippyDecompApp().
map<PyObject*, int> DippyDecompApp::m_rowIndices |
Definition at line 71 of file DippyDecompApp.h.
PyObject* DippyDecompApp::m_colList |
Definition at line 72 of file DippyDecompApp.h.
Referenced by ~DippyDecompApp().
map<PyObject*, int> DippyDecompApp::m_colIndices |
Definition at line 73 of file DippyDecompApp.h.
PyObject* DippyDecompApp::m_relaxedKeys |
Definition at line 75 of file DippyDecompApp.h.
Referenced by ~DippyDecompApp().
map<PyObject*, int> DippyDecompApp::m_relaxIndices |
Definition at line 76 of file DippyDecompApp.h.