Skip to content

Commit

Permalink
allow # in optionfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jjhforrest committed Nov 1, 2024
1 parent d1dbc98 commit 13f902d
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/CbcSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1642,15 +1642,15 @@ int CbcMain1(std::deque<std::string> inputQueue, CbcModel &model,
continue;
}
/* format of file -
comments line starts with *
comments line starts with * or #
first character not blank
command is first - if no - then - added
*/
char line[200];
std::cout << "Extra options - ";
while (fgets(line, 200, fp)) {
// skip comment
if (line[0]=='*')
if (line[0]=='*'|| line[0]=='#')
continue;
int nchar = strlen(line);
if (nchar<2)
Expand Down Expand Up @@ -8458,7 +8458,20 @@ int CbcMain1(std::deque<std::string> inputQueue, CbcModel &model,
int options = babModel_->specialOptions();
babModel_->setSpecialOptions(options|addOptions);
}
babModel_->branchAndBound(statistics);
#ifndef CBC_OTHER_SOLVER
if (doVector) {
OsiClpSolverInterface *solver = dynamic_cast< OsiClpSolverInterface * >(babModel_->solver());
ClpSimplex *lpSolver = solver->getModelPtr();
ClpMatrixBase *matrix = lpSolver->clpMatrix();
if (dynamic_cast<ClpPackedMatrix *>(matrix)) {
ClpPackedMatrix *clpMatrix =
dynamic_cast<ClpPackedMatrix *>(matrix);
clpMatrix->makeSpecialColumnCopy();
lpSolver->setVectorMode(1);
}
}
#endif
babModel_->branchAndBound(statistics);
#ifdef CBC_HAS_NAUTY
if (nautyAdded) {
int *which = new int[nautyAdded];
Expand Down

0 comments on commit 13f902d

Please sign in to comment.