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

Unsupported MQuadExpr addition- error in setting objective function

回答済み

コメント

2件のコメント

  • 正式なコメント
    Simranjit Kaur
    • Gurobi Staff
    This post is more than three years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum. Or why not try our AI Gurobot?.
  • Jaromił Najman
    • Gurobi Staff

    Hi,

    Currently, binary operations for MQuadExpr and QuadExpr objects are not supported. One way to make your code work would be to work with addVars instead of addMVar

    s1=m.addVars(3,N)
    obj1=0
    for k in range(0,N):
    for i in range(0,3):
    obj1=obj1+s1[i,k]*s1[i,k]

    Best regards,
    Jaromił

     

    0

投稿コメントは受け付けていません。