Skip to content

Commit

Permalink
Possibility to obtain custom data associated to a column in a disaggr…
Browse files Browse the repository at this point in the history
…egated solution.
  • Loading branch information
rrsadykov committed Nov 28, 2023
1 parent 841c500 commit 378c566
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/soldisaggregation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,10 @@ value(info::AbstractColumnInfo, x::JuMP.VariableRef) = value(info, x.index)
value(info::AbstractColumnInfo, ::MOI.VariableIndex) = error(
"value(::$(typeof(info)), ::MOI.VariableIndex) not defined."
)

"""
customdata(info)
Returns the custom data attached to the master column variable associated to `info`.
"""
customdata(info::AbstractColumnInfo) = error("customdata(::$(typeof(info))) not defined.")
3 changes: 3 additions & 0 deletions test/soldisaggregation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ function test_sol_disagg()
@test_throws ErrorException(
"value(::ColumnInfo) not defined."
) BlockDecomposition.value(ColumnInfo())
@test_throws ErrorException(
"customdata(::ColumnInfo) not defined."
) BlockDecomposition.customdata(ColumnInfo())
@test_throws ErrorException(
"value(::ColumnInfo, ::MOI.VariableIndex) not defined."
) BlockDecomposition.value(ColumnInfo(), x)
Expand Down

0 comments on commit 378c566

Please sign in to comment.