Skip to content

Commit

Permalink
Fix const version of getVar
Browse files Browse the repository at this point in the history
  • Loading branch information
hedtke committed Nov 11, 2024
1 parent db65e4d commit 2c3769a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/scippp/var.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct Var {
* @since 1.3.0
* @return underlying %SCIP variable.
*/
[[nodiscard]] const SCIP_Var* getVar() const;
[[nodiscard]] SCIP_Var* const getVar() const;

/**
* Get the assigned value in the solution.
Expand Down
2 changes: 1 addition & 1 deletion source/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void Model::addConstr(const scippp::LinIneq& ineq, const std::string& name)
ineq.m_lhs, /* left hand side of constraint */
ineq.m_rhs.has_value() ? ineq.m_rhs.value() : infinity()));
for (size_t index { 0 }; index < ineq.m_linExpr.m_vars.size(); index++) {
m_scipCallWrapper(SCIPaddCoefLinear(m_scip, con, ineq.m_linExpr.m_vars.at(index).var, ineq.m_linExpr.m_coeffs.at(index)));
m_scipCallWrapper(SCIPaddCoefLinear(m_scip, con, ineq.m_linExpr.m_vars.at(index).getVar(), ineq.m_linExpr.m_coeffs.at(index)));
}
m_scipCallWrapper(SCIPaddCons(m_scip, con));
m_cons.push_back(con);
Expand Down
2 changes: 1 addition & 1 deletion source/var.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ SCIP_Var* Var::getVar()
return var;
}

const SCIP_Var* Var::getVar() const
SCIP_Var* const Var::getVar() const
{
return var;
}
Expand Down

0 comments on commit 2c3769a

Please sign in to comment.