Skip to content

Commit f52e6c4

Browse files
authored
Attributes for initial columns callback (#86)
* improve docstring VarsOfSameDwSpInMaster * initial columns callback * fix
1 parent 4138296 commit f52e6c4

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

src/callbacks.jl

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,6 @@ function callback_ub(cbdata, x::JuMP.VariableRef)
109109
end
110110

111111
"""
112-
AbstractCustomData
113-
114112
Every custom data assigned to a pricing variable or a user cut should inherit from it.
115113
"""
116114
abstract type AbstractCustomData end
@@ -123,3 +121,29 @@ end
123121
MathOptInterface.Utilities.map_indices(
124122
variable_map::MathOptInterface.Utilities.IndexMap, x::AbstractCustomData
125123
) = x
124+
125+
"""
126+
A callback to provide initial columns to the optimizer before starting the optimization.
127+
"""
128+
struct InitialColumnsCallback <: MOI.AbstractCallback end
129+
130+
"""
131+
InitialColumn(cbdata)
132+
133+
Solution to a subproblem that is provided to the optimizer ahead of optimization.
134+
"""
135+
struct InitialColumn{CbDataType} <: MOI.AbstractSubmittable
136+
callback_data::CbDataType
137+
end
138+
139+
function MOI.submit(
140+
model::Model,
141+
cb::InitialColumn,
142+
variables::Vector{JuMP.VariableRef},
143+
values::Vector{Float64},
144+
custom_data = nothing
145+
)
146+
return MOI.submit(
147+
JuMP.backend(model), cb, JuMP.index.(variables), values, custom_data
148+
)
149+
end

0 commit comments

Comments
 (0)