Skip to main content

How to retrieve a constraint matrix of (MI)LP in a sparse format in C++?

Answered

Comments

1 comment

  • Jaromił Najman
    Gurobi Staff Gurobi Staff

    Hi Kudria,

    There is no dedicated C++ method to return the coefficient matrix in a compressed format. The APIs for C++, Java, and C# are object oriented and you would have to iterate over either Column or Constraint object and construct a CSR format on your own. However, in your case since you are using C++, you can use the C function GRBgetconstrs(), which will do the job for you.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.