Knitro attributes
Knitro exposes a set of read-only attributes that can be queried after a solve to inspect model properties and solution statistics. See Querying attributes programmatically for how to query attributes in each interface.
Model
Name |
API constant |
ID |
Type |
Description |
|---|---|---|---|---|
|
|
|
integer |
Number of variables in the model. |
|
|
|
integer |
Number of constraints in the model. |
|
|
|
integer |
Number of complementarity constraints in the model. |
|
|
|
integer |
Number of residuals in the model (for least-squares problems). |
|
|
|
integer |
Objective goal: 0 for minimize, 1 for maximize. |
|
|
|
integer |
Type of objective function: -1 for constant, 0 for general, 1 for linear, 2 for quadratic. |
|
|
|
long integer |
Number of nonzeros in the objective gradient. |
|
|
|
long integer |
Number of nonzeros in the constraint Jacobian. |
|
|
|
long integer |
Number of nonzeros in the Hessian of the Lagrangian. |
General
Name |
API constant |
ID |
Type |
Description |
|---|---|---|---|---|
|
|
|
integer |
Number of iterations performed by the solver for continuous solves. |
|
|
|
integer |
Number of conjugate gradient iterations performed. |
|
|
|
integer |
Number of function/constraint evaluations. |
|
|
|
integer |
Number of gradient evaluations. |
|
|
|
integer |
Number of Hessian evaluations. |
|
|
|
integer |
Number of Hessian-vector product evaluations. |
|
|
|
double |
Final objective function value. |
|
|
|
double |
Absolute feasibility error at the solution. |
|
|
|
double |
Relative feasibility error at the solution. |
|
|
|
double |
Absolute optimality error at the solution. |
|
|
|
double |
Relative optimality error at the solution. |
|
|
|
double |
CPU time spent in the solve (in seconds). |
|
|
|
double |
Real/wall-clock time spent in the solve (in seconds). |
MIP
Name |
API constant |
ID |
Type |
Description |
|---|---|---|---|---|
|
|
|
integer |
Number of nodes explored in the MIP branch-and-bound tree. |
|
|
|
integer |
Number of subproblem solves in the MIP algorithm. |
|
|
|
double |
Absolute gap between incumbent and relaxation bound in MIP. |
|
|
|
double |
Relative gap between incumbent and relaxation bound in MIP. |
|
|
|
double |
Objective value of the current best integer solution in MIP. |
|
|
|
double |
Best relaxation bound in MIP. |