Skip to content

Commit e38c841

Browse files
authored
Merge pull request #342 from scipopt/od/ref-value
Fix type stability of Base.RefValue fields
2 parents 887184d + 98dde56 commit e38c841

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/nonlinear.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Returns the SCIP expression pointer, whether the expression is a pure value (wit
3131
function push_expr!(
3232
nonlin::NonlinExpr,
3333
scip::Ptr{SCIP_},
34-
vars::Dict{VarRef,Ref{Ptr{SCIP_VAR}}},
34+
vars::Dict{VarRef,<:Ref{Ptr{SCIP_VAR}}},
3535
expr::Expr,
3636
)
3737
# Storage for SCIP_EXPR*
@@ -262,7 +262,7 @@ end
262262
function push_expr!(
263263
nonlin::NonlinExpr,
264264
scip::Ptr{SCIP_},
265-
vars::Dict{VarRef,Ref{Ptr{SCIP_VAR}}},
265+
vars::Dict{VarRef,<:Ref{Ptr{SCIP_VAR}}},
266266
expr::Number,
267267
)
268268
# Storage for SCIP_EXPR*

src/scip_data.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ SCIPData holds pointers to SCIP data.
3131
It does not perform memory management and should not be created directly.
3232
"""
3333
mutable struct SCIPData
34-
scip::Ref{Ptr{SCIP_}}
35-
vars::Dict{VarRef,Ref{Ptr{SCIP_VAR}}}
36-
conss::Dict{ConsRef,Ref{Ptr{SCIP_CONS}}}
34+
scip::Base.RefValue{Ptr{SCIP_}}
35+
vars::Dict{VarRef,Base.RefValue{Ptr{SCIP_VAR}}}
36+
conss::Dict{ConsRef,Base.RefValue{Ptr{SCIP_CONS}}}
3737

3838
var_count::Int64
3939
cons_count::Int64
@@ -69,8 +69,8 @@ mutable struct SCIPData
6969
@SCIP_CALL SCIPcreateProbBasic(scip[], "")
7070
scip_data = new(
7171
scip,
72-
Dict{VarRef,Ref{Ptr{SCIP_VAR}}}(),
73-
Dict{ConsRef,Ref{Ptr{SCIP_CONS}}}(),
72+
Dict{VarRef,Base.RefValue{Ptr{SCIP_VAR}}}(),
73+
Dict{ConsRef,Base.RefValue{Ptr{SCIP_CONS}}}(),
7474
0,
7575
0,
7676
Dict{Any,Ptr{SCIP_CONSHDLR}}(),

src/sepa.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ associated to the separator `sepa`.
215215
"""
216216
function add_cut_sepa(
217217
scip::Ptr{SCIP_},
218-
vars::Dict{VarRef,Ref{Ptr{SCIP_VAR}}},
218+
vars::Dict{VarRef,<:Ref{Ptr{SCIP_VAR}}},
219219
sepas::Dict{Any,Ptr{SCIP_SEPA}},
220220
sepa::SEPA,
221221
varrefs,

0 commit comments

Comments
 (0)