C++ API Reference
The Cardinal Optimizer provides C++ API library. This chapter documents all COPT constants, including parameters and attributes, and API functions for C++ applications.
Constants
All C++ constants are the same as C constants. Please refer to C API Reference: Constants for more details.
Attributes
All C++ attributes are the same as C attributes. Please refer to C API Reference: Attributes for more details.
In the C++ API, user can get the attribute value by specifying the attribute name. The provided functions are as follows, please refer to C++ API: Model Class for details.
Model::GetIntAttr()
: Get value of a COPT integer attribute.Model::GetDblAttr()
: Get value of a COPT double attribute.
Information
All C++ information is the same as C information. Please refer to C API Reference: Information .
In the C++ API, user can get or set the information value by specifying the information name.
The functions provided are as follows, please refer to C++ Model class for details.
Information of variables or constraints can also be obtained/set through the Get()/Set()
function of themselves.
Model::Get()
: Get the value of information related to the variables or constraints.Model::Set()
: Set the value of information related to the variables or constraints.
Parameters
All C++ parameters are the same as C parameters. Please refer to C API Reference: Parameters for more details.
In the C++ API, user can get and set the parameter value by specifying the parameter name. The provided functions are as follows, please refer to C++ Model class for details.
Get detailed information of the specified parameter (current value/max/min):
Model::GetParamInfo()
Get the current value of the specified integer/double parameter:
Model::GetIntParam()
/Model::GetDblParam()
Set the specified integer/double parameter value:
Model::SetIntParam()
/Model::SetDblParam()
C++ Modeling Classes
This chapter documents COPT C++ interface. Users may refer to C++ classes described below for details of how to construct and solve C++ models.
Envr
Essentially, any C++ application using Cardinal Optimizer should start with a COPT environment. COPT models are always associated with a COPT environment. User must create an environment object before populating models. User generally only need a single environment object in program.
EnvrConfig
If user connects to COPT remote services, such as floating token server or compute cluster, it is necessary to add config settings with EnvrConfig object.
Model
In general, a COPT model consists of a set of variables, a (linear) objective function on these variables, a set of constraints on there varaibles, etc. COPT model class encapsulates all required methods for constructing a COPT model.
- Model::AddCone()
- Model::AddCone()
- Model::AddCone()
- Model::AddConstr()
- Model::AddConstr()
- Model::AddConstr()
- Model::AddConstr()
- Model::AddConstrs()
- Model::AddConstrs()
- Model::AddConstrs()
- Model::AddConstrs()
- Model::AddConstrs()
- Model::AddDenseMat()
- Model::AddDenseMat()
- Model::AddDiagMat()
- Model::AddDiagMat()
- Model::AddDiagMat()
- Model::AddDiagMat()
- Model::AddExpCone()
- Model::AddExpCone()
- Model::AddExpCone()
- Model::AddEyeMat()
- Model::AddGenConstrIndicator()
- Model::AddGenConstrIndicator()
- Model::AddGenConstrIndicator()
- Model::AddGenConstrIndicators()
- Model::AddGenConstrIndicators()
- Model::AddLazyConstr()
- Model::AddLazyConstr()
- Model::AddLazyConstr()
- Model::AddLazyConstrs()
- Model::AddLmiConstr()
- Model::AddMConstr()
- Model::AddMQConstr()
- Model::AddMVar()
- Model::AddMVar()
- Model::AddMVar()
- Model::AddOnesMat()
- Model::AddPsdConstr()
- Model::AddPsdConstr()
- Model::AddPsdConstr()
- Model::AddPsdConstr()
- Model::AddPsdVar()
- Model::AddPsdVars()
- Model::AddPsdVars()
- Model::AddQConstr()
- Model::AddQConstr()
- Model::AddQConstr()
- Model::AddSos()
- Model::AddSos()
- Model::AddSparseMat()
- Model::AddSymMat()
- Model::AddUserCut()
- Model::AddUserCut()
- Model::AddUserCut()
- Model::AddUserCuts()
- Model::AddVar()
- Model::AddVar()
- Model::AddVars()
- Model::AddVars()
- Model::AddVars()
- Model::AddVars()
- Model::AddVars()
- Model::AddVars()
- Model::AddVars()
- Model::Clear()
- Model::Clone()
- Model::ComputeIIS()
- Model::DelPsdObj()
- Model::DelQuadObj()
- Model::FeasRelax()
- Model::FeasRelax()
- Model::Get()
- Model::Get()
- Model::Get()
- Model::Get()
- Model::GetCoeff()
- Model::GetCol()
- Model::GetColBasis()
- Model::GetCone()
- Model::GetConeBuilders()
- Model::GetConeBuilders()
- Model::GetCones()
- Model::GetConstr()
- Model::GetConstrBuilder()
- Model::GetConstrBuilders()
- Model::GetConstrByName()
- Model::GetConstrLowerIIS()
- Model::GetConstrs()
- Model::GetConstrUpperIIS()
- Model::GetDblAttr()
- Model::GetDblParam()
- Model::GetExpCone()
- Model::GetExpConeBuilders()
- Model::GetExpConeBuilders()
- Model::GetExpCones()
- Model::GetGenConstr()
- Model::GetGenConstrByName()
- Model::GetGenConstrIndicator()
- Model::GetGenConstrIndicators()
- Model::GetGenConstrs()
- Model::GetIndicatorIIS()
- Model::GetIntAttr()
- Model::GetIntParam()
- Model::GetLmiCoeff()
- Model::GetLmiConstr()
- Model::GetLmiConstrByName()
- Model::GetLmiConstrs()
- Model::GetLmiRhs()
- Model::GetLmiRow()
- Model::GetLpSolution()
- Model::GetObjective()
- Model::GetParamAttrType()
- Model::GetParamInfo()
- Model::GetParamInfo()
- Model::GetPoolObjVal()
- Model::GetPoolSolution()
- Model::GetPsdCoeff()
- Model::GetPsdConstr()
- Model::GetPsdConstrBuilder()
- Model::GetPsdConstrBuilders()
- Model::GetPsdConstrByName()
- Model::GetPsdConstrs()
- Model::GetPsdObjective()
- Model::GetPsdRow()
- Model::GetPsdRow()
- Model::GetPsdVar()
- Model::GetPsdVarByName()
- Model::GetPsdVars()
- Model::GetQConstr()
- Model::GetQConstrBuilder()
- Model::GetQConstrBuilders()
- Model::GetQConstrByName()
- Model::GetQConstrs()
- Model::GetQuadObjective()
- Model::GetQuadRow()
- Model::GetQuadRow()
- Model::GetRow()
- Model::GetRowBasis()
- Model::GetSolution()
- Model::GetSos()
- Model::GetSosBuilders()
- Model::GetSosBuilders()
- Model::GetSOSIIS()
- Model::GetSoss()
- Model::GetSymMat()
- Model::GetVar()
- Model::GetVarByName()
- Model::GetVarLowerIIS()
- Model::GetVars()
- Model::GetVarUpperIIS()
- Model::Interrupt()
- Model::LoadMipStart()
- Model::LoadTuneParam()
- Model::Read()
- Model::ReadBasis()
- Model::ReadBin()
- Model::ReadCbf()
- Model::ReadLp()
- Model::ReadMps()
- Model::ReadMst()
- Model::ReadParam()
- Model::ReadSdpa()
- Model::ReadSol()
- Model::ReadTune()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Remove()
- Model::Reset()
- Model::ResetAll()
- Model::ResetParam()
- Model::Set()
- Model::Set()
- Model::Set()
- Model::SetBasis()
- Model::SetCallback()
- Model::SetCoeff()
- Model::SetCoeffs()
- Model::SetDblParam()
- Model::SetIntParam()
- Model::SetLmiCoeff()
- Model::SetLmiRhs()
- Model::SetLpSolution()
- Model::SetMipStart()
- Model::SetMipStart()
- Model::SetMipStart()
- Model::SetNames()
- Model::SetNames()
- Model::SetNames()
- Model::SetNames()
- Model::SetNames()
- Model::SetNames()
- Model::SetNames()
- Model::SetObjConst()
- Model::SetObjective()
- Model::SetObjSense()
- Model::SetPsdCoeff()
- Model::SetPsdObjective()
- Model::SetQuadObjective()
- Model::SetSlackBasis()
- Model::SetSolverLogCallback()
- Model::SetSolverLogFile()
- Model::Solve()
- Model::SolveLp()
- Model::Tune()
- Model::Write()
- Model::WriteBasis()
- Model::WriteBin()
- Model::WriteIIS()
- Model::WriteLp()
- Model::WriteMps()
- Model::WriteMpsStr()
- Model::WriteMst()
- Model::WriteParam()
- Model::WritePoolSol()
- Model::WriteRelax()
- Model::WriteSol()
- Model::WriteTuneParam()
Var
COPT variable object. Variables are always associated with a particular model. User creates a variable object by adding a variable to a model, rather than by using constructor of Var class.
VarArray
COPT variable array object. To store and access a set of C++ Var objects, Cardinal Optimizer provides C++ VarArray class, which defines the following methods.
Expr
COPT linear expression object. A linear expression consists of a constant term, a list of terms of variables and associated coefficients. Linear expressions are used to build constraints.
- Expr::Expr()
- Expr::Expr()
- Expr::AddConstant()
- Expr::AddExpr()
- Expr::AddTerm()
- Expr::AddTerms()
- Expr::Clone()
- Expr::Evaluate()
- Expr::GetCoeff()
- Expr::GetConstant()
- Expr::GetVar()
- Expr::operator*=()
- Expr::operator*()
- Expr::operator*()
- Expr::operator*()
- Expr::operator+=()
- Expr::operator+()
- Expr::operator-=()
- Expr::operator-()
- Expr::Remove()
- Expr::Remove()
- Expr::Reserve()
- Expr::SetCoeff()
- Expr::SetConstant()
- Expr::Size()
Constraint
COPT constraint object. Constraints are always associated with a particular model. User creates a constraint object by adding a constraint to a model, rather than by using constructor of Constraint class.
ConstrArray
COPT constraint array object. To store and access a set of C++ Constraint objects, Cardinal Optimizer provides C++ ConstrArray class, which defines the following methods.
ConstrBuilder
COPT constraint builder object. To help building a constraint, given a linear expression, constraint sense and right-hand side value, Cardinal Optimizer provides C++ ConstrBuilder class, which defines the following methods.
ConstrBuilderArray
COPT constraint builder array object. To store and access a set of C++ ConstrBuilder objects, Cardinal Optimizer provides C++ ConstrBuilderArray class, which defines the following methods.
Column
COPT column object. A column consists of a list of constraints and associated coefficients. Columns are used to represent the set of constraints in which a variable participates, and the asssociated coefficents.
ColumnArray
COPT column array object. To store and access a set of C++ Column objects, Cardinal Optimizer provides C++ ColumnArray class, which defines the following methods.
Sos
COPT SOS constraint object. SOS constraints are always associated with a particular model. User creates an SOS constraint object by adding an SOS constraint to a model, rather than by using constructor of Sos class.
An SOS constraint can be type 1 or 2 (COPT_SOS_TYPE1
or
COPT_SOS_TYPE2
).
SosArray
COPT SOS constraint array object. To store and access a set of C++ Sos objects, Cardinal Optimizer provides C++ SosArray class, which defines the following methods.
SosBuilder
COPT SOS constraint builder object. To help building an SOS constraint, given the SOS type, a set of variables and associated weights, Cardinal Optimizer provides C++ SosBuilder class, which defines the following methods.
SosBuilderArray
COPT SOS constraint builder array object. To store and access a set of C++ SosBuilder objects, Cardinal Optimizer provides C++ SosBuilderArray class, which defines the following methods.
GenConstr
COPT general constraint object. General constraints are always associated with a particular model. User creates a general constraint object by adding a general constraint to a model, rather than by using constructor of GenConstr class.
GenConstrArray
COPT general constraint array object. To store and access a set of C++ GenConstr objects, Cardinal Optimizer provides C++ GenConstrArray class, which defines the following methods.
GenConstrBuilder
COPT general constraint builder object. To help building a general constraint, given a binary variable and associated value, a linear expression and constraint sense, Cardinal Optimizer provides C++ GenConstrBuilder class, which defines the following methods.
GenConstrBuilderArray
COPT general constraint builder array object. To store and access a set of C++ GenConstrBuilder objects, Cardinal Optimizer provides C++ GenConstrBuilderArray class, which defines the following methods.
Cone
COPT cone constraint object. Cone constraints are always associated with a particular model. User creates a cone constraint object by adding a cone constraint to a model, rather than by using constructor of Cone class.
A cone constraint can be regular or rotated
(COPT_CONE_QUAD
or COPT_CONE_RQUAD
).
ConeArray
COPT cone constraint array object. To store and access a set of C++ Cone objects, Cardinal Optimizer provides C++ ConeArray class, which defines the following methods.
ConeBuilder
COPT cone constraint builder object. To help building a cone constraint, given the cone type and a set of variables, Cardinal Optimizer provides C++ ConeBuilder class, which defines the following methods.
ConeBuilderArray
COPT cone constraint builder array object. To store and access a set of C++ ConeBuilder objects, Cardinal Optimizer provides C++ ConeBuilderArray class, which defines the following methods.
ExpCone
COPT exponential cone constraint object. ExpCone constraints are always associated with a particular model. User creates an exponential cone constraint object by adding an expcone constraint to a model, rather than by using constructor of ExpCone class.
ExpConeArray
COPT exponential cone constraint array object. To store and access a set of C++ ExpCone objects, Cardinal Optimizer provides C++ ExpConeArray class, which defines the following methods.
ExpConeBuilder
COPT exponential cone constraint builder object. To help building a exponential cone constraint, given the expcone type and a set of variables, Cardinal Optimizer provides C++ ExpConeBuilder class, which defines the following methods.
ExpConeBuilderArray
COPT exponential cone constraint builder array object. To store and access a set of C++ ExpConeBuilder objects, Cardinal Optimizer provides C++ ExpConeBuilderArray class, which defines the following methods.
QuadExpr
COPT quadratic expression object. A quadratic expression consists of a linear expression, a list of variable pairs and associated coefficients of quadratic terms. Quadratic expressions are used to build quadratic constraints and objectives.
- QuadExpr::QuadExpr()
- QuadExpr::QuadExpr()
- QuadExpr::QuadExpr()
- QuadExpr::QuadExpr()
- QuadExpr::QuadExpr()
- QuadExpr::AddConstant()
- QuadExpr::AddLinExpr()
- QuadExpr::AddQuadExpr()
- QuadExpr::AddTerm()
- QuadExpr::AddTerm()
- QuadExpr::AddTerms()
- QuadExpr::AddTerms()
- QuadExpr::Clone()
- QuadExpr::Evaluate()
- QuadExpr::GetCoeff()
- QuadExpr::GetConstant()
- QuadExpr::GetLinExpr()
- QuadExpr::GetVar1()
- QuadExpr::GetVar2()
- QuadExpr::operator*=()
- QuadExpr::operator*()
- QuadExpr::operator+=()
- QuadExpr::operator+()
- QuadExpr::operator-=()
- QuadExpr::operator-()
- QuadExpr::Remove()
- QuadExpr::Remove()
- QuadExpr::Reserve()
- QuadExpr::SetCoeff()
- QuadExpr::SetConstant()
- QuadExpr::Size()
QConstraint
COPT quadratic constraint object. Quadratic constraints are always associated with a particular model. User creates a quadratic constraint object by adding a quadratic constraint to a model, rather than by using constructor of QConstraint class.
QConstrArray
COPT quadratic constraint array object. To store and access a set of C++ QConstraint objects, Cardinal Optimizer provides C++ QConstrArray class, which defines the following methods.
QConstrBuilder
COPT quadratic constraint builder object. To help building a quadratic constraint, given a quadratic expression, constraint sense and right-hand side value, Cardinal Optimizer provides C++ QConstrBuilder class, which defines the following methods.
QConstrBuilderArray
COPT quadratic constraint builder array object. To store and access a set of C++ QConstrBuilder objects, Cardinal Optimizer provides C++ QConstrBuilderArray class, which defines the following methods.
PsdVar
COPT PSD variable object. PSD variables are always associated with a particular model. User creates a PSD variable object by adding a PSD variable to model, rather than by constructor of PsdVar class.
PsdVarArray
COPT PSD variable array object. To store and access a set of PsdVar objects, Cardinal Optimizer provides PsdVarArray class, which defines the following methods.
PsdExpr
COPT PSD expression object. A PSD expression consists of a linear expression, a list of PSD variables and associated coefficient matrices of PSD terms. PSD expressions are used to build PSD constraints and objectives.
- PsdExpr::PsdExpr()
- PsdExpr::PsdExpr()
- PsdExpr::PsdExpr()
- PsdExpr::PsdExpr()
- PsdExpr::PsdExpr()
- PsdExpr::AddConstant()
- PsdExpr::AddLinExpr()
- PsdExpr::AddPsdExpr()
- PsdExpr::AddTerm()
- PsdExpr::AddTerm()
- PsdExpr::AddTerm()
- PsdExpr::AddTerms()
- PsdExpr::AddTerms()
- PsdExpr::Clone()
- PsdExpr::Evaluate()
- PsdExpr::GetCoeff()
- PsdExpr::GetConstant()
- PsdExpr::GetLinExpr()
- PsdExpr::GetPsdVar()
- PsdExpr::operator*=()
- PsdExpr::operator*()
- PsdExpr::operator+=()
- PsdExpr::operator+()
- PsdExpr::operator-=()
- PsdExpr::operator-()
- PsdExpr::Remove()
- PsdExpr::Remove()
- PsdExpr::Remove()
- PsdExpr::Reserve()
- PsdExpr::SetCoeff()
- PsdExpr::SetConstant()
- PsdExpr::Size()
PsdConstraint
COPT PSD constraint object. PSD constraints are always associated with a particular model. User creates a PSD constraint object by adding a PSD constraint to model, rather than by constructor of PsdConstraint class.
PsdConstrArray
COPT PSD constraint array object. To store and access a set of PsdConstraint objects, Cardinal Optimizer provides PsdConstrArray class, which defines the following methods.
PsdConstrBuilder
COPT PSD constraint builder object. To help building a PSD constraint, given a PSD expression, constraint sense and right-hand side value, Cardinal Optimizer provides PsdConstrBuilder class, which defines the following methods.
PsdConstrBuilderArray
COPT PSD constraint builder array object. To store and access a set of PsdConstrBuilder objects, Cardinal Optimizer provides PsdConstrBuilderArray class, which defines the following methods.
LmiConstraint
COPT LMI constraint object. LMI constraints are always associated with a particular model. User creates a LMI constraint object by adding a LMI constraint to model, rather than by constructor of LmiConstraint class.
LmiConstrArray
COPT LMI constraint array object. To store and access a set of LmiConstraint objects, Cardinal Optimizer provides LmiConstrArray class, which defines the following methods.
LmiExpr
COPT LMI expression object. A LMI expression consists of a list of variables, associated coefficient matrices of LMI term, and constant matrices. LMI expressions are used to build LMI constraints.
- LmiExpr::LmiExpr()
- LmiExpr::LmiExpr()
- LmiExpr::LmiExpr()
- LmiExpr::LmiExpr()
- LmiExpr::LmiExpr()
- LmiExpr::AddConstant()
- LmiExpr::AddLmiExpr()
- LmiExpr::AddTerm()
- LmiExpr::AddTerm()
- LmiExpr::AddTerms()
- LmiExpr::Clone()
- LmiExpr::GetCoeff()
- LmiExpr::GetConstant()
- LmiExpr::GetVar()
- LmiExpr::operator*=()
- LmiExpr::operator*()
- LmiExpr::operator+=()
- LmiExpr::operator+()
- LmiExpr::operator-=()
- LmiExpr::operator-()
- LmiExpr::Remove()
- LmiExpr::Remove()
- LmiExpr::Reserve()
- LmiExpr::SetCoeff()
- LmiExpr::SetConstant()
- LmiExpr::Size()
SymMatrix
COPT symmetric matrix object. Symmetric matrices are always associated with a particular model. User creates a symmetric matrix object by adding a symmetric matrix to model, rather than by constructor of SymMatrix class.
Symmetric matrices are used as coefficient matrices of PSD terms in PSD expressions, PSD constraints or PSD objectives.
SymMatrixArray
COPT symmetric matrix object. To store and access a set of SymMatrix objects, Cardinal Optimizer provides SymMatrixArray class, which defines the following methods.
SymMatExpr
COPT symmetric matrix expression object. A symmetric matrix expression is a linear combination of symmetric matrices, which is still a symmetric matrix. However, by doing so, we are able to delay computing the final matrix until setting PSD constraints or PSD objective.
- SymMatExpr::SymMatExpr()
- SymMatExpr::SymMatExpr()
- SymMatExpr::AddSymMatExpr()
- SymMatExpr::AddTerm()
- SymMatExpr::AddTerms()
- SymMatExpr::Clone()
- SymMatExpr::GetCoeff()
- SymMatExpr::GetDim()
- SymMatExpr::GetSymMat()
- SymMatExpr::operator*=()
- SymMatExpr::operator*()
- SymMatExpr::operator+=()
- SymMatExpr::operator+()
- SymMatExpr::operator-=()
- SymMatExpr::operator-()
- SymMatExpr::Remove()
- SymMatExpr::Remove()
- SymMatExpr::Reserve()
- SymMatExpr::SetCoeff()
- SymMatExpr::Size()
MVar
COPT multi-dimensional variable object. It is used to construct
multi-dimensional variables and support operations with the built-in
multi-dimensional array NdArray in COPT. It can be
created by calling the method addMVar
of Model.
The following methods are provided:
- MVar::MVar()
- MVar::MVar()
- MVar::Clone()
- MVar::Diagonal()
- MVar::Expand()
- MVar::Flatten()
- MVar::Get()
- MVar::GetBasis()
- MVar::GetDim()
- MVar::GetIdx()
- MVar::GetLowerIIS()
- MVar::GetND()
- MVar::GetShape()
- MVar::GetSize()
- MVar::GetType()
- MVar::GetUpperIIS()
- MVar::Item()
- MVar::operator[]()
- MVar::operator[]()
- MVar::Represent()
- MVar::Reshape()
- MVar::Set()
- MVar::Set()
- MVar::SetItem()
- MVar::Squeeze()
- MVar::Sum()
- MVar::Sum()
- MVar::Transpose()
MConstr
COPT multi-dimensional linear constraint object. It can be created by calling
the method addMConstr
of Model. The following methods
are provided:
- MConstr::MConstr()
- MConstr::MConstr()
- MConstr::Clone()
- MConstr::Diagonal()
- MConstr::Expand()
- MConstr::Flatten()
- MConstr::Get()
- MConstr::GetBasis()
- MConstr::GetDim()
- MConstr::GetIdx()
- MConstr::GetLowerIIS()
- MConstr::GetND()
- MConstr::GetShape()
- MConstr::GetSize()
- MConstr::GetUpperIIS()
- MConstr::Item()
- MConstr::operator[]()
- MConstr::operator[]()
- MConstr::Represent()
- MConstr::Reshape()
- MConstr::Set()
- MConstr::Set()
- MConstr::SetItem()
- MConstr::Squeeze()
- MConstr::Transpose()
MConstrBuilder
COPT builder object of multi-dimensional linear constraints. It is used to generate multi-dimensional linear constraints and support operations with the built-in multi-dimensional array NdArray in COPT. It is recommended to create MConstrBuilder object by comparing two objects, one of which should be MVar object or MLinExpr object, by comparison operators. The following methods are provided:
MExpression
The MExpression class is a generalized version of Expr. It represents a linear expression and supports most of methods in Expr class. In addition, it supports linear combination of multi-dimensional objects, such as MVar object and NdArray object. The following methods are provided:
MLinExpr
COPT multi-dimensional linear expression object. It is used to construct multi-dimensional linear expressions and perform operations with the built-in multi-dimensional array NdArray in COPT. Its elements are MExpression objects. It can be created by linear combination of MVar objects. The following methods are provided:
- MLinExpr::MLinExpr()
- MLinExpr::MLinExpr()
- MLinExpr::MLinExpr()
- MLinExpr::AddConstant()
- MLinExpr::AddConstant()
- MLinExpr::AddExpr()
- MLinExpr::AddMExpr()
- MLinExpr::AddMLinExpr()
- MLinExpr::AddTerm()
- MLinExpr::AddTerms()
- MLinExpr::AddTerms()
- MLinExpr::Clear()
- MLinExpr::Clone()
- MLinExpr::Diagonal()
- MLinExpr::Expand()
- MLinExpr::Flatten()
- MLinExpr::GetDim()
- MLinExpr::GetND()
- MLinExpr::GetShape()
- MLinExpr::GetSize()
- MLinExpr::Item()
- MLinExpr::operator[]()
- MLinExpr::operator[]()
- MLinExpr::Represent()
- MLinExpr::Reshape()
- MLinExpr::SetItem()
- MLinExpr::Squeeze()
- MLinExpr::SubConstant()
- MLinExpr::Sum()
- MLinExpr::Sum()
- MLinExpr::Transpose()
MQConstr
The MQConstr class is a COPT multi-dimensional quadratic constraint object.
It can be created by calling the method addMQConstr
of Model.
The following methods are provided:
- MQConstr::MQConstr()
- MQConstr::MQConstr()
- MQConstr::Clone()
- MQConstr::Diagonal()
- MQConstr::Expand()
- MQConstr::Flatten()
- MQConstr::Get()
- MQConstr::GetDim()
- MQConstr::GetIdx()
- MQConstr::GetND()
- MQConstr::GetRhs()
- MQConstr::GetSense()
- MQConstr::GetShape()
- MQConstr::GetSize()
- MQConstr::Item()
- MQConstr::operator[]()
- MQConstr::operator[]()
- MQConstr::Represent()
- MQConstr::Reshape()
- MQConstr::Set()
- MQConstr::Set()
- MQConstr::SetItem()
- MQConstr::Squeeze()
- MQConstr::Transpose()
MQConstrBuilder
The MQConstrBuilder class is a COPT builder object of multi-dimensional quadratic constraints. It is used to generate multi-dimensional quadratic constraints and supports operations with the built-in multi-dimensional array NdArray in COPT. It can be created by comparing two objects, one of which should be MQuadExpr object, by comparison operators. The following methods are provided:
MQExpression
The MQExpression class is a generalized version of QuadExpr. It represents a quadratic expression and supports most of methods in QuadExpr class. In addition, it supports quadratic combination of multi-dimensional objects, such as MVar object and MLinExpr object. The following methods are provided:
- MQExpression::MQExpression()
- MQExpression::MQExpression()
- MQExpression::AddExpr()
- MQExpression::AddMExpr()
- MQExpression::AddMQExpr()
- MQExpression::AddQuadExpr()
- MQExpression::AddQuadExpr()
- MQExpression::AddQuadExpr()
- MQExpression::AddQuadExpr()
- MQExpression::AddTerm()
- MQExpression::AddTerm()
- MQExpression::Clone()
- MQExpression::Represent()
MQuadExpr
COPT multi-dimensional quadratic expression object.It is used to construct multi-dimensional quadratic expressions and perform operations with the multi-dimensional array built in COPT NdArray . Its elements are MQExpression objects. It can be created by quadratic combination of MVar objects. The following methods are provided:
- MQuadExpr::MQuadExpr()
- MQuadExpr::MQuadExpr()
- MQuadExpr::MQuadExpr()
- MQuadExpr::AddConstant()
- MQuadExpr::AddConstant()
- MQuadExpr::AddExpr()
- MQuadExpr::AddMExpr()
- MQuadExpr::AddMLinExpr()
- MQuadExpr::AddMQExpr()
- MQuadExpr::AddMQuadExpr()
- MQuadExpr::AddQuadExpr()
- MQuadExpr::AddTerm()
- MQuadExpr::AddTerm()
- MQuadExpr::AddTerms()
- MQuadExpr::AddTerms()
- MQuadExpr::Clear()
- MQuadExpr::Clone()
- MQuadExpr::Diagonal()
- MQuadExpr::Expand()
- MQuadExpr::Flatten()
- MQuadExpr::GetDim()
- MQuadExpr::GetND()
- MQuadExpr::GetShape()
- MQuadExpr::GetSize()
- MQuadExpr::Item()
- MQuadExpr::operator[]()
- MQuadExpr::operator[]()
- MQuadExpr::Represent()
- MQuadExpr::Reshape()
- MQuadExpr::SetItem()
- MQuadExpr::Squeeze()
- MQuadExpr::SubConstant()
- MQuadExpr::Sum()
- MQuadExpr::Sum()
- MQuadExpr::Transpose()
NdArray
The NdArray class is a built-in multi-dimensional array in COPT. It represents a table of elements of the same type, indexed by a tuple of integers. The following methods are provided:
- NdArray::NdArray()
- NdArray::NdArray()
- NdArray::NdArray()
- NdArray::Clone()
- NdArray::Diagonal()
- NdArray::Expand()
- NdArray::Fill()
- NdArray::Flatten()
- NdArray::GetDim()
- NdArray::GetND()
- NdArray::GetShape()
- NdArray::GetSize()
- NdArray::Item()
- NdArray::operator[]()
- NdArray::operator[]()
- NdArray::Represent()
- NdArray::Reshape()
- NdArray::SetItem()
- NdArray::Squeeze()
- NdArray::Sum()
- NdArray::Sum()
- NdArray::Transpose()
Shape
The Shape class encapsulates a tuple of integers, indicating the size of array along each dimension. It refers to dimensions of built-in NdArray in COPT. The following methods are provided:
View
The View class is used to perform slicing operations on multi-dimensional arrays. The following methods are provided:
CallbackBase
COPT Callback abstract base object. Users must implment its virtual method
virtual void CallbackBase::callback()
to instantiate an instance, which
pass to Model::SetCallback(ICallback* pcb, int cbctx)
as the first
parameter. Subclass of CallbackBase inherits the following methods:
- CallbackBase::AddLazyConstr()
- CallbackBase::AddLazyConstr()
- CallbackBase::AddLazyConstr()
- CallbackBase::AddLazyConstrs()
- CallbackBase::AddUserCut()
- CallbackBase::AddUserCut()
- CallbackBase::AddUserCut()
- CallbackBase::AddUserCuts()
- CallbackBase::GetDblInfo()
- CallbackBase::GetIncumbent()
- CallbackBase::GetIncumbent()
- CallbackBase::GetIncumbent()
- CallbackBase::GetIntInfo()
- CallbackBase::GetRelaxSol()
- CallbackBase::GetRelaxSol()
- CallbackBase::GetRelaxSol()
- CallbackBase::GetSolution()
- CallbackBase::GetSolution()
- CallbackBase::GetSolution()
- CallbackBase::Interrupt()
- CallbackBase::LoadSolution()
- CallbackBase::SetSolution()
- CallbackBase::SetSolution()
- CallbackBase::Where()
ProbBuffer
Buffer object for COPT problem. ProbBuffer object holds the (MPS) problem in string format.