Attributes¶
To query and modify properties of a COPT model is through the attribute interface. A variety of different attributes are available, and they can be associated with solutions, or the model.
Problem related¶
Problem related attributes provide the relevant information of the model composition and description. The names and descriptions of these attributes are summarized below.
Name |
Type |
Description |
|---|---|---|
Integer |
Number of variables (columns) in the problem |
|
Integer |
Number of PSD variables in the problem |
|
Integer |
Number of constraints (rows) in the problem |
|
Integer |
Number of non-zero elements in the coefficient matrix |
|
Integer |
Number of non-zero quadratic elements in the quadratic objective function |
|
Integer |
Number of PSD terms in objective function |
|
Integer |
Number of symmetric matrices in the problem |
|
Integer |
Number of binary variables |
|
Integer |
Number of integer variables |
|
Integer |
Number of SOS constraints |
|
Integer |
Number of Second-Order-Cone constraints |
|
Integer |
Number of exponential cone constraints |
|
Integer |
Number of affine cone constraints |
|
Integer |
Number of quadratic constraints |
|
Integer |
Number of PSD constraints |
|
Integer |
Number of LMI (Linear Matrix Inequalities) constraints |
|
Integer |
Number of indicator constraints |
|
Integer |
Number of objectives in a multi-objective model |
|
Integer |
The optimization direction |
|
Double |
The constant part of the objective function |
|
Integer |
Whether the problem has quadratic objective function |
|
Integer |
Whether the problem has PSD terms in objective function |
|
Integer |
Whether the problem has nonlinear terms in objective function |
|
Integer |
Whether the problem is a MIP |
ColsInteger attribute.
Number of variables (columns) in the problem.
PSDColsInteger attribute.
Number of PSD variables in the problem.
RowsInteger attribute.
Number of constraints (rows) in the problem.
ElemsInteger attribute.
Number of non-zero elements in the coefficient matrix.
QElemsInteger attribute.
Number of non-zero quadratic elements in the quadratic objective function.
PSDElemsInteger attribute.
Number of PSD terms in objective function.
SymMatsInteger attribute.
Number of symmetric matrices in the problem.
BinsInteger attribute.
Number of binary variables.
IntsInteger attribute.
Number of integer variables.
SossInteger attribute.
Number of SOS constraints.
ConesInteger attribute.
Number of Second-Order-Cone constraints.
ExpConesInteger attribute.
Number of exponential cone constraints.
AffineConesInteger attribute.
Number of affine cone constraints.
QConstrsInteger attribute.
Number of quadratic constraints.
PSDConstrsInteger attribute.
Number of PSD constraints.
LMIConstrsInteger attribute.
Number of LMI (Linear Matrix Inequalities) constraints.
IndicatorsInteger attribute.
Number of indicator constraints.
MultiObjsInteger attribute.
Number of objectives in a multi-objective model.
ObjSenseInteger attribute.
The optimization direction.
ObjConstDouble attribute.
The constant part of the objective function.
HasQObjInteger attribute.
Whether the problem has quadratic objective function.
HasPSDObjInteger attribute.
Whether the problem has PSD terms in objective function.
HasNLObjInteger attribute.
Whether the problem has nonlinear terms in objective function.
IsMIPInteger attribute.
Whether the problem is a MIP.
Solution related¶
Solution related attributes provide the relevant information of the solution composition and description. The names and descriptions of these attributes are summarized below.
Name |
Type |
Description |
|---|---|---|
Integer |
Optimization status |
|
Integer |
The LP status |
|
Integer |
The MIP status |
|
Integer |
Number of simplex iterations performed |
|
Integer |
Number of barrier iterations performed |
|
Integer |
Number of explored nodes |
|
Integer |
Number of solutions in solution pool |
|
Integer |
Number of parameter tuning results |
|
Integer |
Whether a solution is available |
|
Integer |
Whether LP solution is available |
|
Integer |
Whether MIP solution is available |
|
Integer |
Whether LP basis is available |
|
Integer |
Whether the dual Farkas of an infeasible LP problem is available |
|
Integer |
Whether the primal ray of an unbounded LP problem is available |
|
Integer |
Number of bounds of columns in IIS |
|
Integer |
Number of rows in IIS |
|
Integer |
Number of SOS constraints in IIS |
|
Integer |
Number of indicator constraints in IIS |
|
Integer |
Whether IIS is available |
|
Integer |
Whether feasibility LP-relaxation solution is available |
|
Integer |
Whether the computed IIS is minimal |
|
Double |
Feasibility relaxation objective value |
|
Integer |
Whether sensitivity analysis results are available for LP problem |
|
Double |
Optimal objective value |
|
Double |
Current best bound on the optimal objective value |
|
Double |
Optimal objective value for continuous convex optimization problem |
|
Double |
Current best objective value for MIP |
|
Double |
Current best bound for MIP |
|
Double |
Current best relative gap for MIP |
|
Double |
The time spent for the optimization (in seconds) |
StatusInteger attribute.
Optimization status.
Please refer to General Constants: Solution status for possible values.
LpStatusInteger attribute.
The LP status.
MipStatusInteger attribute.
The MIP status.
SimplexIterInteger attribute.
Number of simplex iterations performed.
BarrierIterInteger attribute.
Number of barrier iterations performed.
NodeCntInteger attribute.
Number of explored nodes.
PoolSolsInteger attribute.
Number of solutions in solution pool.
TuneResultsInteger attribute.
Number of parameter tuning results.
HasSolInteger attribute.
Whether a solution is available.
HasLpSolInteger attribute.
Whether LP solution is available.
HasMipSolInteger attribute.
Whether MIP solution is available.
HasBasisInteger attribute.
Whether LP basis is available.
HasDualFarkasInteger attribute.
Whether the dual Farkas of an infeasible LP problem is available.
HasPrimalRayInteger attribute.
Whether the primal ray of an unbounded LP problem is available.
IISColsInteger attribute.
Number of bounds of columns in IIS.
IISRowsInteger attribute.
Number of rows in IIS.
IISSOSsInteger attribute.
Number of SOS constraints in IIS.
IISIndicatorsInteger attribute.
Number of indicator constraints in IIS.
HasIISInteger attribute.
Whether IIS is available.
HasFeasRelaxSolInteger attribute.
Whether feasibility LP-relaxation solution is available.
IsMinIISInteger attribute.
Whether the computed IIS is minimal.
FeasRelaxObjDouble attribute.
Feasibility relaxation objective value.
HasSensitivityInteger attribute.
Whether sensitivity analysis results are available for LP problem.
ObjValDouble attribute.
Optimal objective value.
LpObjvalDouble attribute.
Optimal objective value for continuous convex optimization problem.
ObjBoundDouble attribute.
Current best bound on the optimal objective value.
BestObjDouble attribute.
Current best objective value for MIP.
BestBndDouble attribute.
Current best bound for MIP.
BestGapDouble attribute.
Current best relative gap for MIP.
SolvingTimeDouble attribute.
The time spent for the optimization (in seconds).
Note
The attributes LpStatus, MipStatus, HasLpSol, HasMipSol, LpObjval, BestObj and BestBnd are deprecated.
It is recommended to use Status, HasSol, ObjVal and ObjBound instead,
as they provide a unified interface for querying the solution status, whether a solution is available,
and optimal objective value across all supported problem types, including linear programming, integer programming, and convex/non-convex optimization problems.
Methods for accessing attributes¶
In different programming interfaces, the ways to access attributes are slightly different. For details, please refer to the corresponding chapters for each programming language API:
C++ API: C++ API Reference: Attributes
C# API: C# API Reference: Attributes
Java API: Java API Reference: Attributes
Python API: Python API Reference: Attributes