From c7ded90a646e75e5e5ffe31b3fe238ae12ee1225 Mon Sep 17 00:00:00 2001 From: Yu Xie Date: Wed, 9 Feb 2022 03:48:25 -0500 Subject: [PATCH] clean up interdict rowSense; remove unused vars --- src/MibSModel.cpp | 23 +++-------------------- src/MibSModel.hpp | 2 +- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/MibSModel.cpp b/src/MibSModel.cpp index f35162a0..bf8aeb05 100644 --- a/src/MibSModel.cpp +++ b/src/MibSModel.cpp @@ -323,7 +323,6 @@ MibSModel::readAuxiliaryData(const CoinPackedMatrix& rowMatrix, int i(0), j(0), k(0), m(0), p(0), pos(0); int lowerColNum(0), lowerRowNum(0); // Find out if we are reading an interdiction problem in legacy format - double * intCosts = getInterdictCost(); while (data_stream >> key){ if(key == "N"){ @@ -3911,7 +3910,7 @@ MibSModel::loadProblemData(const CoinPackedMatrix& matrix, newMatrix = new CoinPackedMatrix(false, 0, 0); newMatrix->setDimensions(0, numTotalCols); - int start(0), end(0), tmp(0), index(0); + int start(0), end(0); /* Add interdiction budget row */ if (intCosts){ @@ -4046,7 +4045,7 @@ MibSModel::loadProblemData(const CoinPackedMatrix& matrix, //determine the list of first-stage variables participate in second-stage constraints setRequiredFixedList(newMatrix); if((stochasticityType == "deterministic") || (stochasticityType == "stochasticWithoutSAA")){ - instanceStructure(newMatrix, conLB, conUB, rowSense); + instanceStructure(newMatrix, conLB, conUB, origRowSense_); } } @@ -6202,7 +6201,7 @@ MibSModel::setRequiredFixedList(const CoinPackedMatrix *newMatrix) void MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, const double* rowLB, const double* rowUB, - const char *rowSense) + const char *newRowSense) { bool printProblemInfo(MibSPar_->entry(MibSParams::printProblemInfo)); @@ -6392,7 +6391,6 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, int numRows(numCons_); int uCols(upperDim_); int lCols(lowerDim_); - int uRows(upperRowNum_); int lRows(lowerRowNum_); int numUpperInt(0); int numLowerInt(0); @@ -6400,7 +6398,6 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, int * lColIndices = getLowerColInd(); int * lRowIndices = getLowerRowInd(); double * lObjCoeffs = getLowerObjCoeffs(); - char * newRowSense = new char[numRows]; for(i = 0; i < uCols; i++){ index = uColIndices[i]; @@ -6423,17 +6420,6 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, std::cout << numLowerInt << std::endl; } - if (isInterdict_ == false){ - CoinDisjointCopyN(rowSense, numRows, newRowSense); - }else{ - for (i = 0; i < numRows; i++){ - newRowSense[i] = 'L'; - } - for (i = 0; i < lRows-lCols; i++){ - newRowSense[i+uRows] = rowSense[i]; - } - } - //Checks general or interdiction if (isInterdict_ == true){ if (printProblemInfo == true){ @@ -6485,7 +6471,6 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, } } - int nonZero (newMatrix->getNumElements()); int counterStart, counterEnd; int rowIndex; bool lowerRow, lowerCol; @@ -6997,6 +6982,4 @@ MibSModel::instanceStructure(const CoinPackedMatrix *newMatrix, } } std::cout << std::endl; - - delete [] newRowSense; } diff --git a/src/MibSModel.hpp b/src/MibSModel.hpp index d3c7fa91..5f73a764 100644 --- a/src/MibSModel.hpp +++ b/src/MibSModel.hpp @@ -692,7 +692,7 @@ class MIBSLIB_EXPORT MibSModel : public BlisModel { /** Determines the properties of instance. */ void instanceStructure(const CoinPackedMatrix *newMatrix, const double* rowLB, - const double* rowUB, const char *rowSense); + const double* rowUB, const char *newRowSense); AlpsTreeNode * createRoot();