Skip to main content

confusion about adding MVar.fromlist()

Answered

Comments

2 comments

  • Riley Clement
    Gurobi Staff Gurobi Staff

    Hi Thomas,

    Our example is incomplete in the sense that it doesn't show the imports.  It's working on the assumption that the following import exists:

    from gurobipy import *

    You can make it work in your example like this:

    x_1d = gp.MVar.fromlist([x0, x1, x2, x3])  # 1-D MVar
    x_2d = gp.MVar.fromlist([[x0, x1], [x2, x3]])  # 2-D MVar

    - Riley

    0
  • Thomas Leveringhaus
    Gurobi-versary
    Collaborator
    Investigator

    Thanks, that works :-)

    0

Please sign in to leave a comment.