Skip to main content

Basic array attribute question

Answered

Comments

3 comments

  • Jaromił Najman
    • Gurobi Staff

    Can someone point me to some documentation on this topic?  Some list of which are used where? 

    You can access attribute array via the GRBgetXXXattrarray and GRBgetXXXattrarray functions.

    if you are interested only in some specifically indexed variables, then you could use the corresponding \(\texttt{list}\) functions, see C documentation of Attribute Management.

    Best regards, 
    Jaromił

    0
  • Nate Bragg
    • Gurobi-versary
    • First Comment
    • First Question

    I understand that.  I'm not asking about which functions I can use.  I saw those in the API.

    What I'm asking is which ATTRIBUTES refer to arrays and which don't.  Clearly, there are some that do (such as X, which I mentioned, as well as LB and UB and others).  Other attributes are not arrays (I presume NumConstrs is not an array).  I don't know which are which.  Which are arrays?

    0
  • Jaromił Najman
    • Gurobi Staff

    Thank you for clarifying.

    From the Attributes documentation

    The following tables list the full set of Gurobi attributes. The attributes have been grouped by type: model attributes take scalar values, while variable, linear constraint, SOS constraint, quadratic constraint, and general constraint attributes contain one entry per variable or constraint in the model. The APIs provide methods to query attribute values for individual constraints or variables, or to query their values for arrays of constraints or variables (refer to our Attribute Examples section for examples). Array queries are generally more efficient. 

    In addition Solution Quality, Multi-Objective, Multi-Scenario, and Batch attributes are all scalar values.

    Best regards, 
    Jaromił

    0

Please sign in to leave a comment.