Skip to content

Commit

Permalink
suggestions by @flomnes
Browse files Browse the repository at this point in the history
  • Loading branch information
sgatto committed Nov 17, 2023
1 parent e732569 commit 254fd48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions ortools/linear_solver/xpress_interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,8 @@ class XpressInterface : public MPSolverInterface {
bool IsMIP() const override { return mMip; }

void SetStartingLpBasis(
const std::vector<MPSolver::BasisStatus>& /*variable_statuses*/,
const std::vector<MPSolver::BasisStatus>& /*constraint_statuses*/) override;
const std::vector<MPSolver::BasisStatus>& variable_statuses,
const std::vector<MPSolver::BasisStatus>& constraint_statuses) override;

void ExtractNewVariables() override;
void ExtractNewConstraints() override;
Expand Down Expand Up @@ -1758,8 +1758,8 @@ void XpressInterface::SetStartingLpBasis(
LOG(DFATAL) << __FUNCTION__ << " is only available for LP problems";
return;
}
initial_variables_basis_status_=XpressBasisStatusesFrom(variable_statuses);
initial_constraint_basis_status_=XpressBasisStatusesFrom(constraint_statuses);
initial_variables_basis_status_ = XpressBasisStatusesFrom(variable_statuses);
initial_constraint_basis_status_ = XpressBasisStatusesFrom(constraint_statuses);
}

bool XpressInterface::readParameters(std::istream& is, char sep) {
Expand Down
3 changes: 1 addition & 2 deletions ortools/linear_solver/xpress_interface_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ TEST(XpressInterface, LpStartingBasis) {

// Then we slightly modify the problem...
MPObjective* obj = solver.MutableObjective();
obj->SetCoefficient(solver.variables().at(1),
100);
obj->SetCoefficient(solver.variable(1), 100);
// Here, we provide the final basis of the previous (similar) problem
solver.SetStartingLpBasis(varStatus, constrStatus);
solver.Solve();
Expand Down

0 comments on commit 254fd48

Please sign in to comment.