diff --git a/src/MibSModel.cpp b/src/MibSModel.cpp index bf8aeb05..c3d8133f 100644 --- a/src/MibSModel.cpp +++ b/src/MibSModel.cpp @@ -4043,9 +4043,9 @@ MibSModel::loadProblemData(const CoinPackedMatrix& matrix, //checkProblemType(); // checks if MibS can solve problem entered setProblemType(); //determine the type of MIBLP //determine the list of first-stage variables participate in second-stage constraints - setRequiredFixedList(newMatrix); + setRequiredFixedList(); if((stochasticityType == "deterministic") || (stochasticityType == "stochasticWithoutSAA")){ - instanceStructure(newMatrix, conLB, conUB, origRowSense_); + instanceStructure(); } } @@ -6134,7 +6134,7 @@ MibSModel::decodeToSelf(AlpsEncoded& encoded) //############################################################################# void -MibSModel::setRequiredFixedList(const CoinPackedMatrix *newMatrix) +MibSModel::setRequiredFixedList() { //saharSto: we should change the structure of fixedInd std::string stochasticityType(MibSPar_->entry @@ -6145,9 +6145,9 @@ MibSModel::setRequiredFixedList(const CoinPackedMatrix *newMatrix) int * upperColInd = getUpperColInd(); int * lowerRowInd = getLowerRowInd(); - const double * matElements = newMatrix->getElements(); - const int * matIndices = newMatrix->getIndices(); - const int * matStarts = newMatrix->getVectorStarts(); + const double * matElements = colMatrix_->getElements(); + const int * matIndices = colMatrix_->getIndices(); + const int * matStarts = colMatrix_->getVectorStarts(); int index1, rowIndex, posRow, start, end, begPos, endPos; int i, j; @@ -6162,7 +6162,7 @@ MibSModel::setRequiredFixedList(const CoinPackedMatrix *newMatrix) fixedInd_[i] = 0; if(binarySearch(0, uCols - 1, i, upperColInd) >= 0){ start = matStarts[i]; - end = start + newMatrix->getVectorSize(i); + end = start + colMatrix_->getVectorSize(i); for(j = start; j < end; j++){ rowIndex = matIndices[j]; posRow = binarySearch(0, lRows - 1, rowIndex, lowerRowInd); @@ -6182,7 +6182,7 @@ MibSModel::setRequiredFixedList(const CoinPackedMatrix *newMatrix) fixedInd_[i] = 0; if(i < uCols){ start = matStarts[i]; - end = start + newMatrix->getVectorSize(i); + end = start + colMatrix_->getVectorSize(i); for(j = start; j < end; j++){ rowIndex = matIndices[j]; if((begPos <= rowIndex) && (rowIndex <= endPos)){ @@ -6199,9 +6199,7 @@ MibSModel::setRequiredFixedList(const CoinPackedMatrix *newMatrix) //############################################################################# void -MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, - const double* rowLB, const double* rowUB, - const char *newRowSense) +MibSModel::instanceStructure() { bool printProblemInfo(MibSPar_->entry(MibSParams::printProblemInfo)); @@ -6476,9 +6474,9 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, bool lowerRow, lowerCol; double rhs(0.0); - const double * matElements = newMatrix->getElements(); - const int * matIndices = newMatrix->getIndices(); - const int * matStarts = newMatrix->getVectorStarts(); + const double * matElements = colMatrix_->getElements(); + const int * matIndices = colMatrix_->getIndices(); + const int * matStarts = colMatrix_->getVectorStarts(); colSignsG2_ = new int[numCols]; colSignsA2_ = new int[numCols]; @@ -6503,7 +6501,7 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, if (binarySearch(0, structRowNum_-1, rowIndex, structRowInd_) < 0){ continue; } - if(newRowSense[rowIndex] == 'L'){ + if(origRowSense_[rowIndex] == 'L'){ mult = -1; } else{ @@ -6567,12 +6565,12 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, if ((isUpperCoeffInt_ == true) || (isLowerCoeffInt_ == true)){ for (i = 0; i < numRows; i++){ - switch(newRowSense[i]){ + switch(origRowSense_[i]){ case 'L': - rhs = rowUB[i]; + rhs = conUB_[i]; break; case 'G': - rhs = rowLB[i]; + rhs = conLB_[i]; break; case 'E': std::cout << "MibS cannot currently handle equality constraints."; diff --git a/src/MibSModel.hpp b/src/MibSModel.hpp index 5f73a764..452de20a 100644 --- a/src/MibSModel.hpp +++ b/src/MibSModel.hpp @@ -688,11 +688,10 @@ class MIBSLIB_EXPORT MibSModel : public BlisModel { virtual void decodeToSelf(AlpsEncoded&); /** Determine the list of first-stage variables participate in second-stage constraints */ - void setRequiredFixedList(const CoinPackedMatrix *newMatrix); + void setRequiredFixedList(); /** Determines the properties of instance. */ - void instanceStructure(const CoinPackedMatrix *newMatrix, const double* rowLB, - const double* rowUB, const char *newRowSense); + void instanceStructure(); AlpsTreeNode * createRoot();