メインコンテンツへスキップ

confusion about adding MVar.fromlist()

回答済み

コメント

2件のコメント

  • 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

サインインしてコメントを残してください。