Skip to content

Add missing license headers #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/LibSCIP.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) 2018 Felipe Serrano, Miles Lubin, Robert Schwarz, and contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.

module LibSCIP

using ..SCIP: libscip
Expand Down
19 changes: 12 additions & 7 deletions src/event_handler.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
# Copyright (c) 2018 Felipe Serrano, Miles Lubin, Robert Schwarz, and contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.

# Wrapper for implementing event handlers in SCIP.
# Before using please familiaze yourself with https://scipopt.org/doc/html/EVENT.php
#
#
# The basic idea here is the same as with the separator wrappers. First, you need
# to define a structure that implements the abstract type `AbstractEventhdlr`.
# Second you should implement the function `eventexec` where the argument is an
# instance of your event handler structure. Third, you should at runtime instantiate
# the structure and call `include_event_handler` to register the event handler with SCIP.
#
#
# See eventhdlr.jl in the test folder for an example.
#
#
abstract type AbstractEventhdlr end

"""
"""
This is a virtual function that must be implemented by the user. Its Only
argument is the event handler object.
"""
Expand Down Expand Up @@ -82,8 +87,8 @@ end
"""
include_event_handler(scipd::SCIP.SCIPData, event_handler::EVENTHDLR; name="", desc="")

Include the event handler in SCIP. WARNING! In contrast to the separator wrapper you only need to
pass the SCIPData rather than the SCIP pointer and dictionary.
Include the event handler in SCIP. WARNING! In contrast to the separator wrapper you only need to
pass the SCIPData rather than the SCIP pointer and dictionary.

# Arguments
- scipd::SCIP.SCIPData: The SCIPData object
Expand Down Expand Up @@ -147,7 +152,7 @@ function catch_event(
@SCIP_CALL SCIPcatchEvent(scipd, eventtype, eventhdlrptr, C_NULL, C_NULL)
end

"""
"""
drop_event(scipd::SCIP.SCIPData, eventtype::SCIP_EVENTTYPE, eventhdlr::EVENTHDLR)

Drop an event in SCIP. This function is a wrapper around the SCIPdropEvent function.
Expand Down
13 changes: 9 additions & 4 deletions test/eventhdlr.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Copyright (c) 2018 Felipe Serrano, Miles Lubin, Robert Schwarz, and contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.

# A simple testcase to test the event handler functionality.
# It is assumed that test/sepa_support.jl is already included
using SCIP
Expand Down Expand Up @@ -67,7 +72,7 @@ end
)
MOI.set(optimizer, MOI.ObjectiveSense(), MOI.MIN_SENSE)

# add eventhandler
# add eventhandler
eventhdlr = FirstLPEventTest.FirstLPEvent(inner, 10)
SCIP.include_event_handler(
inner,
Expand All @@ -81,7 +86,7 @@ end
# solve the problem
SCIP.@SCIP_CALL SCIP.SCIPsolve(inner.scip[])

# test if the event handler worked
# test if the event handler worked
@test eventhdlr.firstlpobj != 10.0

# free the problem
Expand Down Expand Up @@ -121,7 +126,7 @@ end
)
MOI.set(optimizer, MOI.ObjectiveSense(), MOI.MIN_SENSE)

# add eventhandler
# add eventhandler
eventhdlr = FirstLPEventTest.FirstLPEvent(inner, 10)
SCIP.include_event_handler(
inner,
Expand All @@ -135,7 +140,7 @@ end
# solve the problem
SCIP.@SCIP_CALL SCIP.SCIPsolve(inner.scip[])

# test if the event handler worked
# test if the event handler worked
@test eventhdlr.firstlpobj != 10.0

# free the problem
Expand Down
Loading