Skip to main content

Error when using Sparse matrix with Gurobi variables

Answered

Comments

3 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff 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 Gurobi Staff

    Hi Sagnik,

    Could you provide a minimal working example producing the error you posted?

    In case, you were able to solve the problem, could you provide the solution of how you achieved it?

    Best regards,
    Jaromił

    0
  • Brannon King
    • Gurobi-versary
    • First Comment
    • First Question

    This question is old, but so as it has an answer: you can't use numpy functions on scipy sparse objects. The transpose should be sH.T and the dot product should be done via the @ operator: sH @ D . 

    0

Post is closed for comments.