# 16.3 Functions in alphabetical order¶

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


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_analyzeproblem
MSKrescodee (MSKAPI MSK_analyzeproblem) (
MSKstreamtypee whichstream)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_analyzesolution
MSKrescodee (MSKAPI MSK_analyzesolution) (
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:

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

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


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_appendcone
MSKrescodee (MSKAPI MSK_appendcone) (
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 Conic Quadratic Optimization.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Conic constraint data

MSK_appendconeseq
MSKrescodee (MSKAPI MSK_appendconeseq) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Conic constraint data

MSK_appendconesseq
MSKrescodee (MSKAPI MSK_appendconesseq) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Conic constraint data

MSK_appendcons
MSKrescodee (MSKAPI MSK_appendcons) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Linear constraint data

MSK_appendsparsesymmat
MSKrescodee (MSKAPI MSK_appendsparsesymmat) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_appendvars
MSKrescodee (MSKAPI MSK_appendvars) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_asyncgetresult
MSKrescodee (MSKAPI MSK_asyncgetresult) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

MSK_asyncpoll
MSKrescodee (MSKAPI MSK_asyncpoll) (
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) (
const char * server,
const char * port,
const char * token)


Request that the job identified by the token is terminated.

Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Linear algebra

MSK_basiscond
MSKrescodee (MSKAPI MSK_basiscond) (
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) (
MSKboundkeye bk,
char * str)


Obtains an identifier string corresponding to a bound key.

Parameters:

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:

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


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:
MSK_checkinall
MSKrescodee (MSKAPI MSK_checkinall) (
MSKenv_t env)


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:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Memory

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


Checks the memory allocated by the task.

Parameters:

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:

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:

Return:

(MSKrescodee) – The function response code.

MSK_chgbound Deprecated
MSKrescodee (MSKAPI MSK_chgbound) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

MSK_chgvarbound
MSKrescodee (MSKAPI MSK_chgvarbound) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

MSK_clonetask
MSKrescodee (MSKAPI MSK_clonetask) (


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:

MSK_commitchanges
MSKrescodee (MSKAPI MSK_commitchanges) (


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 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:

Return:

(MSKrescodee) – The function response code.

Groups:

Linear algebra

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


Obtains the cone string identifier corresponding to a cone type.

Parameters:

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) (
MSKsoltypee whichsol)


Undefine a solution and free the memory it uses.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_deletetask
MSKrescodee (MSKAPI MSK_deletetask) (


Parameters:
task (MSKtask_t by reference) – An optimization task. (input/output)
Return:
(MSKrescodee) – The function response code.
Groups:
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Linear algebra

MSK_dualsensitivity
MSKrescodee (MSKAPI MSK_dualsensitivity) (
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 Example: Sensitivity Analysis.

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:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_echotask
MSKrescodee (MSKAPIVA MSK_echotask) (
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) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Linear algebra

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


Obtains one column of $$A$$ in a sparse format.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getacolnumnz
MSKrescodee (MSKAPI MSK_getacolnumnz) (
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) (
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) (
MSKint32t i,
MSKint32t j,
MSKrealt * aij)


Obtains a single coefficient in $$A$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getapiecenumnz
MSKrescodee (MSKAPI MSK_getapiecenumnz) (
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:

Return:

(MSKrescodee) – The function response code.

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


Obtains one row of $$A$$ in a sparse format.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getarownumnz
MSKrescodee (MSKAPI MSK_getarownumnz) (
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) (
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) (
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) (
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) (
MSKaccmodee accmode,
MSKint32t first,
MSKint32t last,
MSKint32t * numnz)


Obtains the number of non-zeros in a row or column slice of $$A$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

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


Obtains the number of non-zeros in a slice of rows or columns of $$A$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

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


Obtains $$\barA$$ in block triplet form.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getbaraidx
MSKrescodee (MSKAPI MSK_getbaraidx) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getbaraidxij
MSKrescodee (MSKAPI MSK_getbaraidxij) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getbarasparsity
MSKrescodee (MSKAPI MSK_getbarasparsity) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

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


Obtains $$\barC$$ in block triplet form.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

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


Obtains information about an element in $$\barC$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getbarcidxinfo
MSKrescodee (MSKAPI MSK_getbarcidxinfo) (
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) (
MSKint64t idx,
MSKint32t * j)


Obtains the row index of an element in $$\barC$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getbarcsparsity
MSKrescodee (MSKAPI MSK_getbarcsparsity) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getbarsj
MSKrescodee (MSKAPI MSK_getbarsj) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the name of a semidefinite variable.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

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


Obtains the index of semidefinite variable from its name.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getbarvarnamelen
MSKrescodee (MSKAPI MSK_getbarvarnamelen) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains bound information for one constraint or variable.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

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


Obtains bounds information for a slice of variables or constraints.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

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


Obtains build information.

Parameters:

Return:

(MSKrescodee) – The function response code.

MSK_getc
MSKrescodee (MSKAPI MSK_getc) (
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) (
MSKcallbackfunc * func,
MSKuserhandle_t * handle)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Callback

MSK_getcfix
MSKrescodee (MSKAPI MSK_getcfix) (
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) (
MSKint32t j,
MSKrealt * cj)


Obtains one coefficient of $$c$$.

Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_getconbound
MSKrescodee (MSKAPI MSK_getconbound) (
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) (
MSKint32t first,
MSKint32t last,
MSKboundkeye * bk,
MSKrealt * bl,
MSKrealt * bu)


Obtains bounds information for a slice of the constraints.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

MSK_getcone
MSKrescodee (MSKAPI MSK_getcone) (
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) (
MSKint32t k,
MSKconetypee * ct,
MSKrealt * conepar,
MSKint32t * nummem)


Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Conic constraint data

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


Obtains the name of a cone.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getconenameindex
MSKrescodee (MSKAPI MSK_getconenameindex) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getconenamelen
MSKrescodee (MSKAPI MSK_getconenamelen) (
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) (
MSKint32t i,
MSKint32t sizename,
char * name)


Obtains the name of a constraint.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getconnameindex
MSKrescodee (MSKAPI MSK_getconnameindex) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getconnamelen
MSKrescodee (MSKAPI MSK_getconnamelen) (
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) (
MSKint32t first,
MSKint32t last,
MSKrealt * c)


Obtains a sequence of elements in $$c$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

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


Obtains the dimension of a symmetric matrix variable.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

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


Obtains a double information item from the task information database.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Optimizer statistics

MSK_getdouparam
MSKrescodee (MSKAPI MSK_getdouparam) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getdualsolutionnorms
MSKrescodee (MSKAPI MSK_getdualsolutionnorms) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getdviolcon
MSKrescodee (MSKAPI MSK_getdviolcon) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getdviolcones
MSKrescodee (MSKAPI MSK_getdviolcones) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getdviolvar
MSKrescodee (MSKAPI MSK_getdviolvar) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getenv
MSKrescodee (MSKAPI MSK_getenv) (
MSKenv_t * env)


Obtains the environment used to create the task.

Parameters:

Return:

(MSKrescodee) – The function response code.

MSK_getinfeasiblesubproblem
MSKrescodee (MSKAPI MSK_getinfeasiblesubproblem) (
MSKsoltypee whichsol,


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.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Infeasibility diagnostics

MSK_getinfindex
MSKrescodee (MSKAPI MSK_getinfindex) (
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) (
MSKinftypee inftype,
MSKint32t * infmax)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Optimizer statistics

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


Obtains the name of an information item.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Optimizer statistics

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


Obtains an integer information item from the task information database.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Optimizer statistics

MSK_getintparam
MSKrescodee (MSKAPI MSK_getintparam) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

MSK_getlasterror64
MSKrescodee (MSKAPI MSK_getlasterror64) (
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:

Return:

(MSKrescodee) – The function response code.

MSK_getlenbarvarj
MSKrescodee (MSKAPI MSK_getlenbarvarj) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

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


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Optimizer statistics

MSK_getmaxnamelen
MSKrescodee (MSKAPI MSK_getmaxnamelen) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getmaxnumanz64
MSKrescodee (MSKAPI MSK_getmaxnumanz64) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getmaxnumbarvar
MSKrescodee (MSKAPI MSK_getmaxnumbarvar) (
MSKint32t * maxnumbarvar)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getmaxnumcon
MSKrescodee (MSKAPI MSK_getmaxnumcon) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Linear constraint data

MSK_getmaxnumcone
MSKrescodee (MSKAPI MSK_getmaxnumcone) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_getmaxnumqnz
MSKrescodee (MSKAPI MSK_getmaxnumqnz) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getmaxnumqnz64
MSKrescodee (MSKAPI MSK_getmaxnumqnz64) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getmaxnumvar
MSKrescodee (MSKAPI MSK_getmaxnumvar) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

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


Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Memory

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


Obtains a named double information item from task information database.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Optimizer statistics

MSK_getnadouparam
MSKrescodee (MSKAPI MSK_getnadouparam) (
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) (
const char * infitemname,
MSKint32t * ivalue)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Optimizer statistics

MSK_getnaintparam
MSKrescodee (MSKAPI MSK_getnaintparam) (
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) (
const char * paramname,
MSKint32t sizeparamname,
MSKint32t * len,
char * parvalue)


Obtains the value of a named string parameter.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameters (get)

MSK_getnastrparamal
MSKrescodee (MSKAPI MSK_getnastrparamal) (
const char * paramname,
MSKstring_t * value)


Obtains the value of a named string parameter.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameters (get)

MSK_getnlfunc
MSKrescodee (MSKAPI MSK_getnlfunc) (
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) (
MSKint32t * numanz)


Obtains the number of non-zeros in $$A$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getnumanz64
MSKrescodee (MSKAPI MSK_getnumanz64) (
MSKint64t * numanz)


Obtains the number of non-zeros in $$A$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getnumbarablocktriplets
MSKrescodee (MSKAPI MSK_getnumbarablocktriplets) (
MSKint64t * num)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getnumbaranz
MSKrescodee (MSKAPI MSK_getnumbaranz) (
MSKint64t * nz)


Get the number of nonzero elements in $$\barA$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getnumbarcblocktriplets
MSKrescodee (MSKAPI MSK_getnumbarcblocktriplets) (
MSKint64t * num)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getnumbarcnz
MSKrescodee (MSKAPI MSK_getnumbarcnz) (
MSKint64t * nz)


Obtains the number of nonzero elements in $$\barC$$.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_getnumbarvar
MSKrescodee (MSKAPI MSK_getnumbarvar) (
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) (
MSKint32t * numcon)


Obtains the number of constraints.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Linear constraint data

MSK_getnumcone
MSKrescodee (MSKAPI MSK_getnumcone) (
MSKint32t * numcone)


Obtains the number of cones.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Conic constraint data

MSK_getnumconemem
MSKrescodee (MSKAPI MSK_getnumconemem) (
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) (
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) (
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) (
MSKint32t k,
MSKint32t * numqcnz)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

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


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getnumqobjnz
MSKrescodee (MSKAPI MSK_getnumqobjnz) (
MSKint32t * numqonz)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getnumqobjnz64
MSKrescodee (MSKAPI MSK_getnumqobjnz64) (
MSKint64t * numqonz)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getnumsymmat
MSKrescodee (MSKAPI MSK_getnumsymmat) (
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) (
MSKint32t * numvar)


Obtains the number of variables.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

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


Obtains the name assigned to the objective function.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getobjnamelen
MSKrescodee (MSKAPI MSK_getobjnamelen) (
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) (
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) (
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) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getprimalsolutionnorms
MSKrescodee (MSKAPI MSK_getprimalsolutionnorms) (
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) (
MSKproblemtypee * probtype)


Obtains the problem type.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

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


Obtains the problem status.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getpviolbarvar
MSKrescodee (MSKAPI MSK_getpviolbarvar) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getpviolcon
MSKrescodee (MSKAPI MSK_getpviolcon) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getpviolcones
MSKrescodee (MSKAPI MSK_getpviolcones) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getpviolvar
MSKrescodee (MSKAPI MSK_getpviolvar) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getqconk
MSKrescodee (MSKAPI MSK_getqconk) (
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) (
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) (
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) (
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) (
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) (
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:

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:

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


Obtains the status keys for the constraints.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the status keys for a slice of the constraints.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the status keys for the scalar variables.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the $$s_l^c$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$s_l^c$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the $$s_l^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$s_l^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the $$s_n^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$s_n^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the solution status.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getsolution
MSKrescodee (MSKAPI MSK_getsolution) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

MSK_getsolutioni Deprecated
MSKrescodee (MSKAPI MSK_getsolutioni) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution information

MSK_getsolutionslice
MSKrescodee (MSKAPI MSK_getsolutionslice) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Get a single symmetric matrix from the matrix store.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_getstrparam
MSKrescodee (MSKAPI MSK_getstrparam) (
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) (
MSKsparame param,
MSKstring_t * value)


Obtains the value of a string parameter.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameters (get)

MSK_getstrparamlen
MSKrescodee (MSKAPI MSK_getstrparamlen) (
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) (
MSKsoltypee whichsol,
MSKrealt * suc)


Obtains the $$s_u^c$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$s_u^c$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the $$s_u^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$s_u^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the name and corresponding value for the $$i$$th symbolic constant.

Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameter management

MSK_getsymmatinfo
MSKrescodee (MSKAPI MSK_getsymmatinfo) (
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) (


Obtains the name assigned to the task.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_gettasknamelen
MSKrescodee (MSKAPI MSK_gettasknamelen) (
MSKint32t * len)


Obtains the length the task name.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getvarbound
MSKrescodee (MSKAPI MSK_getvarbound) (
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) (
MSKint32t first,
MSKint32t last,
MSKboundkeye * bk,
MSKrealt * bl,
MSKrealt * bu)


Obtains bounds information for a slice of the variables.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

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


Obtains the name of a variable.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getvarnameindex
MSKrescodee (MSKAPI MSK_getvarnameindex) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_getvarnamelen
MSKrescodee (MSKAPI MSK_getvarnamelen) (
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) (
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) (
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:

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) (
MSKsoltypee whichsol,
MSKrealt * xc)


Obtains the $$x^c$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$x^c$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the $$x^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$x^x$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains the $$y$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

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


Obtains a slice of the $$y$$ vector for a solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (get)

MSK_initbasissolve
MSKrescodee (MSKAPI MSK_initbasissolve) (
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) (
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 Column or Row Ordered Sparse Matrix.

For an explained code example see Section Linear Optimization and Section Matrix Formats.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_inputdata64
MSKrescodee (MSKAPI MSK_inputdata64) (
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 Column or Row Ordered Sparse Matrix.

For an explained code example see Section Linear Optimization and Section Matrix Formats.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameter management

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


Checks whether parname is a valid double parameter name.

Parameters:

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) (
const char * parname,
MSKiparame * param)


Checks whether parname is a valid integer parameter name.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameter management

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


Checks whether parname is a valid string parameter name.

Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Logging

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


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

Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

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


Connects a user-defined function to a task stream.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_makeemptytask
MSKrescodee (MSKAPI MSK_makeemptytask) (
MSKenv_t env,


Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

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,


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:

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


Prints a short summary of a specified solution.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_optimize
MSKrescodee (MSKAPI MSK_optimize) (


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:

Parameters:
task (MSKtask_t) – An optimization task. (input)
Return:
(MSKrescodee) – The function response code.
Groups:
Optimization
MSK_optimizermt
MSKrescodee (MSKAPI MSK_optimizermt) (
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) (
MSKstreamtypee whichstream)


Prints a short summary with optimizer statistics from last optimization.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_optimizetrm
MSKrescodee (MSKAPI MSK_optimizetrm) (
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) (
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) (
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 Sensitivity Analysis.

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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_printparam
MSKrescodee (MSKAPI MSK_printparam) (


Prints the current parameter settings to the message stream.

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


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

Parameters:

Return:

(MSKrescodee) – The function response code.

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


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

Parameters:

Return:

(MSKrescodee) – The function response code.

MSK_putacol
MSKrescodee (MSKAPI MSK_putacol) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putacollist
MSKrescodee (MSKAPI MSK_putacollist) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putacollist64
MSKrescodee (MSKAPI MSK_putacollist64) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putacolslice
MSKrescodee (MSKAPI MSK_putacolslice) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putacolslice64
MSKrescodee (MSKAPI MSK_putacolslice64) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

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


Changes a coefficient in the linear coefficient matrix $$A$$ using the method

$a_{i,j} = \mathtt{aij}.$
Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putaijlist
MSKrescodee (MSKAPI MSK_putaijlist) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putaijlist64
MSKrescodee (MSKAPI MSK_putaijlist64) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putarow
MSKrescodee (MSKAPI MSK_putarow) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putarowlist
MSKrescodee (MSKAPI MSK_putarowlist) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putarowlist64
MSKrescodee (MSKAPI MSK_putarowlist64) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putarowslice
MSKrescodee (MSKAPI MSK_putarowslice) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putarowslice64
MSKrescodee (MSKAPI MSK_putarowslice64) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putbarablocktriplet
MSKrescodee (MSKAPI MSK_putbarablocktriplet) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_putbaraij
MSKrescodee (MSKAPI MSK_putbaraij) (
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) (
MSKint64t num,
const MSKint32t * subj,
const MSKint32t * subk,
const MSKint32t * subl,
const MSKrealt * valjkl)


Inputs the $$\barC$$ matrix in block triplet form.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_putbarcj
MSKrescodee (MSKAPI MSK_putbarcj) (
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) (
MSKsoltypee whichsol,
MSKint32t j,
const MSKrealt * barsj)


Sets the dual solution for a semidefinite variable.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (put)

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


Sets the name of a semidefinite variable.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

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


Sets the primal solution for a semidefinite variable.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Solution (put)

MSK_putbound Deprecated
MSKrescodee (MSKAPI MSK_putbound) (
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) (
MSKaccmodee accmode,
MSKint32t num,
const MSKint32t * sub,
const MSKboundkeye * bk,
const MSKrealt * bl,
const MSKrealt * bu)


Changes the bounds of constraints or variables.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

MSK_putboundslice Deprecated
MSKrescodee (MSKAPI MSK_putboundslice) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

MSK_putcallbackfunc
MSKrescodee (MSKAPI MSK_putcallbackfunc) (
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 Progress and data callback 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) (
MSKrealt cfix)


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

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Objective data

MSK_putcj
MSKrescodee (MSKAPI MSK_putcj) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putclist
MSKrescodee (MSKAPI MSK_putclist) (
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) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

MSK_putconboundlist
MSKrescodee (MSKAPI MSK_putconboundlist) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Bound data

MSK_putconboundslice
MSKrescodee (MSKAPI MSK_putconboundslice) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

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


Replaces a conic constraint.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Conic constraint data

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


Sets the name of a cone.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

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


Sets the name of a constraint.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_putcslice
MSKrescodee (MSKAPI MSK_putcslice) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

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


Sets the value of a double parameter.

Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Callback

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


Sets the value of an integer parameter.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameters (put)

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


Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Environment management

MSK_putlicensepath
MSKrescodee (MSKAPI MSK_putlicensepath) (
MSKenv_t env,


Set the path to the license file.

Parameters:

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:

Return:

(MSKrescodee) – The function response code.

Groups:

Environment management

MSK_putmaxnumanz
MSKrescodee (MSKAPI MSK_putmaxnumanz) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putmaxnumbarvar
MSKrescodee (MSKAPI MSK_putmaxnumbarvar) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Symmetric matrix variable data

MSK_putmaxnumcon
MSKrescodee (MSKAPI MSK_putmaxnumcon) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_putmaxnumcone
MSKrescodee (MSKAPI MSK_putmaxnumcone) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

MSK_putmaxnumqnz
MSKrescodee (MSKAPI MSK_putmaxnumqnz) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putmaxnumvar
MSKrescodee (MSKAPI MSK_putmaxnumvar) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putnadouparam
MSKrescodee (MSKAPI MSK_putnadouparam) (
const char * paramname,
MSKrealt parvalue)


Sets the value of a named double parameter.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameters (put)

MSK_putnaintparam
MSKrescodee (MSKAPI MSK_putnaintparam) (
const char * paramname,
MSKint32t parvalue)


Sets the value of a named integer parameter.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameters (put)

MSK_putnastrparam
MSKrescodee (MSKAPI MSK_putnastrparam) (
const char * paramname,
const char * parvalue)


Sets the value of a named string parameter.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Parameters (put)

MSK_putnlfunc
MSKrescodee (MSKAPI MSK_putnlfunc) (
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) (
const char * objname)


Assigns a new name to the objective.

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Naming

MSK_putobjsense
MSKrescodee (MSKAPI MSK_putobjsense) (
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) (
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) (
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}$$.

• 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 Quadratic Optimization

Parameters:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putqconk
MSKrescodee (MSKAPI MSK_putqconk) (
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:

Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putqobj
MSKrescodee (MSKAPI MSK_putqobj) (
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 (MSKint32t) – Number of non-zero elements in the quadratic objective terms. (input)
• qosubi (MSKint32t*) – Row subscripts for quadratic objective coefficients. (input)
• qosubj (MSKint32t*) – Column subscripts for quadratic objective coefficients. (input)
• qoval (MSKrealt*) – Quadratic objective coefficient values. (input)
Return:

(MSKrescodee) – The function response code.

Groups:

Scalar variable data

MSK_putqobjij
MSKrescodee (MSKAPI MSK_putqobjij) (
MSKint32t i,
MSKint32t j,
MSKrealt qoij)


Replaces one coefficient in the quadratic term in the objective. The function performs the assignment

$q_{ij}^o = q_{ji}^o = \mathtt{qoij}.$

Only the elements in the lower triangular part are accepted. Setting $$q_{ij}$$ with $$j>i$$ will cause an error.

Please note that replacing all quadratic elements one by one is more computationally expensive than replacing them all at once. Use MSK_putqobj instead whenever possible.

Parameters:

Return:

(MSKrescodee) – T