Skip to content

Commit e0facec

Browse files
committed
Remove unneeded module prefixes
1 parent 5b50dfb commit e0facec

12 files changed

+49
-49
lines changed

src/LibSCIP.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63969,7 +63969,7 @@ const ARTIFICIALVARNAMEPREFIX = "andresultant_"
6396963969
const SCIPisFinite = isfinite
6397063970

6397163971
# exports
63972-
const PREFIXES = ["SCIP_", "SCIP", "BMS_"]
63972+
const PREFIXES = ["SCIP", "BMS_"]
6397363973
for name in names(@__MODULE__; all=true), prefix in PREFIXES
6397463974
if startswith(string(name), prefix)
6397563975
@eval export $name

src/MOI_wrapper/HeuristicCallback.jl

Lines changed: 8 additions & 8 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 11 additions & 11 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
# Wrapper for implementing event handlers in SCIP.
22
# Before using please familiaze yourself with https://scipopt.org/doc/html/EVENT.php
3-
#
3+
#
44
# The basic idea here is the same as with the separator wrappers. First, you need
55
# to define a structure that implements the abstract type `AbstractEventhdlr`.
66
# Second you should implement the function `eventexec` where the argument is an
77
# instance of your event handler structure. Third, you should at runtime instantiate
88
# the structure and call `include_event_handler` to register the event handler with SCIP.
9-
#
9+
#
1010
# See eventhdlr.jl in the test folder for an example.
11-
#
11+
#
1212
abstract type AbstractEventhdlr end
1313

14-
"""
14+
"""
1515
This is a virtual function that must be implemented by the user. Its Only
1616
argument is the event handler object.
1717
"""
@@ -80,19 +80,19 @@ function _eventexit(
8080
return SCIP_OKAY
8181
end
8282
"""
83-
include_event_handler(scipd::SCIP.SCIPData, event_handler::EVENTHDLR; name="", desc="")
83+
include_event_handler(scipd::SCIPData, event_handler::EVENTHDLR; name="", desc="")
8484
85-
Include the event handler in SCIP. WARNING! In contrast to the separator wrapper you only need to
86-
pass the SCIPData rather than the SCIP pointer and dictionary.
85+
Include the event handler in SCIP. WARNING! In contrast to the separator wrapper you only need to
86+
pass the SCIPData rather than the SCIP pointer and dictionary.
8787
8888
# Arguments
89-
- scipd::SCIP.SCIPData: The SCIPData object
89+
- scipd::SCIPData: The SCIPData object
9090
- event_handler::EVENTHDLR: The event handler object
9191
- name::String: The name of the event handler
9292
- desc::String: The description of the event handler
9393
"""
9494
function include_event_handler(
95-
scipd::SCIP.SCIPData,
95+
scipd::SCIPData,
9696
event_handler::EVENTHDLR;
9797
name="",
9898
desc="",
@@ -130,14 +130,14 @@ function include_event_handler(
130130
end
131131

132132
"""
133-
catch_event(scipd::SCIP.SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
133+
catch_event(scipd::SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
134134
135135
Catch an event in SCIP. This function is a wrapper around the SCIPcatchEvent function.
136136
Warning! This function should only be called after the SCIP has been transformed.
137137
Use this instead of calling SCIPcatchEvent directly.
138138
"""
139139
function catch_event(
140-
scipd::SCIP.SCIPData,
140+
scipd::SCIPData,
141141
eventtype::SCIP_EVENTTYPE,
142142
eventhdlr::EVENTHDLR,
143143
) where {EVENTHDLR<:AbstractEventhdlr}
@@ -147,15 +147,15 @@ function catch_event(
147147
@SCIP_CALL SCIPcatchEvent(scipd, eventtype, eventhdlrptr, C_NULL, C_NULL)
148148
end
149149

150-
"""
151-
drop_event(scipd::SCIP.SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
150+
"""
151+
drop_event(scipd::SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
152152
153153
Drop an event in SCIP. This function is a wrapper around the SCIPdropEvent function.
154154
Warning! This function should only be called after the SCIP has been transformed.
155155
Use this instead of calling SCIPdropEvent directly.
156156
"""
157157
function drop_event(
158-
scipd::SCIP.SCIPData,
158+
scipd::SCIPData,
159159
eventtype::SCIP_EVENTTYPE,
160160
eventhdlr::EVENTHDLR,
161161
) where {EVENTHDLR<:AbstractEventhdlr}

src/heuristic.jl

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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)