File tree Expand file tree Collapse file tree 2 files changed +6
-5
lines changed
src/Bridges/Variable/bridges Expand file tree Collapse file tree 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change 9090
9191function MOI. get (
9292 :: MOI.ModelLike ,
93- :: MOI.ConstraintDual ,
93+ attr :: MOI.ConstraintDual ,
9494 :: ZerosBridge{T} ,
9595) where {T}
96- return error (
96+ msg =
9797 " Unable to query the dual of a variable bound that was reformulated " *
9898 " using `ZerosBridge`. This usually arises in conic solvers when a " *
9999 " variable is fixed to a value. As a work-around, instead of creating " *
100100 " a fixed variable using variable bounds like `p == 1`, add an affine " *
101- " equality constraint like `1 * p == 1` (or `[1 * p - 1,] in Zeros(1)`)." ,
102- )
101+ " equality constraint like `1 * p == 1` (or `[1 * p - 1,] in Zeros(1)`)."
102+ return throw (MOI . GetAttributeNotAllowed (attr, msg) )
103103end
104104
105105function MOI. get (
Original file line number Diff line number Diff line change @@ -175,7 +175,8 @@ function test_zeros()
175175 @test MOI. get (bridged_mock, MOI. ConstraintDual (), c1) == 0.0
176176 @test MOI. get (bridged_mock, MOI. ConstraintDual (), c2) == 1.0
177177 attr = MOI. ConstraintDual ()
178- err = ErrorException (
178+ err = MOI. GetAttributeNotAllowed (
179+ attr,
179180 " Unable to query the dual of a variable bound that was reformulated " *
180181 " using `ZerosBridge`. This usually arises in conic solvers when a " *
181182 " variable is fixed to a value. As a work-around, instead of creating " *
You can’t perform that action at this time.
0 commit comments