1 #ifndef DIPPY_DECOMPAPP_INCLUDED
2 #define DIPPY_DECOMPAPP_INCLUDED
28 const string m_classTag;
37 bool m_pySolveRelaxed;
38 bool m_pyIsUserFeasible;
39 bool m_pyGenerateCuts;
58 const double* redCostX,
59 const double convexDual,
66 int APPheuristics(
const double* xhat,
const double* origCost, vector<DecompSolution*>& xhatIPFeas);
81 m_classTag (
"SMALL-APP"),
85 m_pySolveRelaxed = utilParam.
GetSetting(
"pyRelaxedSolver",
true);
86 m_pyIsUserFeasible = utilParam.
GetSetting(
"pyIsSolutionFeasible",
true);
87 m_pyGenerateCuts = utilParam.
GetSetting(
"pyGenerateCuts",
true);
88 m_pyHeuristics = utilParam.
GetSetting(
"pyHeuristics",
true);
89 m_pyInitVars = utilParam.
GetSetting(
"pyInitVars",
true);
95 Py_XDECREF(m_rowList);
96 Py_XDECREF(m_colList);
97 Py_XDECREF(m_relaxedKeys);
98 delete [] m_objective;
100 delete m_modelCore.getModel();
101 m_modelCore.setModel(NULL);
102 map<int, DecompModel >::iterator mit;
104 for (mit = m_modelRelax.begin(); mit != m_modelRelax.end(); mit++) {
std::list< DecompVar * > DecompVarList
std::list< DecompCut * > DecompCutList
The main application class.
void setModel(DecompConstraintSet *model)
DecompConstraintSet * getModel() const
A DecompApp that links Python to DIP.
map< PyObject *, int > m_rowIndices
virtual int generateCuts(const double *x, DecompCutList &newCuts)
int generateInitVars(DecompVarList &initVars)
map< PyObject *, int > m_relaxIndices
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.
map< PyObject *, int > m_colIndices
virtual DecompSolverStatus solveRelaxed(const int whichBlock, const double *redCostX, const double convexDual, DecompVarList &varList)
int APPheuristics(const double *xhat, const double *origCost, vector< DecompSolution * > &xhatIPFeas)
virtual ~DippyDecompApp()
DippyDecompApp(UtilParameters &utilParam, PyObject *p)
void addPuLPProb(PyObject *p)
std::string GetSetting(const char *name, const char *defaultValue, const char *section=NULL)