File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/Bridges/Constraint/bridges Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -299,7 +299,7 @@ function MOI.get(
299
299
# We need canonical, because the downstream bridges may have added
300
300
# additional terms that mean it can't be directly converted to G.
301
301
f = MOI. get (model, MOI. ConstraintFunction (), b. constraint)
302
- return convert (G, MOI. Utilities. canonical (f))
302
+ return MOI . Utilities . convert_approx (G, MOI. Utilities. canonical (f))
303
303
end
304
304
305
305
"""
Original file line number Diff line number Diff line change @@ -361,6 +361,18 @@ function test_first_bridge()
361
361
return
362
362
end
363
363
364
+ function test_approx_convert (T = Float64)
365
+ inner = MOI. Utilities. Model {T} ()
366
+ # `SOCtoRSOC` will rotate the function so there will be small
367
+ # rounding errors when getting the `ConstraintFunction`
368
+ # and we test that it's ignored
369
+ soc = MOI. Bridges. Constraint. SOCR {T} (inner)
370
+ model = MOI. Bridges. Constraint. VectorFunctionize {T} (soc)
371
+ config = MOI. Test. Config (T)
372
+ MOI. Test. test_basic_VectorOfVariables_SecondOrderCone (model, config)
373
+ return
374
+ end
375
+
364
376
end # module
365
377
366
378
TestConstraintFunctionize. runtests ()
You can’t perform that action at this time.
0 commit comments