Skip to content

Commit 2c3769a

Browse files
committed
Fix const version of getVar
1 parent db65e4d commit 2c3769a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

include/scippp/var.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct Var {
3434
* @since 1.3.0
3535
* @return underlying %SCIP variable.
3636
*/
37-
[[nodiscard]] const SCIP_Var* getVar() const;
37+
[[nodiscard]] SCIP_Var* const getVar() const;
3838

3939
/**
4040
* Get the assigned value in the solution.

source/model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ void Model::addConstr(const scippp::LinIneq& ineq, const std::string& name)
7979
ineq.m_lhs, /* left hand side of constraint */
8080
ineq.m_rhs.has_value() ? ineq.m_rhs.value() : infinity()));
8181
for (size_t index { 0 }; index < ineq.m_linExpr.m_vars.size(); index++) {
82-
m_scipCallWrapper(SCIPaddCoefLinear(m_scip, con, ineq.m_linExpr.m_vars.at(index).var, ineq.m_linExpr.m_coeffs.at(index)));
82+
m_scipCallWrapper(SCIPaddCoefLinear(m_scip, con, ineq.m_linExpr.m_vars.at(index).getVar(), ineq.m_linExpr.m_coeffs.at(index)));
8383
}
8484
m_scipCallWrapper(SCIPaddCons(m_scip, con));
8585
m_cons.push_back(con);

source/var.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ SCIP_Var* Var::getVar()
1212
return var;
1313
}
1414

15-
const SCIP_Var* Var::getVar() const
15+
SCIP_Var* const Var::getVar() const
1616
{
1717
return var;
1818
}

0 commit comments

Comments
 (0)