Dip 0.95.0
Loading...
Searching...
No Matches
List of all members
DippyDecompApp Class Reference

A DecompApp that links Python to DIP. More...

#include <DippyDecompApp.h>

+ Inheritance diagram for DippyDecompApp:
+ Collaboration diagram for DippyDecompApp:

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 ()
 
virtual DecompSolverStatus solveRelaxed (const int whichBlock, const double *redCostX, const double convexDual, DecompVarList &varList)
 
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. More...
 
virtual int generateCuts (const double *x, DecompCutList &newCuts)
 
int APPheuristics (const double *xhat, const double *origCost, vector< DecompSolution * > &xhatIPFeas)
 
int generateInitVars (DecompVarList &initVars)
 
 DippyDecompApp (UtilParameters &utilParam, PyObject *p)
 
virtual ~DippyDecompApp ()
 

Additional Inherited Members

- Public Member Functions inherited from DecompApp
virtual void initializeApp ()
 Initialize applications. More...
 
void createModels ()
 Create model parts. More...
 
DecompConstraintSetcreateModelPart (const int nRowsPart, const int *rowsPart)
 
void createModelPart (DecompConstraintSet *model, const int nRowsPart, const int *rowsPart)
 
void createModelPartSparse (DecompConstraintSet *model, const int nRowsPart, const int *rowsPart)
 
void readInitSolutionFile (DecompVarList &initVars)
 
void readBlockFile ()
 Read block file. More...
 
void readProblem ()
 Read Problem. More...
 
void singlyBorderStructureDetection ()
 Automatically detect singly bordered structure. More...
 
void findActiveColumns (const std::vector< int > &rowsPart, std::set< int > &activeColsSet)
 Find the active columns for some block. More...
 
const std::string getInstanceName ()
 Get Intance name. More...
 
const CoinPackedMatrixgetMatrix ()
 Get constraint matrix for analysis. More...
 
void setInfinity ()
 Set the value of infinity. More...
 
 DecompApp (UtilParameters &utilParam)
 Constructor for base DecompApp class. More...
 
virtual ~DecompApp ()
 Destructor. More...
 
void preprocess ()
 Preprocess (standard ): on the TODO list. More...
 
void startupLog ()
 Print startup message to log. More...
 
int createModel ()
 
const double getBestKnownLB () const
 
const double getBestKnownUB () const
 
void setBestKnownLB (const double bestKnownLB)
 
void setBestKnownUB (const double bestKnownUB)
 
void setModelObjective (const double *objective, const int length)
 Set the model objective function. More...
 
void setModelCore (DecompConstraintSet *model, const std::string modelName)
 Set the model core constraint matrix. More...
 
void setModelRelax (DecompConstraintSet *model, const std::string modelName="", const int blockId=0)
 Set the model relaxed constraint matrix (for a particular block). More...
 
void setModelRelaxNest (DecompConstraintSet *model, const std::string modelName, const int blockId=0)
 Set the model relaxed (nested) constraint matrix (for a particular block). More...
 
DecompAlgogetDecompAlgo () const
 Get a pointer to the base algorithm class. More...
 
virtual void initDualVector (std::vector< double > &dualVector)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual const double * getDualForGenerateVars (const double *dual)
 This function allows the user to return their own dual vector to be used in the generation of new variables (in the reduced-cost calculation). More...
 
virtual void solveRelaxedWhich (std::vector< int > &blocksToSolve, std::map< int, std::vector< double > > &userDualsByBlock)
 
virtual DecompSolverStatus solveRelaxedNest (const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
 
virtual void printOriginalColumn (const int index, std::ostream *os=&std::cout) const
 
virtual void printOriginalSolution (const int n_cols, const std::vector< std::string > &colNames, const double *solution, std::ostream *os=&std::cout) const
 
- Public Attributes inherited from DecompApp
int NumBlocks
 Number of Blocks defalut value 0 set by BlockNumInput parameter. More...
 
DecompParam m_param
 Parameters. More...
 
UtilParametersm_utilParam
 
const double * m_objective
 Model data: objective function. More...
 
DecompModel m_modelCore
 Model data: the core model (A'') More...
 
std::map< int, DecompModelm_modelRelax
 Model data: the relaxed model(s) (A') More...
 
std::map< int, std::vector< DecompModel > > m_modelRelaxNest
 Model data: the relaxed (nested) model(s) (A') More...
 
DecompAlgom_decompAlgo
 Pointer to the base algorithmic object. More...
 
CoinMpsIO m_mpsIO
 MPS object for reading instances. More...
 
CoinLpIO m_lpIO
 LP object for reading instances. More...
 
const CoinPackedMatrixm_matrix
 Original constraint matrix for the instance. More...
 
DecompConstraintSetm_modelC
 The model constraint systems used for different algos. More...
 
std::map< int, DecompConstraintSet * > m_modelR
 
std::map< int, std::vector< int > > m_blocks
 Definition of blocks (by rows) More...
 
int m_threadIndex
 serves as an index to track different DecompApp object during Concurrent process, where when m_threadIndex is 0, problem is solved by cutting plance from standalone solver, when it is greater than 0, it is solved by branch-and-price, More...
 
double m_infinity
 The value of infinity. More...
 
- Protected Attributes inherited from DecompApp
std::ostream * m_osLog
 Log file. More...
 
double m_bestKnownLB
 The best known LB/UB for this application (if known, for debugging). More...
 
double m_bestKnownUB
 

Detailed Description

A DecompApp that links Python to DIP.

See also
DecompApp

Definition at line 25 of file DippyDecompApp.h.

Constructor & Destructor Documentation

◆ DippyDecompApp()

DippyDecompApp::DippyDecompApp ( UtilParameters utilParam,
PyObject *  p 
)
inline

Definition at line 79 of file DippyDecompApp.h.

◆ ~DippyDecompApp()

virtual DippyDecompApp::~DippyDecompApp ( )
inlinevirtual

Definition at line 92 of file DippyDecompApp.h.

Member Function Documentation

◆ addPuLPProb()

void DippyDecompApp::addPuLPProb ( PyObject *  p)
inline

Definition at line 48 of file DippyDecompApp.h.

◆ createModels()

void DippyDecompApp::createModels ( )

◆ solveRelaxed()

virtual DecompSolverStatus DippyDecompApp::solveRelaxed ( const int  whichBlock,
const double *  redCostX,
const double  convexDual,
DecompVarList varList 
)
virtual

Reimplemented from DecompApp.

◆ APPisUserFeasible()

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.

Parameters
[in]xThe solution point to check.
[in]numColsThe number of variables.
[in]tolZeroThe integrality tolerance (currently ignored).
Returns
True, if x is feasible; otherwise, false.

Reimplemented from DecompApp.

◆ generateCuts()

virtual int DippyDecompApp::generateCuts ( const double *  x,
DecompCutList newCuts 
)
virtual

Reimplemented from DecompApp.

◆ APPheuristics()

int DippyDecompApp::APPheuristics ( const double *  xhat,
const double *  origCost,
vector< DecompSolution * > &  xhatIPFeas 
)
virtual

Reimplemented from DecompApp.

◆ generateInitVars()

int DippyDecompApp::generateInitVars ( DecompVarList initVars)
virtual

Reimplemented from DecompApp.

Member Data Documentation

◆ m_rowList

PyObject* DippyDecompApp::m_rowList

Definition at line 70 of file DippyDecompApp.h.

◆ m_rowIndices

map<PyObject*, int> DippyDecompApp::m_rowIndices

Definition at line 71 of file DippyDecompApp.h.

◆ m_colList

PyObject* DippyDecompApp::m_colList

Definition at line 72 of file DippyDecompApp.h.

◆ m_colIndices

map<PyObject*, int> DippyDecompApp::m_colIndices

Definition at line 73 of file DippyDecompApp.h.

◆ m_relaxedKeys

PyObject* DippyDecompApp::m_relaxedKeys

Definition at line 75 of file DippyDecompApp.h.

◆ m_relaxIndices

map<PyObject*, int> DippyDecompApp::m_relaxIndices

Definition at line 76 of file DippyDecompApp.h.


The documentation for this class was generated from the following file: