>>> The sense of the linear constraint (row).

>>

>> dRowBound

>>

>>> Right hand side of the linear constraint (row).

>>

>> nElemSize

>>

>>> Length of array for non-zero coefficients.

>>

>> pReqSize

>>

>>> Pointer to minimal length of array for non-zero coefficients. Can be NULL.

##### COPT_GetColIdx

> Synopsis
>

>> int COPT_ GetColIdx(copt_ prob *prob,const char *colName,int *p_ iCol)

>
> Description
>

>> Get index of column by name.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> colName

>>

>>> Name of column.

>>

>> p_ iCol

>>

>>> Pointer to index of column.

##### COPT_GetPSDColIdx

> Synopsis
>

>> int COPT_ GetPSDColIdx(copt_ prob *prob,const char *psdColName,int *p_
iPSDCol)

>
> Description
>

>> Get index of PSD variable by name.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> psdColName

>>

>>> Name of PSD variable.

>>

>> p_ iPSDCol

>>

>>> Pointer to index of PSD variable.

##### COPT_GetRowIdx

> Synopsis
>

>> int COPT_ GetRowIdx(copt_ prob *prob,const char *rowName,int *p_ iRow)

>
> Description
>

>> Get index of row by name.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> rowName

>>

>>> Name of row.

>>

>> p_ iRow

>>

>>> Pointer to index of row.

##### COPT_GetQConstrIdx

> Synopsis
>

>> int COPT_ GetQConstrIdx(copt_ prob *prob,const char *qConstrName,int *p_
iQConstr)

>
> Description
>

>> Get index of quadratic constraint by name.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> qConstrName

>>

>>> Name of quadratic constraint.

>>

>> p_ iQConstr

>>

>>> Pointer to index of quadratic constraint.

##### COPT_GetPSDConstrIdx

> Synopsis
>

>> int COPT_ GetPSDConstrIdx(copt_ prob *prob,const char *psdConstrName,int
*p_ iPSDConstr)

>
> Description
>

>> Get index of PSD constraint by name.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> psdConstrName

>>

>>> Name of PSD constraint.

>>

>> p_ iPSDConstr

>>

>>> Pointer to index of PSD constraint.

##### COPT_GetColInfo

> Synopsis
>

>> int COPT_ GetColInfo(copt_ prob *prob,const char *infoName,int num,const
int *list,double *info)

>
> Description
>

>> Get information of column. If list is NULL, then information of the first
num columns will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> infoName

>>

>>> Name of information. Please refer to _Information_ for supported
information.

>>

>> num

>>

>>> Number of columns.

>>

>> list

>>

>>> Index of columns. Can be NULL.

>>

>> info

>>

>>> Array of information.

##### COPT_GetPSDColInfo

> Synopsis
>

>> int COPT_ GetPSDColInfo(copt_ prob *prob,const char *infoName,int
iCol,double *info)

>
> Description
>

>> Get information of PSD variable.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> infoName

>>

>>> Name of information. Please refer to _Information_ for supported
information.

>>

>> iCol

>>

>>> Index of PSD variable.

>>

>> info

>>

>>> Array of information.

##### COPT_GetRowInfo

> Synopsis
>

>> int COPT_ GetRowInfo(copt_ prob *prob,const char *infoName,int num,const
int *list,double *info)

>
> Description
>

>> Get information of row. If list is NULL, then information of the first num
rows will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> infoName

>>

>>> Name of information. Please refer to _Information_ for supported
information.

>>

>> num

>>

>>> Number of rows.

>>

>> list

>>

>>> Index of rows. Can be NULL.

>>

>> info

>>

>>> Array of information.

##### COPT_GetQConstrInfo

> Synopsis
>

>> int COPT_ GetQConstrInfo(copt_ prob *prob,const char *infoName,int
num,const int *list,double *info)

>
> Description
>

>> Get information of quadratic constraints. If list is NULL, then information
of the first num quadratic constraints will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> infoName

>>

>>> Name of information. Please refer to _Information_ for supported
information.

>>

>> num

>>

>>> Number of quadratic constraints.

>>

>> list

>>

>>> Index of quadratic constraints. Can be NULL.

>>

>> info

>>

>>> Array of information.

##### COPT_GetPSDConstrInfo

> Synopsis
>

>> int COPT_ GetPSDConstrInfo(copt_ prob *prob,const char *infoName,int
num,const int* list,double *info)

>
> Description
>

>> Get information of PSD constraints. If list is NULL, then information of
the first num PSD constraints will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> infoName

>>

>>> Name of information. Please refer to _Information_ for supported
information.

>>

>> num

>>

>>> Number of PSD constraints.

>>

>> list

>>

>>> Index of PSD constraints. Can be NULL.

>>

>> info

>>

>>> Array of information.

##### COPT_GetColType

> Synopsis
>

>> int COPT_ GetColType(copt_ prob *prob,int num,const int *list,char *type)

>
> Description
>

>> Get types of columns. If list is NULL, then types of the first num columns
will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of columns.

>>

>> list

>>

>>> Index of columns. Can be NULL.

>>

>> type

>>

>>> Types of columns.

##### COPT_GetColBasis

> Synopsis
>

>> int COPT_ GetColBasis(copt_ prob *prob,int num,const int *list,int
*colBasis)

>
> Description
>

>> Get basis status of columns. If list is NULL, then basis status of the
first num columns will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of columns.

>>

>> list

>>

>>> Index of columns. Can be NULL.

>>

>> colBasis

>>

>>> Basis status of columns.

##### COPT_GetRowBasis

> Synopsis
>

>> int COPT_ GetRowBasis(copt_ prob *prob,int num,const int *list,int
*rowBasis)

>
> Description
>

>> Get basis status of rows. If list is NULL, then basis status of the first
num rows will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of rows.

>>

>> list

>>

>>> Index of rows. Can be NULL.

>>

>> rowBasis

>>

>>> Basis status of rows.

##### COPT_GetQConstrSense

> Synopsis
>

>> int COPT_ GetQConstrSense(copt_ prob *prob,int num,const int *list,char
*sense)

>
> Description
>

>> Get senses of quadratic constraints. If list is NULL, then types of the
first num quadratic constraints will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of quadratic constraints.

>>

>> list

>>

>>> Index of quadratic constraints. Can be NULL.

>>

>> sense

>>

>>> Array of senses.

##### COPT_GetQConstrRhs

> Synopsis
>

>> int COPT_ GetQConstrRhs(copt_ prob *prob,int num,const int *list,double
*rhs)

>
> Description
>

>> Get RHS of quadratic constraints. If list is NULL, then types of the first
num quadratic constraints will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of quadratic constraints.

>>

>> list

>>

>>> Index of quadratic constraints. Can be NULL.

>>

>> rhs

>>

>>> Array of RHS.

##### COPT_GetColName

> Synopsis
>

>> int COPT_ GetColName(copt_ prob *prob,int iCol,char *buff,int buffSize,int
*pReqSize)

>
> Description
>

>> Get name of column by index. If memory of buff is not sufficient, then
return the first buffSize length of sub-string, and the length of name
requested by pReqSize. If buff is NULL, then we can get the length of name
requested by pReqSize.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> iCol

>>

>>> Index of column.

>>

>> buff

>>

>>> Buffer for storing name.

>>

>> buffSize

>>

>>> Length of the buffer.

>>

>> pReqSize

>>

>>> Length of the requested name. Can be NULL.

##### COPT_GetPSDColName

> Synopsis
>

>> int COPT_ GetPSDColName(copt_ prob *prob,int iPSDCol,char *buff,int
buffSize,int *pReqSize)

>
> Description
>

>> Get name of PSD variable by index. If memory of buff is not sufficient,
then return the first buffSize length of sub-string, and the length of name
requested by pReqSize. If buff is NULL, then we can get the length of name
requested by pReqSize.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> iPSDCol

>>

>>> Index of PSD variable.

>>

>> buff

>>

>>> Buffer for storing name.

>>

>> buffSize

>>

>>> Length of the buffer.

>>

>> pReqSize

>>

>>> Length of the requested name. Can be NULL.

##### COPT_GetRowName

> Synopsis
>

>> int COPT_ GetRowName(copt_ prob *prob,int iRow,char *buff,int buffSize,int
*pReqSize)

>
> Description
>

>> Get name of row by index. If memory of buff is not sufficient, then return
the first buffSize length of sub-string, and the length of name requested by
pReqSize. If buff is NULL, then we can get the length of name requested by
pReqSize.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> iRow

>>

>>> Index of row.

>>

>> buff

>>

>>> Buffer for storing name.

>>

>> buffSize

>>

>>> Length of the buffer.

>>

>> pReqSize

>>

>>> Length of the requested name. Can be NULL.

##### COPT_GetQConstrName

> Synopsis
>

>> int COPT_ GetQConstrName(copt_ prob *prob,int iQConstr,char *buff,int
buffSize,int *pReqSize)

>
> Description
>

>> Get name of quadratic constraint by index. If memory of buff is not
sufficient, then return the first buffSize length of sub-string, and the
length of name requested by pReqSize. If buff is NULL, then we can get the
length of name requested by pReqSize.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> iQConstr`

>>

>>> Index of quadratic constraint.

>>

>> buff

>>

>>> Buffer for storing name.

>>

>> buffSize

>>

>>> Length of the buffer.

>>

>> pReqSize

>>

>>> Length of the requested name. Can be NULL.

##### COPT_GetPSDConstrName

> Synopsis
>

>> int COPT_ GetPSDConstrName(copt_ prob *prob,int iPSDConstr,char *buff,int
buffSize,int *pReqSize)

>
> Description
>

>> Get name of PSD constraint by index. If memory of buff is not sufficient,
then return the first buffSize length of sub-string, and the length of name
requested by pReqSize. If buff is NULL, then we can get the length of name
requested by pReqSize.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> iPSDConstr`

>>

>>> Index of PSD constraint.

>>

>> buff

>>

>>> Buffer for storing name.

>>

>> buffSize

>>

>>> Length of the buffer.

>>

>> pReqSize

>>

>>> Length of the requested name. Can be NULL.

#### 6 Accessing parameters and attributes

##### COPT_SetIntParam

> Synopsis
>

>> int COPT_ SetIntParam(copt_ prob *prob,const char *paramName,int intParam)

>
> Description
>

>> Sets an integer parameter.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> paramName

>>

>>> The name of the integer parameter.

>>

>> intParam

>>

>>> The value of the integer parameter.

##### COPT_GetIntParam, COPT_GetIntParamDef/Min/Max

> Synopsis
>

>> int COPT_ GetIntParam(copt_ prob *prob,const char *paramName,int *p_
intParam)

>>

>> int COPT_ GetIntParamDef(copt_ prob *prob,const char *paramName,int *p_
intParam)

>>

>> int COPT_ GetIntParamMin(copt_ prob *prob,const char *paramName,int *p_
intParam)

>>

>> int COPT_ GetIntParamMax(copt_ prob *prob,const char *paramName,int *p_
intParam)

>
> Description
>

>> Gets the

>>

>>> current

>>>

>>> default

>>>

>>> minimal

>>>

>>> maximal

>>

>> value of an integer parameter.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> paramName

>>

>>> The name of the integer parameter.

>>

>> p_ intParam

>>

>>> Pointer to the value of the integer parameter.

##### COPT_SetDblParam

> Synopsis
>

>> int COPT_ SetDblParam(copt_ prob *prob,const char *paramName,double
dblParam)

>
> Description
>

>> Sets a double parameter.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> paramName

>>

>>> The name of the double parameter.

>>

>> dblParam

>>

>>> The value of the double parameter.

##### COPT_GetDblParam, COPT_GetDblParamDef/Min/Max

> Synopsis
>

>> int COPT_ GetDblParam(copt_ prob *prob,const char *paramName,double *p_
dblParam)

>>

>> int COPT_ GetDblParamDef(copt_ prob *prob,const char *paramName,double *p_
dblParam)

>>

>> int COPT_ GetDblParamMin(copt_ prob *prob,const char *paramName,double *p_
dblParam)

>>

>> int COPT_ GetDblParamMax(copt_ prob *prob,const char *paramName,double *p_
dblParam)

>
> Description
>

>> Gets the

>>

>>> current

>>>

>>> default

>>>

>>> minimal

>>>

>>> maximal

>>

>> value of a double parameter.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> paramName

>>

>>> The name of the double parameter.

>>

>> p_ dblParam

>>

>>> Pointer to the value of the double parameter.

##### COPT_ResetParam

> Synopsis
>

>> int COPT_ ResetParam(copt_ prob *prob)

>
> Description
>

>> Reset parameters to default settings.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

##### COPT_GetIntAttr

> Synopsis
>

>> int COPT_ GetIntAttr(copt_ prob *prob,const char *attrName,int *p_ intAttr)

>
> Description
>

>> Gets the value of an integer attribute.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> attrName

>>

>>> The name of the integer attribute.

>>

>> p_ intAttr

>>

>>> Pointer to the value of the integer attribute.

##### COPT_GetDblAttr

> Synopsis
>

>> int COPT_ GetDblAttr(copt_ prob *prob,const char *attrName,int *p_ dblAttr)

>
> Description
>

>> Gets the value of an double attribute.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> attrName

>>

>>> The name of the double attribute.

>>

>> p_ dblAttr

>>

>>> Pointer to the value of the double attribute.

##### COPT_WriteParam

> Synopsis
>

>> int COPT_ WriteParam(copt_ prob *prob,const char *parfilename)

>
> Description
>

>> Writes user defined parameters to a file. This API function will write out
all the parameters that are different from their default values.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> parfilename

>>

>>> The path to the parameter file.

##### COPT_WriteParamStr

> Synopsis
>

>> int COPT_ WriteParamStr(copt_ prob *prob,char *str,int nStrSize,int
*pReqSize)

>
> Description
>

>> Writes the modified parameters to a string buffer.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> str

>>

>>> String buffer of modified parameters.

>>

>> nStrSize

>>

>>> The size of string buffer.

>>

>> pReqSize

>>

>>> Minimum space requirement of string buffer for modified parameters.

##### COPT_ReadParam

> Synopsis
>

>> int COPT_ ReadParam(copt_ prob *prob,const char *parfilename)

>
> Description
>

>> Reads and applies parameters settings as defined in the parameter file.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> parfilename

>>

>>> The path to the parameter file.

##### COPT_ReadParamStr

> Synopsis
>

>> int COPT_ ReadParamStr(copt_ prob *prob,const char *strParam)

>
> Description
>

>> Read parameter settings from string buffer, and set parameters in COPT.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> strParam

>>

>>> String buffer of parameter settings.

#### 7 Logging utilities

##### COPT_SetLogFile

> Synopsis
>

>> int COPT_ SetLogFile(copt_ prob *prob,char *logfilename)

>
> Description
>

>> Set log file for the problem.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> logfilename

>>

>>> The path to the log file.

##### COPT_SetLogCallback

> Synopsis
>

>> int COPT_ SetLogCallback(copt_ prob *prob,void (*logcb)(char *msg,void
*userdata),void *userdata)

>
> Description
>

>> Set message callback for the problem.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> logcb

>>

>>> Callback function for message.

>>

>> userdata

>>

>>> User defined data. The data will be passed to the solver without
modification.

#### 8 MIP start utilities

##### COPT_AddMipStart

> Synopsis
>

>> int COPT_ AddMipStart(copt_ prob *prob,int num,const int *list,double
*colVal)

>
> Description
>

>> Add MIP start information for the problem. If list is NULL, then
information of the first num columns will be added.

>>

>> One MIP start information will be added for each call to this function.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of variables (columns).

>>

>> list

>>

>>> Index of variables (columns). Can be NULL.

>>

>> colVal

>>

>>> MIP start information.

##### COPT_ReadMst

> Synopsis
>

>> int COPT_ ReadMst(copt_ prob *prob,const char *mstfilename)

>
> Description
>

>> Read MIP start information from file, and used as initial solution for the
problem.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> mstfilename

>>

>>> The path to the MIP start file.

##### COPT_WriteMst

> Synopsis
>

>> int COPT_ WriteMst(copt_ prob *prob,const char *mstfilename)

>
> Description
>

>> Write solution or existed MIP start information in problem to file.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> mstfilename

>>

>>> The path to the MIP start file.

#### 9 IIS utilities

##### COPT_ComputeIIS

> Synopsis
>

>> int COPT_ ComputeIIS(copt_ prob *prob)

>
> Description
>

>> Compute IIS (Irreducible Inconsistent Subsystem) for infeasible problem.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

##### COPT_GetColLowerIIS

> Synopsis
>

>> int COPT_ GetColLowerIIS(copt_ prob *prob,int num,const int *list,int
*colLowerIIS)

>
> Description
>

>> Get IIS status of lower bounds of columns. If list is NULL, then IIS status
of the first num columns will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of columns.

>>

>> list

>>

>>> Index of columns. Can be NULL.

>>

>> colLowerIIS

>>

>>> IIS status of lower bounds of columns.

##### COPT_GetColUpperIIS

> Synopsis
>

>> int COPT_ GetColUpperIIS(copt_ prob *prob,int num,const int *list,int
*colUpperIIS)

>
> Description
>

>> Get IIS status of upper bounds of columns. If list is NULL, then IIS status
of the first num columns will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of columns.

>>

>> list

>>

>>> Index of columns. Can be NULL.

>>

>> colUpperIIS

>>

>>> IIS status of upper bounds of columns.

##### COPT_GetRowLowerIIS

> Synopsis
>

>> int COPT_ GetRowLowerIIS(copt_ prob *prob,int num,const int *list,int
*rowLowerIIS)

>
> Description
>

>> Get IIS status of lower bounds of rows. If list is NULL, then IIS status of
the first num rows will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of rows.

>>

>> list

>>

>>> Index of rows. Can be NULL.

>>

>> rowLowerIIS

>>

>>> IIS status of lower bounds of rows.

##### COPT_GetRowUpperIIS

> Synopsis
>

>> int COPT_ GetRowUpperIIS(copt_ prob *prob,int num,const int *list,int
*rowUpperIIS)

>
> Description
>

>> Get IIS status of upper bounds of rows. If list is NULL, then IIS status of
the first num rows will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of rows.

>>

>> list

>>

>>> Index of rows. Can be NULL.

>>

>> rowUpperIIS

>>

>>> IIS status of upper bounds of rows.

##### COPT_GetSOSIIS

> Synopsis
>

>> int COPT_ GetSOSIIS(copt_ prob *prob,int num,const int *list,int *sosIIS)

>
> Description
>

>> Get IIS status of SOS constraints. If list is NULL, then IIS status of the
first num SOS constraints will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of SOS constraints.

>>

>> list

>>

>>> Index of SOS constraints. Can be NULL.

>>

>> sosIIS

>>

>>> IIS status of SOS constraints.

##### COPT_GetIndicatorIIS

> Synopsis
>

>> int COPT_ GetIndicatorIIS(copt_ prob *prob,int num,const int *list,int
*indicatorIIS)

>
> Description
>

>> Get IIS status of indicator constraints. If list is NULL, then IIS status
of the first num indicator constraints will be returned.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> num

>>

>>> Number of indicator constraints.

>>

>> list

>>

>>> Index of indicator constraints. Can be NULL.

>>

>> indicatorIIS

>>

>>> IIS status of indicator constraints.

#### 10 Feasibility relaxation utilities

##### COPT_FeasRelax

> Synopsis
>

>> int COPT_ FeasRelax(copt_ prob *prob,double *colLowPen,double
*colUppPen,double *rowBndPen,double *rowUppPen)

>
> Description
>

>> Compute feasibility relaxation to infeasible problem.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> colLowPen

>>

>>> Penalty for lower bounds of columns. If NULL, then no relaxation for lower
bounds of columns are allowed; If penalty in colLowPen is COPT_ INFINITY, then
no relaxation is allowed for corresponding bound.

>>

>> colUppPen

>>

>>> Penalty for upper bounds of columns. If NULL, then no relaxation for upper
bounds of columns are allowed; If penalty in colUppen is COPT_ INFINITY, then
no relaxation is allowed for corresponding bound.

>>

>> rowBndPen

>>

>>> Penalty for bounds of rows. If NULL, then no relaxation for bounds of rows
are allowed; If penalty in rowBndPen is COPT_ INFINITY, then no relaxation is
allowed for corresponding bound.

>>

>> rowUppPen

>>

>>> Penalty for upper bounds of rows. If problem has two-sided rows, and
rowUppPen is not NULL, then rowUppPen is penalty for upper bounds of rows; If
penalty in rowUppPen is COPT_ INFINITY, then no relaxation is allowed for
corresponding bound.

>>>

>>> Note: Normally, just set rowUppPen to NULL.

##### COPT_WriteRelax

> Synopsis
>

>> int COPT_ WriteRelax(copt_ prob *prob,const char *relaxfilename)

>
> Description
>

>> Write feasrelax problem to file.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

>>

>> relaxfilename

>>

>>> Name of feasrelax problem file.

#### 11 Parameter tuning utilities

##### COPT_Tune

> Synopsis
>

>> int COPT_ Tune(copt_ prob *prob)

>
> Description
>

>> Parameter tuning of the model.

>
> Arguments
>

>> prob

>>

>>> COPT model.

##### COPT_LoadTuneParam

> Synopsis
>

>> int COPT_ LoadTuneParam(copt_ prob *prob,int idx)

>
> Description
>

>> Load the parameter tuning results of the specified number into the model.

>
> Arguments
>

>> prob

>>

>>> COPT model.

>>

>> idx

>>

>>> The number of the parameter tuning result.

##### COPT_ReadTune

> Synopsis
>

>> int COPT_ ReadTune(copt_ prob *prob,const char *tunefilename)

>
> Description
>

>> Read the parameter combination to be tuned from the tuning file to the
model.

>
> Arguments
>

>> prob

>>

>>> COPT model.

>>

>> tunefilename

>>

>>> Tuning file names.

##### COPT_WriteTuneParam

> Synopsis
>

>> int COPT_ WriteTuneParam(copt_ prob *prob,int idx,const char *parfilename)

>
> Description
>

>> Output the parameter tuning result of the specified number to the parameter
file.

>
> Arguments
>

>> prob

>>

>>> COPT model.

>>

>> idx

>>

>>> The number of the parameter tuning result.

>>

>> parfilename

>>

>>> parameter file name.

#### 12 Other API functions

##### COPT_GetBanner

> Synopsis
>

>> int COPT_ GetBanner(char *buff,int buffSize)

>
> Description
>

>> Obtains a C-style string as banner, which describes the COPT version
information.

>
> Arguments
>

>> buff

>>

>>> A buffer for holding the resulting string.

>>

>> buffSize

>>

>>> The size of the above buffer.

##### COPT_GetRetcodeMsg

> Synopsis
>

>> int COPT_ GetRetcodeMsg(int code,char *buff,int buffSize)

>
> Description
>

>> Obtains a C-style string which explains a return code value in plain text.

>
> Arguments
>

>> code

>>

>>> The return code from a COPT API function.

>>

>> buff

>>

>>> A buffer for holding the resulting string.

>>

>> buffSize

>>

>>> The size of the above buffer.

##### COPT_Interrupt

> Synopsis
>

>> int COPT_ Interrupt(copt_ prob *prob)

>
> Description
>

>> Interrupt solving process of current problem.

>
> Arguments
>

>> prob

>>

>>> The COPT problem.

##  Chapter 15 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.

### 1 Constants

All C++ constants are the same as C constants. Please refer to _C API
Reference: Constants_ for more details.

### 2 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.

### 3 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()

### 4 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.

#### 1 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.

##### Envr::Envr()

> Constructor of COPT Envr object.
>
> Synopsis
>

>> Envr()

##### Envr::Envr()

> Constructor of COPT Envr object, given a license folder.
>
> Synopsis
>

>> Envr(const char *szLicDir)

>
> Arguments
>

>> szLicDir: directory having local license or client config file.

##### Envr::Envr()

> Constructor of COPT Envr object, given an Envr config object.
>
> Synopsis
>

>> Envr(const EnvrConfig & config)

>
> Arguments
>

>> config: Envr config object holding settings for remote connection.

##### Envr::Close()

> close remote connection and token becomes invalid for all problems in
> current envr.
>
> Synopsis
>

>> void Close()

##### Envr::CreateModel()

> Create a COPT model object.
>
> Synopsis
>

>> Model CreateModel(const char *szName)

>
> Arguments
>

>> szName: customized model name.

>
> Return
>

>> a COPT model object.

#### 2 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.

##### EnvrConfig::EnvrConfig()

> Constructor of COPT environment config object.
>
> Synopsis
>

>> EnvrConfig()

##### EnvrConfig::Set()

> Set config settings in terms of name-value pair.
>
> Synopsis
>

>> void Set(const char *szName,const char *szValue)

>
> Arguments
>

>> szName: keyword of a config setting

>>

>> szValue: value of a config setting

#### 3 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()

> Add a cone constraint to a model, given its dimension.
>
> Synopsis
>

>> Cone AddCone(

>>

>>> int dim,

>>>

>>> int type,

>>>

>>> char *pvtype,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> dim: dimension of the cone constraint.

>>

>> type: type of the cone constraint.

>>

>> pvtype: types of variables in the cone.

>>

>> szPrefix: name prefix of variables in the cone.

>
> Return
>

>> object of new cone constraint.

##### Model::AddCone()

> Add a cone constraint to model.
>
> Synopsis
>

>> Cone AddCone(const ConeBuilder & builder)

>
> Arguments
>

>> builder: builder for new cone constraint.

>
> Return
>

>> new cone constraint object.

##### Model::AddCone()

> Add a cone constraint to model.
>
> Synopsis
>

>> Cone AddCone(const VarArray & vars,int type)

>
> Arguments
>

>> vars: variables that participate in the cone constraint.

>>

>> type: type of the cone constraint.

>
> Return
>

>> object of new cone constraint.

##### Model::AddConstr()

> Add a linear constraint to model.
>
> Synopsis
>

>> Constraint AddConstr(

>>

>>> const Expr & expr,

>>>

>>> char sense,

>>>

>>> double rhs,

>>>

>>> const char *szName)

>
> Arguments
>

>> expr: expression for the new contraint.

>>

>> sense: sense for new linear constraint, other than range sense.

>>

>> rhs: right hand side value for the new constraint.

>>

>> szName: optional, name of new constraint.

>
> Return
>

>> new constraint object.

##### Model::AddConstr()

> Add a linear constraint to model.
>
> Synopsis
>

>> Constraint AddConstr(

>>

>>> const Expr & lhs,

>>>

>>> char sense,

>>>

>>> const Expr & rhs,

>>>

>>> const char *szName)

>
> Arguments
>

>> lhs: left hand side expression for the new constraint.

>>

>> sense: sense for new linear constraint, other than range sense.

>>

>> rhs: right hand side expression for the new constraint.

>>

>> szName: optional, name of new constraint.

>
> Return
>

>> new constraint object.

##### Model::AddConstr()

> Add a linear constraint to model.
>
> Synopsis
>

>> Constraint AddConstr(

>>

>>> const Expr & expr,

>>>

>>> double lb,

>>>

>>> double ub,

>>>

>>> const char *szName)

>
> Arguments
>

>> expr: expression for the new constraint.

>>

>> lb: lower bound for the new constraint.

>>

>> ub: upper bound for the new constraint

>>

>> szName: optional, name of new constraint.

>
> Return
>

>> new constraint object.

##### Model::AddConstr()

> Add a linear constraint to a model.
>
> Synopsis
>

>> Constraint AddConstr(const ConstrBuilder & builder,const char *szName)

>
> Arguments
>

>> builder: builder for the new constraint.

>>

>> szName: optional, name of new constraint.

>
> Return
>

>> new constraint object.

##### Model::AddConstrs()

> Add linear constraints to model.
>
> Synopsis
>

>> ConstrArray AddConstrs(

>>

>>> int count,

>>>

>>> char *pSense,

>>>

>>> double *pRhs,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> count: number of constraints added to model.

>>

>> pSense: sense array for new linear constraints, other than range sense.

>>

>> pRhs: right hand side values for new variables.

>>

>> szPrefix: name prefix for new constriants.

>
> Return
>

>> array of new constraint objects.

##### Model::AddConstrs()

> Add linear constraints to a model.
>
> Synopsis
>

>> ConstrArray AddConstrs(

>>

>>> int count,

>>>

>>> double *pLower,

>>>

>>> double *pUpper,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> count: number of constraints added to the model.

>>

>> pLower: lower bounds of new constraints.

>>

>> pUpper: upper bounds of new constraints.

>>

>> szPrefix: name prefix for new constriants.

>
> Return
>

>> array of new constraint objects.

##### Model::AddConstrs()

> Add linear constraints to a model.
>
> Synopsis
>

>> ConstrArray AddConstrs(

>>

>>> int count,

>>>

>>> double *pLower,

>>>

>>> double *pUpper,

>>>

>>> const char *szNames,

>>>

>>> int len)

>
> Arguments
>

>> count: number of constraints added to the model.

>>

>> pLower: lower bounds of new constraints.

>>

>> pUpper: upper bounds of new constraints.

>>

>> szNames: name buffer of new constraints.

>>

>> len: length of the name buffer.

>
> Return
>

>> array of new constraint objects.

##### Model::AddConstrs()

> Add linear constraints to a model.
>
> Synopsis
>

>> ConstrArray AddConstrs(const ConstrBuilderArray & builders,const char
*szPrefix)

>
> Arguments
>

>> builders: builders for new constraints.

>>

>> szPrefix: name prefix for new constriants.

>
> Return
>

>> array of new constraint objects.

##### Model::AddConstrs()

> Add linear constraints to model.
>
> Synopsis
>

>> ConstrArray AddConstrs(

>>

>>> const ConstrBuilderArray & builders,

>>>

>>> const char *szNames,

>>>

>>> int len)

>
> Arguments
>

>> builders: builders for new constraints.

>>

>> szNames: name buffer of new constraints.

>>

>> len: length of the name buffer.

>
> Return
>

>> array of new constraint objects.

##### Model::AddDenseMat()

> Add a dense symmetric matrix to a model.
>
> Synopsis
>

>> SymMatrix AddDenseMat(

>>

>>> int dim,

>>>

>>> double *pVals,

>>>

>>> int len)

>
> Arguments
>

>> dim: dimension of the dense symmetric matrix.

>>

>> pVals: array of non

>>

>> len: length of value array.

>
> Return
>

>> new symmetric matrix object.

##### Model::AddDenseMat()

> Add a dense symmetric matrix to a model.
>
> Synopsis
>

>> SymMatrix AddDenseMat(int dim,double val)

>
> Arguments
>

>> dim: dimension of dense symmetric matrix.

>>

>> val: value to fill dense symmetric matrix.

>
> Return
>

>> new symmetric matrix object.

##### Model::AddDiagMat()

> Add a diagonal matrix to a model.
>
> Synopsis
>

>> SymMatrix AddDiagMat(int dim,double val)

>
> Arguments
>

>> dim: dimension of diagonal matrix.

>>

>> val: value to fill diagonal elements.

>
> Return
>

>> new diagonal matrix object.

##### Model::AddDiagMat()

> Add a diagonal matrix to a model.
>
> Synopsis
>

>> SymMatrix AddDiagMat(

>>

>>> int dim,

>>>

>>> double *pVals,

>>>

>>> int len)

>
> Arguments
>

>> dim: dimension of diagonal matrix.

>>

>> pVals: array of values of diagonal elements.

>>

>> len: length of value array.

>
> Return
>

>> new diagonal matrix object.

##### Model::AddDiagMat()

> Add a diagonal matrix to a model.
>
> Synopsis
>

>> SymMatrix AddDiagMat(

>>

>>> int dim,

>>>

>>> double val,

>>>

>>> int offset)

>
> Arguments
>

>> dim: dimension of diagonal matrix.

>>

>> val: value to fill diagonal elements.

>>

>> offset: shift distance against diagonal line.

>
> Return
>

>> new diagonal matrix object.

##### Model::AddDiagMat()

> Add a diagonal matrix to a model.
>
> Synopsis
>

>> SymMatrix AddDiagMat(

>>

>>> int dim,

>>>

>>> double *pVals,

>>>

>>> int len,

>>>

>>> int offset)

>
> Arguments
>

>> dim: dimension of diagonal matrix.

>>

>> pVals: array of values of diagonal elements.

>>

>> len: length of value array.

>>

>> offset: shift distance against diagonal line.

>
> Return
>

>> new diagonal matrix object.

##### Model::AddEyeMat()

> Add an identity matrix to a model.
>
> Synopsis
>

>> SymMatrix AddEyeMat(int dim)

>
> Arguments
>

>> dim: dimension of identity matrix.

>
> Return
>

>> new identity matrix object.

##### Model::AddGenConstrIndicator()

> Add a general constraint of type indicator to model.
>
> Synopsis
>

>> GenConstr AddGenConstrIndicator(const GenConstrBuilder & builder)

>
> Arguments
>

>> builder: builder for the general constraint.

>
> Return
>

>> new general constraint object of type indicator.

##### Model::AddGenConstrIndicator()

> Add a general constraint of type indicator to model.
>
> Synopsis
>

>> GenConstr AddGenConstrIndicator(

>>

>>> Var binVar,

>>>

>>> int binVal,

>>>

>>> const ConstrBuilder & constr)

>
> Arguments
>

>> binVar: binary indicator variable.

>>

>> binVal: value for binary indicator variable that force a linear constraint
to be satisfied(0 or 1).

>>

>> constr: builder for linear constraint.

>
> Return
>

>> new general constraint object of type indicator.

##### Model::AddGenConstrIndicator()

> Add a general constraint of type indicator to model.
>
> Synopsis
>

>> GenConstr AddGenConstrIndicator(

>>

>>> Var binVar,

>>>

>>> int binVal,

>>>

>>> const Expr & expr,

>>>

>>> char sense,

>>>

>>> double rhs)

>
> Arguments
>

>> binVar: binary indicator variable.

>>

>> binVal: value for binary indicator variable that force a linear constraint
to be satisfied(0 or 1).

>>

>> expr: expression for new linear contraint.

>>

>> sense: sense for new linear constraint.

>>

>> rhs: right hand side value for new linear constraint.

>
> Return
>

>> new general constraint object of type indicator.

##### Model::AddOnesMat()

> Add a dense symmetric matrix of value one to a model.
>
> Synopsis
>

>> SymMatrix AddOnesMat(int dim)

>
> Arguments
>

>> dim: dimension of dense symmetric matrix.

>
> Return
>

>> new symmetric matrix object.

##### Model::AddPsdConstr()

> Add a PSD constraint to model.
>
> Synopsis
>

>> PsdConstraint AddPsdConstr(

>>

>>> const PsdExpr & expr,

>>>

>>> char sense,

>>>

>>> double rhs,

>>>

>>> const char *szName)

>
> Arguments
>

>> expr: PSD expression for new PSD contraint.

>>

>> sense: sense for new PSD constraint.

>>

>> rhs: double value at right side of the new PSD constraint.

>>

>> szName: optional, name of new PSD constraint.

>
> Return
>

>> new PSD constraint object.

##### Model::AddPsdConstr()

> Add a PSD constraint to model.
>
> Synopsis
>

>> PsdConstraint AddPsdConstr(

>>

>>> const PsdExpr & expr,

>>>

>>> double lb,

>>>

>>> double ub,

>>>

>>> const char *szName)

>
> Arguments
>

>> expr: expression for new PSD constraint.

>>

>> lb: lower bound for ew PSD constraint.

>>

>> ub: upper bound for new PSD constraint

>>

>> szName: optional, name of new PSD constraint.

>
> Return
>

>> new PSD constraint object.

##### Model::AddPsdConstr()

> Add a PSD constraint to model.
>
> Synopsis
>

>> PsdConstraint AddPsdConstr(

>>

>>> const PsdExpr & lhs,

>>>

>>> char sense,

>>>

>>> const PsdExpr & rhs,

>>>

>>> const char *szName)

>
> Arguments
>

>> lhs: PSD expression at left side of new PSD constraint.

>>

>> sense: sense for new PSD constraint.

>>

>> rhs: PSD expression at right side of new PSD constraint.

>>

>> szName: optional, name of new PSD constraint.

>
> Return
>

>> new PSD constraint object.

##### Model::AddPsdConstr()

> Add a PSD constraint to a model.
>
> Synopsis
>

>> PsdConstraint AddPsdConstr(const PsdConstrBuilder & builder,const char
*szName)

>
> Arguments
>

>> builder: builder for new PSD constraint.

>>

>> szName: optional, name of new PSD constraint.

>
> Return
>

>> new PSD constraint object.

##### Model::AddPsdVar()

> Add a new PSD variable to model.
>
> Synopsis
>

>> PsdVar AddPsdVar(int dim,const char *szName)

>
> Arguments
>

>> dim: dimension of new PSD variable.

>>

>> szName: name of new PSD variable.

>
> Return
>

>> PSD variable object.

##### Model::AddPsdVars()

> Add new PSD variables to model.
>
> Synopsis
>

>> PsdVarArray AddPsdVars(

>>

>>> int count,

>>>

>>> int *pDim,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> count: number of new PSD variables.

>>

>> pDim: array of dimensions of new PSD variables.

>>

>> szPrefix: name prefix of new PSD variables.

>
> Return
>

>> array of PSD variable objects.

##### Model::AddPsdVars()

> Add new PSD variables to model.
>
> Synopsis
>

>> PsdVarArray AddPsdVars(

>>

>>> int count,

>>>

>>> int *pDim,

>>>

>>> const char *szNames,

>>>

>>> int len)

>
> Arguments
>

>> count: number of new PSD variables.

>>

>> pDim: array of dimensions of new PSD variables.

>>

>> szNames: name buffer of new PSD variables.

>>

>> len: length of the name buffer.

>
> Return
>

>> array of PSD variable objects.

##### Model::AddQConstr()

> Add a quadratic constraint to model.
>
> Synopsis
>

>> QConstraint AddQConstr(

>>

>>> const QuadExpr & expr,

>>>

>>> char sense,

>>>

>>> double rhs,

>>>

>>> const char *szName)

>
> Arguments
>

>> expr: quadratic expression for the new contraint.

>>

>> sense: sense for new quadratic constraint.

>>

>> rhs: double value at right side of the new quadratic constraint.

>>

>> szName: optional, name of new quadratic constraint.

>
> Return
>

>> new quadratic constraint object.

##### Model::AddQConstr()

> Add a quadratic constraint to model.
>
> Synopsis
>

>> QConstraint AddQConstr(

>>

>>> const QuadExpr & lhs,

>>>

>>> char sense,

>>>

>>> const QuadExpr & rhs,

>>>

>>> const char *szName)

>
> Arguments
>

>> lhs: quadratic expression at left side of the new quadratic constraint.

>>

>> sense: sense for new quadratic constraint.

>>

>> rhs: quadratic expression at right side of the new quadratic constraint.

>>

>> szName: optional, name of new quadratic constraint.

>
> Return
>

>> new quadratic constraint object.

##### Model::AddQConstr()

> Add a quadratic constraint to a model.
>
> Synopsis
>

>> QConstraint AddQConstr(const QConstrBuilder & builder,const char *szName)

>
> Arguments
>

>> builder: builder for the new quadratic constraint.

>>

>> szName: optional, name of new quadratic constraint.

>
> Return
>

>> new quadratic constraint object.

##### Model::AddSos()

> Add a SOS constraint to model.
>
> Synopsis
>

>> Sos AddSos(const SosBuilder & builder)

>
> Arguments
>

>> builder: builder for new SOS constraint.

>
> Return
>

>> new SOS constraint object.

##### Model::AddSos()

> Add a SOS constraint to model.
>
> Synopsis
>

>> Sos AddSos(

>>

>>> const VarArray & vars,

>>>

>>> const double *pWeights,

>>>

>>> int type)

>
> Arguments
>

>> vars: variables that participate in the SOS constraint.

>>

>> pWeights: optional, weights for variables in the SOS constraint.

>>

>> type: type of SOS constraint.

>
> Return
>

>> new SOS constraint object.

##### Model::AddSparseMat()

> Add a sparse symmetric matrix to a model.
>
> Synopsis
>

>> SymMatrix AddSparseMat(

>>

>>> int dim,

>>>

>>> int nElems,

>>>

>>> int *pRows,

>>>

>>> int *pCols,

>>>

>>> double *pVals)

>
> Arguments
>

>> dim: dimension of the sparse symmetric matrix.

>>

>> nElems: number of non

>>

>> pRows: array of row indexes of non

>>

>> pCols: array of col indexes of non

>>

>> pVals: array of values of non

>
> Return
>

>> new symmetric matrix object.

##### Model::AddSymMat()

> Given a symmetric matrix expression, add results matrix to model.
>
> Synopsis
>

>> SymMatrix AddSymMat(const SymMatExpr & expr)

>
> Arguments
>

>> expr: symmetric matrix expression object.

>
> Return
>

>> results symmetric matrix object.

##### Model::AddVar()

> Add a variable to model.
>
> Synopsis
>

>> Var AddVar(

>>

>>> double lb,

>>>

>>> double ub,

>>>

>>> double obj,

>>>

>>> char vtype,

>>>

>>> const char *szName)

>
> Arguments
>

>> lb: lower bound for new variable.

>>

>> ub: upper bound for new variable.

>>

>> obj: objective coefficient for new variable.

>>

>> vtype: variable type for new variable.

>>

>> szName: optional, name for new variable.

>
> Return
>

>> new variable object.

##### Model::AddVar()

> Add a variable and the associated non-zero coefficients as column.
>
> Synopsis
>

>> Var AddVar(

>>

>>> double lb,

>>>

>>> double ub,

>>>

>>> double obj,

>>>

>>> char vtype,

>>>

>>> const Column & col,

>>>

>>> const char *szName)

>
> Arguments
>

>> lb: lower bound for new variable.

>>

>> ub: upper bound for new variable.

>>

>> obj: objective coefficient for new variable.

>>

>> vtype: variable type for new variable.

>>

>> col: column object for specifying a set of constriants to which the
variable belongs.

>>

>> szName: optional, name for new variable.

>
> Return
>

>> new variable object.

##### Model::AddVars()

> Add new variables to model.
>
> Synopsis
>

>> VarArray AddVars(

>>

>>> int count,

>>>

>>> char vtype,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> count: the number of variables to add.

>>

>> vtype: variable types for new variables.

>>

>> szPrefix: prefix part for names of new variables.

>
> Return
>

>> array of new variable objects.

##### Model::AddVars()

> Add new variables to model.
>
> Synopsis
>

>> VarArray AddVars(

>>

>>> int count,

>>>

>>> char vtype,

>>>

>>> const char *szNames,

>>>

>>> int len)

>
> Arguments
>

>> count: the number of variables to add.

>>

>> vtype: variable types for new variables.

>>

>> szNames: name buffer for new variables.

>>

>> len: length of name buffer.

>
> Return
>

>> array of new variable objects.

##### Model::AddVars()

> Add new variables to model.
>
> Synopsis
>

>> VarArray AddVars(

>>

>>> int count,

>>>

>>> double lb,

>>>

>>> double ub,

>>>

>>> double obj,

>>>

>>> char vtype,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> count: the number of variables to add.

>>

>> lb: lower bound for new variable.

>>

>> ub: upper bound for new variable.

>>

>> obj: objective coefficient for new variable.

>>

>> vtype: variable types for new variables.

>>

>> szPrefix: prefix part for names of new variables.

>
> Return
>

>> array of new variable objects.

##### Model::AddVars()

> Add new variables to model.
>
> Synopsis
>

>> VarArray AddVars(

>>

>>> int count,

>>>

>>> double lb,

>>>

>>> double ub,

>>>

>>> double obj,

>>>

>>> char vtype,

>>>

>>> const char *szNames,

>>>

>>> int len)

>
> Arguments
>

>> count: the number of variables to add.

>>

>> lb: lower bound for new variable.

>>

>> ub: upper bound for new variable.

>>

>> obj: objective coefficient for new variable.

>>

>> vtype: variable types for new variables.

>>

>> szNames: name buffer for new variables.

>>

>> len: length of name buffer.

>
> Return
>

>> array of new variable objects.

##### Model::AddVars()

> Add new variables to model.
>
> Synopsis
>

>> VarArray AddVars(

>>

>>> int count,

>>>

>>> double *plb,

>>>

>>> double *pub,

>>>

>>> double *pobj,

>>>

>>> char *pvtype,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> count: the number of variables to add.

>>

>> plb: lower bounds for new variables. if NULL, lower bounds are 0.0.

>>

>> pub: upper bounds for new variables. if NULL, upper bounds are infinity or
1 for binary variables.

>>

>> pobj: objective coefficients for new variables. if NULL, objective
coefficients are 0.0.

>>

>> pvtype: variable types for new variables. if NULL, variable types are
continuous.

>>

>> szPrefix: prefix part for names of new variables.

>
> Return
>

>> array of new variable objects.

##### Model::AddVars()

> Add new decision variables to a model.
>
> Synopsis
>

>> VarArray AddVars(

>>

>>> int count,

>>>

>>> double *plb,

>>>

>>> double *pub,

>>>

>>> double *pobj,

>>>

>>> char *pvtype,

>>>

>>> const char *szNames,

>>>

>>> int len)

>
> Arguments
>

>> count: the number of variables to add.

>>

>> plb: lower bounds for new variables. if NULL, lower bounds are 0.0.

>>

>> pub: upper bounds for new variables. if NULL, upper bounds are infinity or
1 for binary variables.

>>

>> pobj: objective coefficients for new variables. if NULL, objective
coefficients are 0.0.

>>

>> pvtype: variable types for new variables. if NULL, variable types are
continuous.

>>

>> szNames: name buffer for new variables.

>>

>> len: length of name buffer.

>
> Return
>

>> array of new variable objects.

##### Model::AddVars()

> Add new variables to model.
>
> Synopsis
>

>> VarArray AddVars(

>>

>>> int count,

>>>

>>> double *plb,

>>>

>>> double *pub,

>>>

>>> double *pobj,

>>>

>>> char *pvtype,

>>>

>>> const ColumnArray & cols,

>>>

>>> const char *szPrefix)

>
> Arguments
>

>> count: the number of variables to add.

>>

>> plb: lower bounds for new variables. if NULL, lower bounds are 0.0.

>>

>> pub: upper bounds for new variables. if NULL, upper bounds are infinity or
1 for binary variables.

>>

>> pobj: objective coefficients for new variables. if NULL, objective
coefficients are 0.0.

>>

>> pvtype: variable types for new variables. if NULL, variable types are
continuous.

>>

>> cols: column objects for specifying a set of constriants to which each new
variable belongs.

>>

>> szPrefix: prefix part for names of new variables.

>
> Return
>

>> array of new variable objects.

##### Model::Clear()

> Clear all settings including problem itself.
>
> Synopsis
>

>> void Clear()

##### Model::Clone()

> Deep copy a new model object.
>
> Synopsis
>

>> Model Clone()

>
> Return
>

>> cloned model object.

##### Model::ComputeIIS()

> Compute IIS for infeasible model.
>
> Synopsis
>

>> void ComputeIIS()

##### Model::DelPsdObj()

> delete PSD part of objective in model.
>
> Synopsis
>

>> void DelPsdObj()

##### Model::DelQuadObj()

> delete quadratic part of objective in model.
>
> Synopsis
>

>> void DelQuadObj()

##### Model::FeasRelax()

> Compute feasibility relaxation for infeasible model.
>
> Synopsis
>

>> void FeasRelax(

>>

>>> VarArray & vars,

>>>

>>> double *pColLowPen,

>>>

>>> double *pColUppPen,

>>>

>>> ConstrArray & cons,

>>>

>>> double *pRowBndPen,

>>>

>>> double *pRowUppPen)

>
> Arguments
>

>> vars: an array of variables.

>>

>> pColLowPen: penalties for lower bounds of variables.

>>

>> pColUppPen: penalties for upper bounds of variables.

>>

>> cons: an array of constraints.

>>

>> pRowBndPen: penalties for right hand sides of constraints.

>>

>> pRowUppPen: penalties for upper bounds of range constraints.

##### Model::FeasRelax()

> Compute feasibility relaxation for infeasible model.
>
> Synopsis
>

>> void FeasRelax(int ifRelaxVars,int ifRelaxCons)

>
> Arguments
>

>> ifRelaxVars: whether to relax variables.

>>

>> ifRelaxCons: whether to relax constraints.

##### Model::Get()

> Query values of double parameter or attribute, associated with variables.
>
> Synopsis
>

>> int Get(

>>

>>> const char *szName,

>>>

>>> const VarArray & vars,

>>>

>>> double *pOut)

>
> Arguments
>

>> szName: name of double parameter or double attribute.

>>

>> vars: a list of desired variables.

>>

>> pOut: output array of parameter or attribute values.

>
> Return
>

>> the number of valid variables. If failed, return -1.

##### Model::Get()

> Query values of parameter or attribute, associated with constraints.
>
> Synopsis
>

>> int Get(

>>

>>> const char *szName,

>>>

>>> const ConstrArray & constrs,

>>>

>>> double *pOut)

>
> Arguments
>

>> szName: name of double parameter or double attribute.

>>

>> constrs: a list of desired constraints.

>>

>> pOut: output array of parameter or attribute values.

>
> Return
>

>> the number of valid constraints. If failed, return -1.

##### Model::Get()

> Query values of parameter or attribute, associated with quadratic
> constraints.
>
> Synopsis
>

>> int Get(

>>

>>> const char *szName,

>>>

>>> const QConstrArray & constrs,

>>>

>>> double *pOut)

>
> Arguments
>

>> szName: name of double parameter or double attribute.

>>

>> constrs: a list of desired quadratic constraints.

>>

>> pOut: output array of parameter or attribute values.

>
> Return
>

>> the number of valid quadratic constraints. If failed, return -1.

##### Model::Get()

> Query values of parameter or attribute, associated with PSD constraints.
>
> Synopsis
>

>> int Get(

>>

>>> const char *szName,

>>>

>>> const PsdConstrArray & constrs,

>>>

>>> double *pOut)

>
> Arguments
>

>> szName: name of double parameter or attribute.

>>

>> constrs: a list of desired PSD constraints.

>>

>> pOut: output array of parameter or attribute values.

>
> Return
>

>> the number of valid PSD constraints. If failed, return -1.

##### Model::GetCoeff()

> Get the coefficient of variable in a linear constraint.
>
> Synopsis
>

>> double GetCoeff(const Constraint & constr,const Var & var)

>
> Arguments
>

>> constr: The requested constraint.

>>

>> var: The requested variable.

>
> Return
>

>> The requested coefficient.

##### Model::GetCol()

> Get a column object that have a list of constraints in which the variable
> participates.
>
> Synopsis
>

>> Column GetCol(const Var & var)

>
> Arguments
>

>> var: a variable object.

>
> Return
>

>> a column object associated with a variable.

##### Model::GetColBasis()

> Get status of column basis.
>
> Synopsis
>

>> int GetColBasis(int *pBasis)

>
> Arguments
>

>> pBasis: integer pointer to basis status.

>
> Return
>

>> number of columns.

##### Model::GetCone()

> Get a cone constraint of given index in model.
>
> Synopsis
>

>> Cone GetCone(int idx)

>
> Arguments
>

>> idx: index of the desired cone constraint.

>
> Return
>

>> the desired cone constraint object.

##### Model::GetConeBuilders()

> Get builders of all cone constraints in model.
>
> Synopsis
>

>> ConeBuilderArray GetConeBuilders()

>
> Return
>

>> array object of all cone constraint builders.

##### Model::GetConeBuilders()

> Get builders of given cone constraints in model.
>
> Synopsis
>

>> ConeBuilderArray GetConeBuilders(const ConeArray & cones)

>
> Arguments
>

>> cones: array of cone constraints.

>
> Return
>

>> array object of desired cone constraint builders.

##### Model::GetCones()

> Get all cone constraints in model.
>
> Synopsis
>

>> ConeArray GetCones()

>
> Return
>

>> array object of cone constraints.

##### Model::GetConstr()

> Get a constraint of given index in model.
>
> Synopsis
>

>> Constraint GetConstr(int idx)

>
> Arguments
>

>> idx: index of the desired constraint.

>
> Return
>

>> the desired constraint object.

##### Model::GetConstrBuilder()

> Get builder of a constraint in model, including variables and associated
> coefficients, sense and RHS.
>
> Synopsis
>

>> ConstrBuilder GetConstrBuilder(Constraint constr)

>
> Arguments
>

>> constr: a constraint object.

>
> Return
>

>> constraint builder object.

##### Model::GetConstrBuilders()

> Get builders of all constraints in model.
>
> Synopsis
>

>> ConstrBuilderArray GetConstrBuilders()

>
> Return
>

>> array object of constraint builders.

##### Model::GetConstrByName()

> Get a constraint of given name in model.
>
> Synopsis
>

>> Constraint GetConstrByName(const char *szName)

>
> Arguments
>

>> szName: name of the desired constraint.

>
> Return
>

>> the desired constraint object.

##### Model::GetConstrLowerIIS()

> Get IIS status of lower bounds of constraints.
>
> Synopsis
>

>> int GetConstrLowerIIS(const ConstrArray & constrs,int *pLowerIIS)

>
> Arguments
>

>> constrs: Array of constraints.

>>

>> pLowerIIS: IIS status of lower bounds of constraints.

>
> Return
>

>> Number of constraints.

##### Model::GetConstrs()

> Get all constraints in model.
>
> Synopsis
>

>> ConstrArray GetConstrs()

>
> Return
>

>> array object of constraints.

##### Model::GetConstrUpperIIS()

> Get IIS status of upper bounds of constraints.
>
> Synopsis
>

>> int GetConstrUpperIIS(const ConstrArray & constrs,int *pUpperIIS)

>
> Arguments
>

>> constrs: Array of constraints.

>>

>> pUpperIIS: IIS status of upper bounds of constraints.

>
> Return
>

>> Number of constraints.

##### Model::GetDblAttr()

> Get value of a COPT double attribute.
>
> Synopsis
>

>> double GetDblAttr(const char *szAttr)

>
> Arguments
>

>> szAttr: name of double attribute.

>
> Return
>

>> value of double attribute.

##### Model::GetDblParam()

> Get value of a COPT double parameter.
>
> Synopsis
>

>> double GetDblParam(const char *szParam)

>
> Arguments
>

>> szParam: name of integer parameter.

>
> Return
>

>> value of double parameter.

##### Model::GetGenConstrIndicator()

> Get builder of given general constraint of type indicator.
>
> Synopsis
>

>> GenConstrBuilder GetGenConstrIndicator(const GenConstr & indicator)

>
> Arguments
>

>> indicator: a general constraint of type indicator.

>
> Return
>

>> builder object of general constraint of type indicator.

##### Model::GetIndicatorIIS()

> Get IIS status of indicator constraints.
>
> Synopsis
>

>> int GetIndicatorIIS(const GenConstrArray & genconstrs,int *pIIS)

>
> Arguments
>

>> genconstrs: Array of indicator constraints.

>>

>> pIIS: IIS status of indicator constraints.

>
> Return
>

>> Number of indicator constraints.

##### Model::GetIntAttr()

> Get value of a COPT integer attribute.
>
> Synopsis
>

>> int GetIntAttr(const char *szAttr)

>
> Arguments
>

>> szAttr: name of integer attribute.

>
> Return
>

>> value of integer attribute.

##### Model::GetIntParam()

> Get value of a COPT integer parameter.
>
> Synopsis
>

>> int GetIntParam(const char *szParam)

>
> Arguments
>

>> szParam: name of integer parameter.

>
> Return
>

>> value of integer parameter.

##### Model::GetLpSolution()

> Get LP solution.
>
> Synopsis
>

>> void GetLpSolution(

>>

>>> double *pValue,

>>>

>>> double *pSlack,

>>>

>>> double *pRowDual,

>>>

>>> double *pRedCost)

>
> Arguments
>

>> pValue: optional, double pointer to solution values.

>>

>> pSlack: optional, double poitner to slack values.

>>

>> pRowDual: optional, double pointer to dual values.

>>

>> pRedCost: optional, double pointer to reduced costs.

##### Model::GetObjective()

> Get linear expression of objective for model.
>
> Synopsis
>

>> Expr GetObjective()

>
> Return
>

>> a linear expression object.

##### Model::GetParamAttrType()

> Get type of a COPT parameter or attribute.
>
> Synopsis
>

>> int GetParamAttrType(const char *szName)

>
> Arguments
>

>> szName: name of parameter or attribute.

>
> Return
>

>> type of parameter or attribute.

##### Model::GetParamInfo()

> Get current, default, minimum, maximum of COPT integer parameter.
>
> Synopsis
>

>> void GetParamInfo(

>>

>>> const char *szParam,

>>>

>>> int *pnCur,

>>>

>>> int *pnDef,

>>>

>>> int *pnMin,

>>>

>>> int *pnMax)

>
> Arguments
>

>> szParam: name of integer parameter.

>>

>> pnCur: out, current value of integer parameter.

>>

>> pnDef: out, default value of integer parameter.

>>

>> pnMin: out, minimum value of integer parameter.

>>

>> pnMax: out, maximum value of integer parameter.

##### Model::GetParamInfo()

> Get current, default, minimum, maximum of COPT double parameter.
>
> Synopsis
>

>> void GetParamInfo(

>>

>>> const char *szParam,

>>>

>>> double *pdCur,

>>>

>>> double *pdDef,

>>>

>>> double *pdMin,

>>>

>>> double *pdMax)

>
> Arguments
>

>> szParam: name of double parameter.

>>

>> pdCur: out, current value of double parameter.

>>

>> pdDef: out, default value of double parameter.

>>

>> pdMin: out, minimum value of double parameter.

>>

>> pdMax: out, maximum value of double parameter.

##### Model::GetPoolObjVal()

> Get the iSol-th objective value in solution pool.
>
> Synopsis
>

>> double GetPoolObjVal(int iSol)

>
> Arguments
>

>> iSol: Index of solution.

>
> Return
>

>> The requested objective value.

##### Model::GetPoolSolution()

> Get the iSol-th solution in solution pool.
>
> Synopsis
>

>> int GetPoolSolution(

>>

>>> int iSol,

>>>

>>> const VarArray & vars,

>>>

>>> double *pColVals)

>
> Arguments
>

>> iSol: Index of solution.

>>

>> vars: The requested variables.

>>

>> pColVals: Pointer to the requested solutions.

>
> Return
>

>> The length of requested solution array.

##### Model::GetPsdCoeff()

> Get the symmetric matrix of PSD variable in a PSD constraint.
>
> Synopsis
>

>> SymMatrix GetPsdCoeff(const PsdConstraint & constr,const PsdVar & var)

>
> Arguments
>

>> constr: The desired PSD constraint.

>>

>> var: The desired PSD variable.

>
> Return
>

>> The associated coefficient matrix.

##### Model::GetPsdConstr()

> Get a quadratic constraint of given index in model.
>
> Synopsis
>

>> PsdConstraint GetPsdConstr(int idx)

>
> Arguments
>

>> idx: index of the desired quadratic constraint.

>
> Return
>

>> the desired quadratic constraint object.

##### Model::GetPsdConstrBuilder()

> Get builder of a PSD constraint in model, including PSD variables, sense and
> associated symmtric matrix.
>
> Synopsis
>

>> PsdConstrBuilder GetPsdConstrBuilder(const PsdConstraint & constr)

>
> Arguments
>

>> constr: a PSD constraint object.

>
> Return
>

>> PSD constraint builder object.

##### Model::GetPsdConstrBuilders()

> Get builders of all PSD constraints in model.
>
> Synopsis
>

>> PsdConstrBuilderArray GetPsdConstrBuilders()

>
> Return
>

>> array object of PSD constraint builders.

##### Model::GetPsdConstrByName()

> Get a quadratic constraint of given name in model.
>
> Synopsis
>

>> PsdConstraint GetPsdConstrByName(const char *szName)

>
> Arguments
>

>> szName: name of the desired constraint.

>
> Return
>

>> the desired quadratic constraint object.

##### Model::GetPsdConstrs()

> Get all PSD constraints in model.
>
> Synopsis
>

>> PsdConstrArray GetPsdConstrs()

>
> Return
>

>> array object of PSD constraints.

##### Model::GetPsdObjective()

> Get PSD objective of model.
>
> Synopsis
>

>> PsdExpr GetPsdObjective()

>
> Return
>

>> a PSD expression object.

##### Model::GetPsdRow()

> Get PSD variables and associated symmetric matrix that participate in a PSD
> constraint.
>
> Synopsis
>

>> PsdExpr GetPsdRow(const PsdConstraint & constr)

>
> Arguments
>

>> constr: a PSD constraint object.

>
> Return
>

>> PSD expression object of the PSD constraint.

##### Model::GetPsdRow()

> Get PSD variables, associated symmetric matrix, LB/UB that participate in a
> PSD constraint.
>
> Synopsis
>

>> PsdExpr GetPsdRow(

>>

>>> const PsdConstraint & constr,

>>>

>>> double *pLower,

>>>

>>> double *pUpper)

>
> Arguments
>

>> constr: a PSD constraint object.

>>

>> pLower: pointer to double value of lower bound.

>>

>> pUpper: pointer to double value of upper bound.

>
> Return
>

>> PSD expression object of the PSD constraint.

##### Model::GetPsdVar()

> Get a PSD variable of given index in model.
>
> Synopsis
>

>> PsdVar GetPsdVar(int idx)

>
> Arguments
>

>> idx: index of the desired PSD variable.

>
> Return
>

>> the desired PSD variable object.

##### Model::GetPsdVarByName()

> Get a PSD variable of given name in model.
>
> Synopsis
>

>> PsdVar GetPsdVarByName(const char *szName)

>
> Arguments
>

>> szName: name of the desired PSD variable.

>
> Return
>

>> the desired PSD variable object.

##### Model::GetPsdVars()

> Get all PSD variables in model.
>
> Synopsis
>

>> PsdVarArray GetPsdVars()

>
> Return
>

>> array object of PSD variables.

##### Model::GetQConstr()

> Get a quadratic constraint of given index in model.
>
> Synopsis
>

>> QConstraint GetQConstr(int idx)

>
> Arguments
>

>> idx: index of the desired quadratic constraint.

>
> Return
>

>> the desired quadratic constraint object.

##### Model::GetQConstrBuilder()

> Get builder of a constraint in model, including variables and associated
> coefficients, sense and RHS.
>
> Synopsis
>

>> QConstrBuilder GetQConstrBuilder(const QConstraint & constr)

>
> Arguments
>

>> constr: a constraint object.

>
> Return
>

>> constraint builder object.

##### Model::GetQConstrBuilders()

> Get builders of all constraints in model.
>
> Synopsis
>

>> QConstrBuilderArray GetQConstrBuilders()

>
> Return
>

>> array object of constraint builders.

##### Model::GetQConstrByName()

> Get a quadratic constraint of given name in model.
>
> Synopsis
>

>> QConstraint GetQConstrByName(const char *szName)

>
> Arguments
>

>> szName: name of the desired constraint.

>
> Return
>

>> the desired quadratic constraint object.

##### Model::GetQConstrs()

> Get all quadratic constraints in model.
>
> Synopsis
>

>> QConstrArray GetQConstrs()

>
> Return
>

>> array object of quadratic constraints.

##### Model::GetQuadObjective()

> Get quadratic objective of model.
>
> Synopsis
>

>> QuadExpr GetQuadObjective()

>
> Return
>

>> a quadratic expression object.

##### Model::GetQuadRow()

> Get two variables and associated coefficients that participate in a
> quadratic constraint.
>
> Synopsis
>

>> QuadExpr GetQuadRow(const QConstraint & constr)

>
> Arguments
>

>> constr: a quadratic constraint object.

>
> Return
>

>> quadratic expression object of the constraint.

##### Model::GetQuadRow()

> Get two variables and associated coefficients that participate in a
> quadratic constraint.
>
> Synopsis
>

>> QuadExpr GetQuadRow(

>>

>>> const QConstraint & constr,

>>>

>>> char *pSense,

>>>

>>> double *pBound)

>
> Arguments
>

>> constr: a quadratic constraint object.

>>

>> pSense: sense of quadratic constraint.

>>

>> pBound: right hand side of quadratic constraint.

>
> Return
>

>> quadratic expression object of the constraint.

##### Model::GetRow()

> Get variables that participate in a constraint, and the associated
> coefficients.
>
> Synopsis
>

>> Expr GetRow(const Constraint & constr)

>
> Arguments
>

>> constr: a constraint object.

>
> Return
>

>> expression object of the constraint.

##### Model::GetRowBasis()

> Get status of row basis.
>
> Synopsis
>

>> int GetRowBasis(int *pBasis)

>
> Arguments
>

>> pBasis: integer pointer to basis status.

>
> Return
>

>> number of rows.

##### Model::GetSolution()

> Get MIP solution.
>
> Synopsis
>

>> void GetSolution(double *pValue)

>
> Arguments
>

>> pValue: double pointer to solution values.

##### Model::GetSos()

> Get a SOS constraint of given index in model.
>
> Synopsis
>

>> Sos GetSos(int idx)

>
> Arguments
>

>> idx: index of the desired SOS constraint.

>
> Return
>

>> the desired SOS constraint object.

##### Model::GetSosBuilders()

> Get builders of all SOS constraints in model.
>
> Synopsis
>

>> SosBuilderArray GetSosBuilders()

>
> Return
>

>> array object of SOS constraint builders.

##### Model::GetSosBuilders()

> Get builders of given SOS constraints in model.
>
> Synopsis
>

>> SosBuilderArray GetSosBuilders(const SosArray & soss)

>
> Arguments
>

>> soss: array of SOS constraints.

>
> Return
>

>> array object of desired SOS constraint builders.

##### Model::GetSOSIIS()

> Get IIS status of SOS constraints.
>
> Synopsis
>

>> int GetSOSIIS(const SosArray & soss,int *pIIS)

>
> Arguments
>

>> soss: Array of SOS constraints.

>>

>> pIIS: IIS status of SOS constraints.

>
> Return
>

>> Number of SOS constraints.

##### Model::GetSoss()

> Get all SOS constraints in model.
>
> Synopsis
>

>> SosArray GetSoss()

>
> Return
>

>> array object of SOS constraints.

##### Model::GetSymMat()

> Get a symmetric matrix of given index in model.
>
> Synopsis
>

>> SymMatrix GetSymMat(int idx)

>
> Arguments
>

>> idx: index of the desired symmetric matrix.

>
> Return
>

>> the desired symmetric matrix object.

##### Model::GetVar()

> Get a variable of given index in model.
>
> Synopsis
>

>> Var GetVar(int idx)

>
> Arguments
>

>> idx: index of the desired variable.

>
> Return
>

>> the desired variable object.

##### Model::GetVarByName()

> Get a variable of given name in model.
>
> Synopsis
>

>> Var GetVarByName(const char *szName)

>
> Arguments
>

>> szName: name of the desired variable.

>
> Return
>

>> the desired variable object.

##### Model::GetVarLowerIIS()

> Get IIS status of lower bounds of variables.
>
> Synopsis
>

>> int GetVarLowerIIS(const VarArray & vars,int *pLowerIIS)

>
> Arguments
>

>> vars: Array of variables

>>

>> pLowerIIS: IIS status of lower bounds of variables.

>
> Return
>

>> Number of variables.

##### Model::GetVars()

> Get all variables in model.
>
> Synopsis
>

>> VarArray GetVars()

>
> Return
>

>> variable array object.

##### Model::GetVarUpperIIS()

> Get IIS status of upper bounds of variables.
>
> Synopsis
>

>> int GetVarUpperIIS(const VarArray & vars,int *pUpperIIS)

>
> Arguments
>

>> vars: Array of variables

>>

>> pUpperIIS: IIS status of upper bounds of variables.

>
> Return
>

>> Number of variables.

##### Model::Interrupt()

> Interrupt optimization of current problem.
>
> Synopsis
>

>> void Interrupt()

##### Model::LoadMipStart()

> Load final initial values of variables to the problem.
>
> Synopsis
>

>> void LoadMipStart()

##### Model::LoadTuneParam()

> Load specified tuned parameters into model.
>
> Synopsis
>

>> void LoadTuneParam(int idx)

>
> Arguments
>

>> idx: Index of tuned parameters.

##### Model::Read()

> Read problem, solution, basis, MIP start or COPT parameters from file.
>
> Synopsis
>

>> void Read(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadBasis()

> Read basis from file.
>
> Synopsis
>

>> void ReadBasis(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadBin()

> Read problem in COPT binary format from file.
>
> Synopsis
>

>> void ReadBin(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadCbf()

> Read problem in CBF format from file.
>
> Synopsis
>

>> void ReadCbf(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadLp()

> Read problem in LP format from file.
>
> Synopsis
>

>> void ReadLp(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadMps()

> Read problem in MPS format from file.
>
> Synopsis
>

>> void ReadMps(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadMst()

> Read MIP start information from file.
>
> Synopsis
>

>> void ReadMst(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadParam()

> Read COPT parameters from file.
>
> Synopsis
>

>> void ReadParam(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadSdpa()

> Read problem in SDPA format from file.
>
> Synopsis
>

>> void ReadSdpa(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadSol()

> Read solution from file.
>
> Synopsis
>

>> void ReadSol(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::ReadTune()

> Read tuning parameters from file.
>
> Synopsis
>

>> void ReadTune(const char *szFileName)

>
> Arguments
>

>> szFileName: an input file name.

##### Model::Remove()

> Remove a list of variables from model.
>
> Synopsis
>

>> void Remove(VarArray & vars)

>
> Arguments
>

>> vars: an array of variables.

##### Model::Remove()

> Remove a list of constraints from model.
>
> Synopsis
>

>> void Remove(ConstrArray & constrs)

>
> Arguments
>

>> constrs: an array of constraints.

##### Model::Remove()

> Remove a list of SOS constraints from model.
>
> Synopsis
>

>> void Remove(SosArray & soss)

>
> Arguments
>

>> soss: an array of SOS constraints.

##### Model::Remove()

> Remove a list of gernal constraints from model.
>
> Synopsis
>

>> void Remove(GenConstrArray & genConstrs)

>
> Arguments
>

>> genConstrs: an array of general constraints.

##### Model::Remove()

> Remove a list of Cone constraints from model.
>
> Synopsis
>

>> void Remove(ConeArray & cones)

>
> Arguments
>

>> cones: an array of Cone constraints.

##### Model::Remove()

> Remove a list of quadratic constraints from model.
>
> Synopsis
>

>> void Remove(QConstrArray & qconstrs)

>
> Arguments
>

>> qconstrs: an array of quadratic constraints.

##### Model::Remove()

> Remove a list of PSD variables from model.
>
> Synopsis
>

>> void Remove(PsdVarArray & vars)

>
> Arguments
>

>> vars: an array of PSD variables.

##### Model::Remove()

> Remove a list of PSD constraints from model.
>
> Synopsis
>

>> void Remove(PsdConstrArray & constrs)

>
> Arguments
>

>> constrs: an array of PSD constraints.

##### Model::Reset()

> Reset solution only.
>
> Synopsis
>

>> void Reset()

##### Model::ResetAll()

> Reset solution and additional information.
>
> Synopsis
>

>> void ResetAll()

##### Model::ResetParam()

> Reset parameters to default settings.
>
> Synopsis
>

>> void ResetParam()

##### Model::Set()

> Set values of double parameter, associated with variables.
>
> Synopsis
>

>> void Set(

>>

>>> const char *szName,

>>>

>>> const VarArray & vars,

>>>

>>> double *pVals,

>>>

>>> int len)

>
> Arguments
>

>> szName: name of double parameter.

>>

>> vars: a list of desired variables.

>>

>> pVals: array of parameter values.

>>

>> len: length of value array.

##### Model::Set()

> Set values of parameter, associated with constraints.
>
> Synopsis
>

>> void Set(

>>

>>> const char *szName,

>>>

>>> const ConstrArray & constrs,

>>>

>>> double *pVals,

>>>

>>> int len)

>
> Arguments
>

>> szName: name of double parameter.

>>

>> constrs: a list of desired constraints.

>>

>> pVals: array of parameter values.

>>

>> len: length of value array.

##### Model::Set()

> Set values of parameter, associated with PSD constraints.
>
> Synopsis
>

>> void Set(

>>

>>> const char *szName,

>>>

>>> const PsdConstrArray & constrs,

>>>

>>> double *pVals,

>>>

>>> int len)

>
> Arguments
>

>> szName: name of double parameter.

>>

>> constrs: a list of desired PSD constraints.

>>

>> pVals: array of values of parameter.

>>

>> len: length of value array.

##### Model::SetBasis()

> Set column and row basis status to model.
>
> Synopsis
>

>> void SetBasis(int *pColBasis,int *pRowBasis)

>
> Arguments
>

>> pColBasis: pointer to status of column basis.

>>

>> pRowBasis: pointer to status of row basis.

##### Model::SetCoeff()

> Set the coefficient of a variable in a linear constraint.
>
> Synopsis
>

>> void SetCoeff(

>>

>>> const Constraint & constr,

>>>

>>> const Var & var,

>>>

>>> double newVal)

>
> Arguments
>

>> constr: The requested constraint.

>>

>> var: The requested variable.

>>

>> newVal: New coefficient.

##### Model::SetDblParam()

> Set value of a COPT double parameter.
>
> Synopsis
>

>> void SetDblParam(const char *szParam,double dVal)

>
> Arguments
>

>> szParam: name of integer parameter.

>>

>> dVal: double value.

##### Model::SetIntParam()

> Set value of a COPT integer parameter.
>
> Synopsis
>

>> void SetIntParam(const char *szParam,int nVal)

>
> Arguments
>

>> szParam: name of integer parameter.

>>

>> nVal: integer value.

##### Model::SetLpSolution()

> Set LP solution.
>
> Synopsis
>

>> void SetLpSolution(

>>

>>> double *pValue,

>>>

>>> double *pSlack,

>>>

>>> double *pRowDual,

>>>

>>> double *pRedCost)

>
> Arguments
>

>> pValue: double pointer to solution values.

>>

>> pSlack: double poitner to slack values.

>>

>> pRowDual: double pointer to dual values.

>>

>> pRedCost: double pointer to reduced costs.

##### Model::SetMipStart()

> Set initial values for variables of given number, starting from the first
> one.
>
> Synopsis
>

>> void SetMipStart(int count,double *pVals)

>
> Arguments
>

>> count: the number of variables to set.

>>

>> pVals: pointer to initial values of variables.

##### Model::SetMipStart()

> Set initial value for the specified variable.
>
> Synopsis
>

>> void SetMipStart(const Var & var,double val)

>
> Arguments
>

>> var: an interested variable.

>>

>> val: initial value of the variable.

##### Model::SetMipStart()

> Set initial values for an array of variables.
>
> Synopsis
>

>> void SetMipStart(const VarArray & vars,double *pVals)

>
> Arguments
>

>> vars: a list of interested variables.

>>

>> pVals: pointer to initial values of variables.

##### Model::SetObjConst()

> Set objective constant.
>
> Synopsis
>

>> void SetObjConst(double constant)

>
> Arguments
>

>> constant: constant value to set.

##### Model::SetObjective()

> Set objective for model.
>
> Synopsis
>

>> void SetObjective(const Expr & expr,int sense)

>
> Arguments
>

>> expr: expression of the objective.

>>

>> sense: optional, default value 0 does not change COPT sense.

##### Model::SetObjSense()

> Set objective sense for model.
>
> Synopsis
>

>> void SetObjSense(int sense)

>
> Arguments
>

>> sense: the objective sense.

##### Model::SetPsdCoeff()

> Set the coefficient matrix of a PSD variable in a PSD constraint.
>
> Synopsis
>

>> void SetPsdCoeff(

>>

>>> const PsdConstraint & constr,

>>>

>>> const PsdVar & var,

>>>

>>> const SymMatrix & mat)

>
> Arguments
>

>> constr: The desired PSD constraint.

>>

>> var: The desired PSD variable.

>>

>> mat: new coefficient matrix.

##### Model::SetPsdObjective()

> Set PSD objective for model.
>
> Synopsis
>

>> void SetPsdObjective(const PsdExpr & expr,int sense)

>
> Arguments
>

>> expr: PSD expression of the objective.

>>

>> sense: optional, default value 0 does not change COPT sense.

##### Model::SetQuadObjective()

> Set quadratic objective for model.
>
> Synopsis
>

>> void SetQuadObjective(const QuadExpr & expr,int sense)

>
> Arguments
>

>> expr: quadratic expression of the objective.

>>

>> sense: optional, default value 0 does not change COPT sense.

##### Model::SetSlackBasis()

> Set slack basis to model.
>
> Synopsis
>

>> void SetSlackBasis()

##### Model::SetSolverLogCallback()

> Set log callback for COPT.
>
> Synopsis
>

>> void SetSolverLogCallback(ILogCallback *pcb)

>
> Arguments
>

>> pcb: pointer to ILogCallback object.

##### Model::SetSolverLogFile()

> Set log file for COPT.
>
> Synopsis
>

>> void SetSolverLogFile(const char *szLogFile)

>
> Arguments
>

>> szLogFile: log file name.

##### Model::Solve()

> Solve the model as MIP.
>
> Synopsis
>

>> void Solve()

##### Model::SolveLp()

> Solve the model as LP.
>
> Synopsis
>

>> void SolveLp()

##### Model::Tune()

> Tune model.
>
> Synopsis
>

>> void Tune()

##### Model::Write()

> Output problem, solution, basis, MIP start or modified COPT parameters to
> file.
>
> Synopsis
>

>> void Write(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WriteBasis()

> Output optimal basis to a file of type ‘.bas’.
>
> Synopsis
>

>> void WriteBasis(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WriteBin()

> Output problem to a file as COPT binary format.
>
> Synopsis
>

>> void WriteBin(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WriteIIS()

> Output IIS to file.
>
> Synopsis
>

>> void WriteIIS(const char *szFileName)

>
> Arguments
>

>> szFileName: Output file name.

##### Model::WriteLp()

> Output problem to a file as LP format.
>
> Synopsis
>

>> void WriteLp(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WriteMps()

> Output problem to a file as MPS format.
>
> Synopsis
>

>> void WriteMps(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WriteMpsStr()

> Output problem to a buffer as MPS format.
>
> Synopsis
>

>> ProbBuffer WriteMpsStr()

>
> Return
>

>> output problem buffer.

##### Model::WriteMst()

> Output MIP start information to a file of type ‘.mst’.
>
> Synopsis
>

>> void WriteMst(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WriteParam()

> Output modified COPT parameters to a file of type ‘.par’.
>
> Synopsis
>

>> void WriteParam(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WritePoolSol()

> Output selected pool solution to a file of type ‘.sol’.
>
> Synopsis
>

>> void WritePoolSol(int iSol,const char *szFileName)

>
> Arguments
>

>> iSol: index of pool solution.

>>

>> szFileName: an output file name.

##### Model::WriteRelax()

> Output feasibility relaxation problem to file.
>
> Synopsis
>

>> void WriteRelax(const char *szFileName)

>
> Arguments
>

>> szFileName: Output file name.

##### Model::WriteSol()

> Output solution to a file of type ‘.sol’.
>
> Synopsis
>

>> void WriteSol(const char *szFileName)

>
> Arguments
>

>> szFileName: an output file name.

##### Model::WriteTuneParam()

> Output specified tuned parameters to a file of type ‘.par’.
>
> Synopsis
>

>> void WriteTuneParam(int idx,const char *szFileName)

>
> Arguments
>

>> idx: Index of tuned parameters.

>>

>> szFileName: Output file name.

#### 4 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.

##### Var::Get()

> Get attribute value of the variable. Support “Value”, “RedCost”, “LB”, “UB”,
> and “Obj” attributes.
>
> Synopsis
>

>> double Get(const char *szAttr)

>
> Arguments
>

>> szAttr: attribute name.

>
> Return
>

>> attribute value

##### Var::GetIdx()

> Get index of the variable.
>
> Synopsis
>

>> inline int GetIdx()

>
> Return
>

>> variable index.

##### Var::GetLowerIIS()

> Get IIS status for lower bound of the variable.
>
> Synopsis
>

>> int GetLowerIIS()

>
> Return
>

>> IIS status.

##### Var::GetName()

> Get name of the variable.
>
> Synopsis
>

>> const char *GetName()

>
> Return
>

>> variable name.

##### Var::GetType()

> Get type of the variable.
>
> Synopsis
>

>> char GetType()

>
> Return
>

>> variable type.

##### Var::GetUpperIIS()

> Get IIS status for upper bound of the variable.
>
> Synopsis
>

>> int GetUpperIIS()

>
> Return
>

>> IIS status.

##### Var::Remove()

> Remove variable from model.
>
> Synopsis
>

>> void Remove()

##### Var::Set()

> Set attribute value of the variable. Support “LB”, “UB” and “Obj”
> attributes.
>
> Synopsis
>

>> void Set(const char *szAttr,double value)

>
> Arguments
>

>> szAttr: attribute name.

>>

>> value: new value.

##### Var::SetName()

> Set name of the variable.
>
> Synopsis
>

>> void SetName(const char *szName)

>
> Arguments
>

>> szName: variable name.

##### Var::SetType()

> Set type of the variable.
>
> Synopsis
>

>> void SetType(char type)

>
> Arguments
>

>> type: variable type.

#### 5 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.

##### VarArray::GetVar()

> Get i-th variable object.
>
> Synopsis
>

>> Var & GetVar(int i)

>
> Arguments
>

>> i: index of the variable.

>
> Return
>

>> variable object with index i.

##### VarArray::PushBack()

> Add a variable object to variable array.
>
> Synopsis
>

>> void PushBack(const Var & var)

>
> Arguments
>

>> var: a variable object.

##### VarArray::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for variable object.

##### VarArray::Size()

> Get the number of variable objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of variable objects.

#### 6 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()

> Constructor of a constant linear expression.
>
> Synopsis
>

>> Expr(double constant)

>
> Arguments
>

>> constant: constant value in expression object.

##### Expr::Expr()

> Constructor of a linear expression with one term.
>
> Synopsis
>

>> Expr(const Var & var,double coeff)

>
> Arguments
>

>> var: variable for the added term.

>>

>> coeff: coefficent for the added term.

##### Expr::AddConstant()

> Add constant for the expression.
>
> Synopsis
>

>> void AddConstant(double constant)

>
> Arguments
>

>> constant: the value of the constant.

##### Expr::AddExpr()

> Add an expression to self.
>
> Synopsis
>

>> void AddExpr(const Expr & expr,double mult)

>
> Arguments
>

>> expr: expression to be added.

>>

>> mult: optional, constant multiplier, default value is 1.0.

##### Expr::AddTerm()

> Add a term to expression object.
>
> Synopsis
>

>> void AddTerm(const Var & var,double coeff)

>
> Arguments
>

>> var: a variable for new term.

>>

>> coeff: coefficient for new term.

##### Expr::AddTerms()

> Add terms to expression object.
>
> Synopsis
>

>> int AddTerms(

>>

>>> const VarArray & vars,

>>>

>>> double *pCoeff,

>>>

>>> int len)

>
> Arguments
>

>> vars: variables for added terms.

>>

>> pCoeff: coefficient array for added terms.

>>

>> len: length of coefficient array.

>
> Return
>

>> number of added terms.

##### Expr::Clone()

> Deep copy linear expression object.
>
> Synopsis
>

>> Expr Clone()

>
> Return
>

>> cloned expression object.

##### Expr::Evaluate()

> evaluate linear expression after solving
>
> Synopsis
>

>> double Evaluate()

>
> Return
>

>> value of linear expression

##### Expr::GetCoeff()

> Get coefficient from the i-th term in expression.
>
> Synopsis
>

>> double GetCoeff(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> coefficient of the i-th term in expression object.

##### Expr::GetConstant()

> Get constant in expression.
>
> Synopsis
>

>> double GetConstant()

>
> Return
>

>> constant in expression.

##### Expr::GetVar()

> Get variable from the i-th term in expression.
>
> Synopsis
>

>> Var & GetVar(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> variable of the i-th term in expression object.

##### Expr::operator*=()

> Multiply a constant to self.
>
> Synopsis
>

>> void operator*=(double c)

>
> Arguments
>

>> c: constant multiplier.

##### Expr::operator*()

> Multiply constant and return new expression.
>
> Synopsis
>

>> Expr operator*(double c)

>
> Arguments
>

>> c: constant multiplier.

>
> Return
>

>> result expression.

##### Expr::operator*()

> Multiply a variable and return new quadratic expression object.
>
> Synopsis
>

>> QuadExpr operator*(const Var & var)

>
> Arguments
>

>> var: variable object.

>
> Return
>

>> result quadratic expression.

##### Expr::operator*()

> Multiply a linear expression and return new quadratic expression object.
>
> Synopsis
>

>> QuadExpr operator*(const Expr & other)

>
> Arguments
>

>> other: linear expression object.

>
> Return
>

>> result quadratic expression.

##### Expr::operator+=()

> Add an expression to self.
>
> Synopsis
>

>> void operator+=(const Expr & expr)

>
> Arguments
>

>> expr: expression to be added.

##### Expr::operator+()

> Add expression and return new expression.
>
> Synopsis
>

>> Expr operator+(const Expr & other)

>
> Arguments
>

>> other: other expression to add.

>
> Return
>

>> result expression.

##### Expr::operator-=()

> Substract an expression from self.
>
> Synopsis
>

>> void operator-=(const Expr & expr)

>
> Arguments
>

>> expr: expression to be substracted.

##### Expr::operator-()

> Substract expression and return new expression.
>
> Synopsis
>

>> Expr operator-(const Expr & other)

>
> Arguments
>

>> other: other expression to substract.

>
> Return
>

>> result expression.

##### Expr::Remove()

> Remove i-th term from expression object.
>
> Synopsis
>

>> void Remove(int i)

>
> Arguments
>

>> i: index of the term to be removed.

##### Expr::Remove()

> Remove the term associated with variable from expression.
>
> Synopsis
>

>> void Remove(const Var & var)

>
> Arguments
>

>> var: a variable whose term should be removed.

##### Expr::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(size_ t n)

>
> Arguments
>

>> n: minimum capacity for linear expression object.

##### Expr::SetCoeff()

> Set coefficient for the i-th term in expression.
>
> Synopsis
>

>> void SetCoeff(int i,double val)

>
> Arguments
>

>> i: index of the term.

>>

>> val: coefficient of the term.

##### Expr::SetConstant()

> Set constant for the expression.
>
> Synopsis
>

>> void SetConstant(double constant)

>
> Arguments
>

>> constant: the value of the constant.

##### Expr::Size()

> Get number of terms in expression.
>
> Synopsis
>

>> size_ t Size()

>
> Return
>

>> number of terms.

#### 7 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.

##### Constraint::Get()

> Get attribute value of the constraint. Support “Dual”, “Slack”, “LB”, “UB”
> attributes.
>
> Synopsis
>

>> double Get(const char *szAttr)

>
> Arguments
>

>> szAttr: name of the attribute being queried.

>
> Return
>

>> attribute value.

##### Constraint::GetBasis()

> Get basis status of this constraint.
>
> Synopsis
>

>> int GetBasis()

>
> Return
>

>> basis status.

##### Constraint::GetIdx()

> Get index of the constraint.
>
> Synopsis
>

>> int GetIdx()

>
> Return
>

>> the index of the constraint.

##### Constraint::GetLowerIIS()

> Get IIS status for lower bound of the constraint.
>
> Synopsis
>

>> int GetLowerIIS()

>
> Return
>

>> IIS status.

##### Constraint::GetName()

> Get name of the constraint.
>
> Synopsis
>

>> const char *GetName()

>
> Return
>

>> the name of the constraint.

##### Constraint::GetUpperIIS()

> Get IIS status for upper bound of the constraint.
>
> Synopsis
>

>> int GetUpperIIS()

>
> Return
>

>> IIS status.

##### Constraint::Remove()

> Remove this constraint from model.
>
> Synopsis
>

>> void Remove()

##### Constraint::Set()

> Set attribute value of the constraint. Support “LB” and “UB” attributes.
>
> Synopsis
>

>> void Set(const char *szAttr,double value)

>
> Arguments
>

>> szAttr: name of the attribute.

>>

>> value: new value.

##### Constraint::SetName()

> Set name for the constraint.
>
> Synopsis
>

>> void SetName(const char *szName)

>
> Arguments
>

>> szName: the name to set.

#### 8 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.

##### ConstrArray::GetConstr()

> Get i-th constraint object.
>
> Synopsis
>

>> Constraint & GetConstr(int i)

>
> Arguments
>

>> i: index of the constraint.

>
> Return
>

>> constraint object with index i.

##### ConstrArray::PushBack()

> Add a constraint object to constraint array.
>
> Synopsis
>

>> void PushBack(const Constraint & constr)

>
> Arguments
>

>> constr: a constraint object.

##### ConstrArray::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for Constraint object.

##### ConstrArray::Size()

> Get the number of constraint objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of constraint objects.

#### 9 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.

##### ConstrBuilder::GetExpr()

> Get expression associated with constraint.
>
> Synopsis
>

>> const Expr & GetExpr()

>
> Return
>

>> expression object.

##### ConstrBuilder::GetRange()

> Get range from lower bound to upper bound of range constraint.
>
> Synopsis
>

>> double GetRange()

>
> Return
>

>> length from lower bound to upper bound of the constraint.

##### ConstrBuilder::GetSense()

> Get sense associated with constraint.
>
> Synopsis
>

>> char GetSense()

>
> Return
>

>> constraint sense.

##### ConstrBuilder::Set()

> Set detail of a constraint to its builder object.
>
> Synopsis
>

>> void Set(

>>

>>> const Expr & expr,

>>>

>>> char sense,

>>>

>>> double rhs)

>
> Arguments
>

>> expr: expression object at one side of the constraint

>>

>> sense: constraint sense other than COPT_RANGE.

>>

>> rhs: constant of right side of the constraint.

##### ConstrBuilder::SetRange()

> Set a range constraint to its builder.
>
> Synopsis
>

>> void SetRange(const Expr & expr,double range)

>
> Arguments
>

>> expr: expression object, whose constant is negative upper bound.

>>

>> range: length from lower bound to upper bound of the constraint. Must
greater than 0.

#### 10 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.

##### ConstrBuilderArray::GetBuilder()

> Get i-th constraint builder object.
>
> Synopsis
>

>> ConstrBuilder & GetBuilder(int i)

>
> Arguments
>

>> i: index of the constraint builder.

>
> Return
>

>> constraint builder object with index i.

##### ConstrBuilderArray::PushBack()

> Add a constraint builder object to constraint builder array.
>
> Synopsis
>

>> void PushBack(const ConstrBuilder & builder)

>
> Arguments
>

>> builder: a constraint builder object.

##### ConstrBuilderArray::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for constraint builder object.

##### ConstrBuilderArray::Size()

> Get the number of constraint builder objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of constraint builder objects.

#### 11 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.

##### Column::Column()

> Constructor of column.
>
> Synopsis
>

>> Column()

##### Column::AddColumn()

> Add a column to self.
>
> Synopsis
>

>> void AddColumn(const Column & col,double mult)

>
> Arguments
>

>> col: column object to be added.

>>

>> mult: multiply constant.

##### Column::AddTerm()

> Add a term to column object.
>
> Synopsis
>

>> void AddTerm(const Constraint & constr,double coeff)

>
> Arguments
>

>> constr: a constraint for new term.

>>

>> coeff: coefficient for new term.

##### Column::AddTerms()

> Add terms to column object.
>
> Synopsis
>

>> int AddTerms(

>>

>>> const ConstrArray & constrs,

>>>

>>> double *pCoeff,

>>>

>>> int len)

>
> Arguments
>

>> constrs: constraints for added terms.

>>

>> pCoeff: coefficients for added terms.

>>

>> len: number of terms to be added.

>
> Return
>

>> number of added terms.

##### Column::Clear()

> Clear all terms.
>
> Synopsis
>

>> void Clear()

##### Column::Clone()

> Deep copy column object.
>
> Synopsis
>

>> Column Clone()

>
> Return
>

>> cloned column object.

##### Column::GetCoeff()

> Get coefficient from the i-th term in column object.
>
> Synopsis
>

>> double GetCoeff(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> coefficient of the i-th term in column object.

##### Column::GetConstr()

> Get constraint from the i-th term in column object.
>
> Synopsis
>

>> Constraint GetConstr(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> constraint of the i-th term in column object.

##### Column::Remove()

> Remove i-th term from column object.
>
> Synopsis
>

>> void Remove(int i)

>
> Arguments
>

>> i: index of the term to be removed.

##### Column::Remove()

> Remove the term associated with constraint from column object.
>
> Synopsis
>

>> bool Remove(const Constraint & constr)

>
> Arguments
>

>> constr: a constraint whose term should be removed.

>
> Return
>

>> true if constraint exits in column object.

##### Column::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for Column object.

##### Column::Size()

> Get number of terms in column object.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of terms.

#### 12 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.

##### ColumnArray::Clear()

> Clear all column objects.
>
> Synopsis
>

>> void Clear()

##### ColumnArray::GetColumn()

> Get i-th column object.
>
> Synopsis
>

>> Column & GetColumn(int i)

>
> Arguments
>

>> i: index of the column.

>
> Return
>

>> column object with index i.

##### ColumnArray::PushBack()

> Add a column object to column array.
>
> Synopsis
>

>> void PushBack(const Column & col)

>
> Arguments
>

>> col: a column object.

##### ColumnArray::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for linear expression object.

##### ColumnArray::Size()

> Get the number of column objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of column objects.

#### 13 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).

##### Sos::GetIdx()

> Get the index of SOS constraint.
>
> Synopsis
>

>> int GetIdx()

>
> Return
>

>> index of SOS constraint.

##### Sos::GetIIS()

> Get IIS status of the SOS constraint.
>
> Synopsis
>

>> int GetIIS()

>
> Return
>

>> IIS status.

##### Sos::Remove()

> Remove the SOS constraint from model.
>
> Synopsis
>

>> void Remove()

#### 14 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.

##### SosArray::GetSos()

> Get i-th SOS constraint object.
>
> Synopsis
>

>> Sos & GetSos(int i)

>
> Arguments
>

>> i: index of the SOS constraint.

>
> Return
>

>> SOS constraint object with index i.

##### SosArray::PushBack()

> Add a SOS constraint object to SOS constraint array.
>
> Synopsis
>

>> void PushBack(const Sos & sos)

>
> Arguments
>

>> sos: a SOS constraint object.

##### SosArray::Size()

> Get the number of SOS constraint objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of SOS constraint objects.

#### 15 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.

##### SosBuilder::GetSize()

> Get number of terms in SOS constraint.
>
> Synopsis
>

>> int GetSize()

>
> Return
>

>> number of terms.

##### SosBuilder::GetType()

> Get type of SOS constraint.
>
> Synopsis
>

>> int GetType()

>
> Return
>

>> type of SOS constraint.

##### SosBuilder::GetVar()

> Get variable from the i-th term in SOS constraint.
>
> Synopsis
>

>> Var GetVar(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> variable of the i-th term in SOS constraint.

##### SosBuilder::GetVars()

> Get variables of all terms in SOS constraint.
>
> Synopsis
>

>> VarArray GetVars()

>
> Return
>

>> variable array object.

##### SosBuilder::GetWeight()

> Get weight from the i-th term in SOS constraint.
>
> Synopsis
>

>> double GetWeight(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> weight of the i-th term in SOS constraint.

##### SosBuilder::GetWeights()

> Get weights of all terms in SOS constraint.
>
> Synopsis
>

>> double GetWeights()

>
> Return
>

>> pointer to array of weights.

##### SosBuilder::Set()

> Set variables and weights of SOS constraint.
>
> Synopsis
>

>> void Set(

>>

>>> const VarArray & vars,

>>>

>>> const double *pWeights,

>>>

>>> int type)

>
> Arguments
>

>> vars: variable array object.

>>

>> pWeights: pointer to array of weights.

>>

>> type: type of SOS constraint.

#### 16 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.

##### SosBuilderArray::GetBuilder()

> Get i-th SOS constraint builder object.
>
> Synopsis
>

>> SosBuilder & GetBuilder(int i)

>
> Arguments
>

>> i: index of the SOS constraint builder.

>
> Return
>

>> SOS constraint builder object with index i.

##### SosBuilderArray::PushBack()

> Add a SOS constraint builder object to SOS constraint builder array.
>
> Synopsis
>

>> void PushBack(const SosBuilder & builder)

>
> Arguments
>

>> builder: a SOS constraint builder object.

##### SosBuilderArray::Size()

> Get the number of SOS constraint builder objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of SOS constraint builder objects.

#### 17 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.

##### GenConstr::GetIdx()

> Get the index of the general constraint.
>
> Synopsis
>

>> int GetIdx()

>
> Return
>

>> index of the general constraint.

##### GenConstr::GetIIS()

> Get IIS status of the general constraint.
>
> Synopsis
>

>> int GetIIS()

>
> Return
>

>> IIS status.

##### GenConstr::Remove()

> Remove the general constraint from model.
>
> Synopsis
>

>> void Remove()

#### 18 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.

##### GenConstrArray::GetGenConstr()

> Get i-th general constraint object.
>
> Synopsis
>

>> GenConstr & GetGenConstr(int i)

>
> Arguments
>

>> i: index of the general constraint.

>
> Return
>

>> general constraint object with index i.

##### GenConstrArray::PushBack()

> Add a general constraint object to general constraint array.
>
> Synopsis
>

>> void PushBack(const GenConstr & constr)

>
> Arguments
>

>> constr: a general constraint object.

##### GenConstrArray::Size()

> Get the number of general constraint objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of general constraint objects.

#### 19 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.

##### GenConstrBuilder::GetBinVal()

> Get binary value associated with general constraint.
>
> Synopsis
>

>> int GetBinVal()

>
> Return
>

>> binary value.

##### GenConstrBuilder::GetBinVar()

> Get binary variable associated with general constraint.
>
> Synopsis
>

>> Var GetBinVar()

>
> Return
>

>> binary vaiable object.

##### GenConstrBuilder::GetExpr()

> Get expression associated with general constraint.
>
> Synopsis
>

>> const Expr & GetExpr()

>
> Return
>

>> expression object.

##### GenConstrBuilder::GetSense()

> Get sense associated with general constraint.
>
> Synopsis
>

>> char GetSense()

>
> Return
>

>> constraint sense.

##### GenConstrBuilder::Set()

> Set binary variable, binary value, expression and sense of general
> constraint.
>
> Synopsis
>

>> void Set(

>>

>>> Var var,

>>>

>>> int val,

>>>

>>> const Expr & expr,

>>>

>>> char sense)

>
> Arguments
>

>> var: binary variable.

>>

>> val: binary value.

>>

>> expr: expression object.

>>

>> sense: general constraint sense.

#### 20 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.

##### GenConstrBuilderArray::GetBuilder()

> Get i-th general constraint builder object.
>
> Synopsis
>

>> GenConstrBuilder & GetBuilder(int i)

>
> Arguments
>

>> i: index of the general constraint builder.

>
> Return
>

>> general constraint builder object with index i.

##### GenConstrBuilderArray::PushBack()

> Add a general constraint builder object to general constraint builder array.
>
> Synopsis
>

>> void PushBack(const GenConstrBuilder & builder)

>
> Arguments
>

>> builder: a general constraint builder object.

##### GenConstrBuilderArray::Size()

> Get the number of general constraint builder objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of general constraint builder objects.

#### 21 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).

##### Cone::GetIdx()

> Get the index of a cone constraint.
>
> Synopsis
>

>> int GetIdx()

>
> Return
>

>> index of a cone constraint.

##### Cone::Remove()

> Remove the cone constraint from model.
>
> Synopsis
>

>> void Remove()

#### 22 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.

##### ConeArray::GetCone()

> Get i-th cone constraint object.
>
> Synopsis
>

>> Cone & GetCone(int i)

>
> Arguments
>

>> i: index of the cone constraint.

>
> Return
>

>> cone constraint object with index i.

##### ConeArray::PushBack()

> Add a cone constraint object to cone constraint array.
>
> Synopsis
>

>> void PushBack(const Cone & cone)

>
> Arguments
>

>> cone: a cone constraint object.

##### ConeArray::Size()

> Get the number of cone constraint objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of cone constraint objects.

#### 23 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.

##### ConeBuilder::GetSize()

> Get number of vars in a cone constraint.
>
> Synopsis
>

>> int GetSize()

>
> Return
>

>> number of vars.

##### ConeBuilder::GetType()

> Get type of a cone constraint.
>
> Synopsis
>

>> int GetType()

>
> Return
>

>> type of a cone constraint.

##### ConeBuilder::GetVar()

> Get the i-th variable in a cone constraint.
>
> Synopsis
>

>> Var GetVar(int i)

>
> Arguments
>

>> i: index of vars in a cone constraint.

>
> Return
>

>> the i-th variable in a cone constraint.

##### ConeBuilder::GetVars()

> Get all variables in a cone constraint.
>
> Synopsis
>

>> VarArray GetVars()

>
> Return
>

>> variable array object.

##### ConeBuilder::Set()

> Set variables of a cone constraint.
>
> Synopsis
>

>> void Set(const VarArray & vars,int type)

>
> Arguments
>

>> vars: variable array object.

>>

>> type: type of cone constraint.

#### 24 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.

##### ConeBuilderArray::GetBuilder()

> Get i-th cone constraint builder object.
>
> Synopsis
>

>> ConeBuilder & GetBuilder(int i)

>
> Arguments
>

>> i: index of the cone constraint builder.

>
> Return
>

>> cone constraint builder object with index i.

##### ConeBuilderArray::PushBack()

> Add a cone constraint builder object to cone constraint builder array.
>
> Synopsis
>

>> void PushBack(const ConeBuilder & builder)

>
> Arguments
>

>> builder: a cone constraint builder object.

##### ConeBuilderArray::Size()

> Get the number of cone constraint builder objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of cone constraint builder objects.

#### 25 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()

> Constructor of a quadratic expression with a constant.
>
> Synopsis
>

>> QuadExpr(double constant)

>
> Arguments
>

>> constant: constant value in quadratic expression object.

##### QuadExpr::QuadExpr()

> Constructor of a quadratic expression with one term.
>
> Synopsis
>

>> QuadExpr(const Var & var,double coeff)

>
> Arguments
>

>> var: variable for the added term.

>>

>> coeff: coefficent for the added term.

##### QuadExpr::QuadExpr()

> Constructor of a quadratic expression with a linear expression.
>
> Synopsis
>

>> QuadExpr(const Expr & expr)

>
> Arguments
>

>> expr: input linear expression.

##### QuadExpr::QuadExpr()

> Constructor of a quadratic expression with two linear expression.
>
> Synopsis
>

>> QuadExpr(const Expr & expr,const Var & var)

>
> Arguments
>

>> expr: one linear expression.

>>

>> var: another variable.

##### QuadExpr::QuadExpr()

> Constructor of a quadratic expression with two linear expression.
>
> Synopsis
>

>> QuadExpr(const Expr & left,const Expr & right)

>
> Arguments
>

>> left: one linear expression.

>>

>> right: another linear expression.

##### QuadExpr::AddConstant()

> Add constant for the expression.
>
> Synopsis
>

>> void AddConstant(double constant)

>
> Arguments
>

>> constant: the value of the constant.

##### QuadExpr::AddLinExpr()

> Add a linear expression to self.
>
> Synopsis
>

>> void AddLinExpr(const Expr & expr,double mult)

>
> Arguments
>

>> expr: linear expression to be added.

>>

>> mult: optional, constant multiplier, default value is 1.0.

##### QuadExpr::AddQuadExpr()

> Add a quadratic expression to self.
>
> Synopsis
>

>> void AddQuadExpr(const QuadExpr & expr,double mult)

>
> Arguments
>

>> expr: quadratic expression to be added.

>>

>> mult: optional, constant multiplier, default value is 1.0.

##### QuadExpr::AddTerm()

> Add a linear term to expression object.
>
> Synopsis
>

>> void AddTerm(const Var & var,double coeff)

>
> Arguments
>

>> var: variable of new linear term.

>>

>> coeff: coefficient of new linear term.

##### QuadExpr::AddTerm()

> Add a quadratic term to expression object.
>
> Synopsis
>

>> void AddTerm(

>>

>>> const Var & var1,

>>>

>>> const Var & var2,

>>>

>>> double coeff)

>
> Arguments
>

>> var1: first variable of new quadratic term.

>>

>> var2: second variable of new quadratic term.

>>

>> coeff: coefficient of new quadratic term.

##### QuadExpr::AddTerms()

> Add linear terms to expression object.
>
> Synopsis
>

>> int AddTerms(

>>

>>> const VarArray & vars,

>>>

>>> double *pCoeff,

>>>

>>> int len)

>
> Arguments
>

>> vars: variables for added linear terms.

>>

>> pCoeff: coefficient array for added linear terms.

>>

>> len: length of coefficient array.

>
> Return
>

>> number of added linear terms.

##### QuadExpr::AddTerms()

> Add quadratic terms to expression object.
>
> Synopsis
>

>> int AddTerms(

>>

>>> const VarArray & vars1,

>>>

>>> const VarArray & vars2,

>>>

>>> double *pCoeff,

>>>

>>> int len)

>
> Arguments
>

>> vars1: first set of variables for added quadratic terms.

>>

>> vars2: second set of variables for added quadratic terms.

>>

>> pCoeff: coefficient array for added quadratic terms.

>>

>> len: length of coefficient array.

>
> Return
>

>> number of added quadratic terms.

##### QuadExpr::Clone()

> Deep copy quadratic expression object.
>
> Synopsis
>

>> QuadExpr Clone()

>
> Return
>

>> cloned quadratic expression object.

##### QuadExpr::Evaluate()

> evaluate quadratic expression after solving
>
> Synopsis
>

>> double Evaluate()

>
> Return
>

>> value of quadratic expression

##### QuadExpr::GetCoeff()

> Get coefficient from the i-th term in quadratic expression.
>
> Synopsis
>

>> double GetCoeff(int i)

>
> Arguments
>

>> i: index of the quadratic term.

>
> Return
>

>> coefficient of the i-th quadratic term in quadratic expression object.

##### QuadExpr::GetConstant()

> Get constant in quadratic expression.
>
> Synopsis
>

>> double GetConstant()

>
> Return
>

>> constant in quadratic expression.

##### QuadExpr::GetLinExpr()

> Get linear expression in quadratic expression.
>
> Synopsis
>

>> Expr & GetLinExpr()

>
> Return
>

>> linear expression object.

##### QuadExpr::GetVar1()

> Get the first variable from the i-th term in quadratic expression.
>
> Synopsis
>

>> Var & GetVar1(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> the first variable of the i-th term in quadratic expression object.

##### QuadExpr::GetVar2()

> Get the second variable from the i-th term in quadratic expression.
>
> Synopsis
>

>> Var & GetVar2(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> the second variable of the i-th term in quadratic expression object.

##### QuadExpr::operator*=()

> Multiply a constant to self.
>
> Synopsis
>

>> void operator*=(double c)

>
> Arguments
>

>> c: constant multiplier.

##### QuadExpr::operator*()

> Multiply constant and return new expression.
>
> Synopsis
>

>> QuadExpr operator*(double c)

>
> Arguments
>

>> c: constant multiplier.

>
> Return
>

>> result expression.

##### QuadExpr::operator+=()

> Add an expression to self.
>
> Synopsis
>

>> void operator+=(const QuadExpr & expr)

>
> Arguments
>

>> expr: expression to be added.

##### QuadExpr::operator+()

> Add expression and return new expression.
>
> Synopsis
>

>> QuadExpr operator+(const QuadExpr & other)

>
> Arguments
>

>> other: other expression to add.

>
> Return
>

>> result expression.

##### QuadExpr::operator-=()

> Substract an expression from self.
>
> Synopsis
>

>> void operator-=(const QuadExpr & expr)

>
> Arguments
>

>> expr: expression to be substracted.

##### QuadExpr::operator-()

> Substract expression and return new expression.
>
> Synopsis
>

>> QuadExpr operator-(const QuadExpr & other)

>
> Arguments
>

>> other: other expression to substract.

>
> Return
>

>> result expression.

##### QuadExpr::Remove()

> Remove i-th term from expression object.
>
> Synopsis
>

>> void Remove(int i)

>
> Arguments
>

>> i: index of the term to be removed.

##### QuadExpr::Remove()

> Remove the term associated with variable from expression.
>
> Synopsis
>

>> void Remove(const Var & var)

>
> Arguments
>

>> var: a variable whose term should be removed.

##### QuadExpr::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(size_ t n)

>
> Arguments
>

>> n: minimum capacity for quadratic expression object.

##### QuadExpr::SetCoeff()

> Set coefficient of the i-th term in quadratic expression.
>
> Synopsis
>

>> void SetCoeff(int i,double val)

>
> Arguments
>

>> i: index of the quadratic term.

>>

>> val: coefficient of the term.

##### QuadExpr::SetConstant()

> Set constant for the expression.
>
> Synopsis
>

>> void SetConstant(double constant)

>
> Arguments
>

>> constant: the value of the constant.

##### QuadExpr::Size()

> Get number of terms in expression.
>
> Synopsis
>

>> size_ t Size()

>
> Return
>

>> number of terms.

#### 26 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.

##### QConstraint::Get()

> Get attribute value of the quadratic constraint. Support related quadratic
> attributes.
>
> Synopsis
>

>> double Get(const char *szAttr)

>
> Arguments
>

>> szAttr: name of the attribute being queried.

>
> Return
>

>> attribute value.

##### QConstraint::GetIdx()

> Get index of the quadratic constraint.
>
> Synopsis
>

>> int GetIdx()

>
> Return
>

>> the index of the quadratic constraint.

##### QConstraint::GetName()

> Get name of the quadratic constraint.
>
> Synopsis
>

>> const char *GetName()

>
> Return
>

>> the name of the quadratic constraint.

##### QConstraint::GetRhs()

> Get rhs of quadratic constraint.
>
> Synopsis
>

>> double GetRhs()

>
> Return
>

>> rhs of quadratic constraint.

##### QConstraint::GetSense()

> Get sense of quadratic constraint.
>
> Synopsis
>

>> char GetSense()

>
> Return
>

>> sense of quadratic constraint.

##### QConstraint::Remove()

> Remove this quadratic constraint from model.
>
> Synopsis
>

>> void Remove()

##### QConstraint::Set()

> Set attribute value of the quadratic constraint. Support related quadratic
> attributes.
>
> Synopsis
>

>> void Set(const char *szAttr,double value)

>
> Arguments
>

>> szAttr: name of the attribute.

>>

>> value: new value.

##### QConstraint::SetName()

> Set name of a quadratic constraint.
>
> Synopsis
>

>> void SetName(const char *szName)

>
> Arguments
>

>> szName: the name to set.

##### QConstraint::SetRhs()

> Set rhs of quadratic constraint.
>
> Synopsis
>

>> void SetRhs(double rhs)

>
> Arguments
>

>> rhs: rhs of quadratic constraint.

##### QConstraint::SetSense()

> Set sense of quadratic constraint.
>
> Synopsis
>

>> void SetSense(char sense)

>
> Arguments
>

>> sense: sense of quadratic constraint.

#### 27 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.

##### QConstrArray::GetQConstr()

> Get i-th quadratic constraint object.
>
> Synopsis
>

>> QConstraint & GetQConstr(int idx)

>
> Arguments
>

>> idx: index of the quadratic constraint.

>
> Return
>

>> quadratic constraint object with index i.

##### QConstrArray::PushBack()

> Add a quadratic constraint object to constraint array.
>
> Synopsis
>

>> void PushBack(const QConstraint & constr)

>
> Arguments
>

>> constr: a quadratic constraint object.

##### QConstrArray::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for quadratic constraint objects.

##### QConstrArray::Size()

> Get the number of quadratic constraint objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of quadratic constraint objects.

#### 28 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.

##### QConstrBuilder::GetQuadExpr()

> Get expression associated with quadratic constraint.
>
> Synopsis
>

>> const QuadExpr & GetQuadExpr()

>
> Return
>

>> quadratic expression object.

##### QConstrBuilder::GetSense()

> Get sense associated with quadratic constraint.
>
> Synopsis
>

>> char GetSense()

>
> Return
>

>> quadratic constraint sense.

##### QConstrBuilder::Set()

> Set detail of a quadratic constraint to its builder object.
>
> Synopsis
>

>> void Set(

>>

>>> const QuadExpr & expr,

>>>

>>> char sense,

>>>

>>> double rhs)

>
> Arguments
>

>> expr: expression object at one side of the quadratic constraint.

>>

>> sense: quadratic constraint sense.

>>

>> rhs: quadratic constant of right side of the constraint.

#### 29 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.

##### QConstrBuilderArray::GetBuilder()

> Get i-th quadratic constraint builder object.
>
> Synopsis
>

>> QConstrBuilder & GetBuilder(int idx)

>
> Arguments
>

>> idx: index of the quadratic constraint builder.

>
> Return
>

>> quadratic constraint builder object with index i.

##### QConstrBuilderArray::PushBack()

> Add a quadratic constraint builder object to quadratic constraint builder
> array.
>
> Synopsis
>

>> void PushBack(const QConstrBuilder & builder)

>
> Arguments
>

>> builder: a quadratic constraint builder object.

##### QConstrBuilderArray::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for quadratic constraint builder object.

##### QConstrBuilderArray::Size()

> Get the number of quadratic constraint builder objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of quadratic constraint builder objects.

#### 30 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.

##### PsdVar::Get()

> Get attribute values of PSD variable.
>
> Synopsis
>

>> double Get(const char *szAttr,int sz)

>
> Arguments
>

>> szAttr: attribute name.

>>

>> sz: length of the output array.

>
> Return
>

>> output array of attribute values.

##### PsdVar::GetDim()

> Get dimension of PSD variable.
>
> Synopsis
>

>> int GetDim()

>
> Return
>

>> dimension of PSD variable.

##### PsdVar::GetIdx()

> Get index of PSD variable.
>
> Synopsis
>

>> int GetIdx()

>
> Return
>

>> index of PSD variable.

##### PsdVar::GetLen()

> Get length of PSD variable.
>
> Synopsis
>

>> int GetLen()

>
> Return
>

>> length of PSD variable.

##### PsdVar::GetName()

> Get name of PSD variable.
>
> Synopsis
>

>> const char *GetName()

>
> Return
>

>> name of PSD variable.

##### PsdVar::Remove()

> Remove PSD variable from model.
>
> Synopsis
>

>> void Remove()

##### PsdVar::SetName()

> Set name of PSD variable.
>
> Synopsis
>

>> void SetName(const char *szName)

>
> Arguments
>

>> szName: name of PSD variable.

#### 31 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.

##### PsdVarArray::GetPsdVar()

> Get idx-th PSD variable object.
>
> Synopsis
>

>> PsdVar & GetPsdVar(int idx)

>
> Arguments
>

>> idx: index of the PSD variable.

>
> Return
>

>> PSD variable object with index idx.

##### PsdVarArray::PushBack()

> Add a PSD variable object to PSD variable array.
>
> Synopsis
>

>> void PushBack(const PsdVar & var)

>
> Arguments
>

>> var: a PSD variable object.

##### PsdVarArray::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(int n)

>
> Arguments
>

>> n: minimum capacity for PSD variable object.

##### PsdVarArray::Size()

> Get the number of PSD variable objects.
>
> Synopsis
>

>> int Size()

>
> Return
>

>> number of PSD variable objects.

#### 32 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()

> Constructor of a PSD expression with a constant.
>
> Synopsis
>

>> PsdExpr(double constant)

>
> Arguments
>

>> constant: constant value in PSD expression object.

##### PsdExpr::PsdExpr()

> Constructor of a PSD expression with one term.
>
> Synopsis
>

>> PsdExpr(const Var & var,double coeff)

>
> Arguments
>

>> var: variable for the added term.

>>

>> coeff: coefficent for the added term.

##### PsdExpr::PsdExpr()

> Constructor of a PSD expression with a linear expression.
>
> Synopsis
>

>> PsdExpr(const Expr & expr)

>
> Arguments
>

>> expr: input linear expression.

##### PsdExpr::PsdExpr()

> Constructor of a PSD expression with one term.
>
> Synopsis
>

>> PsdExpr(const PsdVar & var,const SymMatrix & mat)

>
> Arguments
>

>> var: PSD variable for the added term.

>>

>> mat: coefficient matrix for the added term.

##### PsdExpr::PsdExpr()

> Constructor of a PSD expression with one term.
>
> Synopsis
>

>> PsdExpr(const PsdVar & var,const SymMatExpr & expr)

>
> Arguments
>

>> var: PSD variable for the added term.

>>

>> expr: coefficient expression of symmetric matrices for the added term.

##### PsdExpr::AddConstant()

> Add constant to the PSD expression.
>
> Synopsis
>

>> void AddConstant(double constant)

>
> Arguments
>

>> constant: value to be added.

##### PsdExpr::AddLinExpr()

> Add a linear expression to self.
>
> Synopsis
>

>> void AddLinExpr(const Expr & expr,double mult)

>
> Arguments
>

>> expr: linear expression to be added.

>>

>> mult: optional, constant multiplier, default value is 1.0.

##### PsdExpr::AddPsdExpr()

> Add a PSD expression to self.
>
> Synopsis
>

>> void AddPsdExpr(const PsdExpr & expr,double mult)

>
> Arguments
>

>> expr: PSD expression to be added.

>>

>> mult: optional, constant multiplier, default value is 1.0.

##### PsdExpr::AddTerm()

> Add a linear term to PSD expression object.
>
> Synopsis
>

>> void AddTerm(const Var & var,double coeff)

>
> Arguments
>

>> var: variable of new linear term.

>>

>> coeff: coefficient of new linear term.

##### PsdExpr::AddTerm()

> Add a PSD term to PSD expression object.
>
> Synopsis
>

>> void AddTerm(const PsdVar & var,const SymMatrix & mat)

>
> Arguments
>

>> var: PSD variable of new PSD term.

>>

>> mat: coefficient matrix of new PSD term.

##### PsdExpr::AddTerm()

> Add a PSD term to PSD expression object.
>
> Synopsis
>

>> void AddTerm(const PsdVar & var,const SymMatExpr & expr)

>
> Arguments
>

>> var: PSD variable of new PSD term.

>>

>> expr: coefficient expression of symmetric matrices of new PSD term.

##### PsdExpr::AddTerms()

> Add linear terms to PSD expression object.
>
> Synopsis
>

>> int AddTerms(

>>

>>> const VarArray & vars,

>>>

>>> double *pCoeff,

>>>

>>> int len)

>
> Arguments
>

>> vars: variables for added linear terms.

>>

>> pCoeff: coefficient array for added linear terms.

>>

>> len: length of coefficient array.

>
> Return
>

>> number of added linear terms.

##### PsdExpr::AddTerms()

> Add PSD terms to PSD expression object.
>
> Synopsis
>

>> int AddTerms(const PsdVarArray & vars,const SymMatrixArray & mats)

>
> Arguments
>

>> vars: PSD variables for added PSD terms.

>>

>> mats: coefficient matrixes for added PSD terms.

>
> Return
>

>> number of added PSD terms.

##### PsdExpr::Clone()

> Deep copy PSD expression object.
>
> Synopsis
>

>> PsdExpr Clone()

>
> Return
>

>> cloned PSD expression object.

##### PsdExpr::Evaluate()

> evaluate PSD expression after solving
>
> Synopsis
>

>> double Evaluate()

>
> Return
>

>> value of PSD expression

##### PsdExpr::GetCoeff()

> Get coefficient from the i-th term in PSD expression.
>
> Synopsis
>

>> SymMatExpr & GetCoeff(int i)

>
> Arguments
>

>> i: index of the PSD term.

>
> Return
>

>> coefficient of the i-th PSD term in PSD expression object.

##### PsdExpr::GetConstant()

> Get constant in PSD expression.
>
> Synopsis
>

>> double GetConstant()

>
> Return
>

>> constant in PSD expression.

##### PsdExpr::GetLinExpr()

> Get linear expression in PSD expression.
>
> Synopsis
>

>> Expr & GetLinExpr()

>
> Return
>

>> linear expression object.

##### PsdExpr::GetPsdVar()

> Get the PSD variable from the i-th term in PSD expression.
>
> Synopsis
>

>> PsdVar & GetPsdVar(int i)

>
> Arguments
>

>> i: index of the term.

>
> Return
>

>> the first variable of the i-th term in PSD expression object.

##### PsdExpr::operator*=()

> Multiply a constant to self.
>
> Synopsis
>

>> void operator*=(double c)

>
> Arguments
>

>> c: constant multiplier.

##### PsdExpr::operator*()

> Multiply constant and return new expression.
>
> Synopsis
>

>> PsdExpr operator*(double c)

>
> Arguments
>

>> c: constant multiplier.

>
> Return
>

>> result expression.

##### PsdExpr::operator+=()

> Add an expression to self.
>
> Synopsis
>

>> void operator+=(const PsdExpr & expr)

>
> Arguments
>

>> expr: expression to be added.

##### PsdExpr::operator+()

> Add expression and return new expression.
>
> Synopsis
>

>> PsdExpr operator+(const PsdExpr & other)

>
> Arguments
>

>> other: other expression to add.

>
> Return
>

>> result expression.

##### PsdExpr::operator-=()

> Substract an expression from self.
>
> Synopsis
>

>> void operator-=(const PsdExpr & expr)

>
> Arguments
>

>> expr: expression to be substracted.

##### PsdExpr::operator-()

> Substract expression and return new expression.
>
> Synopsis
>

>> PsdExpr operator-(const PsdExpr & other)

>
> Arguments
>

>> other: other expression to substract.

>
> Return
>

>> result expression.

##### PsdExpr::Remove()

> Remove i-th term from PSD expression object.
>
> Synopsis
>

>> void Remove(int idx)

>
> Arguments
>

>> idx: index of the term to be removed.

##### PsdExpr::Remove()

> Remove the term associated with variable from PSD expression.
>
> Synopsis
>

>> void Remove(const Var & var)

>
> Arguments
>

>> var: a variable whose term should be removed.

##### PsdExpr::Remove()

> Remove the term associated with PSD variable from PSD expression.
>
> Synopsis
>

>> void Remove(const PsdVar & var)

>
> Arguments
>

>> var: a PSD variable whose term should be removed.

##### PsdExpr::Reserve()

> Reserve capacity to contain at least n items.
>
> Synopsis
>

>> void Reserve(size_ t n)

>
> Arguments
>

>> n: minimum capacity for PSD expression object.