Skip to main content

norm function should take expressions



1 comment

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Brannon,

    It is possible to model what you are after, just with extra steps, eg

    x = m.addMVar((5))
    z = m.addMVar((5))
    m.addConstr(z == x - np.array([1,4,3,0,-2]))

    w = m.addVar()
    m.addConstr(w == gp.norm(z,2))

     I can pass your request onto our developers.  I suspect it is a case of syntactic sugar, and ultimately these auxiliary variables (such as z and w) have to be added either explicitly, like above, or implicitly under the hood.

    - Riley



Please sign in to leave a comment.