16.3 Functions in alphabetical order

MSK_analyzenames
MSKrescodee (MSKAPI MSK_analyzenames) (
  MSKtask_t task,
  MSKstreamtypee whichstream,
  MSKnametypee nametype)

The function analyzes the names and issues an error if a name is invalid.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • nametype (MSKnametypee) – The type of names e.g. valid in MPS or LP files. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_analyzeproblem
MSKrescodee (MSKAPI MSK_analyzeproblem) (
  MSKtask_t task,
  MSKstreamtypee whichstream)

The function analyzes the data of a task and writes out a report.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_analyzesolution
MSKrescodee (MSKAPI MSK_analyzesolution) (
  MSKtask_t task,
  MSKstreamtypee whichstream,
  MSKsoltypee whichsol)

Print information related to the quality of the solution and other solution statistics.

By default this function prints information about the largest infeasibilites in the solution, the primal (and possibly dual) objective value and the solution status.

Following parameters can be used to configure the printed statistics:

  • MSK_IPAR_ANA_SOL_BASIS enables or disables printing of statistics specific to the basis solution (condition number, number of basic variables etc.). Default is on.
  • MSK_IPAR_ANA_SOL_PRINT_VIOLATED enables or disables listing names of all constraints (both primal and dual) which are violated by the solution. Default is off.
  • MSK_DPAR_ANA_SOL_INFEAS_TOL is the tolerance defining when a constraint is considered violated. If a constraint is violated more than this, it will be listed in the summary.
Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_appendbarvars
MSKrescodee (MSKAPI MSK_appendbarvars) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * dim)

Appends positive semidefinite matrix variables of dimensions given by dim to the problem.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of symmetric matrix variables to be appended. (input)
  • dim (MSKint32t*) – Dimensions of symmetric matrix variables to be added. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_appendcone
MSKrescodee (MSKAPI MSK_appendcone) (
  MSKtask_t task,
  MSKconetypee ct,
  MSKrealt conepar,
  MSKint32t nummem,
  const MSKint32t * submem)

Appends a new conic constraint to the problem. Hence, add a constraint

\[\hat{x} \in \K\]

to the problem where \(\K\) is a convex cone. \(\hat{x}\) is a subset of the variables which will be specified by the argument submem.

Depending on the value of ct this function appends a normal (MSK_CT_QUAD) or rotated quadratic cone (MSK_CT_RQUAD).

Define

\[\hat{x} = x_{\mathtt{submem}[0]},\ldots,x_{\mathtt{submem}[\mathtt{nummem}-1]}.\]

Depending on the value of ct this function appends one of the constraints:

  • Quadratic cone (MSK_CT_QUAD) :

    \[\hat{x}_0 \geq \sqrt{\sum_{i=1}^{i<\mathtt{nummem}} \hat{x}_i^2}\]
  • Rotated quadratic cone (MSK_CT_RQUAD) :

    \[2 \hat{x}_0 \hat{x}_1 \geq \sum_{i=2}^{i<\mathtt{nummem}} \hat{x}^2_i, \quad \hat{x}_{0}, \hat{x}_1 \geq 0\]

Please note that the sets of variables appearing in different conic constraints must be disjoint.

For an explained code example see Section 6.3.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • ct (MSKconetypee) – Specifies the type of the cone. (input)
  • conepar (MSKrealt) – This argument is currently not used. It can be set to 0 (input)
  • nummem (MSKint32t) – Number of member variables in the cone. (input)
  • submem (MSKint32t*) – Variable subscripts of the members in the cone. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_appendconeseq
MSKrescodee (MSKAPI MSK_appendconeseq) (
  MSKtask_t task,
  MSKconetypee ct,
  MSKrealt conepar,
  MSKint32t nummem,
  MSKint32t j)

Appends a new conic constraint to the problem, as in MSK_appendcone. The function assumes the members of cone are sequential where the first member has index j and the last j+nummem-1.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • ct (MSKconetypee) – Specifies the type of the cone. (input)
  • conepar (MSKrealt) – This argument is currently not used. It can be set to 0 (input)
  • nummem (MSKint32t) – Number of member variables in the cone. (input)
  • j (MSKint32t) – Index of the first variable in the conic constraint. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_appendconesseq
MSKrescodee (MSKAPI MSK_appendconesseq) (
  MSKtask_t task,
  MSKint32t num,
  const MSKconetypee * ct,
  const MSKrealt * conepar,
  const MSKint32t * nummem,
  MSKint32t j)

Appends a number of conic constraints to the problem, as in MSK_appendcone. The \(k\)th cone is assumed to be of dimension nummem[k]. Moreover, it is assumed that the first variable of the first cone has index \(j\) and starting from there the sequentially following variables belong to the first cone, then to the second cone and so on.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of cones to be added. (input)
  • ct (MSKconetypee*) – Specifies the type of the cone. (input)
  • conepar (MSKrealt*) – This argument is currently not used. It can be set to 0 (input)
  • nummem (MSKint32t*) – Numbers of member variables in the cones. (input)
  • j (MSKint32t) – Index of the first variable in the first cone to be appended. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_appendcons
MSKrescodee (MSKAPI MSK_appendcons) (
  MSKtask_t task,
  MSKint32t num)

Appends a number of constraints to the model. Appended constraints will be declared free. Please note that MOSEK will automatically expand the problem dimension to accommodate the additional constraints.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of constraints which should be appended. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear constraint data

MSK_appendsparsesymmat
MSKrescodee (MSKAPI MSK_appendsparsesymmat) (
  MSKtask_t task,
  MSKint32t dim,
  MSKint64t nz,
  const MSKint32t * subi,
  const MSKint32t * subj,
  const MSKrealt * valij,
  MSKint64t * idx)

MOSEK maintains a storage of symmetric data matrices that is used to build \(\barC\) and \(\barA\). The storage can be thought of as a vector of symmetric matrices denoted \(E\). Hence, \(E_i\) is a symmetric matrix of certain dimension.

This function appends a general sparse symmetric matrix on triplet form to the vector \(E\) of symmetric matrices. The vectors subi, subj, and valij contains the row subscripts, column subscripts and values of each element in the symmetric matrix to be appended. Since the matrix that is appended is symmetric, only the lower triangular part should be specified. Moreover, duplicates are not allowed.

Observe the function reports the index (position) of the appended matrix in \(E\). This index should be used for later references to the appended matrix.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • dim (MSKint32t) – Dimension of the symmetric matrix that is appended. (input)
  • nz (MSKint64t) – Number of triplets. (input)
  • subi (MSKint32t*) – Row subscript in the triplets. (input)
  • subj (MSKint32t*) – Column subscripts in the triplets. (input)
  • valij (MSKrealt*) – Values of each triplet. (input)
  • idx (MSKint64t by reference) – Unique index assigned to the inputted matrix that can be used for later reference. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_appendvars
MSKrescodee (MSKAPI MSK_appendvars) (
  MSKtask_t task,
  MSKint32t num)

Appends a number of variables to the model. Appended variables will be fixed at zero. Please note that MOSEK will automatically expand the problem dimension to accommodate the additional variables.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of variables which should be appended. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_asyncgetresult
MSKrescodee (MSKAPI MSK_asyncgetresult) (
  MSKtask_t task,
  const char * server,
  const char * port,
  const char * token,
  MSKbooleant * respavailable,
  MSKrescodee * resp,
  MSKrescodee * trm)

Request a response from a remote job. If successful, solver response, termination code and solutions are retrieved.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

MSK_asyncoptimize
MSKrescodee (MSKAPI MSK_asyncoptimize) (
  MSKtask_t task,
  const char * server,
  const char * port,
  char * token)

Offload the optimization task to a solver server defined by server:port. The call will return immediately and not wait for the result.

If the string parameter MSK_SPAR_REMOTE_ACCESS_TOKEN is not blank, it will be passed to the server as authentication.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • server (MSKstring_t) – Name or IP address of the solver server (input)
  • port (MSKstring_t) – Network port of the solver service (input)
  • token (MSKstring_t) – Returns the task token (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_asyncpoll
MSKrescodee (MSKAPI MSK_asyncpoll) (
  MSKtask_t task,
  const char * server,
  const char * port,
  const char * token,
  MSKbooleant * respavailable,
  MSKrescodee * resp,
  MSKrescodee * trm)

Requests information about the status of the remote job.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

MSK_asyncstop
MSKrescodee (MSKAPI MSK_asyncstop) (
  MSKtask_t task,
  const char * server,
  const char * port,
  const char * token)

Request that the job identified by the token is terminated.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • server (MSKstring_t) – Name or IP address of the solver server (input)
  • port (MSKstring_t) – Network port of the solver service (input)
  • token (MSKstring_t) – The task token (input)
Return:
 

(MSKrescodee) – The function response code.

MSK_axpy
MSKrescodee (MSKAPI MSK_axpy) (
  MSKenv_t env,
  MSKint32t n,
  MSKrealt alpha,
  const MSKrealt * x,
  MSKrealt * y)

Adds \(\alpha x\) to \(y\), i.e. performs the update

\[y := \alpha x + y.\]

Note that the result is stored overwriting \(y\).

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • n (MSKint32t) – Length of the vectors. (input)
  • alpha (MSKrealt) – The scalar that multiplies \(x\). (input)
  • x (MSKrealt*) – The \(x\) vector. (input)
  • y (MSKrealt*) – The \(y\) vector. (input/output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear algebra

MSK_basiscond
MSKrescodee (MSKAPI MSK_basiscond) (
  MSKtask_t task,
  MSKrealt * nrmbasis,
  MSKrealt * nrminvbasis)

If a basic solution is available and it defines a nonsingular basis, then this function computes the 1-norm estimate of the basis matrix and a 1-norm estimate for the inverse of the basis matrix. The 1-norm estimates are computed using the method outlined in [Ste98], pp. 388-391.

By definition the 1-norm condition number of a matrix \(B\) is defined as

\[\kappa_1(B) := \|B\|_1 \|B^{-1}\|_1.\]

Moreover, the larger the condition number is the harder it is to solve linear equation systems involving \(B\). Given estimates for \(\|B\|_1\) and \(\|B^{-1}\|_1\) it is also possible to estimate \(\kappa_1(B)\).

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Basis matrix

MSK_bktostr
MSKrescodee (MSKAPI MSK_bktostr) (
  MSKtask_t task,
  MSKboundkeye bk,
  char * str)

Obtains an identifier string corresponding to a bound key.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • bk (MSKboundkeye) – Bound key. (input)
  • str (MSKstring_t) – String corresponding to the bound key code bk. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_callbackcodetostr
MSKrescodee (MSKAPI MSK_callbackcodetostr) (
  MSKcallbackcodee code,
  char * callbackcodestr)

Obtains the string representation of a callback code.

Parameters:
 
  • code (MSKcallbackcodee) – A callback code. (input)
  • callbackcodestr (MSKstring_t) – String corresponding to the callback code. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_callocdbgenv
void * (MSKAPI MSK_callocdbgenv) (
  MSKenv_t env,
  const size_t number,
  const size_t size,
  const char * file,
  const unsigned line)

Debug version of MSK_callocenv.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • number (size_t) – Number of elements. (input)
  • size (size_t) – Size of each individual element. (input)
  • file (MSKstring_t) – File from which the function is called. (input)
  • line (unsigned) – Line in the file from which the function is called. (input)
Return:
 

(void*) – A pointer to the memory allocated through the environment.

Groups:
 

Memory

MSK_callocdbgtask
void * (MSKAPI MSK_callocdbgtask) (
  MSKtask_t task,
  const size_t number,
  const size_t size,
  const char * file,
  const unsigned line)

Debug version of MSK_calloctask.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • number (size_t) – Number of elements. (input)
  • size (size_t) – Size of each individual element. (input)
  • file (MSKstring_t) – File from which the function is called. (input)
  • line (unsigned) – Line in the file from which the function is called. (input)
Return:
 

(void*) – A pointer to the memory allocated through the task.

Groups:
 

Memory

MSK_callocenv
void * (MSKAPI MSK_callocenv) (
  MSKenv_t env,
  const size_t number,
  const size_t size)

Equivalent to calloc i.e. allocate space for an array of length number where each element is of size size.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • number (size_t) – Number of elements. (input)
  • size (size_t) – Size of each individual element. (input)
Return:
 

(void*) – A pointer to the memory allocated through the environment.

Groups:
 

Memory

MSK_calloctask
void * (MSKAPI MSK_calloctask) (
  MSKtask_t task,
  const size_t number,
  const size_t size)

Equivalent to calloc i.e. allocate space for an array of length number where each element is of size size.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • number (size_t) – Number of elements. (input)
  • size (size_t) – Size of each individual element. (input)
Return:
 

(void*) – A pointer to the memory allocated through the task.

Groups:
 

Memory

MSK_checkconvexity
MSKrescodee (MSKAPI MSK_checkconvexity) (
  MSKtask_t task)

This function checks if a quadratic optimization problem is convex. The amount of checking is controlled by MSK_IPAR_CHECK_CONVEXITY.

The function reports an error if the problem is not convex.

Parameters:
 task (MSKtask_t) – An optimization task. (input)
Return:
  (MSKrescodee) – The function response code.
Groups:
 Task diagnostics
MSK_checkinall
MSKrescodee (MSKAPI MSK_checkinall) (
  MSKenv_t env)

Check in all unused license features to the license token server.

Parameters:
 env (MSKenv_t) – The MOSEK environment. (input)
Return:
  (MSKrescodee) – The function response code.
Groups:
 Environment management
MSK_checkinlicense
MSKrescodee (MSKAPI MSK_checkinlicense) (
  MSKenv_t env,
  MSKfeaturee feature)

Check in a license feature to the license server. By default all licenses consumed by functions using a single environment are kept checked out for the lifetime of the MOSEK environment. This function checks in a given license feature back to the license server immediately.

If the given license feature is not checked out at all, or it is in use by a call to MSK_optimize, calling this function has no effect.

Please note that returning a license to the license server incurs a small overhead, so frequent calls to this function should be avoided.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • feature (MSKfeaturee) – Feature to check in to the license system. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_checkmemenv
MSKrescodee (MSKAPI MSK_checkmemenv) (
  MSKenv_t env,
  const char * file,
  MSKint32t line)

Checks the memory allocated by the environment.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • file (MSKstring_t) – File from which the function is called. (input)
  • line (MSKint32t) – Line in the file from which the function is called. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Memory

MSK_checkmemtask
MSKrescodee (MSKAPI MSK_checkmemtask) (
  MSKtask_t task,
  const char * file,
  MSKint32t line)

Checks the memory allocated by the task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • file (MSKstring_t) – File from which the function is called. (input)
  • line (MSKint32t) – Line in the file from which the function is called. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Memory

MSK_checkoutlicense
MSKrescodee (MSKAPI MSK_checkoutlicense) (
  MSKenv_t env,
  MSKfeaturee feature)

Checks out a license feature from the license server. Normally the required license features will be automatically checked out the first time they are needed by the function MSK_optimize. This function can be used to check out one or more features ahead of time.

The feature will remain checked out until the environment is deleted or the function MSK_checkinlicense is called.

If a given feature is already checked out when this function is called, the call has no effect.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • feature (MSKfeaturee) – Feature to check out from the license system. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_checkversion
MSKrescodee (MSKAPI MSK_checkversion) (
  MSKenv_t env,
  MSKint32t major,
  MSKint32t minor,
  MSKint32t build,
  MSKint32t revision)

Compares the version of the MOSEK DLL with a specified version. Returns MSK_RES_OK if the versions match and one of MSK_RES_ERR_NEWER_DLL, MSK_RES_ERR_OLDER_DLL otherwise.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • major (MSKint32t) – Major version number. (input)
  • minor (MSKint32t) – Minor version number. (input)
  • build (MSKint32t) – Build number. (input)
  • revision (MSKint32t) – Revision number. (input)
Return:
 

(MSKrescodee) – The function response code.

MSK_chgbound Deprecated
MSKrescodee (MSKAPI MSK_chgbound) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t i,
  MSKint32t lower,
  MSKint32t finite,
  MSKrealt value)

Changes a bound for one constraint or variable. If accmode equals MSK_ACC_CON, a constraint bound is changed, otherwise a variable bound is changed.

If lower is non-zero, then the lower bound is changed as follows:

\[\begin{split}\mbox{new lower bound} = \left\{ \begin{array}{ll} - \infty, & \mathtt{finite}=0, \\ \mathtt{value} & \mbox{otherwise}. \end{array} \right.\end{split}\]

Otherwise if lower is zero, then

\[\begin{split}\mbox{new upper bound} = \left\{ \begin{array}{ll} \infty, & \mathtt{finite}=0, \\ \mathtt{value} & \mbox{otherwise}. \end{array} \right.\end{split}\]

Please note that this function automatically updates the bound key for bound, in particular, if the lower and upper bounds are identical, the bound key is changed to fixed.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented). (input)
  • i (MSKint32t) – Index of the constraint or variable for which the bounds should be changed. (input)
  • lower (MSKint32t) – If non-zero, then the lower bound is changed, otherwise the upper bound is changed. (input)
  • finite (MSKint32t) – If non-zero, then value is assumed to be finite. (input)
  • value (MSKrealt) – New value for the bound. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_chgconbound
MSKrescodee (MSKAPI MSK_chgconbound) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t lower,
  MSKint32t finite,
  MSKrealt value)

Changes a bound for one constraint.

If lower is non-zero, then the lower bound is changed as follows:

\[\begin{split}\mbox{new lower bound} = \left\{ \begin{array}{ll} - \infty, & \mathtt{finite}=0, \\ \mathtt{value} & \mbox{otherwise}. \end{array} \right.\end{split}\]

Otherwise if lower is zero, then

\[\begin{split}\mbox{new upper bound} = \left\{ \begin{array}{ll} \infty, & \mathtt{finite}=0, \\ \mathtt{value} & \mbox{otherwise}. \end{array} \right.\end{split}\]

Please note that this function automatically updates the bound key for the bound, in particular, if the lower and upper bounds are identical, the bound key is changed to fixed.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of the constraint for which the bounds should be changed. (input)
  • lower (MSKint32t) – If non-zero, then the lower bound is changed, otherwise the upper bound is changed. (input)
  • finite (MSKint32t) – If non-zero, then value is assumed to be finite. (input)
  • value (MSKrealt) – New value for the bound. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_chgvarbound
MSKrescodee (MSKAPI MSK_chgvarbound) (
  MSKtask_t task,
  MSKint32t j,
  MSKint32t lower,
  MSKint32t finite,
  MSKrealt value)

Changes a bound for one variable.

If lower is non-zero, then the lower bound is changed as follows:

\[\begin{split}\mbox{new lower bound} = \left\{ \begin{array}{ll} - \infty, & \mathtt{finite}=0, \\ \mathtt{value} & \mbox{otherwise}. \end{array} \right.\end{split}\]

Otherwise if lower is zero, then

\[\begin{split}\mbox{new upper bound} = \left\{ \begin{array}{ll} \infty, & \mathtt{finite}=0, \\ \mathtt{value} & \mbox{otherwise}. \end{array} \right.\end{split}\]

Please note that this function automatically updates the bound key for the bound, in particular, if the lower and upper bounds are identical, the bound key is changed to fixed.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the variable for which the bounds should be changed. (input)
  • lower (MSKint32t) – If non-zero, then the lower bound is changed, otherwise the upper bound is changed. (input)
  • finite (MSKint32t) – If non-zero, then value is assumed to be finite. (input)
  • value (MSKrealt) – New value for the bound. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_clonetask
MSKrescodee (MSKAPI MSK_clonetask) (
  MSKtask_t task,
  MSKtask_t * clonedtask)

Creates a clone of an existing task copying all problem data and parameter settings to a new task. Callback functions are not copied, so a task containing nonlinear functions cannot be cloned.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_commitchanges
MSKrescodee (MSKAPI MSK_commitchanges) (
  MSKtask_t task)

Commits all cached problem changes to the task. It is usually not necessary to call this function explicitly since changes will be committed automatically when required.

Parameters:
 task (MSKtask_t) – An optimization task. (input)
Return:
  (MSKrescodee) – The function response code.
Groups:
 Scalar variable data
MSK_computesparsecholesky
MSKrescodee (MSKAPI MSK_computesparsecholesky) (
  MSKenv_t env,
  MSKint32t multithread,
  MSKint32t ordermethod,
  MSKrealt tolsingular,
  MSKint32t n,
  const MSKint32t * anzc,
  const MSKint64t * aptrc,
  const MSKint32t * asubc,
  const MSKrealt * avalc,
  MSKint32t ** perm,
  MSKrealt ** diag,
  MSKint32t ** lnzc,
  MSKint64t ** lptrc,
  MSKint64t * lensubnval,
  MSKint32t ** lsubc,
  MSKrealt ** lvalc)

The function computes a Cholesky factorization of a sparse positive semidefinite matrix. Sparsity is exploited during the computations to reduce the amount of space and work required. Both the input and output matrices are represented using the sparse format.

To be precise, given a symmetric matrix \(A \in \real^{n\times n}\) the function computes a nonsingular lower triangular matrix \(L\), a diagonal matrix \(D\) and a permutation matrix \(P\) such that

\[LL^T - D = P A P^T.\]

If ordermethod is zero then reordering heuristics are not employed and \(P\) is the identity.

If a pivot during the computation of the Cholesky factorization is less than

\[-\rho\cdot\max((PAP^T)_{jj},1.0)\]

then the matrix is declared negative semidefinite. On the hand if a pivot is smaller than

\[\rho\cdot\max((PAP^T)_{jj},1.0),\]

then \(D_{jj}\) is increased from zero to

\[\rho\cdot\max((PAP^T)_{jj},1.0).\]

Therefore, if \(A\) is sufficiently positive definite then \(D\) will be the zero matrix. Here \(\rho\) is set equal to value of tolsingular.

The function allocates memory for the output arrays. It must be freed by the user with MSK_freeenv.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • multithread (MSKint32t) – If nonzero then the function may exploit multiple threads. (input)
  • ordermethod (MSKint32t) – If nonzero, then a sparsity preserving ordering will be employed. (input)
  • tolsingular (MSKrealt) – A positive parameter controlling when a pivot is declared zero. (input)
  • n (MSKint32t) – Specifies the order of \(A\). (input)
  • anzc (MSKint32t*) – anzc[j] is the number of nonzeros in the \(j\)-th column of \(A\). (input)
  • aptrc (MSKint64t*) – aptrc[j] is a pointer to the first element in column \(j\) of \(A\). (input)
  • asubc (MSKint32t*) – Row indexes for each column stored in increasing order. (input)
  • avalc (MSKrealt*) – The value corresponding to row indexed stored in asubc. (input)
  • perm (MSKint32t* by reference) – Permutation array used to specify the permutation matrix \(P\) computed by the function. (output)
  • diag (MSKrealt* by reference) – The diagonal elements of matrix \(D\). (output)
  • lnzc (MSKint32t* by reference) – lnzc[j] is the number of non zero elements in column \(j\) of \(L\). (output)
  • lptrc (MSKint64t* by reference) – lptrc[j] is a pointer to the first row index and value in column \(j\) of \(L\). (output)
  • lensubnval (MSKint64t by reference) – Number of elements in lsubc and lvalc. (output)
  • lsubc (MSKint32t* by reference) – Row indexes for each column stored in increasing order. (output)
  • lvalc (MSKrealt* by reference) – The values corresponding to row indexed stored in lsubc. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear algebra

MSK_conetypetostr
MSKrescodee (MSKAPI MSK_conetypetostr) (
  MSKtask_t task,
  MSKconetypee ct,
  char * str)

Obtains the cone string identifier corresponding to a cone type.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • ct (MSKconetypee) – Specifies the type of the cone. (input)
  • str (MSKstring_t) – String corresponding to the cone type code ct. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_deleteenv
MSKrescodee (MSKAPI MSK_deleteenv) (
  MSKenv_t * env)

Deletes a MOSEK environment and all the data associated with it.

Before calling this function it is a good idea to call the function MSK_unlinkfuncfromenvstream for each stream that has had a function linked to it.

Parameters:
 env (MSKenv_t by reference) – The MOSEK environment. (input/output)
Return:
  (MSKrescodee) – The function response code.
Groups:
 Environment management
MSK_deletesolution
MSKrescodee (MSKAPI MSK_deletesolution) (
  MSKtask_t task,
  MSKsoltypee whichsol)

Undefine a solution and free the memory it uses.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_deletetask
MSKrescodee (MSKAPI MSK_deletetask) (
  MSKtask_t * task)

Deletes a task.

Parameters:
 task (MSKtask_t by reference) – An optimization task. (input/output)
Return:
  (MSKrescodee) – The function response code.
Groups:
 Task management
MSK_dot
MSKrescodee (MSKAPI MSK_dot) (
  MSKenv_t env,
  MSKint32t n,
  const MSKrealt * x,
  const MSKrealt * y,
  MSKrealt * xty)

Computes the inner product of two vectors \(x,y\) of length \(n\geq 0\), i.e

\[x\cdot y= \sum_{i=1}^n x_i y_i.\]

Note that if \(n=0\), then the result of the operation is 0.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • n (MSKint32t) – Length of the vectors. (input)
  • x (MSKrealt*) – The \(x\) vector. (input)
  • y (MSKrealt*) – The \(y\) vector. (input)
  • xty (MSKrealt by reference) – The result of the inner product between \(x\) and \(y\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear algebra

MSK_dualsensitivity
MSKrescodee (MSKAPI MSK_dualsensitivity) (
  MSKtask_t task,
  MSKint32t numj,
  const MSKint32t * subj,
  MSKrealt * leftpricej,
  MSKrealt * rightpricej,
  MSKrealt * leftrangej,
  MSKrealt * rightrangej)

Calculates sensitivity information for objective coefficients. The indexes of the coefficients to analyze are

\[\{\mathtt{subj}[i] ~|~ i = 0,\ldots,\mathtt{numj}-1\}\]

The type of sensitivity analysis to perform (basis or optimal partition) is controlled by the parameter MSK_IPAR_SENSITIVITY_TYPE.

For an example, please see Section 15.3.1.4.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numj (MSKint32t) – Number of coefficients to be analyzed. Length of subj. (input)
  • subj (MSKint32t*) – Indexes of objective coefficients to analyze. (input)
  • leftpricej (MSKrealt*) – \(\mathtt{leftpricej}[j]\) is the left shadow price for the coefficient with index \(\mathtt{subj[j]}\). (output)
  • rightpricej (MSKrealt*) – \(\mathtt{rightpricej}[j]\) is the right shadow price for the coefficient with index \(\mathtt{subj[j]}\). (output)
  • leftrangej (MSKrealt*) – \(\mathtt{leftrangej}[j]\) is the left range \(\beta_1\) for the coefficient with index \(\mathtt{subj[j]}\). (output)
  • rightrangej (MSKrealt*) – \(\mathtt{rightrangej}[j]\) is the right range \(\beta_2\) for the coefficient with index \(\mathtt{subj[j]}\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Sensitivity analysis

MSK_echoenv
MSKrescodee (MSKAPIVA MSK_echoenv) (
  MSKenv_t env,
  MSKstreamtypee whichstream,
  const char * format,
  ...)

Prints a formatted message to the environment stream.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • format (MSKstring_t) – Is a valid C format string which matches the arguments in .... (input)
  • varnumarg (...) – A variable argument list. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Logging

MSK_echointro
MSKrescodee (MSKAPI MSK_echointro) (
  MSKenv_t env,
  MSKint32t longver)

Prints an intro to message stream.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • longver (MSKint32t) – If non-zero, then the intro is slightly longer. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_echotask
MSKrescodee (MSKAPIVA MSK_echotask) (
  MSKtask_t task,
  MSKstreamtypee whichstream,
  const char * format,
  ...)

Prints a formatted string to a task stream.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • format (MSKstring_t) – Is a valid C format string which matches the arguments in .... (input)
  • varnumarg (...) – Additional arguments (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Logging

MSK_freedbgenv
void (MSKAPI MSK_freedbgenv) (
  MSKenv_t env,
  void * buffer,
  const char * file,
  const unsigned line)

Frees space allocated by MOSEK. Debug version of MSK_freeenv.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • buffer (void*) – A pointer. (input/output)
  • file (MSKstring_t) – File from which the function is called. (input)
  • line (unsigned) – Line in the file from which the function is called. (input)
Return:
 

(void)

Groups:
 

Memory

MSK_freedbgtask
void (MSKAPI MSK_freedbgtask) (
  MSKtask_t task,
  void * buffer,
  const char * file,
  const unsigned line)

Frees space allocated by MOSEK. Debug version of MSK_freetask.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • buffer (void*) – A pointer. (input/output)
  • file (MSKstring_t) – File from which the function is called. (input)
  • line (unsigned) – Line in the file from which the function is called. (input)
Return:
 

(void)

Groups:
 

Memory

MSK_freeenv
void (MSKAPI MSK_freeenv) (
  MSKenv_t env,
  void * buffer)

Frees space allocated by a MOSEK function. Must not be applied to the MOSEK environment and task.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • buffer (void*) – A pointer. (input/output)
Return:
 

(void)

Groups:
 

Memory

MSK_freetask
void (MSKAPI MSK_freetask) (
  MSKtask_t task,
  void * buffer)

Frees space allocated by a MOSEK function. Must not be applied to the MOSEK environment and task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • buffer (void*) – A pointer. (input/output)
Return:
 

(void)

Groups:
 

Memory

MSK_gemm
MSKrescodee (MSKAPI MSK_gemm) (
  MSKenv_t env,
  MSKtransposee transa,
  MSKtransposee transb,
  MSKint32t m,
  MSKint32t n,
  MSKint32t k,
  MSKrealt alpha,
  const MSKrealt * a,
  const MSKrealt * b,
  MSKrealt beta,
  MSKrealt * c)

Performs a matrix multiplication plus addition of dense matrices. Given \(A\), \(B\) and \(C\) of compatible dimensions, this function computes

\[C:= \alpha op(A)op(B) + \beta C\]

where \(\alpha,\beta\) are two scalar values. The function \(op(X)\) denotes \(X\) if transX is MSK_TRANSPOSE_NO, or \(X^T\) if set to MSK_TRANSPOSE_YES. The matrix \(C\) has \(m\) rows and \(n\) columns, and the other matrices must have compatible dimensions.

The result of this operation is stored in \(C\).

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • transa (MSKtransposee) – Indicates whether the matrix \(A\) must be transposed. (input)
  • transb (MSKtransposee) – Indicates whether the matrix \(B\) must be transposed. (input)
  • m (MSKint32t) – Indicates the number of rows of matrix \(C\). (input)
  • n (MSKint32t) – Indicates the number of columns of matrix \(C\). (input)
  • k (MSKint32t) – Specifies the common dimension along which \(op(A)\) and \(op(B)\) are multiplied. For example, if neither \(A\) nor \(B\) are transposed, then this is the number of columns in \(A\) and also the number of rows in \(B\). (input)
  • alpha (MSKrealt) – A scalar value multiplying the result of the matrix multiplication. (input)
  • a (MSKrealt*) – The pointer to the array storing matrix \(A\) in a column-major format. (input)
  • b (MSKrealt*) – The pointer to the array storing matrix \(B\) in a column-major format. (input)
  • beta (MSKrealt) – A scalar value that multiplies \(C\). (input)
  • c (MSKrealt*) – The pointer to the array storing matrix \(C\) in a column-major format. (input/output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear algebra

MSK_gemv
MSKrescodee (MSKAPI MSK_gemv) (
  MSKenv_t env,
  MSKtransposee transa,
  MSKint32t m,
  MSKint32t n,
  MSKrealt alpha,
  const MSKrealt * a,
  const MSKrealt * x,
  MSKrealt beta,
  MSKrealt * y)

Computes the multiplication of a scaled dense matrix times a dense vector, plus a scaled dense vector. Precisely, if trans is MSK_TRANSPOSE_NO then the update is

\[y := \alpha A x + \beta y,\]

and if trans is MSK_TRANSPOSE_YES then

\[y := \alpha A^T x + \beta y,\]

where \(\alpha,\beta\) are scalar values and \(A\) is a matrix with \(m\) rows and \(n\) columns.

Note that the result is stored overwriting \(y\).

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • transa (MSKtransposee) – Indicates whether the matrix \(A\) must be transposed. (input)
  • m (MSKint32t) – Specifies the number of rows of the matrix \(A\). (input)
  • n (MSKint32t) – Specifies the number of columns of the matrix \(A\). (input)
  • alpha (MSKrealt) – A scalar value multiplying the matrix \(A\). (input)
  • a (MSKrealt*) – A pointer to the array storing matrix \(A\) in a column-major format. (input)
  • x (MSKrealt*) – A pointer to the array storing the vector \(x\). (input)
  • beta (MSKrealt) – A scalar value multiplying the vector \(y\). (input)
  • y (MSKrealt*) – A pointer to the array storing the vector \(y\). (input/output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear algebra

MSK_getacol
MSKrescodee (MSKAPI MSK_getacol) (
  MSKtask_t task,
  MSKint32t j,
  MSKint32t * nzj,
  MSKint32t * subj,
  MSKrealt * valj)

Obtains one column of \(A\) in a sparse format.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the column. (input)
  • nzj (MSKint32t by reference) – Number of non-zeros in the column obtained. (output)
  • subj (MSKint32t*) – Row indices of the non-zeros in the column obtained. (output)
  • valj (MSKrealt*) – Numerical values in the column obtained. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getacolnumnz
MSKrescodee (MSKAPI MSK_getacolnumnz) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t * nzj)

Obtains the number of non-zero elements in one column of \(A\).

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getacolslicetrip
MSKrescodee (MSKAPI MSK_getacolslicetrip) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t maxnumnz,
  MSKint64t * surp,
  MSKint32t * subi,
  MSKint32t * subj,
  MSKrealt * val)

Obtains a sequence of columns from \(A\) in sparse triplet format. The function returns the content of all columns whose index j satisfies first <= j < last. The triplets corresponding to nonzero entries are stored in the arrays subi, subj and val.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – Index of the first column in the sequence. (input)
  • last (MSKint32t) – Index of the last column in the sequence plus one. (input)
  • maxnumnz (MSKint64t) – Denotes the length of the arrays subi, subj, and val. (input)
  • surp (MSKint64t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in subi, subj and val starting from position surp away from the end of the arrays. On return surp will be decremented by the total number of non-zeros written. (input/output)
  • subi (MSKint32t*) – Constraint subscripts. (output)
  • subj (MSKint32t*) – Column subscripts. (output)
  • val (MSKrealt*) – Values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getaij
MSKrescodee (MSKAPI MSK_getaij) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t j,
  MSKrealt * aij)

Obtains a single coefficient in \(A\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Row index of the coefficient to be returned. (input)
  • j (MSKint32t) – Column index of the coefficient to be returned. (input)
  • aij (MSKrealt by reference) – The required coefficient \(a_{i,j}\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getapiecenumnz
MSKrescodee (MSKAPI MSK_getapiecenumnz) (
  MSKtask_t task,
  MSKint32t firsti,
  MSKint32t lasti,
  MSKint32t firstj,
  MSKint32t lastj,
  MSKint32t * numnz)

Obtains the number non-zeros in a rectangular piece of \(A\), i.e. the number of elements in the set

\[\{ (i,j)~:~ a_{i,j} \neq 0,~ \mathtt{firsti} \leq i \leq \mathtt{lasti}-1, ~\mathtt{firstj} \leq j \leq \mathtt{lastj}-1\}\]

This function is not an efficient way to obtain the number of non-zeros in one row or column. In that case use the function MSK_getarownumnz or MSK_getacolnumnz.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • firsti (MSKint32t) – Index of the first row in the rectangular piece. (input)
  • lasti (MSKint32t) – Index of the last row plus one in the rectangular piece. (input)
  • firstj (MSKint32t) – Index of the first column in the rectangular piece. (input)
  • lastj (MSKint32t) – Index of the last column plus one in the rectangular piece. (input)
  • numnz (MSKint32t by reference) – Number of non-zero \(A\) elements in the rectangular piece. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_getarow
MSKrescodee (MSKAPI MSK_getarow) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t * nzi,
  MSKint32t * subi,
  MSKrealt * vali)

Obtains one row of \(A\) in a sparse format.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of the row. (input)
  • nzi (MSKint32t by reference) – Number of non-zeros in the row obtained. (output)
  • subi (MSKint32t*) – Column indices of the non-zeros in the row obtained. (output)
  • vali (MSKrealt*) – Numerical values of the row obtained. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getarownumnz
MSKrescodee (MSKAPI MSK_getarownumnz) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t * nzi)

Obtains the number of non-zero elements in one row of \(A\).

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getarowslicetrip
MSKrescodee (MSKAPI MSK_getarowslicetrip) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t maxnumnz,
  MSKint64t * surp,
  MSKint32t * subi,
  MSKint32t * subj,
  MSKrealt * val)

Obtains a sequence of rows from \(A\) in sparse triplet format. The function returns the content of all rows whose index i satisfies first <= i < last. The triplets corresponding to nonzero entries are stored in the arrays subi, subj and val.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – Index of the first row in the sequence. (input)
  • last (MSKint32t) – Index of the last row in the sequence plus one. (input)
  • maxnumnz (MSKint64t) – Denotes the length of the arrays subi, subj, and val. (input)
  • surp (MSKint64t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in subi, subj and val starting from position surp away from the end of the arrays. On return surp will be decremented by the total number of non-zeros written. (input/output)
  • subi (MSKint32t*) – Constraint subscripts. (output)
  • subj (MSKint32t*) – Column subscripts. (output)
  • val (MSKrealt*) – Values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getaslice Deprecated
MSKrescodee (MSKAPI MSK_getaslice) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t first,
  MSKint32t last,
  MSKint32t maxnumnz,
  MSKint32t * surp,
  MSKint32t * ptrb,
  MSKint32t * ptre,
  MSKint32t * sub,
  MSKrealt * val)

Obtains a sequence of rows or columns from \(A\) in sparse format.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines whether a column slice or a row slice is requested. (input)
  • first (MSKint32t) – Index of the first row or column in the sequence. (input)
  • last (MSKint32t) – Index of the last row or column in the sequence plus one. (input)
  • maxnumnz (MSKint32t) – Denotes the length of the arrays sub and val. (input)
  • surp (MSKint32t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in sub and val starting from position surp away from the end of the arrays. Upon return surp will be decremented by the total number of non-zeros written. (input/output)
  • ptrb (MSKint32t*) – ptrb[t] is an index pointing to the first element in the \(t\)-th row or column obtained. (output)
  • ptre (MSKint32t*) – ptre[t] is an index pointing to the last element plus one in the \(t\)-th row or column obtained. (output)
  • sub (MSKint32t*) – Contains the row or column subscripts. (output)
  • val (MSKrealt*) – Contains the coefficient values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getaslice64 Deprecated
MSKrescodee (MSKAPI MSK_getaslice64) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t first,
  MSKint32t last,
  MSKint64t maxnumnz,
  MSKint64t * surp,
  MSKint64t * ptrb,
  MSKint64t * ptre,
  MSKint32t * sub,
  MSKrealt * val)

Obtains a sequence of rows or columns from \(A\) in sparse format.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines whether a column slice or a row slice is requested. (input)
  • first (MSKint32t) – Index of the first row or column in the sequence. (input)
  • last (MSKint32t) – Index of the last row or column in the sequence plus one. (input)
  • maxnumnz (MSKint64t) – Denotes the length of the arrays sub and val. (input)
  • surp (MSKint64t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in sub and val starting from position surp away from the end of the arrays. Upon return surp will be decremented by the total number of non-zeros written. (input/output)
  • ptrb (MSKint64t*) – ptrb[t] is an index pointing to the first element in the \(t\)-th row or column obtained. (output)
  • ptre (MSKint64t*) – ptre[t] is an index pointing to the last element plus one in the \(t\)-th row or column obtained. (output)
  • sub (MSKint32t*) – Contains the row or column subscripts. (output)
  • val (MSKrealt*) – Contains the coefficient values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getaslicenumnz Deprecated
MSKrescodee (MSKAPI MSK_getaslicenumnz) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t first,
  MSKint32t last,
  MSKint32t * numnz)

Obtains the number of non-zeros in a row or column slice of \(A\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines whether non-zeros are counted in a column-slice or a row-slice. (input)
  • first (MSKint32t) – Index of the first row or column in the sequence. (input)
  • last (MSKint32t) – Index of the last row or column plus one in the sequence. (input)
  • numnz (MSKint32t by reference) – Number of non-zeros in the slice. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_getaslicenumnz64 Deprecated
MSKrescodee (MSKAPI MSK_getaslicenumnz64) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t first,
  MSKint32t last,
  MSKint64t * numnz)

Obtains the number of non-zeros in a slice of rows or columns of \(A\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines whether non-zeros are counted in a column slice or a row slice. (input)
  • first (MSKint32t) – Index of the first row or column in the sequence. (input)
  • last (MSKint32t) – Index of the last row or column plus one in the sequence. (input)
  • numnz (MSKint64t by reference) – Number of non-zeros in the slice. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_getbarablocktriplet
MSKrescodee (MSKAPI MSK_getbarablocktriplet) (
  MSKtask_t task,
  MSKint64t maxnum,
  MSKint64t * num,
  MSKint32t * subi,
  MSKint32t * subj,
  MSKint32t * subk,
  MSKint32t * subl,
  MSKrealt * valijkl)

Obtains \(\barA\) in block triplet form.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnum (MSKint64t) – subi, subj, subk, subl and valijkl must be maxnum long. (input)
  • num (MSKint64t by reference) – Number of elements in the block triplet form. (output)
  • subi (MSKint32t*) – Constraint index. (output)
  • subj (MSKint32t*) – Symmetric matrix variable index. (output)
  • subk (MSKint32t*) – Block row index. (output)
  • subl (MSKint32t*) – Block column index. (output)
  • valijkl (MSKrealt*) – The numerical value associated with each block triplet. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbaraidx
MSKrescodee (MSKAPI MSK_getbaraidx) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint64t maxnum,
  MSKint32t * i,
  MSKint32t * j,
  MSKint64t * num,
  MSKint64t * sub,
  MSKrealt * weights)

Obtains information about an element in \(\barA\). Since \(\barA\) is a sparse matrix of symmetric matrices, only the nonzero elements in \(\barA\) are stored in order to save space. Now \(\barA\) is stored vectorized i.e. as one long vector. This function makes it possible to obtain information such as the row index and the column index of a particular element of the vectorized form of \(\barA\).

Please observe if one element of \(\barA\) is inputted multiple times then it may be stored several times in vectorized form. In that case the element with the highest index is the one that is used.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • idx (MSKint64t) – Position of the element in the vectorized form. (input)
  • maxnum (MSKint64t) – sub and weights must be at least maxnum long. (input)
  • i (MSKint32t by reference) – Row index of the element at position idx. (output)
  • j (MSKint32t by reference) – Column index of the element at position idx. (output)
  • num (MSKint64t by reference) – Number of terms in weighted sum that forms the element. (output)
  • sub (MSKint64t*) – A list indexes of the elements from symmetric matrix storage that appear in the weighted sum. (output)
  • weights (MSKrealt*) – The weights associated with each term in the weighted sum. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbaraidxij
MSKrescodee (MSKAPI MSK_getbaraidxij) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint32t * i,
  MSKint32t * j)

Obtains information about an element in \(\barA\). Since \(\barA\) is a sparse matrix of symmetric matrices, only the nonzero elements in \(\barA\) are stored in order to save space. Now \(\barA\) is stored vectorized i.e. as one long vector. This function makes it possible to obtain information such as the row index and the column index of a particular element of the vectorized form of \(\barA\).

Please note that if one element of \(\barA\) is inputted multiple times then it may be stored several times in vectorized form. In that case the element with the highest index is the one that is used.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbaraidxinfo
MSKrescodee (MSKAPI MSK_getbaraidxinfo) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint64t * num)

Each nonzero element in \(\barA_{ij}\) is formed as a weighted sum of symmetric matrices. Using this function the number of terms in the weighted sum can be obtained. See description of MSK_appendsparsesymmat for details about the weighted sum.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • idx (MSKint64t) – The internal position of the element for which information should be obtained. (input)
  • num (MSKint64t by reference) – Number of terms in the weighted sum that form the specified element in \(\barA\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbarasparsity
MSKrescodee (MSKAPI MSK_getbarasparsity) (
  MSKtask_t task,
  MSKint64t maxnumnz,
  MSKint64t * numnz,
  MSKint64t * idxij)

The matrix \(\barA\) is assumed to be a sparse matrix of symmetric matrices. This implies that many of the elements in \(\barA\) are likely to be zero matrices. Therefore, in order to save space, only nonzero elements in \(\barA\) are stored on vectorized form. This function is used to obtain the sparsity pattern of \(\barA\) and the position of each nonzero element in the vectorized form of \(\barA\). From the index detailed information about each nonzero \(\barA_{i,j}\) can be obtained using MSK_getbaraidxinfo and MSK_getbaraidx.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumnz (MSKint64t) – The array idxij must be at least maxnumnz long. (input)
  • numnz (MSKint64t by reference) – Number of nonzero elements in \(\barA\). (output)
  • idxij (MSKint64t*) – Position of each nonzero element in the vectorized form of \(\barA\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbarcblocktriplet
MSKrescodee (MSKAPI MSK_getbarcblocktriplet) (
  MSKtask_t task,
  MSKint64t maxnum,
  MSKint64t * num,
  MSKint32t * subj,
  MSKint32t * subk,
  MSKint32t * subl,
  MSKrealt * valjkl)

Obtains \(\barC\) in block triplet form.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnum (MSKint64t) – subj, subk, subl and valjkl must be maxnum long. (input)
  • num (MSKint64t by reference) – Number of elements in the block triplet form. (output)
  • subj (MSKint32t*) – Symmetric matrix variable index. (output)
  • subk (MSKint32t*) – Block row index. (output)
  • subl (MSKint32t*) – Block column index. (output)
  • valjkl (MSKrealt*) – The numerical value associated with each block triplet. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbarcidx
MSKrescodee (MSKAPI MSK_getbarcidx) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint64t maxnum,
  MSKint32t * j,
  MSKint64t * num,
  MSKint64t * sub,
  MSKrealt * weights)

Obtains information about an element in \(\barC\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • idx (MSKint64t) – Index of the element for which information should be obtained. (input)
  • maxnum (MSKint64t) – sub and weights must be at least maxnum long. (input)
  • j (MSKint32t by reference) – Row index in \(\barC\). (output)
  • num (MSKint64t by reference) – Number of terms in the weighted sum. (output)
  • sub (MSKint64t*) – Elements appearing the weighted sum. (output)
  • weights (MSKrealt*) – Weights of terms in the weighted sum. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbarcidxinfo
MSKrescodee (MSKAPI MSK_getbarcidxinfo) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint64t * num)

Obtains the number of terms in the weighted sum that forms a particular element in \(\barC\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • idx (MSKint64t) – Index of the element for which information should be obtained. The value is an index of a symmetric sparse variable. (input)
  • num (MSKint64t by reference) – Number of terms that appear in the weighted sum that forms the requested element. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbarcidxj
MSKrescodee (MSKAPI MSK_getbarcidxj) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint32t * j)

Obtains the row index of an element in \(\barC\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • idx (MSKint64t) – Index of the element for which information should be obtained. (input)
  • j (MSKint32t by reference) – Row index in \(\barC\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbarcsparsity
MSKrescodee (MSKAPI MSK_getbarcsparsity) (
  MSKtask_t task,
  MSKint64t maxnumnz,
  MSKint64t * numnz,
  MSKint64t * idxj)

Internally only the nonzero elements of \(\barC\) are stored in a vector. This function is used to obtain the nonzero elements of \(\barC\) and their indexes in the internal vector representation (in idx). From the index detailed information about each nonzero \(\barC_j\) can be obtained using MSK_getbarcidxinfo and MSK_getbarcidx.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumnz (MSKint64t) – idxj must be at least maxnumnz long. (input)
  • numnz (MSKint64t by reference) – Number of nonzero elements in \(\barC\). (output)
  • idxj (MSKint64t*) – Internal positions of the nonzeros elements in \(\barC\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getbarsj
MSKrescodee (MSKAPI MSK_getbarsj) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t j,
  MSKrealt * barsj)

Obtains the dual solution for a semidefinite variable. Only the lower triangular part of \(\barS_j\) is returned because the matrix by construction is symmetric. The format is that the columns are stored sequentially in the natural order.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • j (MSKint32t) – Index of the semidefinite variable. (input)
  • barsj (MSKrealt*) – Value of \(\barS_j\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getbarvarname
MSKrescodee (MSKAPI MSK_getbarvarname) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t sizename,
  char * name)

Obtains the name of a semidefinite variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of the variable. (input)
  • sizename (MSKint32t) – Length of the name buffer. (input)
  • name (MSKstring_t) – The requested name is copied to this buffer. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getbarvarnameindex
MSKrescodee (MSKAPI MSK_getbarvarnameindex) (
  MSKtask_t task,
  const char * somename,
  MSKint32t * asgn,
  MSKint32t * index)

Obtains the index of semidefinite variable from its name.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • somename (MSKstring_t) – The name of the variable. (input)
  • asgn (MSKint32t by reference) – Non-zero if the name somename is assigned to some semidefinite variable. (output)
  • index (MSKint32t by reference) – The index of a semidefinite variable with the name somename (if one exists). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getbarvarnamelen
MSKrescodee (MSKAPI MSK_getbarvarnamelen) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t * len)

Obtains the length of the name of a semidefinite variable.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getbarxj
MSKrescodee (MSKAPI MSK_getbarxj) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t j,
  MSKrealt * barxj)

Obtains the primal solution for a semidefinite variable. Only the lower triangular part of \(\barX_j\) is returned because the matrix by construction is symmetric. The format is that the columns are stored sequentially in the natural order.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • j (MSKint32t) – Index of the semidefinite variable. (input)
  • barxj (MSKrealt*) – Value of \(\barX_j\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getbound Deprecated
MSKrescodee (MSKAPI MSK_getbound) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t i,
  MSKboundkeye * bk,
  MSKrealt * bl,
  MSKrealt * bu)

Obtains bound information for one constraint or variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented). (input)
  • i (MSKint32t) – Index of the constraint or variable for which the bound information should be obtained. (input)
  • bk (MSKboundkeye by reference) – Bound keys. (output)
  • bl (MSKrealt by reference) – Values for lower bounds. (output)
  • bu (MSKrealt by reference) – Values for upper bounds. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_getboundslice Deprecated
MSKrescodee (MSKAPI MSK_getboundslice) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t first,
  MSKint32t last,
  MSKboundkeye * bk,
  MSKrealt * bl,
  MSKrealt * bu)

Obtains bounds information for a slice of variables or constraints.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines if operations are performed row-wise (constraint-oriented) or column-wise (variable-oriented). (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • bk (MSKboundkeye*) – Bound keys. (output)
  • bl (MSKrealt*) – Values for lower bounds. (output)
  • bu (MSKrealt*) – Values for upper bounds. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_getbuildinfo
MSKrescodee (MSKAPI MSK_getbuildinfo) (
  char * buildstate,
  char * builddate)

Obtains build information.

Parameters:
 
  • buildstate (MSKstring_t) – State of binaries, i.e. a debug, release candidate or final release. (output)
  • builddate (MSKstring_t) – Date when the binaries were built. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_getc
MSKrescodee (MSKAPI MSK_getc) (
  MSKtask_t task,
  MSKrealt * c)

Obtains all objective coefficients \(c\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • c (MSKrealt*) – Linear terms of the objective as a dense vector. The length is the number of variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getcallbackfunc
MSKrescodee (MSKAPI MSK_getcallbackfunc) (
  MSKtask_t task,
  MSKcallbackfunc * func,
  MSKuserhandle_t * handle)

Obtains the current user-defined callback function and associated user handle.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • func (MSKcallbackfunc by reference) – Get the user-defined progress callback function MSKcallbackfunc associated with task. If func is identical to NULL, then no callback function is associated with the task. (output)
  • handle (MSKuserhandle_t by reference) – The user-defined pointer associated with the user-defined callback function. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Callback

MSK_getcfix
MSKrescodee (MSKAPI MSK_getcfix) (
  MSKtask_t task,
  MSKrealt * cfix)

Obtains the fixed term in the objective.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getcj
MSKrescodee (MSKAPI MSK_getcj) (
  MSKtask_t task,
  MSKint32t j,
  MSKrealt * cj)

Obtains one coefficient of \(c\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the variable for which the \(c\) coefficient should be obtained. (input)
  • cj (MSKrealt by reference) – The value of \(c_j\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getcodedesc
MSKrescodee (MSKAPI MSK_getcodedesc) (
  MSKrescodee code,
  char * symname,
  char * str)

Obtains a short description of the meaning of the response code given by code.

Parameters:
 
  • code (MSKrescodee) – A valid MOSEK response code. (input)
  • symname (MSKstring_t) – Symbolic name corresponding to code. (output)
  • str (MSKstring_t) – Obtains a short description of a response code. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_getconbound
MSKrescodee (MSKAPI MSK_getconbound) (
  MSKtask_t task,
  MSKint32t i,
  MSKboundkeye * bk,
  MSKrealt * bl,
  MSKrealt * bu)

Obtains bound information for one constraint.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_getconboundslice
MSKrescodee (MSKAPI MSK_getconboundslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKboundkeye * bk,
  MSKrealt * bl,
  MSKrealt * bu)

Obtains bounds information for a slice of the constraints.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • bk (MSKboundkeye*) – Bound keys. (output)
  • bl (MSKrealt*) – Values for lower bounds. (output)
  • bu (MSKrealt*) – Values for upper bounds. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_getcone
MSKrescodee (MSKAPI MSK_getcone) (
  MSKtask_t task,
  MSKint32t k,
  MSKconetypee * ct,
  MSKrealt * conepar,
  MSKint32t * nummem,
  MSKint32t * submem)

Obtains a cone.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_getconeinfo
MSKrescodee (MSKAPI MSK_getconeinfo) (
  MSKtask_t task,
  MSKint32t k,
  MSKconetypee * ct,
  MSKrealt * conepar,
  MSKint32t * nummem)

Obtains information about a cone.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_getconename
MSKrescodee (MSKAPI MSK_getconename) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t sizename,
  char * name)

Obtains the name of a cone.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of the cone. (input)
  • sizename (MSKint32t) – Maximum length of a name that can be stored in name. (input)
  • name (MSKstring_t) – The required name. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getconenameindex
MSKrescodee (MSKAPI MSK_getconenameindex) (
  MSKtask_t task,
  const char * somename,
  MSKint32t * asgn,
  MSKint32t * index)

Checks whether the name somename has been assigned to any cone. If it has been assigned to a cone, then the index of the cone is reported.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • somename (MSKstring_t) – The name which should be checked. (input)
  • asgn (MSKint32t by reference) – Is non-zero if the name somename is assigned to some cone. (output)
  • index (MSKint32t by reference) – If the name somename is assigned to some cone, then index is the index of the cone. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getconenamelen
MSKrescodee (MSKAPI MSK_getconenamelen) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t * len)

Obtains the length of the name of a cone.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getconname
MSKrescodee (MSKAPI MSK_getconname) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t sizename,
  char * name)

Obtains the name of a constraint.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of the constraint. (input)
  • sizename (MSKint32t) – Maximum length of name that can be stored in name. (input)
  • name (MSKstring_t) – The required name. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getconnameindex
MSKrescodee (MSKAPI MSK_getconnameindex) (
  MSKtask_t task,
  const char * somename,
  MSKint32t * asgn,
  MSKint32t * index)

Checks whether the name somename has been assigned to any constraint. If so, the index of the constraint is reported.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • somename (MSKstring_t) – The name which should be checked. (input)
  • asgn (MSKint32t by reference) – Is non-zero if the name somename is assigned to some constraint. (output)
  • index (MSKint32t by reference) – If the name somename is assigned to a constraint, then index is the index of the constraint. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getconnamelen
MSKrescodee (MSKAPI MSK_getconnamelen) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t * len)

Obtains the length of the name of a constraint.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getcslice
MSKrescodee (MSKAPI MSK_getcslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * c)

Obtains a sequence of elements in \(c\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • c (MSKrealt*) – Linear terms of the requested slice of the objective as a dense vector. The length is last-first. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getdimbarvarj
MSKrescodee (MSKAPI MSK_getdimbarvarj) (
  MSKtask_t task,
  MSKint32t j,
  MSKint32t * dimbarvarj)

Obtains the dimension of a symmetric matrix variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the semidefinite variable whose dimension is requested. (input)
  • dimbarvarj (MSKint32t by reference) – The dimension of the \(j\)-th semidefinite variable. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getdouinf
MSKrescodee (MSKAPI MSK_getdouinf) (
  MSKtask_t task,
  MSKdinfiteme whichdinf,
  MSKrealt * dvalue)

Obtains a double information item from the task information database.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichdinf (MSKdinfiteme) – Specifies a double information item. (input)
  • dvalue (MSKrealt by reference) – The value of the required double information item. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getdouparam
MSKrescodee (MSKAPI MSK_getdouparam) (
  MSKtask_t task,
  MSKdparame param,
  MSKrealt * parvalue)

Obtains the value of a double parameter.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getdualobj
MSKrescodee (MSKAPI MSK_getdualobj) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * dualobj)

Computes the dual objective value associated with the solution. Note that if the solution is a primal infeasibility certificate, then the fixed term in the objective value is not included.

Moreover, since there is no dual solution associated with an integer solution, an error will be reported if the dual objective value is requested for the integer solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • dualobj (MSKrealt by reference) – Objective value corresponding to the dual solution. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getdualsolutionnorms
MSKrescodee (MSKAPI MSK_getdualsolutionnorms) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * nrmy,
  MSKrealt * nrmslc,
  MSKrealt * nrmsuc,
  MSKrealt * nrmslx,
  MSKrealt * nrmsux,
  MSKrealt * nrmsnx,
  MSKrealt * nrmbars)

Compute norms of the dual solution.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getdviolbarvar
MSKrescodee (MSKAPI MSK_getdviolbarvar) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

Let \((\barS_j)^*\) be the value of variable \(\barS_j\) for the specified solution. Then the dual violation of the solution associated with variable \(\barS_j\) is given by

\[\max(-\lambda_{\min}(\barS_j),\ 0.0).\]

Both when the solution is a certificate of primal infeasibility and when it is dual feasible solution the violation should be small.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of \(\barX\) variables. (input)
  • viol (MSKrealt*) – viol[k] is the violation of the solution for the constraint \(\barS_{\mathtt{sub}[k]} \in \PSD\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getdviolcon
MSKrescodee (MSKAPI MSK_getdviolcon) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

The violation of the dual solution associated with the \(i\)-th constraint is computed as follows

\[\max( \rho( (s_l^c)_i^*,(b_l^c)_i ),\ \rho( (s_u^c)_i^*, -(b_u^c)_i ),\ |-y_i+(s_l^c)_i^*-(s_u^c)_i^*| )\]

where

\[\begin{split}\rho(x,l) = \left\{ \begin{array}{ll} -x, & l > -\infty , \\ |x|, & \mbox{otherwise}.\\ \end{array} \right.\end{split}\]

Both when the solution is a certificate of primal infeasibility or it is a dual feasible solution the violation should be small.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of constraints. (input)
  • viol (MSKrealt*) – viol[k] is the violation of dual solution associated with the constraint sub[k]. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getdviolcones
MSKrescodee (MSKAPI MSK_getdviolcones) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

Let \((s_n^x)^*\) be the value of variable \((s_n^x)\) for the specified solution. For simplicity let us assume that \(s_n^x\) is a member of a quadratic cone, then the violation is computed as follows

\[\begin{split}\left\{ \begin{array}{ll} \max(0,(\|s_n^x\|_{2:n}^*-(s_n^x)_1^*) / \sqrt{2}, & (s_n^x)^* \geq -\|(s_n^x)_{2:n}^*\|, \\ \|(s_n^x)^*\|, & \mbox{otherwise.} \end{array} \right.\end{split}\]

Both when the solution is a certificate of primal infeasibility or when it is a dual feasible solution the violation should be small.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of conic constraints. (input)
  • viol (MSKrealt*) – viol[k] is the violation of the dual solution associated with the conic constraint sub[k]. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getdviolvar
MSKrescodee (MSKAPI MSK_getdviolvar) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

The violation of the dual solution associated with the \(j\)-th variable is computed as follows

\[\max \left(\rho((s_l^x)_j^*,(b_l^x)_j),\ \rho((s_u^x)_j^*,-(b_u^x)_j),\ |\sum_{i=\idxbeg}^{\idxend{numcon}} a_{ij} y_i+(s_l^x)_j^*-(s_u^x)_j^* - \tau c_j| \right)\]

where

\[\begin{split}\rho(x,l) = \left\{ \begin{array}{ll} -x, & l > -\infty , \\ |x|, & \mbox{otherwise} \end{array} \right.\end{split}\]

and \(\tau=0\) if the solution is a certificate of primal infeasibility and \(\tau=1\) otherwise. The formula for computing the violation is only shown for the linear case but is generalized appropriately for the more general problems. Both when the solution is a certificate of primal infeasibility or when it is a dual feasible solution the violation should be small.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of \(x\) variables. (input)
  • viol (MSKrealt*) – viol[k] is the violation of dual solution associated with the variable sub[k]. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getenv
MSKrescodee (MSKAPI MSK_getenv) (
  MSKtask_t task,
  MSKenv_t * env)

Obtains the environment used to create the task.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

MSK_getinfeasiblesubproblem
MSKrescodee (MSKAPI MSK_getinfeasiblesubproblem) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKtask_t * inftask)

Given the solution is a certificate of primal or dual infeasibility then a primal or dual infeasible subproblem is obtained respectively. The subproblem tends to be much smaller than the original problem and hence it is easier to locate the infeasibility inspecting the subproblem than the original problem.

For the procedure to be useful it is important to assign meaningful names to constraints, variables etc. in the original task because those names will be duplicated in the subproblem.

The function is only applicable to linear and conic quadratic optimization problems.

For more information see Section 15.2.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Which solution to use when determining the infeasible subproblem. (input)
  • inftask (MSKtask_t by reference) – A new task containing the infeasible subproblem. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Infeasibility diagnostics

MSK_getinfindex
MSKrescodee (MSKAPI MSK_getinfindex) (
  MSKtask_t task,
  MSKinftypee inftype,
  const char * infname,
  MSKint32t * infindex)

Obtains the index of a named information item.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getinfmax
MSKrescodee (MSKAPI MSK_getinfmax) (
  MSKtask_t task,
  MSKinftypee inftype,
  MSKint32t * infmax)

Obtains the maximum index of an information item of a given type inftype plus 1.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • inftype (MSKinftypee) – Type of the information item. (input)
  • infmax (MSKint32t*) – The maximum index (plus 1) requested. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getinfname
MSKrescodee (MSKAPI MSK_getinfname) (
  MSKtask_t task,
  MSKinftypee inftype,
  MSKint32t whichinf,
  char * infname)

Obtains the name of an information item.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • inftype (MSKinftypee) – Type of the information item. (input)
  • whichinf (MSKint32t) – An information item. (input)
  • infname (MSKstring_t) – Name of the information item. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getintinf
MSKrescodee (MSKAPI MSK_getintinf) (
  MSKtask_t task,
  MSKiinfiteme whichiinf,
  MSKint32t * ivalue)

Obtains an integer information item from the task information database.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichiinf (MSKiinfiteme) – Specifies an integer information item. (input)
  • ivalue (MSKint32t by reference) – The value of the required integer information item. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getintparam
MSKrescodee (MSKAPI MSK_getintparam) (
  MSKtask_t task,
  MSKiparame param,
  MSKint32t * parvalue)

Obtains the value of an integer parameter.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getlasterror
MSKrescodee (MSKAPI MSK_getlasterror) (
  MSKtask_t task,
  MSKrescodee * lastrescode,
  MSKint32t sizelastmsg,
  MSKint32t * lastmsglen,
  char * lastmsg)

Obtains the last response code and corresponding message reported in MOSEK.

If there is no previous error, warning or termination code for this task, lastrescode returns MSK_RES_OK and lastmsg returns an empty string, otherwise the last response code different from MSK_RES_OK and the corresponding message are returned.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • lastrescode (MSKrescodee by reference) – Returns the last error code reported in the task. (output)
  • sizelastmsg (MSKint32t) – The length of the lastmsg buffer. (input)
  • lastmsglen (MSKint32t by reference) – Returns the length of the last error message reported in the task. (output)
  • lastmsg (MSKstring_t) – Returns the last error message reported in the task. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_getlasterror64
MSKrescodee (MSKAPI MSK_getlasterror64) (
  MSKtask_t task,
  MSKrescodee * lastrescode,
  MSKint64t sizelastmsg,
  MSKint64t * lastmsglen,
  char * lastmsg)

Obtains the last response code and corresponding message reported in MOSEK.

If there is no previous error, warning or termination code for this task, lastrescode returns MSK_RES_OK and lastmsg returns an empty string, otherwise the last response code different from MSK_RES_OK and the corresponding message are returned.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • lastrescode (MSKrescodee by reference) – Returns the last error code reported in the task. (output)
  • sizelastmsg (MSKint64t) – The length of the lastmsg buffer. (input)
  • lastmsglen (MSKint64t by reference) – Returns the length of the last error message reported in the task. (output)
  • lastmsg (MSKstring_t) – Returns the last error message reported in the task. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_getlenbarvarj
MSKrescodee (MSKAPI MSK_getlenbarvarj) (
  MSKtask_t task,
  MSKint32t j,
  MSKint64t * lenbarvarj)

Obtains the length of the \(j\)-th semidefinite variable i.e. the number of elements in the lower triangular part.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the semidefinite variable whose length if requested. (input)
  • lenbarvarj (MSKint64t by reference) – Number of scalar elements in the lower triangular part of the semidefinite variable. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getlintinf
MSKrescodee (MSKAPI MSK_getlintinf) (
  MSKtask_t task,
  MSKliinfiteme whichliinf,
  MSKint64t * ivalue)

Obtains a long integer information item from the task information database.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichliinf (MSKliinfiteme) – Specifies a long information item. (input)
  • ivalue (MSKint64t by reference) – The value of the required long integer information item. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getmaxnamelen
MSKrescodee (MSKAPI MSK_getmaxnamelen) (
  MSKtask_t task,
  MSKint32t * maxlen)

Obtains the maximum length (not including terminating zero character) of any objective, constraint, variable or cone name.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getmaxnumanz
MSKrescodee (MSKAPI MSK_getmaxnumanz) (
  MSKtask_t task,
  MSKint32t * maxnumanz)

Obtains number of preallocated non-zeros in \(A\). When this number of non-zeros is reached MOSEK will automatically allocate more space for \(A\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumanz (MSKint32t by reference) – Number of preallocated non-zero linear matrix elements. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getmaxnumanz64
MSKrescodee (MSKAPI MSK_getmaxnumanz64) (
  MSKtask_t task,
  MSKint64t * maxnumanz)

Obtains number of preallocated non-zeros in \(A\). When this number of non-zeros is reached MOSEK will automatically allocate more space for \(A\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumanz (MSKint64t by reference) – Number of preallocated non-zero linear matrix elements. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getmaxnumbarvar
MSKrescodee (MSKAPI MSK_getmaxnumbarvar) (
  MSKtask_t task,
  MSKint32t * maxnumbarvar)

Obtains maximum number of symmetric matrix variables for which space is currently preallocated.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumbarvar (MSKint32t by reference) – Maximum number of symmetric matrix variables for which space is currently preallocated. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getmaxnumcon
MSKrescodee (MSKAPI MSK_getmaxnumcon) (
  MSKtask_t task,
  MSKint32t * maxnumcon)

Obtains the number of preallocated constraints in the optimization task. When this number of constraints is reached MOSEK will automatically allocate more space for constraints.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumcon (MSKint32t by reference) – Number of preallocated constraints in the optimization task. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear constraint data

MSK_getmaxnumcone
MSKrescodee (MSKAPI MSK_getmaxnumcone) (
  MSKtask_t task,
  MSKint32t * maxnumcone)

Obtains the number of preallocated cones in the optimization task. When this number of cones is reached MOSEK will automatically allocate space for more cones.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumcone (MSKint32t by reference) – Number of preallocated conic constraints in the optimization task. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_getmaxnumqnz
MSKrescodee (MSKAPI MSK_getmaxnumqnz) (
  MSKtask_t task,
  MSKint32t * maxnumqnz)

Obtains the number of preallocated non-zeros for \(Q\) (both objective and constraints). When this number of non-zeros is reached MOSEK will automatically allocate more space for \(Q\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumqnz (MSKint32t by reference) – Number of non-zero elements preallocated in quadratic coefficient matrices. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getmaxnumqnz64
MSKrescodee (MSKAPI MSK_getmaxnumqnz64) (
  MSKtask_t task,
  MSKint64t * maxnumqnz)

Obtains the number of preallocated non-zeros for \(Q\) (both objective and constraints). When this number of non-zeros is reached MOSEK will automatically allocate more space for \(Q\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumqnz (MSKint64t by reference) – Number of non-zero elements preallocated in quadratic coefficient matrices. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getmaxnumvar
MSKrescodee (MSKAPI MSK_getmaxnumvar) (
  MSKtask_t task,
  MSKint32t * maxnumvar)

Obtains the number of preallocated variables in the optimization task. When this number of variables is reached MOSEK will automatically allocate more space for variables.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumvar (MSKint32t by reference) – Number of preallocated variables in the optimization task. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getmemusagetask
MSKrescodee (MSKAPI MSK_getmemusagetask) (
  MSKtask_t task,
  MSKint64t * meminuse,
  MSKint64t * maxmemuse)

Obtains information about the amount of memory used by a task.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Memory

MSK_getnadouinf
MSKrescodee (MSKAPI MSK_getnadouinf) (
  MSKtask_t task,
  const char * infitemname,
  MSKrealt * dvalue)

Obtains a named double information item from task information database.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • infitemname (MSKstring_t) – The name of a double information item. (input)
  • dvalue (MSKrealt by reference) – The value of the required double information item. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getnadouparam
MSKrescodee (MSKAPI MSK_getnadouparam) (
  MSKtask_t task,
  const char * paramname,
  MSKrealt * parvalue)

Obtains the value of a named double parameter.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getnaintinf
MSKrescodee (MSKAPI MSK_getnaintinf) (
  MSKtask_t task,
  const char * infitemname,
  MSKint32t * ivalue)

Obtains a named integer information item from the task information database.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • infitemname (MSKstring_t) – The name of an integer information item. (input)
  • ivalue (MSKint32t by reference) – The value of the required integer information item. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getnaintparam
MSKrescodee (MSKAPI MSK_getnaintparam) (
  MSKtask_t task,
  const char * paramname,
  MSKint32t * parvalue)

Obtains the value of a named integer parameter.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimizer statistics

MSK_getnastrparam
MSKrescodee (MSKAPI MSK_getnastrparam) (
  MSKtask_t task,
  const char * paramname,
  MSKint32t sizeparamname,
  MSKint32t * len,
  char * parvalue)

Obtains the value of a named string parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • paramname (MSKstring_t) – Name of a parameter. (input)
  • sizeparamname (MSKint32t) – Size of the name buffer parvalue. (input)
  • len (MSKint32t by reference) – Length of the string in parvalue. (output)
  • parvalue (MSKstring_t) – Parameter value. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getnastrparamal
MSKrescodee (MSKAPI MSK_getnastrparamal) (
  MSKtask_t task,
  const char * paramname,
  MSKint32t numaddchr,
  MSKstring_t * value)

Obtains the value of a named string parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • paramname (MSKstring_t) – Name of a parameter. (input)
  • numaddchr (MSKint32t) – Number of additional characters for which room is left in value. (input)
  • value (MSKstring_t*) – Parameter value. MOSEK will allocate this char buffer of size equal to the actual length of the string parameter plus numaddchr. This memory must be freed by MSK_freetask. (input/output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getnlfunc
MSKrescodee (MSKAPI MSK_getnlfunc) (
  MSKtask_t task,
  MSKuserhandle_t * nlhandle,
  MSKnlgetspfunc * nlgetsp,
  MSKnlgetvafunc * nlgetva)

This function is used to retrieve the nonlinear callback functions. If NULL no nonlinear callback function exists.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • nlhandle (MSKuserhandle_t by reference) – Retrieve the pointer to the user-defined data structure. This structure is passed to the functions nlgetsp and nlgetva whenever those two functions are called. (input/output)
  • nlgetsp (MSKnlgetspfunc by reference) – Retrieve the pointer to the function which provides information about the structure of the nonlinear part of the optimization problem. (output)
  • nlgetva (MSKnlgetvafunc*) – Retrieve the function which is used to evaluate the nonlinear function in the optimization problem at a given point. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Callback

MSK_getnumanz
MSKrescodee (MSKAPI MSK_getnumanz) (
  MSKtask_t task,
  MSKint32t * numanz)

Obtains the number of non-zeros in \(A\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numanz (MSKint32t by reference) – Number of non-zero elements in the linear constraint matrix. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumanz64
MSKrescodee (MSKAPI MSK_getnumanz64) (
  MSKtask_t task,
  MSKint64t * numanz)

Obtains the number of non-zeros in \(A\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numanz (MSKint64t by reference) – Number of non-zero elements in the linear constraint matrix. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumbarablocktriplets
MSKrescodee (MSKAPI MSK_getnumbarablocktriplets) (
  MSKtask_t task,
  MSKint64t * num)

Obtains an upper bound on the number of elements in the block triplet form of \(\barA\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint64t by reference) – An upper bound on the number of elements in the block triplet form of \(\barA.\) (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getnumbaranz
MSKrescodee (MSKAPI MSK_getnumbaranz) (
  MSKtask_t task,
  MSKint64t * nz)

Get the number of nonzero elements in \(\barA\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • nz (MSKint64t by reference) – The number of nonzero block elements in \(\barA\) i.e. the number of \(\barA_{ij}\) elements that are nonzero. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getnumbarcblocktriplets
MSKrescodee (MSKAPI MSK_getnumbarcblocktriplets) (
  MSKtask_t task,
  MSKint64t * num)

Obtains an upper bound on the number of elements in the block triplet form of \(\barC\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint64t by reference) – An upper bound on the number of elements in the block triplet form of \(\barC.\) (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getnumbarcnz
MSKrescodee (MSKAPI MSK_getnumbarcnz) (
  MSKtask_t task,
  MSKint64t * nz)

Obtains the number of nonzero elements in \(\barC\).

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • nz (MSKint64t by reference) – The number of nonzeros in \(\barC\) i.e. the number of elements \(\barC_j\) that are nonzero. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getnumbarvar
MSKrescodee (MSKAPI MSK_getnumbarvar) (
  MSKtask_t task,
  MSKint32t * numbarvar)

Obtains the number of semidefinite variables.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_getnumcon
MSKrescodee (MSKAPI MSK_getnumcon) (
  MSKtask_t task,
  MSKint32t * numcon)

Obtains the number of constraints.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear constraint data

MSK_getnumcone
MSKrescodee (MSKAPI MSK_getnumcone) (
  MSKtask_t task,
  MSKint32t * numcone)

Obtains the number of cones.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_getnumconemem
MSKrescodee (MSKAPI MSK_getnumconemem) (
  MSKtask_t task,
  MSKint32t k,
  MSKint32t * nummem)

Obtains the number of members in a cone.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_getnumintvar
MSKrescodee (MSKAPI MSK_getnumintvar) (
  MSKtask_t task,
  MSKint32t * numintvar)

Obtains the number of integer-constrained variables.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumparam
MSKrescodee (MSKAPI MSK_getnumparam) (
  MSKtask_t task,
  MSKparametertypee partype,
  MSKint32t * numparam)

Obtains the number of parameters of a given type.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_getnumqconknz
MSKrescodee (MSKAPI MSK_getnumqconknz) (
  MSKtask_t task,
  MSKint32t k,
  MSKint32t * numqcnz)

Obtains the number of non-zero quadratic terms in a constraint.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • k (MSKint32t) – Index of the constraint for which the number of non-zero quadratic terms should be obtained. (input)
  • numqcnz (MSKint32t by reference) – Number of quadratic terms. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumqconknz64
MSKrescodee (MSKAPI MSK_getnumqconknz64) (
  MSKtask_t task,
  MSKint32t k,
  MSKint64t * numqcnz)

Obtains the number of non-zero quadratic terms in a constraint.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • k (MSKint32t) – Index of the constraint for which the number quadratic terms should be obtained. (input)
  • numqcnz (MSKint64t by reference) – Number of quadratic terms. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumqobjnz
MSKrescodee (MSKAPI MSK_getnumqobjnz) (
  MSKtask_t task,
  MSKint32t * numqonz)

Obtains the number of non-zero quadratic terms in the objective.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numqonz (MSKint32t by reference) – Number of non-zero elements in the quadratic objective terms. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumqobjnz64
MSKrescodee (MSKAPI MSK_getnumqobjnz64) (
  MSKtask_t task,
  MSKint64t * numqonz)

Obtains the number of non-zero quadratic terms in the objective.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numqonz (MSKint64t by reference) – Number of non-zero elements in the quadratic objective terms. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumsymmat
MSKrescodee (MSKAPI MSK_getnumsymmat) (
  MSKtask_t task,
  MSKint64t * num)

Obtains the number of symmetric matrices stored in the vector \(E\).

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getnumvar
MSKrescodee (MSKAPI MSK_getnumvar) (
  MSKtask_t task,
  MSKint32t * numvar)

Obtains the number of variables.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getobjname
MSKrescodee (MSKAPI MSK_getobjname) (
  MSKtask_t task,
  MSKint32t sizeobjname,
  char * objname)

Obtains the name assigned to the objective function.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • sizeobjname (MSKint32t) – Length of objname. (input)
  • objname (MSKstring_t) – Assigned the objective name. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getobjnamelen
MSKrescodee (MSKAPI MSK_getobjnamelen) (
  MSKtask_t task,
  MSKint32t * len)

Obtains the length of the name assigned to the objective function.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getobjsense
MSKrescodee (MSKAPI MSK_getobjsense) (
  MSKtask_t task,
  MSKobjsensee * sense)

Gets the objective sense of the task.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Objective data

MSK_getparammax
MSKrescodee (MSKAPI MSK_getparammax) (
  MSKtask_t task,
  MSKparametertypee partype,
  MSKint32t * parammax)

Obtains the maximum index of a parameter of type partype plus 1.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_getparamname
MSKrescodee (MSKAPI MSK_getparamname) (
  MSKtask_t task,
  MSKparametertypee partype,
  MSKint32t param,
  char * parname)

Obtains the name for a parameter param of type partype.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_getprimalobj
MSKrescodee (MSKAPI MSK_getprimalobj) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * primalobj)

Computes the primal objective value for the desired solution. Note that if the solution is an infeasibility certificate, then the fixed term in the objective is not included.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • primalobj (MSKrealt by reference) – Objective value corresponding to the primal solution. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getprimalsolutionnorms
MSKrescodee (MSKAPI MSK_getprimalsolutionnorms) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * nrmxc,
  MSKrealt * nrmxx,
  MSKrealt * nrmbarx)

Compute norms of the primal solution.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getprobtype
MSKrescodee (MSKAPI MSK_getprobtype) (
  MSKtask_t task,
  MSKproblemtypee * probtype)

Obtains the problem type.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_getprosta
MSKrescodee (MSKAPI MSK_getprosta) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKprostae * prosta)

Obtains the problem status.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getpviolbarvar
MSKrescodee (MSKAPI MSK_getpviolbarvar) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

Computes the primal solution violation for a set of semidefinite variables. Let \((\barX_j)^*\) be the value of the variable \(\barX_j\) for the specified solution. Then the primal violation of the solution associated with variable \(\barX_j\) is given by

\[\max(-\lambda_{\min}(\barX_j),\ 0.0).\]

Both when the solution is a certificate of dual infeasibility or when it is primal feasible the violation should be small.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of \(\barX\) variables. (input)
  • viol (MSKrealt*) – viol[k] is how much the solution violates the constraint \(\barX_{\mathtt{sub}[k]} \in \PSD\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getpviolcon
MSKrescodee (MSKAPI MSK_getpviolcon) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

Computes the primal solution violation for a set of constraints. The primal violation of the solution associated with the \(i\)-th constraint is given by

\[\max(\tau l_i^c - (x_i^c)^*,\ (x_i^c)^* - \tau u_i^c),\ |\sum_{j=\idxbeg}^{\idxend{numvar}} a_{ij} x_j^* - x_i^c|)\]

where \(\tau=0\) if the solution is a certificate of dual infeasibility and \(\tau=1\) otherwise. Both when the solution is a certificate of dual infeasibility and when it is primal feasible the violation should be small. The above formula applies for the linear case but is appropriately generalized in other cases.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of constraints. (input)
  • viol (MSKrealt*) – viol[k] is the violation associated with the solution for the constraint sub[k]. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getpviolcones
MSKrescodee (MSKAPI MSK_getpviolcones) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

Computes the primal solution violation for a set of conic constraints. Let \(x^*\) be the value of the variable \(x\) for the specified solution. For simplicity let us assume that \(x\) is a member of a quadratic cone, then the violation is computed as follows

\[\begin{split}\left\{ \begin{array}{ll} \max(0,\|x_{2:n}\|-x_1) / \sqrt{2}, & x_1 \geq -\|x_{2:n}\|, \\ \|x\|, & \mbox{otherwise.} \end{array} \right.\end{split}\]

Both when the solution is a certificate of dual infeasibility or when it is primal feasible the violation should be small.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of conic constraints. (input)
  • viol (MSKrealt*) – viol[k] is the violation of the solution associated with the conic constraint number sub[k]. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getpviolvar
MSKrescodee (MSKAPI MSK_getpviolvar) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t num,
  const MSKint32t * sub,
  MSKrealt * viol)

Computes the primal solution violation associated to a set of variables. Let \(x_j^*\) be the value of \(x_j\) for the specified solution. Then the primal violation of the solution associated with variable \(x_j\) is given by

\[\max( \tau l_j^x - x_j^*,\ x_j^* - \tau u_j^x,\ 0).\]

where \(\tau=0\) if the solution is a certificate of dual infeasibility and \(\tau=1\) otherwise. Both when the solution is a certificate of dual infeasibility and when it is primal feasible the violation should be small.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • num (MSKint32t) – Length of sub and viol. (input)
  • sub (MSKint32t*) – An array of indexes of \(x\) variables. (input)
  • viol (MSKrealt*) – viol[k] is the violation associated with the solution for the variable \(x_\mathtt{sub[k]}\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getqconk
MSKrescodee (MSKAPI MSK_getqconk) (
  MSKtask_t task,
  MSKint32t k,
  MSKint32t maxnumqcnz,
  MSKint32t * qcsurp,
  MSKint32t * numqcnz,
  MSKint32t * qcsubi,
  MSKint32t * qcsubj,
  MSKrealt * qcval)

Obtains all the quadratic terms in a constraint. The quadratic terms are stored sequentially in qcsubi, qcsubj, and qcval.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • k (MSKint32t) – Which constraint. (input)
  • maxnumqcnz (MSKint32t) – Length of the arrays qcsubi, qcsubj, and qcval. (input)
  • qcsurp (MSKint32t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in qssubi, qssubj and qsval starting from position qcsurp away from the end of the arrays. On return qcsurp will be decremented by the total number of non-zeros written. (input/output)
  • numqcnz (MSKint32t by reference) – Number of quadratic terms. (output)
  • qcsubi (MSKint32t*) – Row subscripts for quadratic constraint matrix. (output)
  • qcsubj (MSKint32t*) – Column subscripts for quadratic constraint matrix. (output)
  • qcval (MSKrealt*) – Quadratic constraint coefficient values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getqconk64
MSKrescodee (MSKAPI MSK_getqconk64) (
  MSKtask_t task,
  MSKint32t k,
  MSKint64t maxnumqcnz,
  MSKint64t * qcsurp,
  MSKint64t * numqcnz,
  MSKint32t * qcsubi,
  MSKint32t * qcsubj,
  MSKrealt * qcval)

Obtains all the quadratic terms in a constraint. The quadratic terms are stored sequentially in qcsubi, qcsubj, and qcval.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • k (MSKint32t) – Which constraint. (input)
  • maxnumqcnz (MSKint64t) – Length of the arrays qcsubi, qcsubj, and qcval. (input)
  • qcsurp (MSKint64t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in qcsubi, qcsubj and qcval starting from position qcsurp away from the end of the arrays. On return qcsurp will be decremented by the total number of non-zeros written. (input/output)
  • numqcnz (MSKint64t by reference) – Number of quadratic terms. (output)
  • qcsubi (MSKint32t*) – Row subscripts for quadratic constraint matrix. (output)
  • qcsubj (MSKint32t*) – Column subscripts for quadratic constraint matrix. (output)
  • qcval (MSKrealt*) – Quadratic constraint coefficient values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getqobj
MSKrescodee (MSKAPI MSK_getqobj) (
  MSKtask_t task,
  MSKint32t maxnumqonz,
  MSKint32t * qosurp,
  MSKint32t * numqonz,
  MSKint32t * qosubi,
  MSKint32t * qosubj,
  MSKrealt * qoval)

Obtains the quadratic terms in the objective. The required quadratic terms are stored sequentially in qosubi, qosubj, and qoval.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumqonz (MSKint32t) – The length of the arrays qosubi, qosubj, and qoval. (input)
  • qosurp (MSKint32t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in qosubi, qosubj and qoval starting from position qosurp away from the end of the arrays. On return qosurp will be decremented by the total number of non-zeros written. (input/output)
  • numqonz (MSKint32t by reference) – Number of non-zero elements in the quadratic objective terms. (output)
  • qosubi (MSKint32t*) – Row subscripts for quadratic objective coefficients. (output)
  • qosubj (MSKint32t*) – Column subscripts for quadratic objective coefficients. (output)
  • qoval (MSKrealt*) – Quadratic objective coefficient values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getqobj64
MSKrescodee (MSKAPI MSK_getqobj64) (
  MSKtask_t task,
  MSKint64t maxnumqonz,
  MSKint64t * qosurp,
  MSKint64t * numqonz,
  MSKint32t * qosubi,
  MSKint32t * qosubj,
  MSKrealt * qoval)

Obtains the quadratic terms in the objective. The required quadratic terms are stored sequentially in qosubi, qosubj, and qoval.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumqonz (MSKint64t) – The length of the arrays qosubi, qosubj, and qoval. (input)
  • qosurp (MSKint64t by reference) – Surplus of subscript and coefficient arrays. The required entries are stored sequentially in qosubi, qosubj and qoval starting from position qosurp away from the end of the arrays. On return qosurp will be decremented by the total number of non-zeros written. (input/output)
  • numqonz (MSKint64t by reference) – Number of non-zero elements in the quadratic objective terms. (output)
  • qosubi (MSKint32t*) – Row subscripts for quadratic objective coefficients. (output)
  • qosubj (MSKint32t*) – Column subscripts for quadratic objective coefficients. (output)
  • qoval (MSKrealt*) – Quadratic objective coefficient values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getqobjij
MSKrescodee (MSKAPI MSK_getqobjij) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t j,
  MSKrealt * qoij)

Obtains one coefficient \(q_{ij}^o\) in the quadratic term of the objective.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getreducedcosts
MSKrescodee (MSKAPI MSK_getreducedcosts) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * redcosts)

Computes the reduced costs for a slice of variables and returns them in the array redcosts i.e.

(1)\[\mathtt{redcosts}[j-\mathtt{first}] = (s_l^x)_j-(s_u^x)_j, ~j=\mathtt{first},\ldots,\mathtt{last}-1\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – The index of the first variable in the sequence. (input)
  • last (MSKint32t) – The index of the last variable in the sequence plus 1. (input)
  • redcosts (MSKrealt*) – The reduced costs for the required slice of variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getresponseclass
MSKrescodee (MSKAPI MSK_getresponseclass) (
  MSKrescodee r,
  MSKrescodetypee * rc)

Obtain the class of a response code.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_getskc
MSKrescodee (MSKAPI MSK_getskc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKstakeye * skc)

Obtains the status keys for the constraints.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • skc (MSKstakeye*) – Status keys for the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getskcslice
MSKrescodee (MSKAPI MSK_getskcslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKstakeye * skc)

Obtains the status keys for a slice of the constraints.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • skc (MSKstakeye*) – Status keys for the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getskx
MSKrescodee (MSKAPI MSK_getskx) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKstakeye * skx)

Obtains the status keys for the scalar variables.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • skx (MSKstakeye*) – Status keys for the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getskxslice
MSKrescodee (MSKAPI MSK_getskxslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKstakeye * skx)

Obtains the status keys for a slice of the scalar variables.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • skx (MSKstakeye*) – Status keys for the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getslc
MSKrescodee (MSKAPI MSK_getslc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * slc)

Obtains the \(s_l^c\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getslcslice
MSKrescodee (MSKAPI MSK_getslcslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * slc)

Obtains a slice of the \(s_l^c\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getslx
MSKrescodee (MSKAPI MSK_getslx) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * slx)

Obtains the \(s_l^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getslxslice
MSKrescodee (MSKAPI MSK_getslxslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * slx)

Obtains a slice of the \(s_l^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsnx
MSKrescodee (MSKAPI MSK_getsnx) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * snx)

Obtains the \(s_n^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsnxslice
MSKrescodee (MSKAPI MSK_getsnxslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * snx)

Obtains a slice of the \(s_n^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsolsta
MSKrescodee (MSKAPI MSK_getsolsta) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKsolstae * solsta)

Obtains the solution status.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getsolution
MSKrescodee (MSKAPI MSK_getsolution) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKprostae * prosta,
  MSKsolstae * solsta,
  MSKstakeye * skc,
  MSKstakeye * skx,
  MSKstakeye * skn,
  MSKrealt * xc,
  MSKrealt * xx,
  MSKrealt * y,
  MSKrealt * slc,
  MSKrealt * suc,
  MSKrealt * slx,
  MSKrealt * sux,
  MSKrealt * snx)

Obtains the complete solution.

Consider the case of linear programming. The primal problem is given by

\[\begin{split}\begin{array}{lccccl} \mbox{minimize} & & & c^T x+c^f & & \\ \mbox{subject to} & l^c & \leq & A x & \leq & u^c, \\ & l^x & \leq & x & \leq & u^x. \\ \end{array}\end{split}\]

and the corresponding dual problem is

\[\begin{split}\begin{array}{lccl} \mbox{maximize} & (l^c)^T s_l^c - (u^c)^T s_u^c & \\ & + (l^x)^T s_l^x - (u^x)^T s_u^x + c^f & \\ \mbox{subject to} & A^T y + s_l^x - s_u^x & = & c, \\ & -y + s_l^c - s_u^c & = & 0, \\ & s_l^c,s_u^c,s_l^x,s_u^x \geq 0. & & \\ \end{array}\end{split}\]

A conic optimization problem has the same primal variables as in the linear case. Recall that the dual of a conic optimization problem is given by:

\[\begin{split}\begin{array}{lccccc} \mbox{maximize} & (l^c)^T s_l^c - (u^c)^T s_u^c & & \\ & +(l^x)^T s_l^x - (u^x)^T s_u^x + c^f & & \\ \mbox{subject to} & A^T y + s_l^x - s_u^x + s_n^x & = & c, \\ & -y + s_l^c - s_u^c & = & 0, \\ & s_l^c,s_u^c,s_l^x,s_u^x & \geq & 0, \\ & s_n^x \in \K^* & & \\ \end{array}\end{split}\]

The mapping between variables and arguments to the function is as follows:

  • xx : Corresponds to variable \(x\) (also denoted \(x^x\)).
  • xc : Corresponds to \(x^c:=Ax\).
  • y : Corresponds to variable \(y\).
  • slc: Corresponds to variable \(s_l^c\).
  • suc: Corresponds to variable \(s_u^c\).
  • slx: Corresponds to variable \(s_l^x\).
  • sux: Corresponds to variable \(s_u^x\).
  • snx: Corresponds to variable \(s_n^x\).

The meaning of the values returned by this function depend on the solution status returned in the argument solsta. The most important possible values of solsta are:

In order to retrieve the primal and dual values of semidefinite variables see MSK_getbarxj and MSK_getbarsj.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • prosta (MSKprostae by reference) – Problem status. (output)
  • solsta (MSKsolstae by reference) – Solution status. (output)
  • skc (MSKstakeye*) – Status keys for the constraints. (output)
  • skx (MSKstakeye*) – Status keys for the variables. (output)
  • skn (MSKstakeye*) – Status keys for the conic constraints. (output)
  • xc (MSKrealt*) – Primal constraint solution. (output)
  • xx (MSKrealt*) – Primal variable solution. (output)
  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (output)
  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (output)
  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (output)
  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (output)
  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (output)
  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsolutioni Deprecated
MSKrescodee (MSKAPI MSK_getsolutioni) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t i,
  MSKsoltypee whichsol,
  MSKstakeye * sk,
  MSKrealt * x,
  MSKrealt * sl,
  MSKrealt * su,
  MSKrealt * sn)

Obtains the primal and dual solution information for a single constraint or variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines whether solution information for a constraint or for a variable is retrieved. (input)
  • i (MSKint32t) – Index of the constraint or variable. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • sk (MSKstakeye by reference) – Status key of the constraint of variable. (output)
  • x (MSKrealt by reference) – Solution value of the primal variable. (output)
  • sl (MSKrealt by reference) – Solution value of the dual variable associated with the lower bound. (output)
  • su (MSKrealt by reference) – Solution value of the dual variable associated with the upper bound. (output)
  • sn (MSKrealt by reference) – Solution value of the dual variable associated with the cone constraint. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsolutioninfo
MSKrescodee (MSKAPI MSK_getsolutioninfo) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * pobj,
  MSKrealt * pviolcon,
  MSKrealt * pviolvar,
  MSKrealt * pviolbarvar,
  MSKrealt * pviolcone,
  MSKrealt * pviolitg,
  MSKrealt * dobj,
  MSKrealt * dviolcon,
  MSKrealt * dviolvar,
  MSKrealt * dviolbarvar,
  MSKrealt * dviolcone)

Obtains information about a solution.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution information

MSK_getsolutionslice
MSKrescodee (MSKAPI MSK_getsolutionslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKsoliteme solitem,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * values)

Obtains a slice of one item from the solution. The format of the solution is exactly as in MSK_getsolution. The parameter solitem determines which of the solution vectors should be returned.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • solitem (MSKsoliteme) – Which part of the solution is required. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • values (MSKrealt*) – The values in the required sequence are stored sequentially in values. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsparsesymmat
MSKrescodee (MSKAPI MSK_getsparsesymmat) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint64t maxlen,
  MSKint32t * subi,
  MSKint32t * subj,
  MSKrealt * valij)

Get a single symmetric matrix from the matrix store.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • idx (MSKint64t) – Index of the matrix to retrieve. (input)
  • maxlen (MSKint64t) – Length of the output arrays subi, subj and valij. (input)
  • subi (MSKint32t*) – Row subscripts of the matrix non-zero elements. (output)
  • subj (MSKint32t*) – Column subscripts of the matrix non-zero elements. (output)
  • valij (MSKrealt*) – Coefficients of the matrix non-zero elements. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getstrparam
MSKrescodee (MSKAPI MSK_getstrparam) (
  MSKtask_t task,
  MSKsparame param,
  MSKint32t maxlen,
  MSKint32t * len,
  char * parvalue)

Obtains the value of a string parameter.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getstrparamal
MSKrescodee (MSKAPI MSK_getstrparamal) (
  MSKtask_t task,
  MSKsparame param,
  MSKint32t numaddchr,
  MSKstring_t * value)

Obtains the value of a string parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • param (MSKsparame) – Which parameter. (input)
  • numaddchr (MSKint32t) – Number of additional characters for which room is left in value. (input)
  • value (MSKstring_t by reference) – Parameter value. MOSEK will allocate this char buffer of size equal to the actual length of the string parameter plus numaddchr. This memory must be freed by MSK_freetask. (input/output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getstrparamlen
MSKrescodee (MSKAPI MSK_getstrparamlen) (
  MSKtask_t task,
  MSKsparame param,
  MSKint32t * len)

Obtains the length of a string parameter.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (get)

MSK_getsuc
MSKrescodee (MSKAPI MSK_getsuc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * suc)

Obtains the \(s_u^c\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsucslice
MSKrescodee (MSKAPI MSK_getsucslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * suc)

Obtains a slice of the \(s_u^c\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsux
MSKrescodee (MSKAPI MSK_getsux) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * sux)

Obtains the \(s_u^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsuxslice
MSKrescodee (MSKAPI MSK_getsuxslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * sux)

Obtains a slice of the \(s_u^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getsymbcon
MSKrescodee (MSKAPI MSK_getsymbcon) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t sizevalue,
  char * name,
  MSKint32t * value)

Obtains the name and corresponding value for the \(i\)th symbolic constant.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index. (input)
  • sizevalue (MSKint32t) – The length of the buffer pointed to by the value argument. (input)
  • name (MSKstring_t) – Name of the \(i\)th symbolic constant. (output)
  • value (MSKint32t by reference) – The corresponding value. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_getsymbcondim
MSKrescodee (MSKAPI MSK_getsymbcondim) (
  MSKenv_t env,
  MSKint32t * num,
  size_t * maxlen)

Obtains the number of symbolic constants defined by MOSEK and the maximum length of the name of any symbolic constant.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • num (MSKint32t by reference) – Number of symbolic constants defined by MOSEK. (output)
  • maxlen (size_t by reference) – Maximum length of the name of any symbolic constants. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_getsymmatinfo
MSKrescodee (MSKAPI MSK_getsymmatinfo) (
  MSKtask_t task,
  MSKint64t idx,
  MSKint32t * dim,
  MSKint64t * nz,
  MSKsymmattypee * type)

MOSEK maintains a vector denoted by \(E\) of symmetric data matrices. This function makes it possible to obtain important information about a single matrix in \(E\).

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_gettaskname
MSKrescodee (MSKAPI MSK_gettaskname) (
  MSKtask_t task,
  MSKint32t sizetaskname,
  char * taskname)

Obtains the name assigned to the task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • sizetaskname (MSKint32t) – Length of the taskname buffer. (input)
  • taskname (MSKstring_t) – Returns the task name. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_gettasknamelen
MSKrescodee (MSKAPI MSK_gettasknamelen) (
  MSKtask_t task,
  MSKint32t * len)

Obtains the length the task name.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getvarbound
MSKrescodee (MSKAPI MSK_getvarbound) (
  MSKtask_t task,
  MSKint32t i,
  MSKboundkeye * bk,
  MSKrealt * bl,
  MSKrealt * bu)

Obtains bound information for one variable.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_getvarboundslice
MSKrescodee (MSKAPI MSK_getvarboundslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKboundkeye * bk,
  MSKrealt * bl,
  MSKrealt * bu)

Obtains bounds information for a slice of the variables.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • bk (MSKboundkeye*) – Bound keys. (output)
  • bl (MSKrealt*) – Values for lower bounds. (output)
  • bu (MSKrealt*) – Values for upper bounds. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_getvarname
MSKrescodee (MSKAPI MSK_getvarname) (
  MSKtask_t task,
  MSKint32t j,
  MSKint32t sizename,
  char * name)

Obtains the name of a variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of a variable. (input)
  • sizename (MSKint32t) – The length of the buffer pointed to by the name argument. (input)
  • name (MSKstring_t) – Returns the required name. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getvarnameindex
MSKrescodee (MSKAPI MSK_getvarnameindex) (
  MSKtask_t task,
  const char * somename,
  MSKint32t * asgn,
  MSKint32t * index)

Checks whether the name somename has been assigned to any variable. If so, the index of the variable is reported.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • somename (MSKstring_t) – The name which should be checked. (input)
  • asgn (MSKint32t by reference) – Is non-zero if the name somename is assigned to a variable. (output)
  • index (MSKint32t by reference) – If the name somename is assigned to a variable, then index is the index of the variable. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getvarnamelen
MSKrescodee (MSKAPI MSK_getvarnamelen) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t * len)

Obtains the length of the name of a variable.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_getvartype
MSKrescodee (MSKAPI MSK_getvartype) (
  MSKtask_t task,
  MSKint32t j,
  MSKvariabletypee * vartype)

Gets the variable type of one variable.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getvartypelist
MSKrescodee (MSKAPI MSK_getvartypelist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subj,
  MSKvariabletypee * vartype)

Obtains the variable type of one or more variables. Upon return vartype[k] is the variable type of variable subj[k].

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of variables for which the variable type should be obtained. (input)
  • subj (MSKint32t*) – A list of variable indexes. (input)
  • vartype (MSKvariabletypee*) – The variables types corresponding to the variables specified by subj. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_getversion
MSKrescodee (MSKAPI MSK_getversion) (
  MSKint32t * major,
  MSKint32t * minor,
  MSKint32t * build,
  MSKint32t * revision)

Obtains MOSEK version information.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

MSK_getxc
MSKrescodee (MSKAPI MSK_getxc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * xc)

Obtains the \(x^c\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • xc (MSKrealt*) – Primal constraint solution. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getxcslice
MSKrescodee (MSKAPI MSK_getxcslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * xc)

Obtains a slice of the \(x^c\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • xc (MSKrealt*) – Primal constraint solution. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getxx
MSKrescodee (MSKAPI MSK_getxx) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * xx)

Obtains the \(x^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • xx (MSKrealt*) – Primal variable solution. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getxxslice
MSKrescodee (MSKAPI MSK_getxxslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * xx)

Obtains a slice of the \(x^x\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • xx (MSKrealt*) – Primal variable solution. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_gety
MSKrescodee (MSKAPI MSK_gety) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * y)

Obtains the \(y\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_getyslice
MSKrescodee (MSKAPI MSK_getyslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKrealt * y)

Obtains a slice of the \(y\) vector for a solution.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (get)

MSK_initbasissolve
MSKrescodee (MSKAPI MSK_initbasissolve) (
  MSKtask_t task,
  MSKint32t * basis)

Prepare a task for use with the MSK_solvewithbasis function.

This function should be called

If the basis is singular i.e. not invertible, then the error MSK_RES_ERR_BASIS_SINGULAR is reported.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • basis (MSKint32t*) – The array of basis indexes to use. The array is interpreted as follows: If \(\mathtt{basis}[i] \leq \idxend{numcon}\), then \(x_{\mathtt{basis}[i]}^c\) is in the basis at position \(i\), otherwise \(x_{\mathtt{basis}[i]-\mathtt{numcon}}\) is in the basis at position \(i\). (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Basis matrix

MSK_inputdata
MSKrescodee (MSKAPI MSK_inputdata) (
  MSKtask_t task,
  MSKint32t maxnumcon,
  MSKint32t maxnumvar,
  MSKint32t numcon,
  MSKint32t numvar,
  const MSKrealt * c,
  MSKrealt cfix,
  const MSKint32t * aptrb,
  const MSKint32t * aptre,
  const MSKint32t * asub,
  const MSKrealt * aval,
  const MSKboundkeye * bkc,
  const MSKrealt * blc,
  const MSKrealt * buc,
  const MSKboundkeye * bkx,
  const MSKrealt * blx,
  const MSKrealt * bux)

Input the linear part of an optimization problem.

The non-zeros of \(A\) are inputted column-wise in the format described in Section 16.1.4.2.

For an explained code example see Section 6.1 and Section 16.1.4.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumcon (MSKint32t) – Number of preallocated constraints in the optimization task. (input)
  • maxnumvar (MSKint32t) – Number of preallocated variables in the optimization task. (input)
  • numcon (MSKint32t) – Number of constraints. (input)
  • numvar (MSKint32t) – Number of variables. (input)
  • c (MSKrealt*) – Linear terms of the objective as a dense vector. The length is the number of variables. (input)
  • cfix (MSKrealt) – Fixed term in the objective. (input)
  • aptrb (MSKint32t*) – Row or column start pointers. (input)
  • aptre (MSKint32t*) – Row or column end pointers. (input)
  • asub (MSKint32t*) – Coefficient subscripts. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
  • bkc (MSKboundkeye*) – Bound keys for the constraints. (input)
  • blc (MSKrealt*) – Lower bounds for the constraints. (input)
  • buc (MSKrealt*) – Upper bounds for the constraints. (input)
  • bkx (MSKboundkeye*) – Bound keys for the variables. (input)
  • blx (MSKrealt*) – Lower bounds for the variables. (input)
  • bux (MSKrealt*) – Upper bounds for the variables. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_inputdata64
MSKrescodee (MSKAPI MSK_inputdata64) (
  MSKtask_t task,
  MSKint32t maxnumcon,
  MSKint32t maxnumvar,
  MSKint32t numcon,
  MSKint32t numvar,
  const MSKrealt * c,
  MSKrealt cfix,
  const MSKint64t * aptrb,
  const MSKint64t * aptre,
  const MSKint32t * asub,
  const MSKrealt * aval,
  const MSKboundkeye * bkc,
  const MSKrealt * blc,
  const MSKrealt * buc,
  const MSKboundkeye * bkx,
  const MSKrealt * blx,
  const MSKrealt * bux)

Input the linear part of an optimization problem.

The non-zeros of \(A\) are inputted column-wise in the format described in Section 16.1.4.2.

For an explained code example see Section 6.1 and Section 16.1.4.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumcon (MSKint32t) – Number of preallocated constraints in the optimization task. (input)
  • maxnumvar (MSKint32t) – Number of preallocated variables in the optimization task. (input)
  • numcon (MSKint32t) – Number of constraints. (input)
  • numvar (MSKint32t) – Number of variables. (input)
  • c (MSKrealt*) – Linear terms of the objective as a dense vector. The length is the number of variables. (input)
  • cfix (MSKrealt) – Fixed term in the objective. (input)
  • aptrb (MSKint64t*) – Row or column start pointers. (input)
  • aptre (MSKint64t*) – Row or column end pointers. (input)
  • asub (MSKint32t*) – Coefficient subscripts. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
  • bkc (MSKboundkeye*) – Bound keys for the constraints. (input)
  • blc (MSKrealt*) – Lower bounds for the constraints. (input)
  • buc (MSKrealt*) – Upper bounds for the constraints. (input)
  • bkx (MSKboundkeye*) – Bound keys for the variables. (input)
  • blx (MSKrealt*) – Lower bounds for the variables. (input)
  • bux (MSKrealt*) – Upper bounds for the variables. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_iparvaltosymnam
MSKrescodee (MSKAPI MSK_iparvaltosymnam) (
  MSKenv_t env,
  MSKiparame whichparam,
  MSKint32t whichvalue,
  char * symbolicname)

Obtains the symbolic name corresponding to a value that can be assigned to an integer parameter.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • whichparam (MSKiparame) – Which parameter. (input)
  • whichvalue (MSKint32t) – Which value. (input)
  • symbolicname (MSKstring_t) – The symbolic name corresponding to whichvalue. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_isdouparname
MSKrescodee (MSKAPI MSK_isdouparname) (
  MSKtask_t task,
  const char * parname,
  MSKdparame * param)

Checks whether parname is a valid double parameter name.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • parname (MSKstring_t) – Parameter name. (input)
  • param (MSKdparame by reference) – Returns the parameter corresponding to the name, if one exists. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_isinfinity
MSKbooleant (MSKAPI MSK_isinfinity) (
  MSKrealt value)

Return true if value is considered infinity by MOSEK.

Parameters:
 value (MSKrealt) – The value to be checked (input)
Return:
  (MSKbooleant) – True if the value represents infinity.
MSK_isintparname
MSKrescodee (MSKAPI MSK_isintparname) (
  MSKtask_t task,
  const char * parname,
  MSKiparame * param)

Checks whether parname is a valid integer parameter name.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • parname (MSKstring_t) – Parameter name. (input)
  • param (MSKiparame by reference) – Returns the parameter corresponding to the name, if one exists. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_isstrparname
MSKrescodee (MSKAPI MSK_isstrparname) (
  MSKtask_t task,
  const char * parname,
  MSKsparame * param)

Checks whether parname is a valid string parameter name.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • parname (MSKstring_t) – Parameter name. (input)
  • param (MSKsparame by reference) – Returns the parameter corresponding to the name, if one exists. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameter management

MSK_licensecleanup
MSKrescodee (MSKAPI MSK_licensecleanup) (
void)

Stops all threads and deletes all handles used by the license system. If this function is called, it must be called as the last MOSEK API call. No other MOSEK API calls are valid after this.

Return:
  (MSKrescodee) – The function response code.
Groups:
 Environment management
MSK_linkfiletoenvstream
MSKrescodee (MSKAPI MSK_linkfiletoenvstream) (
  MSKenv_t env,
  MSKstreamtypee whichstream,
  const char * filename,
  MSKint32t append)

Sends all output from the stream defined by whichstream to the file given by filename.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • filename (MSKstring_t) – A valid file name. (input)
  • append (MSKint32t) – If this argument is 0 the file will be overwritten, otherwise it will be appended to. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Logging

MSK_linkfiletotaskstream
MSKrescodee (MSKAPI MSK_linkfiletotaskstream) (
  MSKtask_t task,
  MSKstreamtypee whichstream,
  const char * filename,
  MSKint32t append)

Directs all output from a task stream whichstream to a file filename.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • filename (MSKstring_t) – A valid file name. (input)
  • append (MSKint32t) – If this argument is 0 the output file will be overwritten, otherwise it will be appended to. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Logging

MSK_linkfunctoenvstream
MSKrescodee (MSKAPI MSK_linkfunctoenvstream) (
  MSKenv_t env,
  MSKstreamtypee whichstream,
  MSKuserhandle_t handle,
  MSKstreamfunc func)

Connects a user-defined function to a stream.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • handle (MSKuserhandle_t) – A user-defined handle which is passed to the user-defined function func. (input)
  • func (MSKstreamfunc) – All output to the stream whichstream is passed to func. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Logging, Callback

MSK_linkfunctotaskstream
MSKrescodee (MSKAPI MSK_linkfunctotaskstream) (
  MSKtask_t task,
  MSKstreamtypee whichstream,
  MSKuserhandle_t handle,
  MSKstreamfunc func)

Connects a user-defined function to a task stream.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • handle (MSKuserhandle_t) – A user-defined handle which is passed to the user-defined function func. (input)
  • func (MSKstreamfunc) – All output to the stream whichstream is passed to func. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Logging, Callback

MSK_makeemptytask
MSKrescodee (MSKAPI MSK_makeemptytask) (
  MSKenv_t env,
  MSKtask_t * task)

Creates a new optimization task.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_makeenv
MSKrescodee (MSKAPI MSK_makeenv) (
  MSKenv_t * env,
  const char * dbgfile)

Creates a new MOSEK environment. The environment must be shared among all tasks in a program.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_makeenvalloc
MSKrescodee (MSKAPI MSK_makeenvalloc) (
  MSKenv_t * env,
  MSKuserhandle_t usrptr,
  MSKmallocfunc usrmalloc,
  MSKcallocfunc usrcalloc,
  MSKreallocfunc usrrealloc,
  MSKfreefunc usrfree,
  const char * dbgfile)

Creates a new MOSEK environment with user-defined memory management functions. The environment must be shared among all tasks in a program.

Parameters:
 
  • env (MSKenv_t by reference) – The MOSEK environment. (output)
  • usrptr (MSKuserhandle_t) – A pointer to a user-defined data structure. The pointer is fed into usrmalloc and usrfree. (input)
  • usrmalloc (MSKmallocfunc) – A user-defined malloc function or a NULL pointer. (input)
  • usrcalloc (MSKcallocfunc) – A user-defined calloc function or a NULL pointer. (input)
  • usrrealloc (MSKreallocfunc) – A user-defined realloc function or a NULL pointer. (input)
  • usrfree (MSKfreefunc) – A user-defined free function which is used to deallocate space allocated by usrmalloc. This function must be defined if usrmalloc!=null. (input)
  • dbgfile (MSKstring_t) – A user-defined file debug file. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_maketask
MSKrescodee (MSKAPI MSK_maketask) (
  MSKenv_t env,
  MSKint32t maxnumcon,
  MSKint32t maxnumvar,
  MSKtask_t * task)

Creates a new task.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • maxnumcon (MSKint32t) – An optional estimate on the maximum number of constraints in the task. Can be \(0\) if no such estimate is known. (input)
  • maxnumvar (MSKint32t) – An optional estimate on the maximum number of variables in the task. Can be \(0\) if no such estimate is known. (input)
  • task (MSKtask_t by reference) – An optimization task. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_onesolutionsummary
MSKrescodee (MSKAPI MSK_onesolutionsummary) (
  MSKtask_t task,
  MSKstreamtypee whichstream,
  MSKsoltypee whichsol)

Prints a short summary of a specified solution.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_optimize
MSKrescodee (MSKAPI MSK_optimize) (
  MSKtask_t task)

Calls the optimizer. Depending on the problem type and the selected optimizer this will call one of the optimizers in MOSEK. By default the interior point optimizer will be selected for continuous problems. The optimizer may be selected manually by setting the parameter MSK_IPAR_OPTIMIZER.

Response codes come in three categories:

  • Errors: Indicate that an error has occurred during the optimization, e.g the optimizer has run out of memory (MSK_RES_ERR_SPACE).
  • Warnings: Less fatal than errors. E.g MSK_RES_WRN_LARGE_CJ indicating possibly problematic problem data.
  • Termination codes: Relaying information about the conditions under which the optimizer terminated. E.g MSK_RES_TRM_MAX_ITERATIONS indicates that the optimizer finished because it reached the maximum number of iterations specified by the user.
Parameters:
 task (MSKtask_t) – An optimization task. (input)
Return:
  (MSKrescodee) – The function response code.
Groups:
 Optimization
MSK_optimizermt
MSKrescodee (MSKAPI MSK_optimizermt) (
  MSKtask_t task,
  const char * server,
  const char * port,
  MSKrescodee * trmcode)

Offload the optimization task to a solver server defined by server:port. The call will block until a result is available or the connection closes.

If the string parameter MSK_SPAR_REMOTE_ACCESS_TOKEN is not blank, it will be passed to the server as authentication.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

MSK_optimizersummary
MSKrescodee (MSKAPI MSK_optimizersummary) (
  MSKtask_t task,
  MSKstreamtypee whichstream)

Prints a short summary with optimizer statistics from last optimization.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_optimizetrm
MSKrescodee (MSKAPI MSK_optimizetrm) (
  MSKtask_t task,
  MSKrescodee * trmcode)

Calls the optimizer. Depending on the problem type and the selected optimizer this will call one of the optimizers in MOSEK. By default the interior point optimizer will be selected for continuous problems. The optimizer may be selected manually by setting the parameter MSK_IPAR_OPTIMIZER.

This function is equivalent to MSK_optimize except for the handling of return values. This function returns errors on the left hand side. Warnings are not returned and termination codes are returned through the separate argument trmcode.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Optimization

MSK_potrf
MSKrescodee (MSKAPI MSK_potrf) (
  MSKenv_t env,
  MSKuploe uplo,
  MSKint32t n,
  MSKrealt * a)

Computes a Cholesky factorization of a real symmetric positive definite dense matrix.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • uplo (MSKuploe) – Indicates whether the upper or lower triangular part of the matrix is stored. (input)
  • n (MSKint32t) – Dimension of the symmetric matrix. (input)
  • a (MSKrealt*) – A symmetric matrix stored in column-major order. Only the lower or the upper triangular part is used, accordingly with the uplo parameter. It will contain the result on exit. (input/output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear algebra

MSK_primalrepair
MSKrescodee (MSKAPI MSK_primalrepair) (
  MSKtask_t task,
  const MSKrealt * wlc,
  const MSKrealt * wuc,
  const MSKrealt * wlx,
  const MSKrealt * wux)

The function repairs a primal infeasible optimization problem by adjusting the bounds on the constraints and variables where the adjustment is computed as the minimal weighted sum of relaxations to the bounds on the constraints and variables. Observe the function only repairs the problem but does not solve it. If an optimal solution is required the problem should be optimized after the repair.

The function is applicable to linear and conic problems possibly with integer variables.

Observe that when computing the minimal weighted relaxation the termination tolerance specified by the parameters of the task is employed. For instance the parameter MSK_IPAR_MIO_MODE can be used to make MOSEK ignore the integer constraints during the repair which usually leads to a much faster repair. However, the drawback is of course that the repaired problem may not have an integer feasible solution.

Note the function modifies the task in place. If this is not desired, then apply the function to a cloned task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • wlc (MSKrealt*) – \((w_l^c)_i\) is the weight associated with relaxing the lower bound on constraint \(i\). If the weight is negative, then the lower bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)
  • wuc (MSKrealt*) – \((w_u^c)_i\) is the weight associated with relaxing the upper bound on constraint \(i\). If the weight is negative, then the upper bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)
  • wlx (MSKrealt*) – \((w_l^x)_j\) is the weight associated with relaxing the lower bound on variable \(j\). If the weight is negative, then the lower bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)
  • wux (MSKrealt*) – \((w_l^x)_i\) is the weight associated with relaxing the upper bound on variable \(j\). If the weight is negative, then the upper bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Infeasibility diagnostics

MSK_primalsensitivity
MSKrescodee (MSKAPI MSK_primalsensitivity) (
  MSKtask_t task,
  MSKint32t numi,
  const MSKint32t * subi,
  const MSKmarke * marki,
  MSKint32t numj,
  const MSKint32t * subj,
  const MSKmarke * markj,
  MSKrealt * leftpricei,
  MSKrealt * rightpricei,
  MSKrealt * leftrangei,
  MSKrealt * rightrangei,
  MSKrealt * leftpricej,
  MSKrealt * rightpricej,
  MSKrealt * leftrangej,
  MSKrealt * rightrangej)

Calculates sensitivity information for bounds on variables and constraints. For details on sensitivity analysis, the definitions of shadow price and linearity interval and an example see Section 15.3.

The type of sensitivity analysis to be performed (basis or optimal partition) is controlled by the parameter MSK_IPAR_SENSITIVITY_TYPE.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numi (MSKint32t) – Number of bounds on constraints to be analyzed. Length of subi and marki. (input)
  • subi (MSKint32t*) – Indexes of constraints to analyze. (input)
  • marki (MSKmarke*) – The value of marki[i] indicates for which bound of constraint subi[i] sensitivity analysis is performed. If marki[i] = MSK_MARK_UP the upper bound of constraint subi[i] is analyzed, and if marki[i] = MSK_MARK_LO the lower bound is analyzed. If subi[i] is an equality constraint, either MSK_MARK_LO or MSK_MARK_UP can be used to select the constraint for sensitivity analysis. (input)
  • numj (MSKint32t) – Number of bounds on variables to be analyzed. Length of subj and markj. (input)
  • subj (MSKint32t*) – Indexes of variables to analyze. (input)
  • markj (MSKmarke*) – The value of markj[j] indicates for which bound of variable subj[j] sensitivity analysis is performed. If markj[j] = MSK_MARK_UP the upper bound of variable subj[j] is analyzed, and if markj[j] = MSK_MARK_LO the lower bound is analyzed. If subj[j] is a fixed variable, either MSK_MARK_LO or MSK_MARK_UP can be used to select the bound for sensitivity analysis. (input)
  • leftpricei (MSKrealt*) – leftpricei[i] is the left shadow price for the bound marki[i] of constraint subi[i]. (output)
  • rightpricei (MSKrealt*) – rightpricei[i] is the right shadow price for the bound marki[i] of constraint subi[i]. (output)
  • leftrangei (MSKrealt*) – leftrangei[i] is the left range \(\beta_1\) for the bound marki[i] of constraint subi[i]. (output)
  • rightrangei (MSKrealt*) – rightrangei[i] is the right range \(\beta_2\) for the bound marki[i] of constraint subi[i]. (output)
  • leftpricej (MSKrealt*) – leftpricej[j] is the left shadow price for the bound markj[j] of variable subj[j]. (output)
  • rightpricej (MSKrealt*) – rightpricej[j] is the right shadow price for the bound markj[j] of variable subj[j]. (output)
  • leftrangej (MSKrealt*) – leftrangej[j] is the left range \(\beta_1\) for the bound markj[j] of variable subj[j]. (output)
  • rightrangej (MSKrealt*) – rightrangej[j] is the right range \(\beta_2\) for the bound markj[j] of variable subj[j]. (output)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Sensitivity analysis

MSK_printdata
MSKrescodee (MSKAPI MSK_printdata) (
  MSKtask_t task,
  MSKstreamtypee whichstream,
  MSKint32t firsti,
  MSKint32t lasti,
  MSKint32t firstj,
  MSKint32t lastj,
  MSKint32t firstk,
  MSKint32t lastk,
  MSKint32t c,
  MSKint32t qo,
  MSKint32t a,
  MSKint32t qc,
  MSKint32t bc,
  MSKint32t bx,
  MSKint32t vartype,
  MSKint32t cones)

Prints a part of the problem data to a stream. This function is normally used for debugging purposes only, e.g. to verify that the correct data has been inputted.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichstream (MSKstreamtypee) – Index of the stream. (input)
  • firsti (MSKint32t) – Index of first constraint for which data should be printed. (input)
  • lasti (MSKint32t) – Index of last constraint plus 1 for which data should be printed. (input)
  • firstj (MSKint32t) – Index of first variable for which data should be printed. (input)
  • lastj (MSKint32t) – Index of last variable plus 1 for which data should be printed. (input)
  • firstk (MSKint32t) – Index of first cone for which data should be printed. (input)
  • lastk (MSKint32t) – Index of last cone plus 1 for which data should be printed. (input)
  • c (MSKint32t) – If non-zero \(c\) is printed. (input)
  • qo (MSKint32t) – If non-zero \(Q^o\) is printed. (input)
  • a (MSKint32t) – If non-zero \(A\) is printed. (input)
  • qc (MSKint32t) – If non-zero \(Q^k\) is printed for the relevant constraints. (input)
  • bc (MSKint32t) – If non-zero the constraint bounds are printed. (input)
  • bx (MSKint32t) – If non-zero the variable bounds are printed. (input)
  • vartype (MSKint32t) – If non-zero the variable types are printed. (input)
  • cones (MSKint32t) – If non-zero the conic data is printed. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task diagnostics

MSK_printparam
MSKrescodee (MSKAPI MSK_printparam) (
  MSKtask_t task)

Prints the current parameter settings to the message stream.

Parameters:
 task (MSKtask_t) – An optimization task. (input)
Return:
  (MSKrescodee) – The function response code.
Groups:
 Task diagnostics
MSK_probtypetostr
MSKrescodee (MSKAPI MSK_probtypetostr) (
  MSKtask_t task,
  MSKproblemtypee probtype,
  char * str)

Obtains a string containing the name of a given problem type.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • probtype (MSKproblemtypee) – Problem type. (input)
  • str (MSKstring_t) – String corresponding to the problem type key probtype. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_prostatostr
MSKrescodee (MSKAPI MSK_prostatostr) (
  MSKtask_t task,
  MSKprostae prosta,
  char * str)

Obtains a string containing the name of a given problem status.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • prosta (MSKprostae) – Problem status. (input)
  • str (MSKstring_t) – String corresponding to the status key prosta. (output)
Return:
 

(MSKrescodee) – The function response code.

MSK_putacol
MSKrescodee (MSKAPI MSK_putacol) (
  MSKtask_t task,
  MSKint32t j,
  MSKint32t nzj,
  const MSKint32t * subj,
  const MSKrealt * valj)

Change one column of the linear constraint matrix \(A\). Resets all the elements in column \(j\) to zero and then sets

\[a_{\mathtt{subj}[k],\mathtt{j}} = \mathtt{valj}[k], \quad k=0,\ldots,\mathtt{nzj}-1.\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of a column in \(A\). (input)
  • nzj (MSKint32t) – Number of non-zeros in column \(j\) of \(A\). (input)
  • subj (MSKint32t*) – Row indexes of non-zero values in column \(j\) of \(A\). (input)
  • valj (MSKrealt*) – New non-zero values of column \(j\) in \(A\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putacollist
MSKrescodee (MSKAPI MSK_putacollist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKint32t * ptrb,
  const MSKint32t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a set of columns in the linear constraint matrix \(A\) with data in sparse triplet format. The requested columns are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{num}\\ & a_{\mathtt{asub}[k],\mathtt{sub}[i]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of columns of \(A\) to replace. (input)
  • sub (MSKint32t*) – Indexes of columns that should be replaced, no duplicates. (input)
  • ptrb (MSKint32t*) – Array of pointers to the first element in each column. (input)
  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each column. (input)
  • asub (MSKint32t*) – Row indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putacollist64
MSKrescodee (MSKAPI MSK_putacollist64) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKint64t * ptrb,
  const MSKint64t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a set of columns in the linear constraint matrix \(A\) with data in sparse triplet format. The requested columns are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{num}\\ & a_{\mathtt{asub}[k],\mathtt{sub}[i]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of columns of \(A\) to replace. (input)
  • sub (MSKint32t*) – Indexes of columns that should be replaced, no duplicates. (input)
  • ptrb (MSKint64t*) – Array of pointers to the first element in each column. (input)
  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each column. (input)
  • asub (MSKint32t*) – Row indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putacolslice
MSKrescodee (MSKAPI MSK_putacolslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKint32t * ptrb,
  const MSKint32t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a slice of columns in the linear constraint matrix \(A\) with data in sparse triplet format. The requested columns are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1\\ & a_{\mathtt{asub}[k],i} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First column in the slice. (input)
  • last (MSKint32t) – Last column plus one in the slice. (input)
  • ptrb (MSKint32t*) – Array of pointers to the first element in each column. (input)
  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each column. (input)
  • asub (MSKint32t*) – Row indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putacolslice64
MSKrescodee (MSKAPI MSK_putacolslice64) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKint64t * ptrb,
  const MSKint64t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a slice of columns in the linear constraint matrix \(A\) with data in sparse triplet format. The requested columns are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1\\ & a_{\mathtt{asub}[k],i} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First column in the slice. (input)
  • last (MSKint32t) – Last column plus one in the slice. (input)
  • ptrb (MSKint64t*) – Array of pointers to the first element in each column. (input)
  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each column. (input)
  • asub (MSKint32t*) – Row indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putaij
MSKrescodee (MSKAPI MSK_putaij) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t j,
  MSKrealt aij)

Changes a coefficient in the linear coefficient matrix \(A\) using the method

\[a_{i,j} = \mathtt{aij}.\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Constraint (row) index. (input)
  • j (MSKint32t) – Variable (column) index. (input)
  • aij (MSKrealt) – New coefficient for \(a_{i,j}\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putaijlist
MSKrescodee (MSKAPI MSK_putaijlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subi,
  const MSKint32t * subj,
  const MSKrealt * valij)

Changes one or more coefficients in \(A\) using the method

\[a_{\mathtt{subi[k]},\mathtt{subj[k]}} = \mathtt{valij[k]}, \quad k=\idxbeg,\ldots,\idxend{num}.\]

Duplicates are not allowed.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of coefficients that should be changed. (input)
  • subi (MSKint32t*) – Constraint (row) indices. (input)
  • subj (MSKint32t*) – Variable (column) indices. (input)
  • valij (MSKrealt*) – New coefficient values for \(a_{i,j}\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putaijlist64
MSKrescodee (MSKAPI MSK_putaijlist64) (
  MSKtask_t task,
  MSKint64t num,
  const MSKint32t * subi,
  const MSKint32t * subj,
  const MSKrealt * valij)

Changes one or more coefficients in \(A\) using the method

\[a_{\mathtt{subi[k]},\mathtt{subj[k]}} = \mathtt{valij[k]}, \quad k=\idxbeg,\ldots,\idxend{num}.\]

Duplicates are not allowed.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint64t) – Number of coefficients that should be changed. (input)
  • subi (MSKint32t*) – Constraint (row) indices. (input)
  • subj (MSKint32t*) – Variable (column) indices. (input)
  • valij (MSKrealt*) – New coefficient values for \(a_{i,j}\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putarow
MSKrescodee (MSKAPI MSK_putarow) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t nzi,
  const MSKint32t * subi,
  const MSKrealt * vali)

Change one row of the linear constraint matrix \(A\). Resets all the elements in row \(i\) to zero and then sets

\[a_{\mathtt{i},\mathtt{subi}[k]} = \mathtt{vali}[k], \quad k=0,\ldots,\mathtt{nzi}-1.\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of a row in \(A\). (input)
  • nzi (MSKint32t) – Number of non-zeros in row \(i\) of \(A\). (input)
  • subi (MSKint32t*) – Column indexes of non-zero values in row \(i\) of \(A\). (input)
  • vali (MSKrealt*) – New non-zero values of row \(i\) in \(A\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putarowlist
MSKrescodee (MSKAPI MSK_putarowlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKint32t * ptrb,
  const MSKint32t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a set of rows in the linear constraint matrix \(A\) with data in sparse triplet format. The requested rows are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{num} \\ & a_{\mathtt{sub}[i],\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of rows of \(A\) to replace. (input)
  • sub (MSKint32t*) – Indexes of rows that should be replaced, no duplicates. (input)
  • ptrb (MSKint32t*) – Array of pointers to the first element in each row. (input)
  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each row. (input)
  • asub (MSKint32t*) – Column indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putarowlist64
MSKrescodee (MSKAPI MSK_putarowlist64) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKint64t * ptrb,
  const MSKint64t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a set of rows in the linear constraint matrix \(A\) with data in sparse triplet format. The requested rows are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{num} \\ & a_{\mathtt{sub}[i],\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of rows of \(A\) to replace. (input)
  • sub (MSKint32t*) – Indexes of rows that should be replaced, no duplicates. (input)
  • ptrb (MSKint64t*) – Array of pointers to the first element in each row. (input)
  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each row. (input)
  • asub (MSKint32t*) – Column indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putarowslice
MSKrescodee (MSKAPI MSK_putarowslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKint32t * ptrb,
  const MSKint32t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a slice of rows in the linear constraint matrix \(A\) with data in sparse triplet format. The requested columns are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1 \\ & a_{\mathtt{sub}[i],\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First row in the slice. (input)
  • last (MSKint32t) – Last row plus one in the slice. (input)
  • ptrb (MSKint32t*) – Array of pointers to the first element in each row. (input)
  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each row. (input)
  • asub (MSKint32t*) – Column indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putarowslice64
MSKrescodee (MSKAPI MSK_putarowslice64) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKint64t * ptrb,
  const MSKint64t * ptre,
  const MSKint32t * asub,
  const MSKrealt * aval)

Change a slice of rows in the linear constraint matrix \(A\) with data in sparse triplet format. The requested columns are set to zero and then updated with:

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1 \\ & a_{\mathtt{sub}[i],\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First row in the slice. (input)
  • last (MSKint32t) – Last row plus one in the slice. (input)
  • ptrb (MSKint64t*) – Array of pointers to the first element in each row. (input)
  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each row. (input)
  • asub (MSKint32t*) – Column indexes of new elements. (input)
  • aval (MSKrealt*) – Coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putbarablocktriplet
MSKrescodee (MSKAPI MSK_putbarablocktriplet) (
  MSKtask_t task,
  MSKint64t num,
  const MSKint32t * subi,
  const MSKint32t * subj,
  const MSKint32t * subk,
  const MSKint32t * subl,
  const MSKrealt * valijkl)

Inputs the \(\barA\) matrix in block triplet form.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint64t) – Number of elements in the block triplet form. (input)
  • subi (MSKint32t*) – Constraint index. (input)
  • subj (MSKint32t*) – Symmetric matrix variable index. (input)
  • subk (MSKint32t*) – Block row index. (input)
  • subl (MSKint32t*) – Block column index. (input)
  • valijkl (MSKrealt*) – The numerical value associated with each block triplet. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_putbaraij
MSKrescodee (MSKAPI MSK_putbaraij) (
  MSKtask_t task,
  MSKint32t i,
  MSKint32t j,
  MSKint64t num,
  const MSKint64t * sub,
  const MSKrealt * weights)

This function sets one element in the \(\barA\) matrix.

Each element in the \(\barA\) matrix is a weighted sum of symmetric matrices from the symmetric matrix storage \(E\), so \(\barA_{ij}\) is a symmetric matrix. By default all elements in \(\barA\) are 0, so only non-zero elements need be added. Setting the same element again will overwrite the earlier entry.

The symmetric matrices from \(E\) are defined separately using the function MSK_appendsparsesymmat.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Row index of \(\barA\). (input)
  • j (MSKint32t) – Column index of \(\barA\). (input)
  • num (MSKint64t) – The number of terms in the weighted sum that forms \(\barA_{ij}\). (input)
  • sub (MSKint64t*) – Indices in \(E\) of the matrices appearing in the weighted sum for \(\barA_{ij}\). (input)
  • weights (MSKrealt*) – weights[k] is the coefficient of the sub[k]-th element of \(E\) in the weighted sum forming \(\barA_{ij}\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_putbarcblocktriplet
MSKrescodee (MSKAPI MSK_putbarcblocktriplet) (
  MSKtask_t task,
  MSKint64t num,
  const MSKint32t * subj,
  const MSKint32t * subk,
  const MSKint32t * subl,
  const MSKrealt * valjkl)

Inputs the \(\barC\) matrix in block triplet form.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint64t) – Number of elements in the block triplet form. (input)
  • subj (MSKint32t*) – Symmetric matrix variable index. (input)
  • subk (MSKint32t*) – Block row index. (input)
  • subl (MSKint32t*) – Block column index. (input)
  • valjkl (MSKrealt*) – The numerical value associated with each block triplet. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_putbarcj
MSKrescodee (MSKAPI MSK_putbarcj) (
  MSKtask_t task,
  MSKint32t j,
  MSKint64t num,
  const MSKint64t * sub,
  const MSKrealt * weights)

This function sets one entry in the \(\barC\) vector.

Each element in the \(\barC\) vector is a weighted sum of symmetric matrices from the symmetric matrix storage \(E\), so \(\barC_{j}\) is a symmetric matrix. By default all elements in \(\barC\) are 0, so only non-zero elements need be added. Setting the same element again will overwrite the earlier entry.

The symmetric matrices from \(E\) are defined separately using the function MSK_appendsparsesymmat.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the element in \(\barC\) that should be changed. (input)
  • num (MSKint64t) – The number of elements in the weighted sum that forms \(\barC_j\). (input)
  • sub (MSKint64t*) – Indices in \(E\) of matrices appearing in the weighted sum for \(\barC_j\) (input)
  • weights (MSKrealt*) – weights[k] is the coefficient of the sub[k]-th element of \(E\) in the weighted sum forming \(\barC_j\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_putbarsj
MSKrescodee (MSKAPI MSK_putbarsj) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t j,
  const MSKrealt * barsj)

Sets the dual solution for a semidefinite variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • j (MSKint32t) – Index of the semidefinite variable. (input)
  • barsj (MSKrealt*) – Value of \(\barS_j\). Format as in MSK_getbarsj. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (put)

MSK_putbarvarname
MSKrescodee (MSKAPI MSK_putbarvarname) (
  MSKtask_t task,
  MSKint32t j,
  const char * name)

Sets the name of a semidefinite variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the variable. (input)
  • name (MSKstring_t) – The variable name. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_putbarxj
MSKrescodee (MSKAPI MSK_putbarxj) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t j,
  const MSKrealt * barxj)

Sets the primal solution for a semidefinite variable.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • whichsol (MSKsoltypee) – Selects a solution. (input)
  • j (MSKint32t) – Index of the semidefinite variable. (input)
  • barxj (MSKrealt*) – Value of \(\barX_j\). Format as in MSK_getbarxj. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Solution (put)

MSK_putbound Deprecated
MSKrescodee (MSKAPI MSK_putbound) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t i,
  MSKboundkeye bk,
  MSKrealt bl,
  MSKrealt bu)

Changes the bound for either one constraint or one variable.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_putboundlist Deprecated
MSKrescodee (MSKAPI MSK_putboundlist) (
  MSKtask_t task,
  MSKaccmodee accmode,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKboundkeye * bk,
  const MSKrealt * bl,
  const MSKrealt * bu)

Changes the bounds of constraints or variables.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • accmode (MSKaccmodee) – Defines whether bounds for constraints (MSK_ACC_CON) or variables (MSK_ACC_VAR) are changed. (input)
  • num (MSKint32t) – Number of bounds that should be changed. (input)
  • sub (MSKint32t*) – Subscripts of the constraints or variables that should be changed. (input)
  • bk (MSKboundkeye*) – Bound keys. (input)
  • bl (MSKrealt*) – Values for lower bounds. (input)
  • bu (MSKrealt*) – Values for upper bounds. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_putboundslice Deprecated
MSKrescodee (MSKAPI MSK_putboundslice) (
  MSKtask_t task,
  MSKaccmodee con,
  MSKint32t first,
  MSKint32t last,
  const MSKboundkeye * bk,
  const MSKrealt * bl,
  const MSKrealt * bu)

Changes the bounds for a slice of constraints or variables.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • con (MSKaccmodee) – Defines whether bounds for constraints (MSK_ACC_CON) or variables (MSK_ACC_VAR) are changed. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • bk (MSKboundkeye*) – Bound keys. (input)
  • bl (MSKrealt*) – Values for lower bounds. (input)
  • bu (MSKrealt*) – Values for upper bounds. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_putcallbackfunc
MSKrescodee (MSKAPI MSK_putcallbackfunc) (
  MSKtask_t task,
  MSKcallbackfunc func,
  MSKuserhandle_t handle)

Sets a user-defined progress callback function of type MSKcallbackfunc. The callback function is called frequently during the optimization process. See Section 7.6 for an example.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • func (MSKcallbackfunc) – A user-defined function which will be called occasionally from within the MOSEK optimizers. If the argument is a NULL pointer, then a previously defined callback function is removed. The progress function has the type MSKcallbackfunc. (input)
  • handle (MSKuserhandle_t) – A pointer to a user-defined data structure. Whenever the function func is called, then handle is passed to the function. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Callback

MSK_putcfix
MSKrescodee (MSKAPI MSK_putcfix) (
  MSKtask_t task,
  MSKrealt cfix)

Replaces the fixed term in the objective by a new one.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • cfix (MSKrealt) – Fixed term in the objective. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Objective data

MSK_putcj
MSKrescodee (MSKAPI MSK_putcj) (
  MSKtask_t task,
  MSKint32t j,
  MSKrealt cj)

Modifies one coefficient in the linear objective vector \(c\), i.e.

\[c_{\mathtt{j}} = \mathtt{cj}.\]

If the absolute value exceeds MSK_DPAR_DATA_TOL_C_HUGE an error is generated. If the absolute value exceeds MSK_DPAR_DATA_TOL_CJ_LARGE, a warning is generated, but the coefficient is inputted as specified.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the variable for which \(c\) should be changed. (input)
  • cj (MSKrealt) – New value of \(c_j\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putclist
MSKrescodee (MSKAPI MSK_putclist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subj,
  const MSKrealt * val)

Modifies the coefficients in the linear term \(c\) in the objective using the principle

\[c_{\mathtt{subj[t]}} = \mathtt{val[t]}, \quad t=\idxbeg,\ldots,\idxend{num}.\]

If a variable index is specified multiple times in subj only the last entry is used. Data checks are performed as in MSK_putcj.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of coefficients that should be changed. (input)
  • subj (MSKint32t*) – Indices of variables for which the coefficient in \(c\) should be changed. (input)
  • val (MSKrealt*) – New numerical values for coefficients in \(c\) that should be modified. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putconbound
MSKrescodee (MSKAPI MSK_putconbound) (
  MSKtask_t task,
  MSKint32t i,
  MSKboundkeye bk,
  MSKrealt bl,
  MSKrealt bu)

Changes the bounds for one constraint.

If the bound value specified is numerically larger than MSK_DPAR_DATA_TOL_BOUND_INF it is considered infinite and the bound key is changed accordingly. If a bound value is numerically larger than MSK_DPAR_DATA_TOL_BOUND_WRN, a warning will be displayed, but the bound is inputted as specified.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of the constraint. (input)
  • bk (MSKboundkeye) – New bound key. (input)
  • bl (MSKrealt) – New lower bound. (input)
  • bu (MSKrealt) – New upper bound. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_putconboundlist
MSKrescodee (MSKAPI MSK_putconboundlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKboundkeye * bk,
  const MSKrealt * bl,
  const MSKrealt * bu)

Changes the bounds for a list of constraints. If multiple bound changes are specified for a constraint, then only the last change takes effect. Data checks are performed as in MSK_putconbound.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • num (MSKint32t) – Number of bounds that should be changed. (input)
  • sub (MSKint32t*) – List of constraint indexes. (input)
  • bk (MSKboundkeye*) – Bound keys. (input)
  • bl (MSKrealt*) – Values for lower bounds. (input)
  • bu (MSKrealt*) – Values for upper bounds. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Bound data

MSK_putconboundslice
MSKrescodee (MSKAPI MSK_putconboundslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKboundkeye * bk,
  const MSKrealt * bl,
  const MSKrealt * bu)

Changes the bounds for a slice of the constraints. Data checks are performed as in MSK_putconbound.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First index in the sequence. (input)
  • last (MSKint32t) – Last index plus 1 in the sequence. (input)
  • bk (MSKboundkeye*) – Bound keys. (input)
  • bl (MSKrealt*) – Values for lower bounds. (input)
  • bu (MSKrealt*) – Values for upper bounds. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Linear constraint data, Bound data

MSK_putcone
MSKrescodee (MSKAPI MSK_putcone) (
  MSKtask_t task,
  MSKint32t k,
  MSKconetypee ct,
  MSKrealt conepar,
  MSKint32t nummem,
  const MSKint32t * submem)

Replaces a conic constraint.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • k (MSKint32t) – Index of the cone. (input)
  • ct (MSKconetypee) – Specifies the type of the cone. (input)
  • conepar (MSKrealt) – This argument is currently not used. It can be set to 0 (input)
  • nummem (MSKint32t) – Number of member variables in the cone. (input)
  • submem (MSKint32t*) – Variable subscripts of the members in the cone. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Conic constraint data

MSK_putconename
MSKrescodee (MSKAPI MSK_putconename) (
  MSKtask_t task,
  MSKint32t j,
  const char * name)

Sets the name of a cone.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • j (MSKint32t) – Index of the cone. (input)
  • name (MSKstring_t) – The name of the cone. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_putconname
MSKrescodee (MSKAPI MSK_putconname) (
  MSKtask_t task,
  MSKint32t i,
  const char * name)

Sets the name of a constraint.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • i (MSKint32t) – Index of the constraint. (input)
  • name (MSKstring_t) – The name of the constraint. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_putcslice
MSKrescodee (MSKAPI MSK_putcslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKrealt * slice)

Modifies a slice in the linear term \(c\) in the objective using the principle

\[c_{\mathtt{j}} = \mathtt{slice[j-first]}, \quad j=first,..,\idxend{last}\]

Data checks are performed as in MSK_putcj.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • first (MSKint32t) – First element in the slice of \(c\). (input)
  • last (MSKint32t) – Last element plus 1 of the slice in \(c\) to be changed. (input)
  • slice (MSKrealt*) – New numerical values for coefficients in \(c\) that should be modified. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putdouparam
MSKrescodee (MSKAPI MSK_putdouparam) (
  MSKtask_t task,
  MSKdparame param,
  MSKrealt parvalue)

Sets the value of a double parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • param (MSKdparame) – Which parameter. (input)
  • parvalue (MSKrealt) – Parameter value. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (put)

MSK_putexitfunc
MSKrescodee (MSKAPI MSK_putexitfunc) (
  MSKenv_t env,
  MSKexitfunc exitfunc,
  MSKuserhandle_t handle)

In case MOSEK experiences a fatal error, then a user-defined exit function can be called. The exit function should terminate MOSEK. In general it is not necessary to define an exit function.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • exitfunc (MSKexitfunc) – A user-defined exit function. (input)
  • handle (MSKuserhandle_t) – A pointer to a user-defined data structure which is passed to exitfunc when called. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Callback

MSK_putintparam
MSKrescodee (MSKAPI MSK_putintparam) (
  MSKtask_t task,
  MSKiparame param,
  MSKint32t parvalue)

Sets the value of an integer parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • param (MSKiparame) – Which parameter. (input)
  • parvalue (MSKint32t) – Parameter value. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (put)

MSK_putlicensecode
MSKrescodee (MSKAPI MSK_putlicensecode) (
  MSKenv_t env,
  const MSKint32t * code)

Input a runtime license code.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • code (MSKint32t*) – A runtime license code. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_putlicensedebug
MSKrescodee (MSKAPI MSK_putlicensedebug) (
  MSKenv_t env,
  MSKint32t licdebug)

Enables debug information for the license system. If licdebug is non-zero, then MOSEK will print debug info regarding the license checkout.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • licdebug (MSKint32t) – Whether license checkout debug info should be printed. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_putlicensepath
MSKrescodee (MSKAPI MSK_putlicensepath) (
  MSKenv_t env,
  const char * licensepath)

Set the path to the license file.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • licensepath (MSKstring_t) – A path specifying where to search for the license. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_putlicensewait
MSKrescodee (MSKAPI MSK_putlicensewait) (
  MSKenv_t env,
  MSKint32t licwait)

Control whether MOSEK should wait for an available license if no license is available. If licwait is non-zero, then MOSEK will wait for licwait-1 milliseconds between each check for an available license.

Parameters:
 
  • env (MSKenv_t) – The MOSEK environment. (input)
  • licwait (MSKint32t) – Whether MOSEK should wait for a license if no license is available. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Environment management

MSK_putmaxnumanz
MSKrescodee (MSKAPI MSK_putmaxnumanz) (
  MSKtask_t task,
  MSKint64t maxnumanz)

Sets the number of preallocated non-zero entries in \(A\).

MOSEK stores only the non-zero elements in the linear coefficient matrix \(A\) and it cannot predict how much storage is required to store \(A\). Using this function it is possible to specify the number of non-zeros to preallocate for storing \(A\).

If the number of non-zeros in the problem is known, it is a good idea to set maxnumanz slightly larger than this number, otherwise a rough estimate can be used. In general, if \(A\) is inputted in many small chunks, setting this value may speed up the data input phase.

It is not mandatory to call this function, since MOSEK will reallocate internal structures whenever it is necessary.

The function call has no effect if both maxnumcon and maxnumvar are zero.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumanz (MSKint64t) – Number of preallocated non-zeros in \(A\). (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putmaxnumbarvar
MSKrescodee (MSKAPI MSK_putmaxnumbarvar) (
  MSKtask_t task,
  MSKint32t maxnumbarvar)

Sets the number of preallocated symmetric matrix variables in the optimization task. When this number of variables is reached MOSEK will automatically allocate more space for variables.

It is not mandatory to call this function. It only gives a hint about the amount of data to preallocate for efficiency reasons.

Please note that maxnumbarvar must be larger than the current number of symmetric matrix variables in the task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumbarvar (MSKint32t) – Number of preallocated symmetric matrix variables. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Symmetric matrix variable data

MSK_putmaxnumcon
MSKrescodee (MSKAPI MSK_putmaxnumcon) (
  MSKtask_t task,
  MSKint32t maxnumcon)

Sets the number of preallocated constraints in the optimization task. When this number of constraints is reached MOSEK will automatically allocate more space for constraints.

It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Please note that maxnumcon must be larger than the current number of constraints in the task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumcon (MSKint32t) – Number of preallocated constraints in the optimization task. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_putmaxnumcone
MSKrescodee (MSKAPI MSK_putmaxnumcone) (
  MSKtask_t task,
  MSKint32t maxnumcone)

Sets the number of preallocated conic constraints in the optimization task. When this number of conic constraints is reached MOSEK will automatically allocate more space for conic constraints.

It is not mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Please note that maxnumcon must be larger than the current number of conic constraints in the task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumcone (MSKint32t) – Number of preallocated conic constraints in the optimization task. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Task management

MSK_putmaxnumqnz
MSKrescodee (MSKAPI MSK_putmaxnumqnz) (
  MSKtask_t task,
  MSKint64t maxnumqnz)

Sets the number of preallocated non-zero entries in quadratic terms.

MOSEK stores only the non-zero elements in \(Q\). Therefore, MOSEK cannot predict how much storage is required to store \(Q\). Using this function it is possible to specify the number non-zeros to preallocate for storing \(Q\) (both objective and constraints).

It may be advantageous to reserve more non-zeros for \(Q\) than actually needed since it may improve the internal efficiency of MOSEK, however, it is never worthwhile to specify more than the double of the anticipated number of non-zeros in \(Q\).

It is not mandatory to call this function, since MOSEK will reallocate internal structures whenever it is necessary.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumqnz (MSKint64t) – Number of non-zero elements preallocated in quadratic coefficient matrices. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putmaxnumvar
MSKrescodee (MSKAPI MSK_putmaxnumvar) (
  MSKtask_t task,
  MSKint32t maxnumvar)

Sets the number of preallocated variables in the optimization task. When this number of variables is reached MOSEK will automatically allocate more space for variables.

It is not mandatory to call this function. It only gives a hint about the amount of data to preallocate for efficiency reasons.

Please note that maxnumvar must be larger than the current number of variables in the task.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • maxnumvar (MSKint32t) – Number of preallocated variables in the optimization task. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putnadouparam
MSKrescodee (MSKAPI MSK_putnadouparam) (
  MSKtask_t task,
  const char * paramname,
  MSKrealt parvalue)

Sets the value of a named double parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • paramname (MSKstring_t) – Name of a parameter. (input)
  • parvalue (MSKrealt) – Parameter value. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (put)

MSK_putnaintparam
MSKrescodee (MSKAPI MSK_putnaintparam) (
  MSKtask_t task,
  const char * paramname,
  MSKint32t parvalue)

Sets the value of a named integer parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • paramname (MSKstring_t) – Name of a parameter. (input)
  • parvalue (MSKint32t) – Parameter value. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (put)

MSK_putnastrparam
MSKrescodee (MSKAPI MSK_putnastrparam) (
  MSKtask_t task,
  const char * paramname,
  const char * parvalue)

Sets the value of a named string parameter.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • paramname (MSKstring_t) – Name of a parameter. (input)
  • parvalue (MSKstring_t) – Parameter value. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (put)

MSK_putnlfunc
MSKrescodee (MSKAPI MSK_putnlfunc) (
  MSKtask_t task,
  MSKuserhandle_t nlhandle,
  MSKnlgetspfunc nlgetsp,
  MSKnlgetvafunc nlgetva)

This function is used to communicate the nonlinear function information in a general convex optimization problem to MOSEK.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • nlhandle (MSKuserhandle_t) – A pointer to a user-defined data structure. It is passed to the functions nlgetsp and nlgetva whenever those two functions called. (input)
  • nlgetsp (MSKnlgetspfunc) – Pointer to a user-defined function computing nonlinear structural information. (input)
  • nlgetva (MSKnlgetvafunc) – Pointer to user-defined function which evaluates the nonlinear function in the optimization problem at a given point. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Callback

MSK_putobjname
MSKrescodee (MSKAPI MSK_putobjname) (
  MSKtask_t task,
  const char * objname)

Assigns a new name to the objective.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • objname (MSKstring_t) – Name of the objective. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Naming

MSK_putobjsense
MSKrescodee (MSKAPI MSK_putobjsense) (
  MSKtask_t task,
  MSKobjsensee sense)

Sets the objective sense of the task.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Objective data

MSK_putparam
MSKrescodee (MSKAPI MSK_putparam) (
  MSKtask_t task,
  const char * parname,
  const char * parvalue)

Checks if parname is valid parameter name. If it is, the parameter is assigned the value specified by parvalue.

Parameters:
 
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Parameters (put)

MSK_putqcon
MSKrescodee (MSKAPI MSK_putqcon) (
  MSKtask_t task,
  MSKint32t numqcnz,
  const MSKint32t * qcsubk,
  const MSKint32t * qcsubi,
  const MSKint32t * qcsubj,
  const MSKrealt * qcval)

Replace all quadratic entries in the constraints. The list of constraints has the form

\[l_k^c \leq \half \sum_{i=0}^{\idxend{numvar}} \sum_{j=0}^{\idxend{numvar}} q_{ij}^k x_i x_j + \sum_{j=0}^{\idxend{numvar}} a_{kj} x_j \leq u_k^c, ~\ k=0,\ldots,m-1.\]

This function sets all the quadratic terms to zero and then performs the update:

\[q_{\mathtt{qcsubi[t]},\mathtt{qcsubj[t]}}^{\mathtt{qcsubk[t]}} = q_{\mathtt{\mathtt{qcsubj[t]},qcsubi[t]}}^{\mathtt{qcsubk[t]}} = q_{\mathtt{\mathtt{qcsubj[t]},qcsubi[t]}}^{\mathtt{qcsubk[t]}} + \mathtt{qcval[t]},\]

for \(t=\idxbeg,\ldots,\idxend{numqcnz}\).

Please note that:

  • For large problems it is essential for the efficiency that the function MSK_putmaxnumqnz is employed to pre-allocate space.
  • Only the lower triangular parts should be specified because the \(Q\) matrices are symmetric. Specifying entries where \(i < j\) will result in an error.
  • Only non-zero elements should be specified.
  • The order in which the non-zero elements are specified is insignificant.
  • Duplicate elements are added together as shown above. Hence, it is usually not recommended to specify the same entry multiple times.

For a code example see Section 6.2

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numqcnz (MSKint32t) – Number of quadratic terms. (input)
  • qcsubk (MSKint32t*) – Constraint subscripts for quadratic coefficients. (input)
  • qcsubi (MSKint32t*) – Row subscripts for quadratic constraint matrix. (input)
  • qcsubj (MSKint32t*) – Column subscripts for quadratic constraint matrix. (input)
  • qcval (MSKrealt*) – Quadratic constraint coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putqconk
MSKrescodee (MSKAPI MSK_putqconk) (
  MSKtask_t task,
  MSKint32t k,
  MSKint32t numqcnz,
  const MSKint32t * qcsubi,
  const MSKint32t * qcsubj,
  const MSKrealt * qcval)

Replaces all the quadratic entries in one constraint. This function performs the same operations as MSK_putqcon but only with respect to constraint number k and it does not modify the other constraints. See the description of MSK_putqcon for definitions and important remarks.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • k (MSKint32t) – The constraint in which the new \(Q\) elements are inserted. (input)
  • numqcnz (MSKint32t) – Number of quadratic terms. (input)
  • qcsubi (MSKint32t*) – Row subscripts for quadratic constraint matrix. (input)
  • qcsubj (MSKint32t*) – Column subscripts for quadratic constraint matrix. (input)
  • qcval (MSKrealt*) – Quadratic constraint coefficient values. (input)
Return:
 

(MSKrescodee) – The function response code.

Groups:
 

Scalar variable data

MSK_putqobj
MSKrescodee (MSKAPI MSK_putqobj) (
  MSKtask_t task,
  MSKint32t numqonz,
  const MSKint32t * qosubi,
  const MSKint32t * qosubj,
  const MSKrealt * qoval)

Replace all quadratic terms in the objective. If the objective has the form

\[\half \sum_{i=0}^{\idxend{numvar}} \sum_{j=0}^{\idxend{numvar}} q_{ij}^o x_i x_j + \sum_{j=0}^{\idxend{numvar}} c_{j} x_j + c^f\]

then this function sets all the quadratic terms to zero and then performs the update:

\[q_{\mathtt{qosubi[t]},\mathtt{qosubj[t]}}^{o} = q_{\mathtt{\mathtt{qosubj[t]},qosubi[t]}}^{o} = q_{\mathtt{\mathtt{qosubj[t]},qosubi[t]}}^{o} + \mathtt{qoval[t]},\]

for \(t=\idxbeg,\ldots,\idxend{numqonz}\).

See the description of MSK_putqcon for important remarks and example.

Parameters:
 
  • task (MSKtask_t) – An optimization task. (input)
  • numqonz (