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 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 |
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 LP 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 |
Whether MIP solution 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 |
|
Double |
Whether IIS is available |
|
Integer |
Whether feasibility LP-relaxation solution is available |
|
Integer |
Whether the computed IIS is minimal |
|
Integer |
Whether sensitivity analysis results are available for LP problem |
|
Double |
The LP objective value |
|
Double |
Best integer objective value for MIP |
|
Double |
Best bound for MIP |
|
Double |
Best relative gap for MIP |
|
Double |
Feasibility relaxation objective value |
|
Double |
The time spent for the optimization (in seconds) |
LpStatusInteger attribute.
The LP status. Please refer to General Constants: Solution Status for possible values.
MipStatusInteger attribute.
The MIP status. Please refer to General Constants: Solution Status for possible values.
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
HasLpSolInteger attribute.
Whether LP 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.
HasMipSolInteger attribute.
Whether MIP solution 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.
HasSensitivityInteger attribute.
Whether sensitivity analysis results are available for LP problem.
LpObjvalDouble attribute.
The LP objective value.
BestObjDouble attribute.
Best integer objective value for MIP.
BestBndDouble attribute.
Best bound for MIP.
BestGapDouble attribute.
Best relative gap for MIP.
FeasRelaxObjDouble attribute.
Feasibility relaxation objective value.
SolvingTimeDouble attribute.
The time spent for the optimization (in seconds).
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