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 |
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 is a MIP |
Cols
Integer attribute.
Number of variables (columns) in the problem.
PSDCols
Integer attribute.
Number of PSD variables in the problem.
Rows
Integer attribute.
Number of constraints (rows) in the problem.
Elems
Integer attribute.
Number of non-zero elements in the coefficient matrix.
QElems
Integer attribute.
Number of non-zero quadratic elements in the quadratic objective function.
PSDElems
Integer attribute.
Number of PSD terms in objective function.
SymMats
Integer attribute.
Number of symmetric matrices in the problem.
Bins
Integer attribute.
Number of binary variables.
Ints
Integer attribute.
Number of integer variables.
Soss
Integer attribute.
Number of SOS constraints.
Cones
Integer attribute.
Number of Second-Order-Cone constraints.
ExpCones
Integer attribute.
Number of exponential cone constraints.
AffineCones
Integer attribute.
Number of affine cone constraints.
QConstrs
Integer attribute.
Number of quadratic constraints.
PSDConstrs
Integer attribute.
Number of PSD constraints.
LMIConstrs
Integer attribute.
Number of LMI (Linear Matrix Inequalities) constraints.
Indicators
Integer attribute.
Number of indicator constraints.
ObjSense
Integer attribute.
The optimization direction.
ObjConst
Double attribute.
The constant part of the objective function.
HasQObj
Integer attribute.
Whether the problem has quadratic objective function.
HasPSDObj
Integer attribute.
Whether the problem has PSD terms in objective function.
IsMIP
Integer 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 |
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) |
LpStatus
Integer attribute.
The LP status. Please refer to General Constants: Solution Status for possible values.
MipStatus
Integer attribute.
The MIP status. Please refer to General Constants: Solution Status for possible values.
SimplexIter
Integer attribute.
Number of simplex iterations performed.
BarrierIter
Integer attribute.
Number of barrier iterations performed.
NodeCnt
Integer attribute.
Number of explored nodes.
PoolSols
Integer attribute.
Number of solutions in solution pool.
TuneResults
Integer attribute.
Number of parameter tuning results
HasLpSol
Integer attribute.
Whether LP solution is available.
HasBasis
Integer attribute.
Whether LP basis is available.
HasDualFarkas
Integer attribute.
Whether the dual Farkas of an infeasible LP problem is available.
HasPrimalRay
Integer attribute.
Whether the primal ray of an unbounded LP problem is available.
HasMipSol
Integer attribute.
Whether MIP solution is available.
IISCols
Integer attribute.
Number of bounds of columns in IIS.
IISRows
Integer attribute.
Number of rows in IIS.
IISSOSs
Integer attribute.
Number of SOS constraints in IIS.
IISIndicators
Integer attribute.
Number of indicator constraints in IIS.
HasIIS
Integer attribute.
Whether IIS is available.
HasFeasRelaxSol
Integer attribute.
Whether feasibility LP-relaxation solution is available.
IsMinIIS
Integer attribute.
Whether the computed IIS is minimal.
LpObjval
Double attribute.
The LP objective value.
BestObj
Double attribute.
Best integer objective value for MIP.
BestBnd
Double attribute.
Best bound for MIP.
BestGap
Double attribute.
Best relative gap for MIP.
FeasRelaxObj
Double attribute.
Feasibility relaxation objective value.
SolvingTime
Double 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