Dip  0.92.4
Public Member Functions | Private Attributes | List of all members
ATM_DecompApp Class Reference

#include <ATM_DecompApp.h>

Inheritance diagram for ATM_DecompApp:
Inheritance graph
[legend]
Collaboration diagram for ATM_DecompApp:
Collaboration graph
[legend]

Public Member Functions

virtual bool APPisUserFeasible (const double *x, const int nCols, const double tolZero)
 Method to determine if the solution (x) is feasible to the original model. More...
 
Helper functions (public).
void initializeApp ()
 Initialize application. More...
 
void createModels ()
 Initialize application. More...
 
int createConZtoX (DecompConstraintSet *model, const int atmIndex)
 Initialize application. More...
 
int createConPickOne (DecompConstraintSet *model, const int atmIndex)
 Initialize application. More...
 
int createConCount (DecompConstraintSet *model, const int atmIndex)
 Initialize application. More...
 
DecompConstraintSetcreateModelCore1 (bool includeCount=true)
 Initialize application. More...
 
DecompConstraintSetcreateModelRelax1 (const int a, bool includeCount=true)
 Initialize application. More...
 
DecompConstraintSetcreateModelCore2 ()
 Initialize application. More...
 
DecompConstraintSetcreateModelRelax2 (const int d)
 Initialize application. More...
 
DecompConstraintSetcreateModelCoreCount ()
 Initialize application. More...
 
DecompConstraintSetcreateModelRelaxCount ()
 Initialize application. More...
 
const int numCoreCols () const
 Initialize application. More...
 
const int getNAtmsSteps () const
 Initialize application. More...
 
void createModelColumns (DecompConstraintSet *model, const int atmIndex=-1, const int dateIndex=-1)
 Initialize application. More...
 
const int getColOffset_x1 () const
 Initialize application. More...
 
const int getColOffset_z () const
 Initialize application. More...
 
const int getColOffset_fp () const
 Initialize application. More...
 
const int getColOffset_fm () const
 Initialize application. More...
 
const int getColOffset_x2 () const
 Initialize application. More...
 
const int getColOffset_x3 () const
 Initialize application. More...
 
const int getColOffset_v () const
 Initialize application. More...
 
const int colIndex_x1 (const int a, const int t) const
 Initialize application. More...
 
const int colIndex_z (const int a, const int t) const
 Initialize application. More...
 
const int colIndex_fp (const int pairIndex) const
 Initialize application. More...
 
const int colIndex_fm (const int pairIndex) const
 Initialize application. More...
 
const int colIndex_x2 (const int a) const
 Initialize application. More...
 
const int colIndex_x3 (const int a) const
 Initialize application. More...
 
const int colIndex_v (const int pairIndex) const
 Initialize application. More...
 
void addColumnNamesA (DecompConstraintSet *model, const string prefix, const int offset)
 Initialize application. More...
 
void addColumnNamesAT (DecompConstraintSet *model, const string prefix, const int offset)
 Initialize application. More...
 
void addColumnNamesAD (DecompConstraintSet *model, const string prefix, const int offset)
 Initialize application. More...
 
Constructor and Destructor
 ATM_DecompApp (UtilParameters &utilParam)
 Default constructor. More...
 
virtual ~ATM_DecompApp ()
 Default constructor. More...
 
- Public Member Functions inherited from DecompApp
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 startupLog ()
 Initialize the DecompApp data. More...
 
int createModel ()
 
virtual void APPcreateModel (double *&objCoeff, map< int, DecompConstraintSet * > &modelCore, map< int, DecompConstraintSet * > &modelRelax)=0
 
virtual int APPheuristics (const double *xhat, vector< DecompSolution * > &xhatIPFeas)
 
virtual int generateInitVars (DecompVarList &initVars, int whichModel)
 
virtual int generateCuts (const double *x, const DecompConstraintSet &modelCore, const DecompConstraintSet &modelRelax, DecompCutList &newCuts)
 
virtual decompStat APPsolveRelaxed (const int whichModel, const double *redCostX, const double *origCost, const double alpha, const int n_origCols, const bool checkRC, const bool checkDup, OsiSolverInterface *m_subprobSI, list< DecompVar * > &vars)
 
virtual void printOriginalColumn (const int index, ostream *os=&cout) const
 
virtual void printOriginalSolution (const int n_cols, const double *solution, ostream *os=&cout) const
 
 DecompApp (UtilParameters &utilParam)
 
virtual ~DecompApp ()
 
void preprocess ()
 Preprocess (standard ): on the TODO list. More...
 
void startupLog ()
 Print startup message to log. More...
 
int createModel ()
 Preprocess (standard ): on the TODO list. More...
 
const double getBestKnownLB () const
 Preprocess (standard ): on the TODO list. More...
 
const double getBestKnownUB () const
 Preprocess (standard ): on the TODO list. More...
 
void setBestKnownLB (const double bestKnownLB)
 Preprocess (standard ): on the TODO list. More...
 
void setBestKnownUB (const double bestKnownUB)
 Preprocess (standard ): on the TODO list. More...
 
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 int APPheuristics (const double *xhat, const double *origCost, std::vector< DecompSolution * > &xhatIPFeas)
 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 int generateInitVars (DecompVarList &initVars)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual int generateCuts (const double *x, DecompCutList &newCuts)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual void solveRelaxedWhich (std::vector< int > &blocksToSolve, std::map< int, std::vector< double > > &userDualsByBlock)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual DecompSolverStatus solveRelaxed (const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual DecompSolverStatus solveRelaxedNest (const int whichBlock, const double *redCostX, const double target, DecompVarList &varList)
 Initialize the dual vector for PhaseII of PC. More...
 
virtual void printOriginalColumn (const int index, std::ostream *os=&std::cout) const
 Initialize the dual vector for PhaseII of PC. More...
 
virtual void printOriginalSolution (const int n_cols, const std::vector< std::string > &colNames, const double *solution, std::ostream *os=&std::cout) const
 Initialize the dual vector for PhaseII of PC. More...
 

Private Attributes

const string m_classTag
 Class id tag (for log / debugging). More...
 
ATM_Instance m_instance
 ATM problem instance data. More...
 
ATM_Param m_appParam
 Application specific parameters. More...
 
double * m_objective
 The model objective coefficients (original space). More...
 
vector< DecompConstraintSet * > m_models
 The various model constraint systems used for different algos. More...
 

Additional Inherited Members

- 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...
 
DecompModel m_model
 
map< int, DecompConstraintSet * > m_modelCore
 
map< int, DecompConstraintSet * > m_modelRelax
 
- 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
 
ostream * m_osLog
 

Detailed Description

A DecompApp for solving the ATM Cash Management Problem (ATM).

See Also
DecompApp

Definition at line 37 of file ATM_DecompApp.h.

Constructor & Destructor Documentation

ATM_DecompApp::ATM_DecompApp ( UtilParameters utilParam)
inline

Default constructor.

Takes an instance of UtilParameters

Definition at line 191 of file ATM_DecompApp.h.

References ATM_Param::dumpSettings(), ATM_Param::getSettings(), initializeApp(), ATM_Param::LogLevel, and m_appParam.

virtual ATM_DecompApp::~ATM_DecompApp ( )
inlinevirtual

Default constructor.

Takes an instance of UtilParameters

Definition at line 205 of file ATM_DecompApp.h.

References m_models, and UtilDeleteVectorPtr().

Member Function Documentation

virtual bool ATM_DecompApp::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.

void ATM_DecompApp::initializeApp ( )
virtual

Initialize application.

Reimplemented from DecompApp.

Referenced by ATM_DecompApp().

void ATM_DecompApp::createModels ( )

Initialize application.

int ATM_DecompApp::createConZtoX ( DecompConstraintSet model,
const int  atmIndex 
)

Initialize application.

int ATM_DecompApp::createConPickOne ( DecompConstraintSet model,
const int  atmIndex 
)

Initialize application.

int ATM_DecompApp::createConCount ( DecompConstraintSet model,
const int  atmIndex 
)

Initialize application.

DecompConstraintSet* ATM_DecompApp::createModelCore1 ( bool  includeCount = true)

Initialize application.

DecompConstraintSet* ATM_DecompApp::createModelRelax1 ( const int  a,
bool  includeCount = true 
)

Initialize application.

DecompConstraintSet* ATM_DecompApp::createModelCore2 ( )

Initialize application.

DecompConstraintSet* ATM_DecompApp::createModelRelax2 ( const int  d)

Initialize application.

DecompConstraintSet* ATM_DecompApp::createModelCoreCount ( )

Initialize application.

DecompConstraintSet* ATM_DecompApp::createModelRelaxCount ( )

Initialize application.

const int ATM_DecompApp::numCoreCols ( ) const
inline

Initialize application.

Definition at line 89 of file ATM_DecompApp.h.

References ATM_Instance::getNAtms(), getNAtmsSteps(), ATM_Instance::getNPairs(), and m_instance.

const int ATM_DecompApp::getNAtmsSteps ( ) const
inline

Initialize application.

Definition at line 104 of file ATM_DecompApp.h.

References ATM_Instance::getNAtms(), m_appParam, m_instance, ATM_Param::NumSteps, and ATM_Param::UseTightModel.

Referenced by getColOffset_fp(), getColOffset_z(), and numCoreCols().

void ATM_DecompApp::createModelColumns ( DecompConstraintSet model,
const int  atmIndex = -1,
const int  dateIndex = -1 
)

Initialize application.

const int ATM_DecompApp::getColOffset_x1 ( ) const
inline

Initialize application.

Definition at line 125 of file ATM_DecompApp.h.

Referenced by colIndex_x1(), and getColOffset_z().

const int ATM_DecompApp::getColOffset_z ( ) const
inline

Initialize application.

Definition at line 128 of file ATM_DecompApp.h.

References getColOffset_x1(), and getNAtmsSteps().

Referenced by colIndex_z(), and getColOffset_fp().

const int ATM_DecompApp::getColOffset_fp ( ) const
inline

Initialize application.

Definition at line 131 of file ATM_DecompApp.h.

References getColOffset_z(), and getNAtmsSteps().

Referenced by colIndex_fp(), and getColOffset_fm().

const int ATM_DecompApp::getColOffset_fm ( ) const
inline

Initialize application.

Definition at line 134 of file ATM_DecompApp.h.

References getColOffset_fp(), ATM_Instance::getNPairs(), and m_instance.

Referenced by colIndex_fm(), and getColOffset_x2().

const int ATM_DecompApp::getColOffset_x2 ( ) const
inline

Initialize application.

Definition at line 137 of file ATM_DecompApp.h.

References getColOffset_fm(), ATM_Instance::getNPairs(), and m_instance.

Referenced by colIndex_x2(), and getColOffset_x3().

const int ATM_DecompApp::getColOffset_x3 ( ) const
inline

Initialize application.

Definition at line 140 of file ATM_DecompApp.h.

References getColOffset_x2(), ATM_Instance::getNAtms(), and m_instance.

Referenced by colIndex_x3(), and getColOffset_v().

const int ATM_DecompApp::getColOffset_v ( ) const
inline

Initialize application.

Definition at line 143 of file ATM_DecompApp.h.

References getColOffset_x3(), ATM_Instance::getNAtms(), and m_instance.

Referenced by colIndex_v().

const int ATM_DecompApp::colIndex_x1 ( const int  a,
const int  t 
) const
inline

Initialize application.

Definition at line 147 of file ATM_DecompApp.h.

References getColOffset_x1(), m_appParam, ATM_Param::NumSteps, and ATM_Param::UseTightModel.

const int ATM_DecompApp::colIndex_z ( const int  a,
const int  t 
) const
inline

Initialize application.

Definition at line 153 of file ATM_DecompApp.h.

References getColOffset_z(), m_appParam, ATM_Param::NumSteps, and ATM_Param::UseTightModel.

const int ATM_DecompApp::colIndex_fp ( const int  pairIndex) const
inline

Initialize application.

Definition at line 159 of file ATM_DecompApp.h.

References getColOffset_fp().

const int ATM_DecompApp::colIndex_fm ( const int  pairIndex) const
inline

Initialize application.

Definition at line 162 of file ATM_DecompApp.h.

References getColOffset_fm().

const int ATM_DecompApp::colIndex_x2 ( const int  a) const
inline

Initialize application.

Definition at line 165 of file ATM_DecompApp.h.

References getColOffset_x2().

const int ATM_DecompApp::colIndex_x3 ( const int  a) const
inline

Initialize application.

Definition at line 168 of file ATM_DecompApp.h.

References getColOffset_x3().

const int ATM_DecompApp::colIndex_v ( const int  pairIndex) const
inline

Initialize application.

Definition at line 171 of file ATM_DecompApp.h.

References getColOffset_v().

void ATM_DecompApp::addColumnNamesA ( DecompConstraintSet model,
const string  prefix,
const int  offset 
)

Initialize application.

void ATM_DecompApp::addColumnNamesAT ( DecompConstraintSet model,
const string  prefix,
const int  offset 
)

Initialize application.

void ATM_DecompApp::addColumnNamesAD ( DecompConstraintSet model,
const string  prefix,
const int  offset 
)

Initialize application.

Member Data Documentation

const string ATM_DecompApp::m_classTag
private

Class id tag (for log / debugging).

Definition at line 40 of file ATM_DecompApp.h.

ATM_Instance ATM_DecompApp::m_instance
private

ATM problem instance data.

Definition at line 43 of file ATM_DecompApp.h.

Referenced by getColOffset_fm(), getColOffset_v(), getColOffset_x2(), getColOffset_x3(), getNAtmsSteps(), and numCoreCols().

ATM_Param ATM_DecompApp::m_appParam
private

Application specific parameters.

Definition at line 46 of file ATM_DecompApp.h.

Referenced by ATM_DecompApp(), colIndex_x1(), colIndex_z(), and getNAtmsSteps().

double* ATM_DecompApp::m_objective
private

The model objective coefficients (original space).

Definition at line 49 of file ATM_DecompApp.h.

vector<DecompConstraintSet*> ATM_DecompApp::m_models
private

The various model constraint systems used for different algos.

Definition at line 52 of file ATM_DecompApp.h.

Referenced by ~ATM_DecompApp().


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