Skip to content

Commit 9daba0b

Browse files
authored
Add missing license headers (#337)
1 parent 5b50dfb commit 9daba0b

File tree

3 files changed

+26
-11
lines changed

3 files changed

+26
-11
lines changed

src/LibSCIP.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2018 Felipe Serrano, Miles Lubin, Robert Schwarz, and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
module LibSCIP
27

38
using ..SCIP: libscip

src/event_handler.jl

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1+
# Copyright (c) 2018 Felipe Serrano, Miles Lubin, Robert Schwarz, and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
# Wrapper for implementing event handlers in SCIP.
27
# Before using please familiaze yourself with https://scipopt.org/doc/html/EVENT.php
3-
#
8+
#
49
# The basic idea here is the same as with the separator wrappers. First, you need
510
# to define a structure that implements the abstract type `AbstractEventhdlr`.
611
# Second you should implement the function `eventexec` where the argument is an
712
# instance of your event handler structure. Third, you should at runtime instantiate
813
# the structure and call `include_event_handler` to register the event handler with SCIP.
9-
#
14+
#
1015
# See eventhdlr.jl in the test folder for an example.
11-
#
16+
#
1217
abstract type AbstractEventhdlr end
1318

14-
"""
19+
"""
1520
This is a virtual function that must be implemented by the user. Its Only
1621
argument is the event handler object.
1722
"""
@@ -82,8 +87,8 @@ end
8287
"""
8388
include_event_handler(scipd::SCIP.SCIPData, event_handler::EVENTHDLR; name="", desc="")
8489
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.
90+
Include the event handler in SCIP. WARNING! In contrast to the separator wrapper you only need to
91+
pass the SCIPData rather than the SCIP pointer and dictionary.
8792
8893
# Arguments
8994
- scipd::SCIP.SCIPData: The SCIPData object
@@ -147,7 +152,7 @@ function catch_event(
147152
@SCIP_CALL SCIPcatchEvent(scipd, eventtype, eventhdlrptr, C_NULL, C_NULL)
148153
end
149154

150-
"""
155+
"""
151156
drop_event(scipd::SCIP.SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)
152157
153158
Drop an event in SCIP. This function is a wrapper around the SCIPdropEvent function.

test/eventhdlr.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# Copyright (c) 2018 Felipe Serrano, Miles Lubin, Robert Schwarz, and contributors
2+
#
3+
# Use of this source code is governed by an MIT-style license that can be found
4+
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.
5+
16
# A simple testcase to test the event handler functionality.
27
# It is assumed that test/sepa_support.jl is already included
38
using SCIP
@@ -67,7 +72,7 @@ end
6772
)
6873
MOI.set(optimizer, MOI.ObjectiveSense(), MOI.MIN_SENSE)
6974

70-
# add eventhandler
75+
# add eventhandler
7176
eventhdlr = FirstLPEventTest.FirstLPEvent(inner, 10)
7277
SCIP.include_event_handler(
7378
inner,
@@ -81,7 +86,7 @@ end
8186
# solve the problem
8287
SCIP.@SCIP_CALL SCIP.SCIPsolve(inner.scip[])
8388

84-
# test if the event handler worked
89+
# test if the event handler worked
8590
@test eventhdlr.firstlpobj != 10.0
8691

8792
# free the problem
@@ -121,7 +126,7 @@ end
121126
)
122127
MOI.set(optimizer, MOI.ObjectiveSense(), MOI.MIN_SENSE)
123128

124-
# add eventhandler
129+
# add eventhandler
125130
eventhdlr = FirstLPEventTest.FirstLPEvent(inner, 10)
126131
SCIP.include_event_handler(
127132
inner,
@@ -135,7 +140,7 @@ end
135140
# solve the problem
136141
SCIP.@SCIP_CALL SCIP.SCIPsolve(inner.scip[])
137142

138-
# test if the event handler worked
143+
# test if the event handler worked
139144
@test eventhdlr.firstlpobj != 10.0
140145

141146
# free the problem

0 commit comments

Comments
 (0)