Skip to content

Commit 9811124

Browse files
authored
Remove unneeded module prefixes (#336)
1 parent 9daba0b commit 9811124

12 files changed

+42
-42
lines changed

src/LibSCIP.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -63974,7 +63974,7 @@ const ARTIFICIALVARNAMEPREFIX = "andresultant_"
6397463974
const SCIPisFinite = isfinite
6397563975

6397663976
# exports
63977-
const PREFIXES = ["SCIP_", "SCIP", "BMS_"]
63977+
const PREFIXES = ["SCIP", "BMS_"]
6397863978
for name in names(@__MODULE__; all=true), prefix in PREFIXES
6397963979
if startswith(string(name), prefix)
6398063980
@eval export $name

src/MOI_wrapper/HeuristicCallback.jl

+8-8
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,25 @@ function MOI.submit(
8484
heur_ = o.inner.heuristic_storage[heuristic]
8585
sol = create_empty_scipsol(o.inner.scip[], heur_)
8686
for idx in eachindex(x)
87-
SCIP.@SCIP_CALL SCIP.SCIPsetSolVal(
87+
@SCIP_CALL SCIPsetSolVal(
8888
o.inner.scip[],
8989
sol,
9090
var(o, x[idx]),
9191
values[idx],
9292
)
9393
end
94-
stored = Ref{SCIP_Bool}(SCIP.FALSE)
94+
stored = Ref{SCIP_Bool}(FALSE)
9595
@SCIP_CALL SCIPtrySolFree(
9696
o.inner.scip[],
9797
Ref(sol),
98-
SCIP.FALSE,
99-
SCIP.FALSE,
100-
SCIP.TRUE,
101-
SCIP.TRUE,
102-
SCIP.TRUE,
98+
FALSE,
99+
FALSE,
100+
TRUE,
101+
TRUE,
102+
TRUE,
103103
stored,
104104
)
105-
if stored[] == SCIP.TRUE
105+
if stored[] == TRUE
106106
callback_data.submit_called = true
107107
end
108108
return

src/MOI_wrapper/conflict.jl

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function compute_minimum_unsatisfied_constraints!(o::Optimizer)
2929
)
3030
end
3131
# free the transformed problem first
32-
if LibSCIP.SCIPgetStage(o) != LibSCIP.SCIP_STAGE_PROBLEM
33-
@SCIP_CALL LibSCIP.SCIPfreeTransform(o)
32+
if SCIPgetStage(o) != SCIP_STAGE_PROBLEM
33+
@SCIP_CALL SCIPfreeTransform(o)
3434
end
3535
# first transform all variable bound constraints to constraint bounds
3636
for (F, S) in MOI.get(o, MOI.ListOfConstraintTypesPresent())
@@ -68,9 +68,9 @@ function compute_minimum_unsatisfied_constraints!(o::Optimizer)
6868
end
6969
end
7070
end
71-
success = Ref{LibSCIP.SCIP_Bool}(SCIP.FALSE)
72-
@SCIP_CALL LibSCIP.SCIPtransformMinUC(o, success)
73-
if success[] != SCIP.TRUE
71+
success = Ref{SCIP_Bool}(FALSE)
72+
@SCIP_CALL SCIPtransformMinUC(o, success)
73+
if success[] != TRUE
7474
error(
7575
"Failed to compute the minimum unsatisfied constraints system.\nSome constraint types may not support the required transformations",
7676
)

src/MOI_wrapper/constraints.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,5 @@ function MOI.is_valid(o::Optimizer, c::MOI.ConstraintIndex{F,S}) where {F,S}
120120
if !in(ConsRef(c.value), cons_set)
121121
return false
122122
end
123-
return haskey(o.inner.conss, SCIP.ConsRef(c.value))
123+
return haskey(o.inner.conss, ConsRef(c.value))
124124
end

src/MOI_wrapper/linear_constraints.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function MOI.add_constraint(
3131
end
3232

3333
function MOI.set(
34-
o::SCIP.Optimizer,
34+
o::Optimizer,
3535
::MOI.ConstraintSet,
3636
ci::MOI.ConstraintIndex{<:MOI.ScalarAffineFunction{Float64},S},
3737
set::S,

src/MOI_wrapper/quadratic_constraints.jl

+11-11
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ function MOI.get(
6060
expr_ref = SCIPgetExprNonlinear(c)
6161
# This call is required to get quaddata computed in the expression
6262
isq = Ref{UInt32}(100)
63-
@SCIP_CALL LibSCIP.SCIPcheckExprQuadratic(o, expr_ref, isq)
63+
@SCIP_CALL SCIPcheckExprQuadratic(o, expr_ref, isq)
6464
@assert isq[] == 1
6565
constant_ref = Ref{Cdouble}(-1.0)
6666
n_linear_terms_ref = Ref{Cint}(-1)
67-
linear_exprs = Ref{Ptr{Ptr{LibSCIP.SCIP_EXPR}}}()
67+
linear_exprs = Ref{Ptr{Ptr{SCIP_EXPR}}}()
6868
lincoefs = Ref{Ptr{Cdouble}}()
6969
n_quad_terms_ref = Ref{Cint}(-1)
7070
n_bilinear_terms_ref = Ref{Cint}(-1)
71-
LibSCIP.SCIPexprGetQuadraticData(
71+
SCIPexprGetQuadraticData(
7272
expr_ref,
7373
constant_ref,
7474
n_linear_terms_ref,
@@ -83,16 +83,16 @@ function MOI.get(
8383
unsafe_wrap(Vector{Ptr{Cvoid}}, linear_exprs[], n_linear_terms_ref[])
8484
lin_coeff_vec =
8585
unsafe_wrap(Vector{Cdouble}, lincoefs[], n_linear_terms_ref[])
86-
func = SCIP.MOI.ScalarQuadraticFunction{Float64}([], [], constant_ref[])
86+
func = MOI.ScalarQuadraticFunction{Float64}([], [], constant_ref[])
8787
for idx in 1:n_linear_terms_ref[]
88-
var_ptr = LibSCIP.SCIPgetVarExprVar(lin_expr_vec[idx])
88+
var_ptr = SCIPgetVarExprVar(lin_expr_vec[idx])
8989
func += lin_coeff_vec[idx] * MOI.VariableIndex(o.reference[var_ptr].val)
9090
end
9191
for term_idx in 1:n_quad_terms_ref[]
9292
var_expr = Ref{Ptr{Cvoid}}()
9393
lin_coef_ref = Ref{Cdouble}()
9494
sqr_coef_ref = Ref{Cdouble}()
95-
LibSCIP.SCIPexprGetQuadraticQuadTerm(
95+
SCIPexprGetQuadraticQuadTerm(
9696
expr_ref,
9797
term_idx - 1, # 0-indexed terms
9898
var_expr,
@@ -104,7 +104,7 @@ function MOI.get(
104104
)
105105
@assert lin_coef_ref[] == 0.0
106106
if sqr_coef_ref[] != 0.0
107-
var_ptr = LibSCIP.SCIPgetVarExprVar(var_expr[])
107+
var_ptr = SCIPgetVarExprVar(var_expr[])
108108
var_idx = MOI.VariableIndex(o.reference[var_ptr].val)
109109
MOI.Utilities.operate!(
110110
+,
@@ -118,7 +118,7 @@ function MOI.get(
118118
var_expr1 = Ref{Ptr{Cvoid}}()
119119
var_expr2 = Ref{Ptr{Cvoid}}()
120120
coef_ref = Ref{Cdouble}()
121-
LibSCIP.SCIPexprGetQuadraticBilinTerm(
121+
SCIPexprGetQuadraticBilinTerm(
122122
expr_ref,
123123
term_idx - 1,
124124
var_expr1,
@@ -128,9 +128,9 @@ function MOI.get(
128128
C_NULL,
129129
)
130130
if coef_ref[] != 0.0
131-
var_ptr1 = LibSCIP.SCIPgetVarExprVar(var_expr1[])
131+
var_ptr1 = SCIPgetVarExprVar(var_expr1[])
132132
var_idx1 = MOI.VariableIndex(o.reference[var_ptr1].val)
133-
var_ptr2 = LibSCIP.SCIPgetVarExprVar(var_expr2[])
133+
var_ptr2 = SCIPgetVarExprVar(var_expr2[])
134134
var_idx2 = MOI.VariableIndex(o.reference[var_ptr2].val)
135135
MOI.Utilities.operate!(
136136
+,
@@ -164,7 +164,7 @@ function MOI.get(
164164
c = cons(o, ci)
165165
expr_ref = SCIPgetExprNonlinear(c)
166166
isq = Ref{UInt32}(100)
167-
@SCIP_CALL LibSCIP.SCIPcheckExprQuadratic(o, expr_ref, isq)
167+
@SCIP_CALL SCIPcheckExprQuadratic(o, expr_ref, isq)
168168
@assert isq[] == 1
169169
sol = SCIPgetBestSol(o)
170170
@SCIP_CALL SCIPevalExpr(o, expr_ref, sol, Clonglong(0))

src/branching_rule.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Perform branching with the current `branching_rule`.
4242
`allow_additional_constraints` is a Boolean indicating if the branching rule
4343
is allowed to add constraints to the current node in order to cut off the current solution instead of creating a branching.
4444
45-
That method must return a tuple (return_code::LibSCIP.SCIP_RETCODE, result::SCIP.LibSCIP.SCIP_RESULT).
45+
That method must return a tuple (return_code::SCIP_RETCODE, result::SCIP_RESULT).
4646
If no branching was performed, use `SCIP_DIDNOTRUN` as a result to pass on to the following branching rule.
4747
4848
`type` is the `BranchingType` to branch on, i.e. on LP solution, pseudo-solution or external candidate.
@@ -53,7 +53,7 @@ function branch(
5353
allow_additional_constraints,
5454
type::BranchingType,
5555
)
56-
return (LibSCIP.SCIP_OKAY, LibSCIP.SCIP_DIDNOTRUN)
56+
return (SCIP_OKAY, SCIP_DIDNOTRUN)
5757
end
5858

5959
"""
@@ -104,7 +104,7 @@ function get_branching_candidates(scip)
104104
end
105105

106106
function branch_on_candidate!(scip, var)
107-
@SCIP_CALL LibSCIP.SCIPbranchVar(scip, var, C_NULL, C_NULL, C_NULL)
107+
@SCIP_CALL SCIPbranchVar(scip, var, C_NULL, C_NULL, C_NULL)
108108
return nothing
109109
end
110110

src/convenience.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Recover Julia object which is attached to user constraint (via constraint data).
1010
"""
1111
function user_constraint(cons_::Ptr{SCIP_CONS})
1212
@assert cons_ != C_NULL
13-
consdata_::Ptr{SCIP.SCIP_CONSDATA} = SCIPconsGetData(cons_)
13+
consdata_::Ptr{SCIP_CONSDATA} = SCIPconsGetData(cons_)
1414
return unsafe_pointer_to_objref(consdata_)
1515
end
1616

src/cut_selector.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function _select_cut_callback(
4848
@assert length(cuts) == ncuts
4949
forced_cuts = unsafe_wrap(Vector{Ptr{SCIP_ROW}}, forced_cuts_, nforced_cuts)
5050
@assert length(forced_cuts) == nforced_cuts
51-
root = root_ == SCIP.TRUE
51+
root = root_ == TRUE
5252
(retcode, nselectedcuts, result) = select_cuts(
5353
cutsel,
5454
scip,
@@ -260,7 +260,7 @@ function select_cuts(
260260
nselected_cuts = Ref{Cint}(-1)
261261
maxparalellism = root ? cutsel.max_parallelism_root : cutsel.max_parallelism
262262
max_good_parallelism = max(maxparalellism, 0.5)
263-
retcode = LibSCIP.SCIPselectCutsHybrid(
263+
retcode = SCIPselectCutsHybrid(
264264
scip,
265265
cuts,
266266
forced_cuts,

src/event_handler.jl

+7-7
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ function _eventexit(
8585
return SCIP_OKAY
8686
end
8787
"""
88-
include_event_handler(scipd::SCIP.SCIPData, event_handler::EVENTHDLR; name="", desc="")
88+
include_event_handler(scipd::SCIPData, event_handler::EVENTHDLR; name="", desc="")
8989
9090
Include the event handler in SCIP. WARNING! In contrast to the separator wrapper you only need to
9191
pass the SCIPData rather than the SCIP pointer and dictionary.
9292
9393
# Arguments
94-
- scipd::SCIP.SCIPData: The SCIPData object
94+
- scipd::SCIPData: The SCIPData object
9595
- event_handler::EVENTHDLR: The event handler object
9696
- name::String: The name of the event handler
9797
- desc::String: The description of the event handler
9898
"""
9999
function include_event_handler(
100-
scipd::SCIP.SCIPData,
100+
scipd::SCIPData,
101101
event_handler::EVENTHDLR;
102102
name="",
103103
desc="",
@@ -135,14 +135,14 @@ function include_event_handler(
135135
end
136136

137137
"""
138-
catch_event(scipd::SCIP.SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
138+
catch_event(scipd::SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
139139
140140
Catch an event in SCIP. This function is a wrapper around the SCIPcatchEvent function.
141141
Warning! This function should only be called after the SCIP has been transformed.
142142
Use this instead of calling SCIPcatchEvent directly.
143143
"""
144144
function catch_event(
145-
scipd::SCIP.SCIPData,
145+
scipd::SCIPData,
146146
eventtype::SCIP_EVENTTYPE,
147147
eventhdlr::EVENTHDLR,
148148
) where {EVENTHDLR<:AbstractEventhdlr}
@@ -153,14 +153,14 @@ function catch_event(
153153
end
154154

155155
"""
156-
drop_event(scipd::SCIP.SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
156+
drop_event(scipd::SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
157157
158158
Drop an event in SCIP. This function is a wrapper around the SCIPdropEvent function.
159159
Warning! This function should only be called after the SCIP has been transformed.
160160
Use this instead of calling SCIPdropEvent directly.
161161
"""
162162
function drop_event(
163-
scipd::SCIP.SCIPData,
163+
scipd::SCIPData,
164164
eventtype::SCIP_EVENTTYPE,
165165
eventhdlr::EVENTHDLR,
166166
) where {EVENTHDLR<:AbstractEventhdlr}

src/heuristic.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function _find_primal_solution_callback(
3939
)
4040
heurdata::Ptr{SCIP_HEURDATA} = SCIPheurGetData(heur_)
4141
heur = unsafe_pointer_to_objref(heurdata)
42-
nodeinfeasible = nodeinfeasible_ == SCIP.TRUE
42+
nodeinfeasible = nodeinfeasible_ == TRUE
4343
(retcode, result) = find_primal_solution(
4444
scip,
4545
heur,

src/scip_data.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ mutable struct SCIPData
6666
@SCIP_CALL SCIPcreate(scip)
6767
@assert scip[] != C_NULL
6868
@SCIP_CALL SCIPincludeDefaultPlugins(scip[])
69-
@SCIP_CALL SCIP.SCIPcreateProbBasic(scip[], "")
69+
@SCIP_CALL SCIPcreateProbBasic(scip[], "")
7070
scip_data = new(
7171
scip,
7272
Dict{VarRef,Ref{Ptr{SCIP_VAR}}}(),

0 commit comments

Comments
 (0)