# SOCP with Vector{GenericAffExpr}

**URL:** <https://discourse.julialang.org/t/socp-with-vector-genericaffexpr/54844>\
**Category:** Optimization (Mathematical)\
**Tags:** jump\
**Created:** [February 8, 2021, 2:19pm UTC](https://discourse.julialang.org/t/socp-with-vector-genericaffexpr/54844 "2021-02-08T14:19:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)\
**Post date:** [February 8, 2021, 2:19pm UTC](https://discourse.julialang.org/t/socp-with-vector-genericaffexpr/54844/1 "2021-02-08T14:19:04Z")

</div>

Hi

Is it possible to add a SOCP constraint to Gurobi through JuMP using

`@constraint(model, vec in SecondOrderCone())`

where `vec` is a `Vector{GenericAffExpr{Float64,VariableRef}}` ?

I got the impression it is possible adding the bridge that allows `VectorAffineFunction` -in- `SOC` (as discussed [here](https://github.com/jump-dev/MathOptInterface.jl/pull/478)) but I don’t get how to add that bridge.

Best,

Michael.

---

<div class="post-metadata">

**Author:** ![blegat](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/blegat/32/217090_2.png) [@blegat](https://discourse.julialang.org/u/blegat)\
**Post date:** [February 8, 2021, 3:26pm UTC](https://discourse.julialang.org/t/socp-with-vector-genericaffexpr/54844/2 "2021-02-08T15:26:02Z")

</div>

You can do it with the [add\_bridge](https://jump.dev/JuMP.jl/stable/extensions/#JuMP.add_bridge) function with the [SOCtoNonConvexQuadBridge](https://jump.dev/MathOptInterface.jl/stable/apireference/#MathOptInterface.Bridges.Constraint.SOCtoNonConvexQuadBridge):

```julia
add_bridge(model, MOI.Bridges.Constraint.SOCtoNonConvexQuadBridge)

```

---

<div class="post-metadata">

**Author:** ![mposs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mposs/32/21087_2.png) [@mposs](https://discourse.julialang.org/u/mposs)\
**Post date:** [February 8, 2021, 3:48pm UTC](https://discourse.julialang.org/t/socp-with-vector-genericaffexpr/54844/3 "2021-02-08T15:48:34Z")

</div>

Thanks!
