Skip to content

Commit

Permalink
revert the action of copy; instead throw an error.
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxies committed Sep 4, 2024
1 parent fd58e7b commit deca2ad
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/MibSModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1099,11 +1099,10 @@ MibSModel::loadProblemData(const CoinPackedMatrix& matrix,
CoinPackedMatrix *newMatrix = NULL;
CoinPackedMatrix *matrix1 = NULL; // YX: w/ appended equality constrs

// YX: need col mat to start; cp to matrix1 if row-ordered
// YX: note that MibS defaults to using a column matrix.
if(!matType){
matrix1 = new CoinPackedMatrix();
matrix1->copyOf(matrix);
matrix1->reverseOrdering();
throw CoinError("Expect a column-oriented matrix. Try matrix.reverseOrdering() before loading the matrix.",
"loadProblemData", "MibSModel");
}

// --- prepare for equality constraints (if any) ---
Expand Down Expand Up @@ -1163,17 +1162,12 @@ MibSModel::loadProblemData(const CoinPackedMatrix& matrix,

// YX: add rows to the problem matrix and link pointers to vectors
if(numRows > inputNumRows){
if(!matrix1){
matrix1 = new CoinPackedMatrix();
matrix1->copyOf(matrix);
}
matrix1 = new CoinPackedMatrix();
matrix1->copyOf(matrix);
matrix1->reverseOrdering();

rowMatrix = matrix;
// YX: switch if matrix was col ordered
if(matType){
rowMatrix.reverseOrdering();
}
rowMatrix.reverseOrdering();
const double * matElements = rowMatrix.getElements();
const int * matIndices = rowMatrix.getIndices();
const int * matStarts = rowMatrix.getVectorStarts();
Expand Down

0 comments on commit deca2ad

Please sign in to comment.