From 378c566a389762bfd93b68cc55680ac71e139a0b Mon Sep 17 00:00:00 2001 From: Ruslan Sadykov Date: Tue, 28 Nov 2023 11:12:49 +0100 Subject: [PATCH] Possibility to obtain custom data associated to a column in a disaggregated solution. --- src/soldisaggregation.jl | 7 +++++++ test/soldisaggregation.jl | 3 +++ 2 files changed, 10 insertions(+) diff --git a/src/soldisaggregation.jl b/src/soldisaggregation.jl index 99e3cff..c0fbdaf 100644 --- a/src/soldisaggregation.jl +++ b/src/soldisaggregation.jl @@ -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.") diff --git a/test/soldisaggregation.jl b/test/soldisaggregation.jl index 02ed8ec..be5cf1a 100644 --- a/test/soldisaggregation.jl +++ b/test/soldisaggregation.jl @@ -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)