Skip to main content

@ operator for 2 Mvars

Answered

Comments

1 comment

  • Eli Towle
    Gurobi Staff Gurobi Staff

    This is not possible at the moment, but it has been logged as a feature request. In the meantime, you can use matrix semantics to add the constraints individually:

    m, n, p = 3, 4, 5

    x = model.addMVar((m,n), name='x')
    y = model.addMVar((n,p), name='y')

    model.addConstrs((x[i,:] @ y[:,j] <= 1 for i in range(m) for j in range(p)), name='matrixcon')
    0

Please sign in to leave a comment.