15 #ifndef DECOMP_MODEL_INCLUDED 16 #define DECOMP_MODEL_INCLUDED 79 std::string modelName,
93 OsiSolverInterface* m_osi;
116 const int numCols = m_osi->getNumCols();
118 m_colIndices =
new int[numCols];
130 assert(m_colIndices);
131 assert(m_numCols == m_osi->getNumCols());
136 std::map<int, int>::const_iterator mcit;
138 for (mcit = origToSparse.begin();
139 mcit != origToSparse.end(); mcit++) {
140 m_osi->setObjCoeff(mcit->second,
144 m_osi->setObjCoeffSet(m_colIndices,
145 m_colIndices + m_numCols,
objCoeff);
150 const double* colUB) {
160 std::map<int, int>::const_iterator mcit;
162 for (mcit = origToSparse.begin();
163 mcit != origToSparse.end(); mcit++) {
164 m_osi->setColLower(mcit->second,
166 m_osi->setColUpper(mcit->second,
174 if (activeColumns.size()) {
175 std::vector<int>::iterator vi;
177 for (vi = activeColumns.begin(); vi != activeColumns.end(); vi++) {
180 m_osi->setColBounds(*vi, colLB[*vi], colUB[*vi]);
183 m_osi->setColLower(colLB);
184 m_osi->setColUpper(colUB);
236 const bool isXSparse =
false,
237 const int logLevel = 0,
238 const double feasVarTol = 1.0e-5,
239 const double feasConTol = 1.0e-4);
263 std::string modelName,
278 delete [] m_colIndices;
const int getBlockId() const
void solveAsMIPCpx(DecompSolverResult *result, DecompParam ¶m, bool doExact, bool doCutoff, bool isRoot, double cutoff, double timeLimit)
void setBlockId(const int blockId)
void solveAsMIPGrb(DecompSolverResult *result, DecompParam ¶m, bool doExact, bool doCutoff, bool isRoot, double cutoff, double timeLimit)
OsiSolverInterface * getOsi() const
void solveAsMIPCbc(DecompSolverResult *result, DecompParam ¶m, bool doExact, bool doCutoff, bool isRoot, double cutoff, double timeLimit)
void setActiveColBounds(const double *colLB, const double *colUB)
const std::map< int, int > & getMapOrigToSparse() const
UtilParameters * m_utilParam
void setOsiObjCoeff(const double *objCoeff)
void UtilIotaN(int *first, const int size, const int init)
const std::string & getModelName() const
void setModelName(const std::string modelName)
DecompModel & operator=(const DecompModel &rhs)
void solveAsMIPSym(DecompSolverResult *result, DecompParam ¶m, bool doExact, bool doCutoff, bool isRoot, double cutoff, double timeLimit)
std::vector< int > activeColumns
DecompModel(DecompConstraintSet *model, std::string modelName, int blockId, UtilParameters &utilParam)
DecompModel(const DecompModel &appModel)
DecompConstraintSet * getModel() const
void setOsi(OsiSolverInterface *osi)
bool isPointFeasible(const double *x, const bool isXSparse=false, const int logLevel=0, const double feasVarTol=1.0e-5, const double feasConTol=1.0e-4)
DecompSubModel(DecompConstraintSet *model, std::string modelName, int blockId, UtilParameters &utilParam)
void solveAsMIP(DecompSolverResult *result, DecompParam ¶m, bool doExact, bool doCutoff, bool isRoot, double cutoff, double timeLimit)
DecompModel(UtilParameters &utilParam)
const bool isSparse() const
#define UtilExceptionMemory(methodN, classN)
double * objCoeff
Model data objects (must be defined by users).
Storage of solver result.
DecompSubModel(UtilParameters &utilParam)
DecompSubModel(const DecompModel &appModel)
void setCounter(const int num)
DecompSubModel & operator=(const DecompModel &rhs)
void setModel(DecompConstraintSet *model)
DecompConstraintSet * m_model