Try our new documentation site (beta).




GRBModel::get()

Query the value(s) of a parameter or attribute. Use this method for parameters, for scalar model attributes, or for arrays of constraint or variable attributes.

double get ( GRB_DoubleParam param )

    Query the value of a double-valued parameter.

    Arguments:

    param: The parameter being queried.

    Return value:

    The current value of the requested parameter.

int get ( GRB_IntParam param )

    Query the value of an int-valued parameter.

    Arguments:

    param: The parameter being queried.

    Return value:

    The current value of the requested parameter.

string get ( GRB_StringParam param )

    Query the value of a string-valued parameter.

    Arguments:

    param: The parameter being queried.

    Return value:

    The current value of the requested parameter.

char* get ( GRB_CharAttr attr,
    const GRBVar* vars,
    int count )
    Query a char-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being queried.

    vars: An array of variables whose attribute values are being queried.

    count: The number of variable attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input variable. Note that the result is heap-allocated, and must be returned to the heap by the user.

char* get ( GRB_CharAttr attr,
    const GRBConstr* constrs,
    int count )
    Query a char-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being queried.

    constrs: An array of constraints whose attribute values are being queried.

    count: The number of constraint attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input constraint. Note that the result is heap-allocated, and must be returned to the heap by the user.

char* get ( GRB_CharAttr attr,
    const GRBQConstr* qconstrs,
    int count )
    Query a char-valued quadratic constraint attribute for an array of quadratic constraints.

    Arguments:

    attr: The attribute being queried.

    constrs: An array of quadratic constraints whose attribute values are being queried.

    count: The number of quadratic constraint attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input quadratic constraint. Note that the result is heap-allocated, and must be returned to the heap by the user.

double get ( GRB_DoubleAttr attr )

    Query the value of a double-valued model attribute.

    Arguments:

    attr: The attribute being queried.

    Return value:

    The current value of the requested attribute.

double* get ( GRB_DoubleAttr attr,
    const GRBVar* vars,
    int count )
    Query a double-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being queried.

    vars: An array of variables whose attribute values are being queried.

    count: The number of variable attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input variable. Note that the result is heap-allocated, and must be returned to the heap by the user.

double* get ( GRB_DoubleAttr attr,
    const GRBConstr* constrs,
    int count )
    Query a double-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being queried.

    constrs: An array of constraints whose attribute values are being queried.

    count: The number of constraint attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input constraint. Note that the result is heap-allocated, and must be returned to the heap by the user.

double* get ( GRB_DoubleAttr attr,
    const GRBQConstr* qconstrs,
    int count )
    Query a double-valued quadratic constraint attribute for an array of quadratic constraints.

    Arguments:

    attr: The attribute being queried.

    constrs: An array of quadratic constraints whose attribute values are being queried.

    count: The number of quadratic constraint attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input quadratic constraint. Note that the result is heap-allocated, and must be returned to the heap by the user.

int get ( GRB_IntAttr attr )

    Query the value of an int-valued model attribute.

    Arguments:

    attr: The attribute being queried.

    Return value:

    The current value of the requested attribute.

int* get ( GRB_IntAttr attr,
    const GRBVar* vars,
    int count )
    Query an int-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being queried.

    vars: An array of variables whose attribute values are being queried.

    count: The number of variable attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input variable. Note that the result is heap-allocated, and must be returned to the heap by the user.

int* get ( GRB_IntAttr attr,
    const GRBConstr* constrs,
    int count )
    Query an int-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being queried.

    constrs: An array of constraints whose attribute values are being queried.

    count: The number of constraint attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input constraint. Note that the result is heap-allocated, and must be returned to the heap by the user.

string get ( GRB_StringAttr attr )

    Query the value of a string-valued model attribute.

    Arguments:

    attr: The attribute being queried.

    Return value:

    The current value of the requested attribute.

string* get ( GRB_StringAttr attr,
    const GRBVar* vars,
    int count )
    Query a string-valued variable attribute for an array of variables.

    Arguments:

    attr: The attribute being queried.

    vars: An array of variables whose attribute values are being queried.

    count: The number of variable attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input variable. Note that the result is heap-allocated, and must be returned to the heap by the user.

string* get ( GRB_StringAttr attr,
    const GRBConstr* constrs,
    int count )
    Query a string-valued constraint attribute for an array of constraints.

    Arguments:

    attr: The attribute being queried.

    constrs: An array of constraints whose attribute values are being queried.

    count: The number of constraint attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input constraint. Note that the result is heap-allocated, and must be returned to the heap by the user.

string* get ( GRB_StringAttr attr,
    const GRBQConstr* qconstrs,
    int count )
    Query a string-valued quadratic constraint attribute for an array of quadratic constraints.

    Arguments:

    attr: The attribute being queried.

    constrs: An array of quadratic constraints whose attribute values are being queried.

    count: The number of quadratic constraint attributes to retrieve.

    Return value:

    The current values of the requested attribute for each input quadratic constraint. Note that the result is heap-allocated, and must be returned to the heap by the user.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.

Search

Gurobi Optimization