15.3 Functions in alphabetical order

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichstream (MSKstreamtypee) – Index of the stream. (input)

  • nametype (MSKnametypee) – The type of names e.g. valid in MPS or LP files. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task

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

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

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

Following parameters can be used to configure the printed statistics:

  • MSK_IPAR_ANA_SOL_BASIS enables or disables printing of statistics specific to the basis solution (condition number, number of basic variables etc.). Default is on.

  • MSK_IPAR_ANA_SOL_PRINT_VIOLATED enables or disables listing names of all constraints (both primal and dual) which are violated by the solution. Default is off.

  • MSK_DPAR_ANA_SOL_INFEAS_TOL is the tolerance defining when a constraint is considered violated. If a constraint is violated more than this, it will be listed in the summary.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information, Inspecting the task

MSK_appendacc
MSKrescodee (MSKAPI MSK_appendacc) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKint64t numafeidx,
  const MSKint64t * afeidxlist,
  const MSKrealt * b)

Appends an affine conic constraint to the task. The affine constraint has the form a sequence of affine expressions belongs to a domain.

The domain index is specified with domidx and should refer to a domain previously appended with one of the append...domain functions.

The length of the affine expression list afeidxlist must be equal to the dimension \(n\) of the domain. The elements of afeidxlist are indexes to the store of affine expressions, i.e. the affine expressions appearing in the affine conic constraint are:

\[F_{\mathtt{afeidxlist}[k],:}x + g_{\mathtt{afeidxlist}[k]} \quad \mathrm{for}\ k=\idxbeg,\ldots,\idxend{n}.\]

If an optional vector b of the same length as afeidxlist is specified then the expressions appearing in the affine constraint will instead be taken as:

\[F_{\mathtt{afeidxlist}[k],:}x + g_{\mathtt{afeidxlist}[k]} - b_k \quad \mathrm{for}\ k=\idxbeg,\ldots,\idxend{n}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • domidx (MSKint64t) – Domain index. (input)

  • numafeidx (MSKint64t) – Number of affine expressions in the affine expression list (must equal the dimension of the domain). (input)

  • afeidxlist (MSKint64t*) – List of affine expression indexes. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_appendaccs
MSKrescodee (MSKAPI MSK_appendaccs) (
  MSKtask_t task,
  MSKint64t numaccs,
  const MSKint64t * domidxs,
  MSKint64t numafeidx,
  const MSKint64t * afeidxlist,
  const MSKrealt * b)

Appends numaccs affine conic constraint to the task. Each single affine conic constraint should be specified as in MSK_appendacc and the input of this function should contain the concatenation of all these descriptions.

In particular, the length of afeidxlist must equal the sum of dimensions of domains indexed in domainsidxs.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numaccs (MSKint64t) – The number of affine conic constraints to append. (input)

  • domidxs (MSKint64t*) – Domain indices. (input)

  • numafeidx (MSKint64t) – Number of affine expressions in the affine expression list (must equal the sum of dimensions of the domains). (input)

  • afeidxlist (MSKint64t*) – List of affine expression indexes. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_appendaccseq
MSKrescodee (MSKAPI MSK_appendaccseq) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKint64t numafeidx,
  MSKint64t afeidxfirst,
  const MSKrealt * b)

Appends an affine conic constraint to the task, as in MSK_appendacc. The function assumes the affine expressions forming the constraint are sequential. The affine constraint has the form a sequence of affine expressions belongs to a domain.

The domain index is specified with domidx and should refer to a domain previously appended with one of the append...domain functions.

The number of affine expressions should be equal to the dimension \(n\) of the domain. The affine expressions forming the affine constraint are arranged sequentially in a contiguous block of the affine expression store starting from position afeidxfirst. That is, the affine expressions appearing in the affine conic constraint are:

\[F_{\mathtt{afeidxfirst}+k,:}x + g_{\mathtt{afeidxfirst}+k} \quad \mathrm{for}\ k=\idxbeg,\ldots,\idxend{n}.\]

If an optional vector b of length numafeidx is specified then the expressions appearing in the affine constraint will instead be taken as

\[F_{\mathtt{afeidxfirst}+k,:}x + g_{\mathtt{afeidxfirst}+k} - b_k \quad \mathrm{for}\ k=\idxbeg,\ldots,\idxend{n}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • domidx (MSKint64t) – Domain index. (input)

  • numafeidx (MSKint64t) – Number of affine expressions in the affine expression list (must equal the dimension of the domain). (input)

  • afeidxfirst (MSKint64t) – Index of the first affine expression. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_appendaccsseq
MSKrescodee (MSKAPI MSK_appendaccsseq) (
  MSKtask_t task,
  MSKint64t numaccs,
  const MSKint64t * domidxs,
  MSKint64t numafeidx,
  MSKint64t afeidxfirst,
  const MSKrealt * b)

Appends numaccs affine conic constraint to the task. It is the block variant of MSK_appendaccs, that is it assumes that the affine expressions appearing in the affine conic constraints are sequential in the affine expression store, starting from position afeidxfirst.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numaccs (MSKint64t) – The number of affine conic constraints to append. (input)

  • domidxs (MSKint64t*) – Domain indices. (input)

  • numafeidx (MSKint64t) – Number of affine expressions in the affine expression list (must equal the sum of dimensions of the domains). (input)

  • afeidxfirst (MSKint64t) – Index of the first affine expression. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_appendafes
MSKrescodee (MSKAPI MSK_appendafes) (
  MSKtask_t task,
  MSKint64t num)

Appends a number of empty affine expressions to the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t) – Number of empty affine expressions which should be appended. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of symmetric matrix variables to be appended. (input)

  • dim (MSKint32t*) – Dimensions of symmetric matrix variables to be added. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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. Cone type is specified by ct.

Define

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

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

  • Quadratic cone (MSK_CT_QUAD, requires \(\mathtt{nummem}\geq 1\)):

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

    \[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\]
  • Primal exponential cone (MSK_CT_PEXP, requires \(\mathtt{nummem}=3\)):

    \[\hat{x}_0 \geq \hat{x}_1\exp(\hat{x}_2/\hat{x}_1), \quad \hat{x}_0,\hat{x}_1 \geq 0\]
  • Primal power cone (MSK_CT_PPOW, requires \(\mathtt{nummem}\geq 2\)):

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

    where \(\alpha\) is the cone parameter specified by conepar.

  • Dual exponential cone (MSK_CT_DEXP, requires \(\mathtt{nummem}=3\)):

    \[\hat{x}_0 \geq -\hat{x}_2 e^{-1}\exp(\hat{x}_1/\hat{x}_2), \quad \hat{x}_2\leq 0,\hat{x}_0 \geq 0\]
  • Dual power cone (MSK_CT_DPOW, requires \(\mathtt{nummem}\geq 2\)):

    \[\left(\frac{\hat{x}_0}{\alpha}\right)^\alpha \left(\frac{\hat{x}_1}{1-\alpha}\right)^{1-\alpha} \geq \sqrt{\sum_{i=2}^{i<\mathtt{nummem}} \hat{x}^2_i}, \quad \hat{x}_{0}, \hat{x}_1 \geq 0\]

    where \(\alpha\) is the cone parameter specified by conepar.

  • Zero cone (MSK_CT_ZERO):

    \[\hat{x}_i = 0 \ \textrm{for all}\ i\]

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

For an explained code example see Sec. 6.3 (Conic Quadratic Optimization), Sec. 6.5 (Conic Exponential Optimization) or Sec. 6.4 (Power Cone Optimization).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • ct (MSKconetypee) – Specifies the type of the cone. (input)

  • conepar (MSKrealt) – For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0. (input)

  • nummem (MSKint32t) – Number of member variables in the cone. (input)

  • submem (MSKint32t*) – Variable subscripts of the members in the cone. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - cones (deprecated)

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • ct (MSKconetypee) – Specifies the type of the cone. (input)

  • conepar (MSKrealt) – For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0. (input)

  • nummem (MSKint32t) – Number of member variables in the cone. (input)

  • j (MSKint32t) – Index of the first variable in the conic constraint. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - cones (deprecated)

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of cones to be added. (input)

  • ct (MSKconetypee*) – Specifies the type of the cone. (input)

  • conepar (MSKrealt*) – For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0. (input)

  • nummem (MSKint32t*) – Numbers of member variables in the cones. (input)

  • j (MSKint32t) – Index of the first variable in the first cone to be appended. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - cones (deprecated)

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of constraints which should be appended. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - constraints

MSK_appenddjcs
MSKrescodee (MSKAPI MSK_appenddjcs) (
  MSKtask_t task,
  MSKint64t num)

Appends a number of empty disjunctive constraints to the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t) – Number of empty disjunctive constraints which should be appended. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints

MSK_appenddualexpconedomain
MSKrescodee (MSKAPI MSK_appenddualexpconedomain) (
  MSKtask_t task,
  MSKint64t * domidx)

Appends the dual exponential cone \(\left\{ x\in \real^3 ~:~ x_0 \geq -x_2 e^{-1} e^{x_1/x_2},\ x_0> 0,\ x_2< 0 \right\}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appenddualgeomeanconedomain
MSKrescodee (MSKAPI MSK_appenddualgeomeanconedomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the dual geometric mean cone \(\left\{ x\in \real^n ~:~ (n-1) \left(\prod_{i=0}^{n-2} x_i\right)^{1/(n-1)} \geq |x_{n-1}|,\ x_0,\ldots,x_{n-2}\geq 0 \right\}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appenddualpowerconedomain
MSKrescodee (MSKAPI MSK_appenddualpowerconedomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t nleft,
  const MSKrealt * alpha,
  MSKint64t * domidx)

Appends the dual power cone domain of dimension \(n\), with \(n_\ell\) variables appearing on the left-hand side, where \(n_\ell\) is the length of \(\alpha\), and with a homogenous sequence of exponents \(\alpha_0,\ldots,\alpha_{n_\ell-1}\).

Formally, let \(s = \sum_i \alpha_i\) and \(\beta_i = \alpha_i / s\), so that \(\sum_i \beta_i=1\). Then the dual power cone is defined as follows:

\[\left\{ x\in \real^n ~:~ \prod_{i=0}^{n_\ell-1} \left(\frac{x_i}{\beta_i}\right)^{\beta_i} \geq \sqrt{\sum_{j=n_\ell}^{n-1}x_j^2},\ x_0\ldots,x_{n_\ell-1}\geq 0 \right\}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • n (MSKint64t) – Dimension of the domain. (input)

  • nleft (MSKint64t) – Number of variables on the left hand side. (input)

  • alpha (MSKrealt*) – The sequence proportional to exponents. Must be positive. (input)

  • domidx (MSKint64t by reference) – Index of the domain. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendprimalexpconedomain
MSKrescodee (MSKAPI MSK_appendprimalexpconedomain) (
  MSKtask_t task,
  MSKint64t * domidx)

Appends the primal exponential cone \(\left\{ x\in \real^3 ~:~ x_0 \geq x_1 e^{x_2/x_1},\ x_0,x_1> 0 \right\}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendprimalgeomeanconedomain
MSKrescodee (MSKAPI MSK_appendprimalgeomeanconedomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the primal geometric mean cone \(\left\{ x\in \real^n ~:~ \left(\prod_{i=0}^{n-2} x_i\right)^{1/(n-1)} \geq |x_{n-1}|,\ x_0\ldots,x_{n-2}\geq 0 \right\}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendprimalpowerconedomain
MSKrescodee (MSKAPI MSK_appendprimalpowerconedomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t nleft,
  const MSKrealt * alpha,
  MSKint64t * domidx)

Appends the primal power cone domain of dimension \(n\), with \(n_\ell\) variables appearing on the left-hand side, where \(n_\ell\) is the length of \(\alpha\), and with a homogenous sequence of exponents \(\alpha_0,\ldots,\alpha_{n_\ell-1}\).

Formally, let \(s = \sum_i \alpha_i\) and \(\beta_i = \alpha_i / s\), so that \(\sum_i \beta_i=1\). Then the primal power cone is defined as follows:

\[\left\{ x\in \real^n ~:~ \prod_{i=0}^{n_\ell-1} x_i^{\beta_i} \geq \sqrt{\sum_{j=n_\ell}^{n-1}x_j^2},\ x_0\ldots,x_{n_\ell-1}\geq 0 \right\}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • n (MSKint64t) – Dimension of the domain. (input)

  • nleft (MSKint64t) – Number of variables on the left hand side. (input)

  • alpha (MSKrealt*) – The sequence proportional to exponents. Must be positive. (input)

  • domidx (MSKint64t by reference) – Index of the domain. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendquadraticconedomain
MSKrescodee (MSKAPI MSK_appendquadraticconedomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the \(n\)-dimensional quadratic cone \(\left\{x\in\real^n~:~x_0 \geq \sqrt{\sum_{i=1}^{n-1} x_i^2}\right\}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendrdomain
MSKrescodee (MSKAPI MSK_appendrdomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the \(n\)-dimensional real space \(\{ x \in \real^n \}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendrminusdomain
MSKrescodee (MSKAPI MSK_appendrminusdomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the \(n\)-dimensional negative orthant \(\{ x \in \real^n: \, x \leq 0 \}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendrplusdomain
MSKrescodee (MSKAPI MSK_appendrplusdomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the \(n\)-dimensional positive orthant \(\{ x \in \real^n: \, x \geq 0 \}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendrquadraticconedomain
MSKrescodee (MSKAPI MSK_appendrquadraticconedomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the \(n\)-dimensional rotated quadratic cone \(\left\{x\in\real^n~:~2 x_0 x_1 \geq \sum_{i=2}^{n-1} x_i^2,\ x_0,x_1\geq 0\right\}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

MSK_appendrzerodomain
MSKrescodee (MSKAPI MSK_appendrzerodomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the zero in \(n\)-dimensional real space \(\{ x \in \real^n: \, x = 0 \}\) to the list of domains.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • dim (MSKint32t) – Dimension of the symmetric matrix that is appended. (input)

  • nz (MSKint64t) – Number of triplets. (input)

  • subi (MSKint32t*) – Row subscript in the triplets. (input)

  • subj (MSKint32t*) – Column subscripts in the triplets. (input)

  • valij (MSKrealt*) – Values of each triplet. (input)

  • idx (MSKint64t by reference) – Unique index assigned to the inputted matrix that can be used for later reference. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

MSK_appendsparsesymmatlist
MSKrescodee (MSKAPI MSK_appendsparsesymmatlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * dims,
  const 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 general sparse symmetric matrixes on triplet form to the vector \(E\) of symmetric matrices. The vectors subi, subj, and valij contains the row subscripts, column subscripts and values of each element in the symmetric matrix to be appended. Since the matrix that is appended is symmetric, only the lower triangular part should be specified. Moreover, duplicates are not allowed.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of matrixes to append. (input)

  • dims (MSKint32t*) – Dimensions of the symmetric matrixes. (input)

  • nz (MSKint64t*) – Number of nonzeros for each matrix. (input)

  • subi (MSKint32t*) – Row subscript in the triplets. (input)

  • subj (MSKint32t*) – Column subscripts in the triplets. (input)

  • valij (MSKrealt*) – Values of each triplet. (input)

  • idx (MSKint64t*) – Unique index assigned to the inputted matrix that can be used for later reference. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

MSK_appendsvecpsdconedomain
MSKrescodee (MSKAPI MSK_appendsvecpsdconedomain) (
  MSKtask_t task,
  MSKint64t n,
  MSKint64t * domidx)

Appends the domain consisting of vectors of length \(n=d(d+1)/2\) defined as follows

\[\{(x_1,\ldots,x_{d(d+1)/2})\in \real^n~:~ \mathrm{sMat}(x)\in\PSD^d\} = \{\mathrm{sVec}(X)~:~X\in\PSD^d\},\]

where

\[\mathrm{sVec}(X) = (X_{11},\sqrt{2}X_{21},\ldots,\sqrt{2}X_{d1},X_{22},\sqrt{2}X_{32},\ldots,X_{dd}),\]

and

\[\begin{split}\mathrm{sMat}(x) = \left[\begin{array}{cccc}x_1 & x_2/\sqrt{2} & \cdots & x_{d}/\sqrt{2} \\ x_2/\sqrt{2} & x_{d+1} & \cdots & x_{2d-1}/\sqrt{2} \\ \cdots & \cdots & \cdots & \cdots \\ x_{d}/\sqrt{2} & x_{2d-1}/\sqrt{2} & \cdots & x_{d(d+1)/2}\end{array}\right].\end{split}\]

In other words, the domain consists of vectorizations of the lower-triangular part of a positive semidefinite matrix, with the non-diagonal elements additionally rescaled.

This domain is a self-dual cone.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • n (MSKint64t) – Dimension of the domain, must be of the form \(d(d+1)/2\). (input)

  • domidx (MSKint64t by reference) – Index of the domain. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of variables which should be appended. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - variables

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

Request a solution from a remote job identified by the argument token. For other arguments see MSK_asyncoptimize. If the solution is available it will be retrieved and loaded into the local task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • address (char*) – Address of the OptServer. (input)

  • accesstoken (char*) – Access token. (input)

  • token (char*) – The task token. (input)

  • respavailable (MSKbooleant by reference) – Indicates if a remote response is available. If this is not true, resp and trm should be ignored. (output)

  • resp (MSKrescodee by reference) – Is the response code from the remote solver. (output)

  • trm (MSKrescodee by reference) – Is either MSK_RES_OK or a termination response code. (output)

Return

(MSKrescodee) – The function response code.

Groups

Remote optimization

MSK_asyncoptimize
MSKrescodee (MSKAPI MSK_asyncoptimize) (
  MSKtask_t task,
  const char * address,
  const char * accesstoken,
  char * token)

Offload the optimization task to an instance of OptServer specified by addr, which should be a valid URL, for example http://server:port or https://server:port. The call will exit immediately.

If the server requires authentication, the authentication token can be passed in the accesstoken argument.

If the server requires encryption, the keys can be passed using one of the solver parameters MSK_SPAR_REMOTE_TLS_CERT or MSK_SPAR_REMOTE_TLS_CERT_PATH.

The function returns a token which should be used in future calls to identify the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • address (char*) – Address of the OptServer. (input)

  • accesstoken (char*) – Access token. (input)

  • token (char*) – Returns the task token. (output)

Return

(MSKrescodee) – The function response code.

Groups

Remote optimization

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

Requests information about the status of the remote job identified by the argument token. For other arguments see MSK_asyncoptimize.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • address (char*) – Address of the OptServer. (input)

  • accesstoken (char*) – Access token. (input)

  • token (char*) – The task token. (input)

  • respavailable (MSKbooleant by reference) – Indicates if a remote response is available. If this is not true, resp and trm should be ignored. (output)

  • resp (MSKrescodee by reference) – Is the response code from the remote solver. (output)

  • trm (MSKrescodee by reference) – Is either MSK_RES_OK or a termination response code. (output)

Return

(MSKrescodee) – The function response code.

Groups

Remote optimization

MSK_asyncstop
MSKrescodee (MSKAPI MSK_asyncstop) (
  MSKtask_t task,
  const char * address,
  const char * accesstoken,
  const char * token)

Request that the remote job identified by token is terminated. For other arguments see MSK_asyncoptimize.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • address (char*) – Address of the OptServer. (input)

  • accesstoken (char*) – Access token. (input)

  • token (char*) – The task token. (input)

Return

(MSKrescodee) – The function response code.

Groups

Remote optimization

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\). It must not overlap with the other input arrays.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • n (MSKint32t) – Length of the vectors. (input)

  • alpha (MSKrealt) – The scalar that multiplies \(x\). (input)

  • x (MSKrealt*) – The \(x\) vector. (input)

  • y (MSKrealt*) – The \(y\) vector. (input/output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

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

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

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

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solving systems with basis matrix

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

Obtains an identifier string corresponding to a bound key.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • bk (MSKboundkeye) – Bound key. (input)

  • str (char*) – String corresponding to the bound key code bk. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

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

Obtains the string representation of a callback code.

Parameters
  • code (MSKcallbackcodee) – A callback code. (input)

  • callbackcodestr (char*) – String corresponding to the callback code. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

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 (char*) – 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

System, memory and debugging

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

Debug version of MSK_calloctask.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • number (size_t) – Number of elements. (input)

  • size (size_t) – Size of each individual element. (input)

  • file (char*) – 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

System, memory and debugging

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

System, memory and debugging

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • number (size_t) – Number of elements. (input)

  • size (size_t) – Size of each individual element. (input)

Return

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

Groups

System, memory and debugging

MSK_checkinall
MSKrescodee (MSKAPI MSK_checkinall) (
  MSKenv_t env)

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

Parameters

env (MSKenv_t) – The MOSEK environment. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

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

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

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • feature (MSKfeaturee) – Feature to check in to the license system. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

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

Checks the memory allocated by the environment.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • file (char*) – File from which the function is called. (input)

  • line (MSKint32t) – Line in the file from which the function is called. (input)

Return

(MSKrescodee) – The function response code.

Groups

System, memory and debugging

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

Checks the memory allocated by the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • file (char*) – File from which the function is called. (input)

  • line (MSKint32t) – Line in the file from which the function is called. (input)

Return

(MSKrescodee) – The function response code.

Groups

System, memory and debugging

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

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

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • feature (MSKfeaturee) – Feature to check out from the license system. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • major (MSKint32t) – Major version number. (input)

  • minor (MSKint32t) – Minor version number. (input)

  • revision (MSKint32t) – Revision number. (input)

Return

(MSKrescodee) – The function response code.

Groups

Versions

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

Changes a bound for one constraint.

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

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

Otherwise if lower is zero, then

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the constraint for which the bounds should be changed. (input)

  • lower (MSKint32t) – If non-zero, then the lower bound is changed, otherwise the upper bound is changed. (input)

  • finite (MSKint32t) – If non-zero, then value is assumed to be finite. (input)

  • value (MSKrealt) – New value for the bound. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - bounds, Problem data - constraints, Problem data - linear part

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

Changes a bound for one variable.

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

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

Otherwise if lower is zero, then

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the variable for which the bounds should be changed. (input)

  • lower (MSKint32t) – If non-zero, then the lower bound is changed, otherwise the upper bound is changed. (input)

  • finite (MSKint32t) – If non-zero, then value is assumed to be finite. (input)

  • value (MSKrealt) – New value for the bound. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - bounds, Problem data - variables, Problem data - linear part

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

Creates a clone of an existing task copying all problem data and parameter settings to a new task. Callback functions are not copied.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

MSK_commitchanges
MSKrescodee (MSKAPI MSK_commitchanges) (
  MSKtask_t task)

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

Parameters

task (MSKtask_t) – An optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

MSK_computesparsecholesky
MSKrescodee (MSKAPI MSK_computesparsecholesky) (
  MSKenv_t env,
  MSKint32t numthreads,
  MSKint32t ordermethod,
  MSKrealt tolsingular,
  MSKint32t n,
  const MSKint32t * anzc,
  const MSKint64t * aptrc,
  const MSKint32t * asubc,
  const MSKrealt * avalc,
  MSKint32t ** perm,
  MSKrealt ** diag,
  MSKint32t ** lnzc,
  MSKint64t ** lptrc,
  MSKint64t * lensubnval,
  MSKint32t ** lsubc,
  MSKrealt ** lvalc)

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

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

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

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

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

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

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

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

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

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

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • numthreads (MSKint32t) – The number threads that can be used to do the computation. 0 means the code makes the choice. NOTE: API change in version 10: in versions up to 9 the argument in this position indicated whether to use multithreading or not. (input)

  • ordermethod (MSKint32t) – If nonzero, then a sparsity preserving ordering will be employed. (input)

  • tolsingular (MSKrealt) – A positive parameter controlling when a pivot is declared zero. (input)

  • n (MSKint32t) – Specifies the order of \(A\). (input)

  • anzc (MSKint32t*) – anzc[j] is the number of nonzeros in the \(j\)-th column of \(A\). (input)

  • aptrc (MSKint64t*) – aptrc[j] is a pointer to the first element in column \(j\) of \(A\). (input)

  • asubc (MSKint32t*) – Row indexes for each column stored in increasing order. (input)

  • avalc (MSKrealt*) – The value corresponding to row indexed stored in asubc. (input)

  • perm (MSKint32t* by reference) – Permutation array used to specify the permutation matrix \(P\) computed by the function. (output)

  • diag (MSKrealt* by reference) – The diagonal elements of matrix \(D\). (output)

  • lnzc (MSKint32t* by reference) – lnzc[j] is the number of non zero elements in column \(j\) of \(L\). (output)

  • lptrc (MSKint64t* by reference) – lptrc[j] is a pointer to the first row index and value in column \(j\) of \(L\). (output)

  • lensubnval (MSKint64t by reference) – Number of elements in lsubc and lvalc. (output)

  • lsubc (MSKint32t* by reference) – Row indexes for each column stored in increasing order. (output)

  • lvalc (MSKrealt* by reference) – The values corresponding to row indexed stored in lsubc. (output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Obtains the cone string identifier corresponding to a cone type.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • ct (MSKconetypee) – Specifies the type of the cone. (input)

  • str (char*) – String corresponding to the cone type code ct. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

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 and task management

MSK_deletesolution
MSKrescodee (MSKAPI MSK_deletesolution) (
  MSKtask_t task,
  MSKsoltypee whichsol)

Undefine a solution and free the memory it uses.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Solution information

MSK_deletetask
MSKrescodee (MSKAPI MSK_deletetask) (
  MSKtask_t * task)

Deletes a task.

Parameters

task (MSKtask_t by reference) – An optimization task. (input/output)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

MSK_dinfitemtostr
MSKrescodee (MSKAPI MSK_dinfitemtostr) (
  MSKdinfiteme item,
  char * str)

Obtains an identifier string corresponding to a information item.

Parameters
  • item (MSKdinfiteme) – Information item. (input)

  • str (char*) – String corresponding to the bound information item item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_dot
MSKrescodee (MSKAPI MSK_dot) (
  MSKenv_t env,
  MSKint32t n,
  const MSKrealt * x,
  const MSKrealt * y,
  MSKrealt * xty)

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

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • n (MSKint32t) – Length of the vectors. (input)

  • x (MSKrealt*) – The \(x\) vector. (input)

  • y (MSKrealt*) – The \(y\) vector. (input)

  • xty (MSKrealt by reference) – The result of the inner product between \(x\) and \(y\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

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

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

\[\{\mathtt{subj}[i] ~|~ i = \idxbeg,\ldots,\idxend{\mathtt{numj}}\}\]

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 (char*) – Is a valid C format string which matches the arguments in .... (input)

  • varnumarg (...) – A variable argument list. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging

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

Prints an intro to message stream.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • longver (MSKint32t) – If non-zero, then the intro is slightly longer. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging

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

Prints a formatted string to a task stream.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichstream (MSKstreamtypee) – Index of the stream. (input)

  • format (char*) – Is a valid C format string which matches the arguments in .... (input)

  • varnumarg (...) – Additional arguments (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_emptyafebarfrow
MSKrescodee (MSKAPI MSK_emptyafebarfrow) (
  MSKtask_t task,
  MSKint64t afeidx)

Clears a row in \(\barF\) i.e. sets \(\barF_{\mathrm{afeidx},*} = 0\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Row index of \(\barF\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_emptyafebarfrowlist
MSKrescodee (MSKAPI MSK_emptyafebarfrowlist) (
  MSKtask_t task,
  MSKint64t numafeidx,
  const MSKint64t * afeidxlist)

Clears a number of rows in \(\barF\) i.e. sets \(\barF_{i,*} = 0\) for all indices \(i\) in afeidxlist.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numafeidx (MSKint64t) – The number of rows to zero, length of afeidxlist. (input)

  • afeidxlist (MSKint64t*) – Indices of rows in \(\barF\) to clear. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_emptyafefcol
MSKrescodee (MSKAPI MSK_emptyafefcol) (
  MSKtask_t task,
  MSKint32t varidx)

Clears one column in the affine constraint matrix \(F\), that is sets \(F_{*,\mathrm{varidx}}=0\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • varidx (MSKint32t) – Index of a variable (column in \(F\)). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_emptyafefcollist
MSKrescodee (MSKAPI MSK_emptyafefcollist) (
  MSKtask_t task,
  MSKint64t numvaridx,
  const MSKint32t * varidx)

Clears a number of columns in \(F\) i.e. sets \(F_{*,j} = 0\) for all indices \(j\) in varidx.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numvaridx (MSKint64t) – The number of columns to zero, length of varidx list. (input)

  • varidx (MSKint32t*) – Indices of variables (columns) in \(F\) to clear. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_emptyafefrow
MSKrescodee (MSKAPI MSK_emptyafefrow) (
  MSKtask_t task,
  MSKint64t afeidx)

Clears one row in the affine constraint matrix \(F\), that is sets \(F_{\mathrm{afeidx},*}=0\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Index of a row in \(F\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_emptyafefrowlist
MSKrescodee (MSKAPI MSK_emptyafefrowlist) (
  MSKtask_t task,
  MSKint64t numafeidx,
  const MSKint64t * afeidx)

Clears a number of rows in \(F\) i.e. sets \(F_{i,*} = 0\) for all indices \(i\) in afeidx.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numafeidx (MSKint64t) – The number of rows to zero, length of afeidxlist. (input)

  • afeidx (MSKint64t*) – Indices of rows in \(F\) to clear. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_evaluateacc
MSKrescodee (MSKAPI MSK_evaluateacc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint64t accidx,
  MSKrealt * activity)

Evaluates the activity of an affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • accidx (MSKint64t) – The index of the affine conic constraint. (input)

  • activity (MSKrealt*) – The activity of the affine conic constraint. The array should have length equal to the dimension of the constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal, Problem data - affine conic constraints

MSK_evaluateaccs
MSKrescodee (MSKAPI MSK_evaluateaccs) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * activity)

Evaluates the activities of all affine conic constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • activity (MSKrealt*) – The activity of affine conic constraints. The array should have length equal to the sum of dimensions of all affine conic constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal, Problem data - affine conic constraints

MSK_expirylicenses
MSKrescodee (MSKAPI MSK_expirylicenses) (
  MSKenv_t env,
  MSKint64t * expiry)

Reports when the first license feature expires. It reports the number of days to the expiry of the first feature of all the features that were ever checked out from the start of the process, or from the last call to MSK_resetexpirylicenses, until now.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • expiry (MSKint64t by reference) – If nonnegative, then it is the minimum number days to expiry of any feature that has been checked out. (output)

Return

(MSKrescodee) – The function response code.

Groups

License system

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 (char*) – File from which the function is called. (input)

  • line (unsigned) – Line in the file from which the function is called. (input)

Return

(void)

Groups

System, memory and debugging

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

Frees space allocated by MOSEK. Debug version of MSK_freetask.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • buffer (void*) – A pointer. (input/output)

  • file (char*) – File from which the function is called. (input)

  • line (unsigned) – Line in the file from which the function is called. (input)

Return

(void)

Groups

System, memory and debugging

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

System, memory and debugging

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • buffer (void*) – A pointer. (input/output)

Return

(void)

Groups

System, memory and debugging

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\). It must not overlap with the other input arrays.

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\). It must not overlap with the other input arrays.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • transa (MSKtransposee) – Indicates whether the matrix \(A\) must be transposed. (input)

  • m (MSKint32t) – Specifies the number of rows of the matrix \(A\). (input)

  • n (MSKint32t) – Specifies the number of columns of the matrix \(A\). (input)

  • alpha (MSKrealt) – A scalar value multiplying the matrix \(A\). (input)

  • a (MSKrealt*) – A pointer to the array storing matrix \(A\) in a column-major format. (input)

  • x (MSKrealt*) – A pointer to the array storing the vector \(x\). (input)

  • beta (MSKrealt) – A scalar value multiplying the vector \(y\). (input)

  • y (MSKrealt*) – A pointer to the array storing the vector \(y\). (input/output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

MSK_generateaccnames
MSKrescodee (MSKAPI MSK_generateaccnames) (
  MSKtask_t task,
  MSKint64t num,
  const MSKint64t * sub,
  const char * fmt,
  MSKint32t ndims,
  const MSKint32t * dims,
  const MSKint64t * sp,
  MSKint32t numnamedaxis,
  const MSKint32t * namedaxisidxs,
  MSKint64t numnames,
  const char ** names)

Internal.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t) – Number of variable indexes. (input)

  • sub (MSKint64t*) – Indexes of the affine conic constraints. (input)

  • fmt (char*) – The variable name formatting string. (input)

  • ndims (MSKint32t) – Number of dimensions in the shape. (input)

  • dims (MSKint32t*) – Dimensions in the shape. (input)

  • sp (MSKint64t*) – Items that should be named. (input)

  • numnamedaxis (MSKint32t) – Number of named axes (input)

  • namedaxisidxs (MSKint32t*) – List if named index axes (input)

  • numnames (MSKint64t) – Total number of names. (input)

  • names (char**) – All axis names. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_generatebarvarnames
MSKrescodee (MSKAPI MSK_generatebarvarnames) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subj,
  const char * fmt,
  MSKint32t ndims,
  const MSKint32t * dims,
  const MSKint64t * sp,
  MSKint32t numnamedaxis,
  const MSKint32t * namedaxisidxs,
  MSKint64t numnames,
  const char ** names)

Generates systematic names for variables.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of variable indexes. (input)

  • subj (MSKint32t*) – Indexes of the variables. (input)

  • fmt (char*) – The variable name formatting string. (input)

  • ndims (MSKint32t) – Number of dimensions in the shape. (input)

  • dims (MSKint32t*) – Dimensions in the shape. (input)

  • sp (MSKint64t*) – Items that should be named. (input)

  • numnamedaxis (MSKint32t) – Number of named axes (input)

  • namedaxisidxs (MSKint32t*) – List if named index axes (input)

  • numnames (MSKint64t) – Total number of names. (input)

  • names (char**) – All axis names. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - variables, Problem data - linear part

MSK_generateconenames Deprecated
MSKrescodee (MSKAPI MSK_generateconenames) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subk,
  const char * fmt,
  MSKint32t ndims,
  const MSKint32t * dims,
  const MSKint64t * sp,
  MSKint32t numnamedaxis,
  const MSKint32t * namedaxisidxs,
  MSKint64t numnames,
  const char ** names)

Internal, deprecated.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of cone indexes. (input)

  • subk (MSKint32t*) – Indexes of the cone. (input)

  • fmt (char*) – The cone name formatting string. (input)

  • ndims (MSKint32t) – Number of dimensions in the shape. (input)

  • dims (MSKint32t*) – Dimensions in the shape. (input)

  • sp (MSKint64t*) – Items that should be named. (input)

  • numnamedaxis (MSKint32t) – Number of named axes (input)

  • namedaxisidxs (MSKint32t*) – List if named index axes (input)

  • numnames (MSKint64t) – Total number of names. (input)

  • names (char**) – All axis names. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - cones (deprecated)

MSK_generateconnames
MSKrescodee (MSKAPI MSK_generateconnames) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subi,
  const char * fmt,
  MSKint32t ndims,
  const MSKint32t * dims,
  const MSKint64t * sp,
  MSKint32t numnamedaxis,
  const MSKint32t * namedaxisidxs,
  MSKint64t numnames,
  const char ** names)

Generates systematic names for constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of constraint indexes. (input)

  • subi (MSKint32t*) – Indexes of the constraints. (input)

  • fmt (char*) – The constraint name formatting string. (input)

  • ndims (MSKint32t) – Number of dimensions in the shape. (input)

  • dims (MSKint32t*) – Dimensions in the shape. (input)

  • sp (MSKint64t*) – Items that should be named. (input)

  • numnamedaxis (MSKint32t) – Number of named axes (input)

  • namedaxisidxs (MSKint32t*) – List if named index axes (input)

  • numnames (MSKint64t) – Total number of names. (input)

  • names (char**) – All axis names. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - constraints, Problem data - linear part

MSK_generatedjcnames
MSKrescodee (MSKAPI MSK_generatedjcnames) (
  MSKtask_t task,
  MSKint64t num,
  const MSKint64t * sub,
  const char * fmt,
  MSKint32t ndims,
  const MSKint32t * dims,
  const MSKint64t * sp,
  MSKint32t numnamedaxis,
  const MSKint32t * namedaxisidxs,
  MSKint64t numnames,
  const char ** names)

Internal.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t) – Number of variable indexes. (input)

  • sub (MSKint64t*) – Indexes of the disjunctive constraints. (input)

  • fmt (char*) – The variable name formatting string. (input)

  • ndims (MSKint32t) – Number of dimensions in the shape. (input)

  • dims (MSKint32t*) – Dimensions in the shape. (input)

  • sp (MSKint64t*) – Items that should be named. (input)

  • numnamedaxis (MSKint32t) – Number of named axes (input)

  • namedaxisidxs (MSKint32t*) – List if named index axes (input)

  • numnames (MSKint64t) – Total number of names. (input)

  • names (char**) – All axis names. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_generatevarnames
MSKrescodee (MSKAPI MSK_generatevarnames) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subj,
  const char * fmt,
  MSKint32t ndims,
  const MSKint32t * dims,
  const MSKint64t * sp,
  MSKint32t numnamedaxis,
  const MSKint32t * namedaxisidxs,
  MSKint64t numnames,
  const char ** names)

Generates systematic names for variables.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of variable indexes. (input)

  • subj (MSKint32t*) – Indexes of the variables. (input)

  • fmt (char*) – The variable name formatting string. (input)

  • ndims (MSKint32t) – Number of dimensions in the shape. (input)

  • dims (MSKint32t*) – Dimensions in the shape. (input)

  • sp (MSKint64t*) – Items that should be named. (input)

  • numnamedaxis (MSKint32t) – Number of named axes (input)

  • namedaxisidxs (MSKint32t*) – List if named index axes (input)

  • numnames (MSKint64t) – Total number of names. (input)

  • names (char**) – All axis names. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - variables, Problem data - linear part

MSK_getaccafeidxlist
MSKrescodee (MSKAPI MSK_getaccafeidxlist) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint64t * afeidxlist)

Obtains the list of affine expressions appearing in the affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Index of the affine conic constraint. (input)

  • afeidxlist (MSKint64t*) – List of indexes of affine expressions appearing in the constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getaccb
MSKrescodee (MSKAPI MSK_getaccb) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKrealt * b)

Obtains the additional constant term vector appearing in the affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Index of the affine conic constraint. (input)

  • b (MSKrealt*) – The vector b appearing in the constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getaccbarfblocktriplet
MSKrescodee (MSKAPI MSK_getaccbarfblocktriplet) (
  MSKtask_t task,
  MSKint64t maxnumtrip,
  MSKint64t * numtrip,
  MSKint64t * acc_afe,
  MSKint32t * bar_var,
  MSKint32t * blk_row,
  MSKint32t * blk_col,
  MSKrealt * blk_val)

Obtains \(\barF\), implied by the ACCs, in block triplet form. If the AFEs passed to the ACCs were out of order, then this function can be used to obtain the barF as seen by the ACCs.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumtrip (MSKint64t) – acc_afe, bar_var, blk_row, blk_col and blk_val must be numtrip long. (input)

  • numtrip (MSKint64t by reference) – Number of elements in the block triplet form. (output)

  • acc_afe (MSKint64t*) – Index of the AFE within the concatenated list of AFEs in ACCs. (output)

  • bar_var (MSKint32t*) – Symmetric matrix variable index. (output)

  • blk_row (MSKint32t*) – Block row index. (output)

  • blk_col (MSKint32t*) – Block column index. (output)

  • blk_val (MSKrealt*) – The numerical value associated with each block triplet. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_getaccbarfnumblocktriplets
MSKrescodee (MSKAPI MSK_getaccbarfnumblocktriplets) (
  MSKtask_t task,
  MSKint64t * numtrip)

Obtains an upper bound on the number of elements in the block triplet form of \(\barF\), as used within the ACCs.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numtrip (MSKint64t by reference) – An upper bound on the number of elements in the block triplet form of \(\barF.\), as used within the ACCs. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Problem data - affine conic constraints, Inspecting the task

MSK_getaccdomain
MSKrescodee (MSKAPI MSK_getaccdomain) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint64t * domidx)

Obtains the domain appearing in the affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – The index of the affine conic constraint. (input)

  • domidx (MSKint64t by reference) – The index of domain in the affine conic constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getaccdoty
MSKrescodee (MSKAPI MSK_getaccdoty) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint64t accidx,
  MSKrealt * doty)

Obtains the \(\dot{y}\) vector for a solution (the dual values of an affine conic constraint).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • accidx (MSKint64t) – The index of the affine conic constraint. (input)

  • doty (MSKrealt*) – The dual values for this affine conic constraint. The array should have length equal to the dimension of the constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual, Problem data - affine conic constraints

MSK_getaccdotys
MSKrescodee (MSKAPI MSK_getaccdotys) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKrealt * doty)

Obtains the \(\dot{y}\) vector for a solution (the dual values of all affine conic constraint).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • doty (MSKrealt*) – The dual values of affine conic constraints. The array should have length equal to the sum of dimensions of all affine conic constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual, Problem data - affine conic constraints

MSK_getaccfnumnz
MSKrescodee (MSKAPI MSK_getaccfnumnz) (
  MSKtask_t task,
  MSKint64t * accfnnz)

If the AFEs are not added sequentially to the ACCs, then the present function gives the number of nonzero elements in the F matrix that would be implied by the ordering of AFEs within ACCs.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getaccftrip
MSKrescodee (MSKAPI MSK_getaccftrip) (
  MSKtask_t task,
  MSKint64t * frow,
  MSKint32t * fcol,
  MSKrealt * fval)

Obtains the \(F\) (that would be implied by the ordering of the AFEs within the ACCs) in triplet format.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • frow (MSKint64t*) – Row indices of nonzeros in the implied F matrix. (output)

  • fcol (MSKint32t*) – Column indices of nonzeros in the implied F matrix. (output)

  • fval (MSKrealt*) – Values of nonzero entries in the implied F matrix. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getaccgvector
MSKrescodee (MSKAPI MSK_getaccgvector) (
  MSKtask_t task,
  MSKrealt * g)

If the AFEs are passed out of sequence to the ACCs, then this function can be used to obtain the vector \(g\) of constant terms used within the ACCs.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • g (MSKrealt*) – The \(g\) used within the ACCs as a dense vector. The length is sum of the dimensions of the ACCs. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - affine conic constraints

MSK_getaccn
MSKrescodee (MSKAPI MSK_getaccn) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint64t * n)

Obtains the dimension of the affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – The index of the affine conic constraint. (input)

  • n (MSKint64t by reference) – The dimension of the affine conic constraint (equal to the dimension of its domain). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getaccname
MSKrescodee (MSKAPI MSK_getaccname) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint32t sizename,
  char * name)

Obtains the name of an affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Index of an affine conic constraint. (input)

  • sizename (MSKint32t) – The length of the buffer pointed to by the name argument. (input)

  • name (char*) – Returns the required name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - affine conic constraints, Inspecting the task

MSK_getaccnamelen
MSKrescodee (MSKAPI MSK_getaccnamelen) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint32t * len)

Obtains the length of the name of an affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Index of an affine conic constraint. (input)

  • len (MSKint32t by reference) – Returns the length of the indicated name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - affine conic constraints, Inspecting the task

MSK_getaccntot
MSKrescodee (MSKAPI MSK_getaccntot) (
  MSKtask_t task,
  MSKint64t * n)

Obtains the total dimension of all affine conic constraints (the sum of all their dimensions).

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getaccs
MSKrescodee (MSKAPI MSK_getaccs) (
  MSKtask_t task,
  MSKint64t * domidxlist,
  MSKint64t * afeidxlist,
  MSKrealt * b)

Obtains full data of all affine conic constraints. The output array domainidxlist must have at least length determined by MSK_getnumacc. The output arrays afeidxlist and b must have at least length determined by MSK_getaccntot.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • domidxlist (MSKint64t*) – The list of domains appearing in all affine conic constraints. (output)

  • afeidxlist (MSKint64t*) – The concatenation of index lists of affine expressions appearing in all affine conic constraints. (output)

  • b (MSKrealt*) – The concatenation of vectors b appearing in all affine conic constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the column. (input)

  • nzj (MSKint32t by reference) – Number of non-zeros in the column obtained. (output)

  • subj (MSKint32t*) – Row indices of the non-zeros in the column obtained. (output)

  • valj (MSKrealt*) – Numerical values in the column obtained. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getacolslice
MSKrescodee (MSKAPI MSK_getacolslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint32t maxnumnz,
  MSKint32t * ptrb,
  MSKint32t * ptre,
  MSKint32t * sub,
  MSKrealt * val)

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

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 (MSKint32t) – Denotes the length of the arrays sub and val. (input)

  • ptrb (MSKint32t*) – ptrb[t] is an index pointing to the first element in the \(t\)-th column obtained. (output)

  • ptre (MSKint32t*) – ptre[t] is an index pointing to the last element plus one in the \(t\)-th column obtained. (output)

  • sub (MSKint32t*) – Contains the row subscripts. (output)

  • val (MSKrealt*) – Contains the coefficient values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getacolslice64
MSKrescodee (MSKAPI MSK_getacolslice64) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t maxnumnz,
  MSKint64t * ptrb,
  MSKint64t * ptre,
  MSKint32t * sub,
  MSKrealt * val)

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

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 sub and val. (input)

  • ptrb (MSKint64t*) – ptrb[t] is an index pointing to the first element in the \(t\)-th column obtained. (output)

  • ptre (MSKint64t*) – ptre[t] is an index pointing to the last element plus one in the \(t\)-th column obtained. (output)

  • sub (MSKint32t*) – Contains the row subscripts. (output)

  • val (MSKrealt*) – Contains the coefficient values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getacolslicenumnz
MSKrescodee (MSKAPI MSK_getacolslicenumnz) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint32t * numnz)

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

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 plus one in the sequence. (input)

  • numnz (MSKint32t by reference) – Number of non-zeros in the slice. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getacolslicenumnz64
MSKrescodee (MSKAPI MSK_getacolslicenumnz64) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t * numnz)

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

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 plus one in the sequence. (input)

  • numnz (MSKint64t by reference) – Number of non-zeros in the slice. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getacolslicetrip
MSKrescodee (MSKAPI MSK_getacolslicetrip) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t maxnumnz,
  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)

  • subi (MSKint32t*) – Constraint subscripts. (output)

  • subj (MSKint32t*) – Column subscripts. (output)

  • val (MSKrealt*) – Values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getafebarfblocktriplet
MSKrescodee (MSKAPI MSK_getafebarfblocktriplet) (
  MSKtask_t task,
  MSKint64t maxnumtrip,
  MSKint64t * numtrip,
  MSKint64t * afeidx,
  MSKint32t * barvaridx,
  MSKint32t * subk,
  MSKint32t * subl,
  MSKrealt * valkl)

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumtrip (MSKint64t) – afeidx, barvaridx, subk, subl and valkl must be maxnumtrip long. (input)

  • numtrip (MSKint64t by reference) – Number of elements in the block triplet form. (output)

  • afeidx (MSKint64t*) – Constraint index. (output)

  • barvaridx (MSKint32t*) – Symmetric matrix variable index. (output)

  • subk (MSKint32t*) – Block row index. (output)

  • subl (MSKint32t*) – Block column index. (output)

  • valkl (MSKrealt*) – The numerical value associated with each block triplet. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_getafebarfnumblocktriplets
MSKrescodee (MSKAPI MSK_getafebarfnumblocktriplets) (
  MSKtask_t task,
  MSKint64t * numtrip)

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numtrip (MSKint64t by reference) – An upper bound on the number of elements in the block triplet form of \(\barF.\) (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

MSK_getafebarfnumrowentries
MSKrescodee (MSKAPI MSK_getafebarfnumrowentries) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t * numentr)

Obtains the number of nonzero entries in one row of \(\barF\), that is the number of \(j\) such that \(\barF_{\mathrm{afeidx},j}\) is not the zero matrix.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Row index of \(\barF\). (input)

  • numentr (MSKint32t by reference) – Number of nonzero entries in a row of \(\barF\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite, Inspecting the task

MSK_getafebarfrow
MSKrescodee (MSKAPI MSK_getafebarfrow) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t * barvaridx,
  MSKint64t * ptrterm,
  MSKint64t * numterm,
  MSKint64t * termidx,
  MSKrealt * termweight)

Obtains all nonzero entries in one row \(\barF_{\mathrm{afeidx},*}\) of \(\barF\). For every \(k\) there is a nonzero entry \(\barF_{\mathrm{afeidx}, \mathrm{barvaridx}[k]}\), which is represented as a weighted sum of \(\mathrm{numterm}[k]\) terms. The indices in the matrix store \(E\) and their weights for the \(k\)-th entry appear in the arrays termidx and termweight in positions

\[\mathrm{ptrterm}[k],\ldots,\mathrm{ptrterm}[k]+(\mathrm{numterm}[k]-1).\]

The arrays should be long enough to accommodate the data; their required lengths can be obtained with MSK_getafebarfrowinfo.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Row index of \(\barF\). (input)

  • barvaridx (MSKint32t*) – Semidefinite variable indices of nonzero entries in the row of \(\barF\). (output)

  • ptrterm (MSKint64t*) – Pointers to the start of each entry’s description. (output)

  • numterm (MSKint64t*) – Number of terms in the weighted sum representation of each entry. (output)

  • termidx (MSKint64t*) – Indices of semidefinite matrices from the matrix store \(E\). (output)

  • termweight (MSKrealt*) – Weights appearing in the weighted sum representations of all entries. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite, Inspecting the task

MSK_getafebarfrowinfo
MSKrescodee (MSKAPI MSK_getafebarfrowinfo) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t * numentr,
  MSKint64t * numterm)

Obtains information about one row of \(\barF\): the number of nonzero entries, that is the number of \(j\) such that \(\barF_{\mathrm{afeidx},j}\) is not the zero matrix, as well as the total number of terms in the representations of all these entries as weighted sums of matrices from \(E\). This information provides the data sizes required for a call to MSK_getafebarfrow.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Row index of \(\barF\). (input)

  • numentr (MSKint32t by reference) – Number of nonzero entries in a row of \(\barF\). (output)

  • numterm (MSKint64t by reference) – Number of terms in the weighted sums representation of the row of \(\barF\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite, Inspecting the task

MSK_getafefnumnz
MSKrescodee (MSKAPI MSK_getafefnumnz) (
  MSKtask_t task,
  MSKint64t * numnz)

Obtains the total number of nonzeros in \(F\).

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Inspecting the task

MSK_getafefrow
MSKrescodee (MSKAPI MSK_getafefrow) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t * numnz,
  MSKint32t * varidx,
  MSKrealt * val)

Obtains one row of \(F\) in sparse format.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Index of a row in \(F\). (input)

  • numnz (MSKint32t by reference) – Number of non-zeros in the row obtained. (output)

  • varidx (MSKint32t*) – Column indices of the non-zeros in the row obtained. (output)

  • val (MSKrealt*) – Values of the non-zeros in the row obtained. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Inspecting the task

MSK_getafefrownumnz
MSKrescodee (MSKAPI MSK_getafefrownumnz) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t * numnz)

Obtains the number of nonzeros in one row of \(F\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Index of a row in \(F\). (input)

  • numnz (MSKint32t by reference) – Number of non-zeros in row afeidx of \(F\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Inspecting the task

MSK_getafeftrip
MSKrescodee (MSKAPI MSK_getafeftrip) (
  MSKtask_t task,
  MSKint64t * afeidx,
  MSKint32t * varidx,
  MSKrealt * val)

Obtains the \(F\) in triplet format.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t*) – Row indices of nonzeros. (output)

  • varidx (MSKint32t*) – Column indices of nonzeros. (output)

  • val (MSKrealt*) – Values of nonzero entries. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Inspecting the task

MSK_getafeg
MSKrescodee (MSKAPI MSK_getafeg) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKrealt * g)

Obtains a single coefficient in \(g\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Index of an element in \(g\). (input)

  • g (MSKrealt by reference) – The value of \(g_{\mathrm{afeidx}}\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Inspecting the task

MSK_getafegslice
MSKrescodee (MSKAPI MSK_getafegslice) (
  MSKtask_t task,
  MSKint64t first,
  MSKint64t last,
  MSKrealt * g)

Obtains a sequence of elements from the vector \(g\) of constant terms in the affine expressions list.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint64t) – First index in the sequence. (input)

  • last (MSKint64t) – Last index plus 1 in the sequence. (input)

  • g (MSKrealt*) – The slice \(g\) as a dense vector. The length is last-first. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - affine expressions

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

Obtains a single coefficient in \(A\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Row index of the coefficient to be returned. (input)

  • j (MSKint32t) – Column index of the coefficient to be returned. (input)

  • aij (MSKrealt by reference) – The required coefficient \(a_{i,j}\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • firsti (MSKint32t) – Index of the first row in the rectangular piece. (input)

  • lasti (MSKint32t) – Index of the last row plus one in the rectangular piece. (input)

  • firstj (MSKint32t) – Index of the first column in the rectangular piece. (input)

  • lastj (MSKint32t) – Index of the last column plus one in the rectangular piece. (input)

  • numnz (MSKint32t by reference) – Number of non-zero \(A\) elements in the rectangular piece. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the row. (input)

  • nzi (MSKint32t by reference) – Number of non-zeros in the row obtained. (output)

  • subi (MSKint32t*) – Column indices of the non-zeros in the row obtained. (output)

  • vali (MSKrealt*) – Numerical values of the row obtained. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getarowslice
MSKrescodee (MSKAPI MSK_getarowslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint32t maxnumnz,
  MSKint32t * ptrb,
  MSKint32t * ptre,
  MSKint32t * sub,
  MSKrealt * val)

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

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 (MSKint32t) – Denotes the length of the arrays sub and val. (input)

  • ptrb (MSKint32t*) – ptrb[t] is an index pointing to the first element in the \(t\)-th row obtained. (output)

  • ptre (MSKint32t*) – ptre[t] is an index pointing to the last element plus one in the \(t\)-th row obtained. (output)

  • sub (MSKint32t*) – Contains the column subscripts. (output)

  • val (MSKrealt*) – Contains the coefficient values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getarowslice64
MSKrescodee (MSKAPI MSK_getarowslice64) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t maxnumnz,
  MSKint64t * ptrb,
  MSKint64t * ptre,
  MSKint32t * sub,
  MSKrealt * val)

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

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 sub and val. (input)

  • ptrb (MSKint64t*) – ptrb[t] is an index pointing to the first element in the \(t\)-th row obtained. (output)

  • ptre (MSKint64t*) – ptre[t] is an index pointing to the last element plus one in the \(t\)-th row obtained. (output)

  • sub (MSKint32t*) – Contains the column subscripts. (output)

  • val (MSKrealt*) – Contains the coefficient values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getarowslicenumnz
MSKrescodee (MSKAPI MSK_getarowslicenumnz) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint32t * numnz)

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

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 plus one in the sequence. (input)

  • numnz (MSKint32t by reference) – Number of non-zeros in the slice. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getarowslicenumnz64
MSKrescodee (MSKAPI MSK_getarowslicenumnz64) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t * numnz)

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

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 plus one in the sequence. (input)

  • numnz (MSKint64t by reference) – Number of non-zeros in the slice. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getarowslicetrip
MSKrescodee (MSKAPI MSK_getarowslicetrip) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKint64t maxnumnz,
  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)

  • subi (MSKint32t*) – Constraint subscripts. (output)

  • subj (MSKint32t*) – Column subscripts. (output)

  • val (MSKrealt*) – Values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getatrip
MSKrescodee (MSKAPI MSK_getatrip) (
  MSKtask_t task,
  MSKint64t maxnumnz,
  MSKint32t * subi,
  MSKint32t * subj,
  MSKrealt * val)

Obtains \(A\) in sparse triplet format. The triplets corresponding to nonzero entries are stored in the arrays subi, subj and val.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumnz (MSKint64t) – Denotes the length of the arrays subi, subj, and val. (input)

  • subi (MSKint32t*) – Constraint subscripts. (output)

  • subj (MSKint32t*) – Column subscripts. (output)

  • val (MSKrealt*) – Values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

MSK_getatruncatetol
MSKrescodee (MSKAPI MSK_getatruncatetol) (
  MSKtask_t task,
  MSKrealt * tolzero)

Obtains the tolerance value set with MSK_putatruncatetol.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • tolzero (MSKrealt*) – All elements \(|a_{i,j}|\) less than this tolerance is truncated to zero. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters, Problem data - linear part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnum (MSKint64t) – subi, subj, subk, subl and valijkl must be maxnum long. (input)

  • num (MSKint64t by reference) – Number of elements in the block triplet form. (output)

  • subi (MSKint32t*) – Constraint index. (output)

  • subj (MSKint32t*) – Symmetric matrix variable index. (output)

  • subk (MSKint32t*) – Block row index. (output)

  • subl (MSKint32t*) – Block column index. (output)

  • valijkl (MSKrealt*) – The numerical value associated with each block triplet. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • idx (MSKint64t) – Position of the element in the vectorized form. (input)

  • maxnum (MSKint64t) – sub and weights must be at least maxnum long. (input)

  • i (MSKint32t by reference) – Row index of the element at position idx. (output)

  • j (MSKint32t by reference) – Column index of the element at position idx. (output)

  • num (MSKint64t by reference) – Number of terms in weighted sum that forms the element. (output)

  • sub (MSKint64t*) – A list indexes of the elements from symmetric matrix storage that appear in the weighted sum. (output)

  • weights (MSKrealt*) – The weights associated with each term in the weighted sum. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • idx (MSKint64t) – The internal position of the element for which information should be obtained. (input)

  • num (MSKint64t by reference) – Number of terms in the weighted sum that form the specified element in \(\barA\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumnz (MSKint64t) – The array idxij must be at least maxnumnz long. (input)

  • numnz (MSKint64t by reference) – Number of nonzero elements in \(\barA\). (output)

  • idxij (MSKint64t*) – Position of each nonzero element in the vectorized form of \(\barA\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnum (MSKint64t) – subj, subk, subl and valjkl must be maxnum long. (input)

  • num (MSKint64t by reference) – Number of elements in the block triplet form. (output)

  • subj (MSKint32t*) – Symmetric matrix variable index. (output)

  • subk (MSKint32t*) – Block row index. (output)

  • subl (MSKint32t*) – Block column index. (output)

  • valjkl (MSKrealt*) – The numerical value associated with each block triplet. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • idx (MSKint64t) – Index of the element for which information should be obtained. (input)

  • maxnum (MSKint64t) – sub and weights must be at least maxnum long. (input)

  • j (MSKint32t by reference) – Row index in \(\barC\). (output)

  • num (MSKint64t by reference) – Number of terms in the weighted sum. (output)

  • sub (MSKint64t*) – Elements appearing the weighted sum. (output)

  • weights (MSKrealt*) – Weights of terms in the weighted sum. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • idx (MSKint64t) – Index of the element for which information should be obtained. The value is an index of a symmetric sparse variable. (input)

  • num (MSKint64t by reference) – Number of terms that appear in the weighted sum that forms the requested element. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • idx (MSKint64t) – Index of the element for which information should be obtained. (input)

  • j (MSKint32t by reference) – Row index in \(\barC\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumnz (MSKint64t) – idxj must be at least maxnumnz long. (input)

  • numnz (MSKint64t by reference) – Number of nonzero elements in \(\barC\). (output)

  • idxj (MSKint64t*) – Internal positions of the nonzeros elements in \(\barC\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • j (MSKint32t) – Index of the semidefinite variable. (input)

  • barsj (MSKrealt*) – Value of \(\barS_j\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - semidefinite

MSK_getbarsslice
MSKrescodee (MSKAPI MSK_getbarsslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKint64t slicesize,
  MSKrealt * barsslice)

Obtains the dual solution for a sequence of semidefinite variables. The format is that matrices are stored sequentially, and in each matrix the columns are stored as in MSK_getbarsj.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – Index of the first semidefinite variable in the slice. (input)

  • last (MSKint32t) – Index of the last semidefinite variable in the slice plus one. (input)

  • slicesize (MSKint64t) – Denotes the length of the array barsslice. (input)

  • barsslice (MSKrealt*) – Dual solution values of symmetric matrix variables in the slice, stored sequentially. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - semidefinite

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

Obtains the name of a semidefinite variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the variable. (input)

  • sizename (MSKint32t) – Length of the name buffer. (input)

  • name (char*) – The requested name is copied to this buffer. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Inspecting the task

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

Obtains the index of semidefinite variable from its name.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • somename (char*) – The name of the variable. (input)

  • asgn (MSKint32t by reference) – Non-zero if the name somename is assigned to some semidefinite variable. (output)

  • index (MSKint32t by reference) – The index of a semidefinite variable with the name somename (if one exists). (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Inspecting the task

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

Obtains the length of the name of a semidefinite variable.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Names, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • j (MSKint32t) – Index of the semidefinite variable. (input)

  • barxj (MSKrealt*) – Value of \(\barX_j\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - semidefinite

MSK_getbarxslice
MSKrescodee (MSKAPI MSK_getbarxslice) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint32t first,
  MSKint32t last,
  MSKint64t slicesize,
  MSKrealt * barxslice)

Obtains the primal solution for a sequence of semidefinite variables. The format is that matrices are stored sequentially, and in each matrix the columns are stored as in MSK_getbarxj.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – Index of the first semidefinite variable in the slice. (input)

  • last (MSKint32t) – Index of the last semidefinite variable in the slice plus one. (input)

  • slicesize (MSKint64t) – Denotes the length of the array barxslice. (input)

  • barxslice (MSKrealt*) – Solution values of symmetric matrix variables in the slice, stored sequentially. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - semidefinite

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

Obtains build information.

Parameters
  • buildstate (char*) – State of binaries, i.e. a debug, release candidate or final release. (output)

  • builddate (char*) – Date when the binaries were built. (output)

Return

(MSKrescodee) – The function response code.

Groups

Versions

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

Obtains all objective coefficients \(c\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • c (MSKrealt*) – Linear terms of the objective as a dense vector. The length is the number of variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task, Problem data - variables

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • func (MSKcallbackfunc by reference) – Get the user-defined progress callback function MSKcallbackfunc associated with task. If func is identical to NULL, then no callback function is associated with the task. (output)

  • handle (MSKuserhandle_t by reference) – The user-defined pointer associated with the user-defined callback function. (output)

Return

(MSKrescodee) – The function response code.

Groups

Callback

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

Obtains the fixed term in the objective.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task

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

Obtains one coefficient of \(c\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the variable for which the \(c\) coefficient should be obtained. (input)

  • cj (MSKrealt by reference) – The value of \(c_j\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task, Problem data - variables

MSK_getclist
MSKrescodee (MSKAPI MSK_getclist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subj,
  MSKrealt * c)

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of variables for which the c values should be obtained. (input)

  • subj (MSKint32t*) – A list of variable indexes. (input)

  • c (MSKrealt*) – Linear terms of the requested list of the objective as a dense vector. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part

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

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

Parameters
  • code (MSKrescodee) – A valid MOSEK response code. (input)

  • symname (char*) – Symbolic name corresponding to code. (output)

  • str (char*) – Obtains a short description of a response code. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Responses, errors and warnings

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

Obtains bound information for one constraint.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - constraints

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

Obtains bounds information for a slice of the constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • bk (MSKboundkeye*) – Bound keys. (output)

  • bl (MSKrealt*) – Values for lower bounds. (output)

  • bu (MSKrealt*) – Values for upper bounds. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - constraints

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • k (MSKint32t) – Index of the cone. (input)

  • ct (MSKconetypee by reference) – Specifies the type of the cone. (output)

  • conepar (MSKrealt by reference) – For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0. (output)

  • nummem (MSKint32t by reference) – Number of member variables in the cone. (output)

  • submem (MSKint32t*) – Variable subscripts of the members in the cone. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - cones (deprecated)

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - cones (deprecated)

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the cone. (input)

  • sizename (MSKint32t) – Maximum length of a name that can be stored in name. (input)

  • name (char*) – The required name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - cones (deprecated), Inspecting the task

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • somename (char*) – The name which should be checked. (input)

  • asgn (MSKint32t by reference) – Is non-zero if the name somename is assigned to some cone. (output)

  • index (MSKint32t by reference) – If the name somename is assigned to some cone, then index is the index of the cone. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - cones (deprecated), Inspecting the task

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - cones (deprecated), Inspecting the task

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

Obtains the name of a constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the constraint. (input)

  • sizename (MSKint32t) – Maximum length of name that can be stored in name. (input)

  • name (char*) – The required name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - linear part, Problem data - constraints, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • somename (char*) – The name which should be checked. (input)

  • asgn (MSKint32t by reference) – Is non-zero if the name somename is assigned to some constraint. (output)

  • index (MSKint32t by reference) – If the name somename is assigned to a constraint, then index is the index of the constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - linear part, Problem data - constraints, Inspecting the task

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

Obtains the length of the name of a constraint.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - linear part, Problem data - constraints, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • c (MSKrealt*) – Linear terms of the requested slice of the objective as a dense vector. The length is last-first. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part

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

Obtains the dimension of a symmetric matrix variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the semidefinite variable whose dimension is requested. (input)

  • dimbarvarj (MSKint32t by reference) – The dimension of the \(j\)-th semidefinite variable. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - semidefinite

MSK_getdjcafeidxlist
MSKrescodee (MSKAPI MSK_getdjcafeidxlist) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint64t * afeidxlist)

Obtains the list of affine expression indexes in a disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • afeidxlist (MSKint64t*) – List of affine expression indexes. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcb
MSKrescodee (MSKAPI MSK_getdjcb) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKrealt * b)

Obtains the optional constant term vector of a disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • b (MSKrealt*) – The vector b. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcdomainidxlist
MSKrescodee (MSKAPI MSK_getdjcdomainidxlist) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint64t * domidxlist)

Obtains the list of domain indexes in a disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • domidxlist (MSKint64t*) – List of term sizes. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcname
MSKrescodee (MSKAPI MSK_getdjcname) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint32t sizename,
  char * name)

Obtains the name of a disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of a disjunctive constraint. (input)

  • sizename (MSKint32t) – The length of the buffer pointed to by the name argument. (input)

  • name (char*) – Returns the required name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcnamelen
MSKrescodee (MSKAPI MSK_getdjcnamelen) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint32t * len)

Obtains the length of the name of a disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of a disjunctive constraint. (input)

  • len (MSKint32t by reference) – Returns the length of the indicated name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcnumafe
MSKrescodee (MSKAPI MSK_getdjcnumafe) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint64t * numafe)

Obtains the number of affine expressions in the disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • numafe (MSKint64t by reference) – Number of affine expressions in the disjunctive constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcnumafetot
MSKrescodee (MSKAPI MSK_getdjcnumafetot) (
  MSKtask_t task,
  MSKint64t * numafetot)

Obtains the total number of affine expressions in all disjunctive constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numafetot (MSKint64t by reference) – Number of affine expressions in all disjunctive constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcnumdomain
MSKrescodee (MSKAPI MSK_getdjcnumdomain) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint64t * numdomain)

Obtains the number of domains in the disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • numdomain (MSKint64t by reference) – Number of domains in the disjunctive constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcnumdomaintot
MSKrescodee (MSKAPI MSK_getdjcnumdomaintot) (
  MSKtask_t task,
  MSKint64t * numdomaintot)

Obtains the total number of domains in all disjunctive constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numdomaintot (MSKint64t by reference) – Number of domains in all disjunctive constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcnumterm
MSKrescodee (MSKAPI MSK_getdjcnumterm) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint64t * numterm)

Obtains the number terms in the disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • numterm (MSKint64t by reference) – Number of terms in the disjunctive constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcnumtermtot
MSKrescodee (MSKAPI MSK_getdjcnumtermtot) (
  MSKtask_t task,
  MSKint64t * numtermtot)

Obtains the total number of terms in all disjunctive constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numtermtot (MSKint64t by reference) – Total number of terms in all disjunctive constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjcs
MSKrescodee (MSKAPI MSK_getdjcs) (
  MSKtask_t task,
  MSKint64t * domidxlist,
  MSKint64t * afeidxlist,
  MSKrealt * b,
  MSKint64t * termsizelist,
  MSKint64t * numterms)

Obtains full data of all disjunctive constraints. The output arrays must have minimal lengths determined by the following methods: domainidxlist by MSK_getdjcnumdomaintot, afeidxlist and b by MSK_getdjcnumafetot, termsizelist by MSK_getdjcnumtermtot and numterms by MSK_getnumdomain.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • domidxlist (MSKint64t*) – The concatenation of index lists of domains appearing in all disjunctive constraints. (output)

  • afeidxlist (MSKint64t*) – The concatenation of index lists of affine expressions appearing in all disjunctive constraints. (output)

  • b (MSKrealt*) – The concatenation of vectors b appearing in all disjunctive constraints. (output)

  • termsizelist (MSKint64t*) – The concatenation of lists of term sizes appearing in all disjunctive constraints. (output)

  • numterms (MSKint64t*) – The number of terms in each of the disjunctive constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdjctermsizelist
MSKrescodee (MSKAPI MSK_getdjctermsizelist) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint64t * termsizelist)

Obtains the list of term sizes in a disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • termsizelist (MSKint64t*) – List of term sizes. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getdomainn
MSKrescodee (MSKAPI MSK_getdomainn) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKint64t * n)

Obtains the dimension of the domain.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain, Inspecting the task

MSK_getdomainname
MSKrescodee (MSKAPI MSK_getdomainname) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKint32t sizename,
  char * name)

Obtains the name of a domain.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • domidx (MSKint64t) – Index of a domain. (input)

  • sizename (MSKint32t) – The length of the buffer pointed to by the name argument. (input)

  • name (char*) – Returns the required name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - domain, Inspecting the task

MSK_getdomainnamelen
MSKrescodee (MSKAPI MSK_getdomainnamelen) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKint32t * len)

Obtains the length of the name of a domain.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - domain, Inspecting the task

MSK_getdomaintype
MSKrescodee (MSKAPI MSK_getdomaintype) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKdomaintypee * domtype)

Returns the type of the domain.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain, Inspecting the task

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

Obtains a double information item from the task information database.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichdinf (MSKdinfiteme) – Specifies a double information item. (input)

  • dvalue (MSKrealt by reference) – The value of the required double information item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

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

Obtains the value of a double parameter.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • dualobj (MSKrealt by reference) – Objective value corresponding to the dual solution. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - dual

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

Compute norms of the dual solution.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information

MSK_getdviolacc
MSKrescodee (MSKAPI MSK_getdviolacc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint64t numaccidx,
  const MSKint64t * accidxlist,
  MSKrealt * viol)

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • numaccidx (MSKint64t) – Length of sub and viol. (input)

  • accidxlist (MSKint64t*) – An array of indexes of conic constraints. (input)

  • viol (MSKrealt*) – viol[k] is the violation of the dual solution associated with the conic constraint sub[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of \(\barX\) variables. (input)

  • viol (MSKrealt*) – viol[k] is the violation of the solution for the constraint \(\barS_{\mathtt{sub}[k]} \in \PSD\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

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

where

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of constraints. (input)

  • viol (MSKrealt*) – viol[k] is the violation of dual solution associated with the constraint sub[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of conic constraints. (input)

  • viol (MSKrealt*) – viol[k] is the violation of the dual solution associated with the conic constraint sub[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

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

where

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of \(x\) variables. (input)

  • viol (MSKrealt*) – viol[k] is the violation of dual solution associated with the variable sub[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Obtains the environment used to create the task.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

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

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

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

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

For more information see Sec. 8.3 (Debugging infeasibility) and Sec. 14.2 (Automatic Repair of Infeasible Problems).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Which solution to use when determining the infeasible subproblem. (input)

  • inftask (MSKtask_t by reference) – A new task containing the infeasible subproblem. (output)

Return

(MSKrescodee) – The function response code.

Groups

Infeasibility diagnostic

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

Obtains the index of a named information item.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • inftype (MSKinftypee) – Type of the information item. (input)

  • infname (char*) – Name of the information item. (input)

  • infindex (MSKint32t by reference) – The item index. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • inftype (MSKinftypee) – Type of the information item. (input)

  • infmax (MSKint32t*) – The maximum index (plus 1) requested. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

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

Obtains the name of an information item.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • inftype (MSKinftypee) – Type of the information item. (input)

  • whichinf (MSKint32t) – An information item. (input)

  • infname (char*) – Name of the information item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics, Names

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

Obtains an integer information item from the task information database.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichiinf (MSKiinfiteme) – Specifies an integer information item. (input)

  • ivalue (MSKint32t by reference) – The value of the required integer information item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

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

Obtains the value of an integer parameter.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • lastrescode (MSKrescodee by reference) – Returns the last error code reported in the task. (output)

  • sizelastmsg (MSKint32t) – The length of the lastmsg buffer. (input)

  • lastmsglen (MSKint32t by reference) – Returns the length of the last error message reported in the task. (output)

  • lastmsg (char*) – Returns the last error message reported in the task. (output)

Return

(MSKrescodee) – The function response code.

Groups

Responses, errors and warnings

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • lastrescode (MSKrescodee by reference) – Returns the last error code reported in the task. (output)

  • sizelastmsg (MSKint64t) – The length of the lastmsg buffer. (input)

  • lastmsglen (MSKint64t by reference) – Returns the length of the last error message reported in the task. (output)

  • lastmsg (char*) – Returns the last error message reported in the task. (output)

Return

(MSKrescodee) – The function response code.

Groups

Responses, errors and warnings

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the semidefinite variable whose length if requested. (input)

  • lenbarvarj (MSKint64t by reference) – Number of scalar elements in the lower triangular part of the semidefinite variable. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - semidefinite

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichliinf (MSKliinfiteme) – Specifies a long information item. (input)

  • ivalue (MSKint64t by reference) – The value of the required long integer information item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Names

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumanz (MSKint32t by reference) – Number of preallocated non-zero linear matrix elements. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumanz (MSKint64t by reference) – Number of preallocated non-zero linear matrix elements. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumbarvar (MSKint32t by reference) – Maximum number of symmetric matrix variables for which space is currently preallocated. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - semidefinite

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumcon (MSKint32t by reference) – Number of preallocated constraints in the optimization task. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part, Problem data - constraints

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumcone (MSKint32t by reference) – Number of preallocated conic constraints in the optimization task. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - cones (deprecated)

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumqnz (MSKint32t by reference) – Number of non-zero elements preallocated in quadratic coefficient matrices. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - quadratic part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumqnz (MSKint64t by reference) – Number of non-zero elements preallocated in quadratic coefficient matrices. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - quadratic part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumvar (MSKint32t by reference) – Number of preallocated variables in the optimization task. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part, Problem data - variables

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

System, memory and debugging

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

Obtains a named double information item from task information database.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • infitemname (char*) – The name of a double information item. (input)

  • dvalue (MSKrealt by reference) – The value of the required double information item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

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

Obtains the value of a named double parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • paramname (char*) – Name of a parameter. (input)

  • parvalue (MSKrealt by reference) – Parameter value. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • infitemname (char*) – The name of an integer information item. (input)

  • ivalue (MSKint32t by reference) – The value of the required integer information item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

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

Obtains the value of a named integer parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • paramname (char*) – Name of a parameter. (input)

  • parvalue (MSKint32t by reference) – Parameter value. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

Obtains the value of a named string parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • paramname (char*) – Name of a parameter. (input)

  • sizeparamname (MSKint32t) – Size of the name buffer parvalue. (input)

  • len (MSKint32t by reference) – Length of the string in parvalue. (output)

  • parvalue (char*) – Parameter value. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters, Names

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

Obtains the value of a named string parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • paramname (char*) – Name of a parameter. (input)

  • numaddchr (MSKint32t) – Number of additional characters for which room is left in value. (input)

  • value (char* by reference) – Parameter value. MOSEK will allocate this char buffer of size equal to the actual length of the string parameter plus numaddchr. This memory must be freed by MSK_freetask. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

Obtains the number of affine conic constraints.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints, Inspecting the task

MSK_getnumafe
MSKrescodee (MSKAPI MSK_getnumafe) (
  MSKtask_t task,
  MSKint64t * numafe)

Obtains the number of affine expressions.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numanz (MSKint32t by reference) – Number of non-zero elements in the linear constraint matrix. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numanz (MSKint64t by reference) – Number of non-zero elements in the linear constraint matrix. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - linear part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t by reference) – An upper bound on the number of elements in the block triplet form of \(\barA.\) (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • nz (MSKint64t by reference) – The number of nonzero block elements in \(\barA\) i.e. the number of \(\barA_{ij}\) elements that are nonzero. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t by reference) – An upper bound on the number of elements in the block triplet form of \(\barC.\) (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • nz (MSKint64t by reference) – The number of nonzeros in \(\barC\) i.e. the number of elements \(\barC_j\) that are nonzero. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

Obtains the number of semidefinite variables.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - semidefinite

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

Obtains the number of constraints.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - constraints, Inspecting the task

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - cones (deprecated), Inspecting the task

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - cones (deprecated), Inspecting the task

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

Obtains the number of disjunctive constraints.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints, Inspecting the task

MSK_getnumdomain
MSKrescodee (MSKAPI MSK_getnumdomain) (
  MSKtask_t task,
  MSKint64t * numdomain)

Obtain the number of domains defined.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - domain

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

Obtains the number of integer-constrained variables.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - variables

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

Obtains the number of parameters of a given type.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Parameters

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • k (MSKint32t) – Index of the constraint for which the number of non-zero quadratic terms should be obtained. (input)

  • numqcnz (MSKint32t by reference) – Number of quadratic terms. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - constraints, Problem data - quadratic part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • k (MSKint32t) – Index of the constraint for which the number quadratic terms should be obtained. (input)

  • numqcnz (MSKint64t by reference) – Number of quadratic terms. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - constraints, Problem data - quadratic part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numqonz (MSKint32t by reference) – Number of non-zero elements in the quadratic objective terms. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - quadratic part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numqonz (MSKint64t by reference) – Number of non-zero elements in the quadratic objective terms. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - quadratic part

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

Obtains the number of variables.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - variables

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

Obtains the name assigned to the objective function.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • sizeobjname (MSKint32t) – Length of objname. (input)

  • objname (char*) – Assigned the objective name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Names

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Names

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

Gets the objective sense of the task.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

Obtains the name for a parameter param of type partype.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • partype (MSKparametertypee) – Parameter type. (input)

  • param (MSKint32t) – Which parameter. (input)

  • parname (char*) – Parameter name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Parameters

MSK_getpowerdomainalpha
MSKrescodee (MSKAPI MSK_getpowerdomainalpha) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKrealt * alpha)

Obtains the exponent vector \(\alpha\) of a primal or dual power cone domain.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • domidx (MSKint64t) – Index of the domain. (input)

  • alpha (MSKrealt*) – The vector \(\alpha\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain, Inspecting the task

MSK_getpowerdomaininfo
MSKrescodee (MSKAPI MSK_getpowerdomaininfo) (
  MSKtask_t task,
  MSKint64t domidx,
  MSKint64t * n,
  MSKint64t * nleft)

Obtains structural information about a primal or dual power cone domain.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - domain, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • primalobj (MSKrealt by reference) – Objective value corresponding to the primal solution. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - primal

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

Compute norms of the primal solution.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Obtains the problem type.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task

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

Obtains the problem status.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information

MSK_getpviolacc
MSKrescodee (MSKAPI MSK_getpviolacc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint64t numaccidx,
  const MSKint64t * accidxlist,
  MSKrealt * viol)

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • numaccidx (MSKint64t) – Length of sub and viol. (input)

  • accidxlist (MSKint64t*) – An array of indexes of conic constraints. (input)

  • viol (MSKrealt*) – viol[k] is the violation of the solution associated with the affine conic constraint number accidxlist[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of \(\barX\) variables. (input)

  • viol (MSKrealt*) – viol[k] is how much the solution violates the constraint \(\barX_{\mathtt{sub}[k]} \in \PSD\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of constraints. (input)

  • viol (MSKrealt*) – viol[k] is the violation associated with the solution for the constraint sub[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of conic constraints. (input)

  • viol (MSKrealt*) – viol[k] is the violation of the solution associated with the conic constraint number sub[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

MSK_getpvioldjc
MSKrescodee (MSKAPI MSK_getpvioldjc) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint64t numdjcidx,
  const MSKint64t * djcidxlist,
  MSKrealt * viol)

Computes the primal solution violation for a set of disjunctive constraints. For a single DJC the violation is defined as

\[\mathrm{viol}\left(\bigvee_{i=1}^t \bigwedge_{j=1}^{s_i} T_{i,j}\right) = \min_{i=1,\ldots,t}\left(\max_{j=1,\ldots,s_j}(\mathrm{viol}(T_{i,j}))\right)\]

where the violation of each simple term \(T_{i,j}\) is defined as for an ordinary linear constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • numdjcidx (MSKint64t) – Length of sub and viol. (input)

  • djcidxlist (MSKint64t*) – An array of indexes of disjunctive constraints. (input)

  • viol (MSKrealt*) – viol[k] is the violation of the solution associated with the disjunctive constraint number djcidxlist[k]. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • num (MSKint32t) – Length of sub and viol. (input)

  • sub (MSKint32t*) – An array of indexes of \(x\) variables. (input)

  • viol (MSKrealt*) – viol[k] is the violation associated with the solution for the variable \(x_\mathtt{sub[k]}\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

MSK_getqconk
MSKrescodee (MSKAPI MSK_getqconk) (
  MSKtask_t task,
  MSKint32t k,
  MSKint32t maxnumqcnz,
  MSKint32t * 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)

  • 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

Inspecting the task, Problem data - quadratic part, Problem data - constraints

MSK_getqconk64
MSKrescodee (MSKAPI MSK_getqconk64) (
  MSKtask_t task,
  MSKint32t k,
  MSKint64t maxnumqcnz,
  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)

  • 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

Inspecting the task, Problem data - quadratic part, Problem data - constraints

MSK_getqobj
MSKrescodee (MSKAPI MSK_getqobj) (
  MSKtask_t task,
  MSKint32t maxnumqonz,
  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)

  • 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

Inspecting the task, Problem data - quadratic part

MSK_getqobj64
MSKrescodee (MSKAPI MSK_getqobj64) (
  MSKtask_t task,
  MSKint64t maxnumqonz,
  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)

  • 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

Inspecting the task, Problem data - quadratic part

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - quadratic part

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

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

(15.2)\[\mathtt{redcosts} = \left[ (s_l^x)_j-(s_u^x)_j, ~j=\mathtt{first},\ldots,\mathtt{last}-1 \right]\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – The index of the first variable in the sequence. (input)

  • last (MSKint32t) – The index of the last variable in the sequence plus 1. (input)

  • redcosts (MSKrealt*) – The reduced costs for the required slice of variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

Responses, errors and warnings

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

Obtains the status keys for the constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • skc (MSKstakeye*) – Status keys for the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Obtains the status keys for a slice of the constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • skc (MSKstakeye*) – Status keys for the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

MSK_getskn
MSKrescodee (MSKAPI MSK_getskn) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKstakeye * skn)

Obtains the status keys for the conic constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • skn (MSKstakeye*) – Status keys for the conic constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Obtains the status keys for the scalar variables.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • skx (MSKstakeye*) – Status keys for the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • skx (MSKstakeye*) – Status keys for the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

Obtains the solution status.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Obtains the complete solution.

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

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

and the corresponding dual problem is

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

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

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

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

  • xx : Corresponds to variable \(x\) (also denoted \(x^x\)).

  • xc : Corresponds to \(x^c:=Ax\).

  • y : Corresponds to variable \(y\).

  • slc: Corresponds to variable \(s_l^c\).

  • suc: Corresponds to variable \(s_u^c\).

  • slx: Corresponds to variable \(s_l^x\).

  • sux: Corresponds to variable \(s_u^x\).

  • snx: Corresponds to variable \(s_n^x\).

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • problemsta (MSKprostae by reference) – Problem status. (output)

  • solutionsta (MSKsolstae by reference) – Solution status. (output)

  • skc (MSKstakeye*) – Status keys for the constraints. (output)

  • skx (MSKstakeye*) – Status keys for the variables. (output)

  • skn (MSKstakeye*) – Status keys for the conic constraints. (output)

  • xc (MSKrealt*) – Primal constraint solution. (output)

  • xx (MSKrealt*) – Primal variable solution. (output)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (output)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (output)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (output)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (output)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (output)

  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - primal, Solution - dual

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

Obtains information about a solution.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Obtains information about a solution.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information

MSK_getsolutionnew
MSKrescodee (MSKAPI MSK_getsolutionnew) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKprostae * problemsta,
  MSKsolstae * solutionsta,
  MSKstakeye * skc,
  MSKstakeye * skx,
  MSKstakeye * skn,
  MSKrealt * xc,
  MSKrealt * xx,
  MSKrealt * y,
  MSKrealt * slc,
  MSKrealt * suc,
  MSKrealt * slx,
  MSKrealt * sux,
  MSKrealt * snx,
  MSKrealt * doty)

Obtains the complete solution. See MSK_getsolution for further information.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • problemsta (MSKprostae by reference) – Problem status. (output)

  • solutionsta (MSKsolstae by reference) – Solution status. (output)

  • skc (MSKstakeye*) – Status keys for the constraints. (output)

  • skx (MSKstakeye*) – Status keys for the variables. (output)

  • skn (MSKstakeye*) – Status keys for the conic constraints. (output)

  • xc (MSKrealt*) – Primal constraint solution. (output)

  • xx (MSKrealt*) – Primal variable solution. (output)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (output)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (output)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (output)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (output)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (output)

  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (output)

  • doty (MSKrealt*) – Dual variables corresponding to affine conic constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - primal, Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • solitem (MSKsoliteme) – Which part of the solution is required. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • values (MSKrealt*) – The values in the required sequence are stored sequentially in values. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal, Solution - dual, Solution information

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

Get a single symmetric matrix from the matrix store.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • idx (MSKint64t) – Index of the matrix to retrieve. (input)

  • maxlen (MSKint64t) – Length of the output arrays subi, subj and valij. (input)

  • subi (MSKint32t*) – Row subscripts of the matrix non-zero elements. (output)

  • subj (MSKint32t*) – Column subscripts of the matrix non-zero elements. (output)

  • valij (MSKrealt*) – Coefficients of the matrix non-zero elements. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Inspecting the task

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

Obtains the value of a string parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • param (MSKsparame) – Which parameter. (input)

  • maxlen (MSKint32t) – Length of the parvalue buffer. (input)

  • len (MSKint32t by reference) – The length of the parameter value. (output)

  • parvalue (char*) – Parameter value. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Parameters

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

Obtains the value of a string parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • param (MSKsparame) – Which parameter. (input)

  • numaddchr (MSKint32t) – Number of additional characters for which room is left in value. (input)

  • value (char* by reference) – Parameter value. MOSEK will allocate this char buffer of size equal to the actual length of the string parameter plus numaddchr. This memory must be freed by MSK_freetask. (input/output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

Obtains the length of a string parameter.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Names, Parameters

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index. (input)

  • sizevalue (MSKint32t) – The length of the buffer pointed to by the value argument. (input)

  • name (char*) – Name of the \(i\)th symbolic constant. (output)

  • value (MSKint32t by reference) – The corresponding value. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • num (MSKint32t by reference) – Number of symbolic constants defined by MOSEK. (output)

  • maxlen (size_t by reference) – Maximum length of the name of any symbolic constants. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

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

Problem data - semidefinite, Inspecting the task

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

Obtains the name assigned to the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • sizetaskname (MSKint32t) – Length of the taskname buffer. (input)

  • taskname (char*) – Returns the task name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Inspecting the task

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

Obtains the length the task name.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Names, Inspecting the task

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

Obtains bound information for one variable.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - variables

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

Obtains bounds information for a slice of the variables.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • bk (MSKboundkeye*) – Bound keys. (output)

  • bl (MSKrealt*) – Values for lower bounds. (output)

  • bu (MSKrealt*) – Values for upper bounds. (output)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - variables

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

Obtains the name of a variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of a variable. (input)

  • sizename (MSKint32t) – The length of the buffer pointed to by the name argument. (input)

  • name (char*) – Returns the required name. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - linear part, Problem data - variables, Inspecting the task

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • somename (char*) – The name which should be checked. (input)

  • asgn (MSKint32t by reference) – Is non-zero if the name somename is assigned to a variable. (output)

  • index (MSKint32t by reference) – If the name somename is assigned to a variable, then index is the index of the variable. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - linear part, Problem data - variables, Inspecting the task

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

Obtains the length of the name of a variable.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - linear part, Problem data - variables, Inspecting the task

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

Gets the variable type of one variable.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - variables

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of variables for which the variable type should be obtained. (input)

  • subj (MSKint32t*) – A list of variable indexes. (input)

  • vartype (MSKvariabletypee*) – The variables types corresponding to the variables specified by subj. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Problem data - variables

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

Obtains MOSEK version information.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Versions

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • xc (MSKrealt*) – Primal constraint solution. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • xc (MSKrealt*) – Primal constraint solution. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • xx (MSKrealt*) – Primal variable solution. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • xx (MSKrealt*) – Primal variable solution. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

MSK_iinfitemtostr
MSKrescodee (MSKAPI MSK_iinfitemtostr) (
  MSKiinfiteme item,
  char * str)

Obtains an identifier string corresponding to a information item.

Parameters
  • item (MSKiinfiteme) – Information item. (input)

  • str (char*) – String corresponding to the bound information item item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

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

Prints the infeasibility report to an output stream.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Infeasibility diagnostic

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

Prepare a task for use with the MSK_solvewithbasis function.

This function should be called

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

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

Return

(MSKrescodee) – The function response code.

Groups

Solving systems with basis matrix

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

Input the linear part of an optimization problem.

The non-zeros of \(A\) are inputted column-wise in the format described in Section Column or Row Ordered Sparse Matrix.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumcon (MSKint32t) – Number of preallocated constraints in the optimization task. (input)

  • maxnumvar (MSKint32t) – Number of preallocated variables in the optimization task. (input)

  • numcon (MSKint32t) – Number of constraints. (input)

  • numvar (MSKint32t) – Number of variables. (input)

  • c (MSKrealt*) – Linear terms of the objective as a dense vector. The length is the number of variables. (input)

  • cfix (MSKrealt) – Fixed term in the objective. (input)

  • aptrb (MSKint32t*) – Row or column start pointers. (input)

  • aptre (MSKint32t*) – Row or column end pointers. (input)

  • asub (MSKint32t*) – Coefficient subscripts. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

  • bkc (MSKboundkeye*) – Bound keys for the constraints. (input)

  • blc (MSKrealt*) – Lower bounds for the constraints. (input)

  • buc (MSKrealt*) – Upper bounds for the constraints. (input)

  • bkx (MSKboundkeye*) – Bound keys for the variables. (input)

  • blx (MSKrealt*) – Lower bounds for the variables. (input)

  • bux (MSKrealt*) – Upper bounds for the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - bounds, Problem data - constraints

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

Input the linear part of an optimization problem.

The non-zeros of \(A\) are inputted column-wise in the format described in Section Column or Row Ordered Sparse Matrix.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumcon (MSKint32t) – Number of preallocated constraints in the optimization task. (input)

  • maxnumvar (MSKint32t) – Number of preallocated variables in the optimization task. (input)

  • numcon (MSKint32t) – Number of constraints. (input)

  • numvar (MSKint32t) – Number of variables. (input)

  • c (MSKrealt*) – Linear terms of the objective as a dense vector. The length is the number of variables. (input)

  • cfix (MSKrealt) – Fixed term in the objective. (input)

  • aptrb (MSKint64t*) – Row or column start pointers. (input)

  • aptre (MSKint64t*) – Row or column end pointers. (input)

  • asub (MSKint32t*) – Coefficient subscripts. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

  • bkc (MSKboundkeye*) – Bound keys for the constraints. (input)

  • blc (MSKrealt*) – Lower bounds for the constraints. (input)

  • buc (MSKrealt*) – Upper bounds for the constraints. (input)

  • bkx (MSKboundkeye*) – Bound keys for the variables. (input)

  • blx (MSKrealt*) – Lower bounds for the variables. (input)

  • bux (MSKrealt*) – Upper bounds for the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - bounds, Problem data - constraints

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • whichparam (MSKiparame) – Which parameter. (input)

  • whichvalue (MSKint32t) – Which value. (input)

  • symbolicname (char*) – The symbolic name corresponding to whichvalue. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters, Names

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

Checks whether parname is a valid double parameter name.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • parname (char*) – Parameter name. (input)

  • param (MSKdparame by reference) – Returns the parameter corresponding to the name, if one exists. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters, Names

MSK_isinfinity
MSKbooleant (MSKAPI MSK_isinfinity) (
  MSKrealt value)

Return true if value is considered infinity by MOSEK.

Parameters

value (MSKrealt) – The value to be checked (input)

Return

(MSKbooleant) – True if the value represents infinity.

MSK_isintparname
MSKrescodee (MSKAPI MSK_isintparname) (
  MSKtask_t task,
  const char * parname,
  MSKiparame * param)

Checks whether parname is a valid integer parameter name.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • parname (char*) – Parameter name. (input)

  • param (MSKiparame by reference) – Returns the parameter corresponding to the name, if one exists. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters, Names

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

Checks whether parname is a valid string parameter name.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • parname (char*) – Parameter name. (input)

  • param (MSKsparame by reference) – Returns the parameter corresponding to the name, if one exists. (output)

Return

(MSKrescodee) – The function response code.

Groups

Parameters, Names

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

License system

MSK_liinfitemtostr
MSKrescodee (MSKAPI MSK_liinfitemtostr) (
  MSKliinfiteme item,
  char * str)

Obtains an identifier string corresponding to a information item.

Parameters
  • item (MSKliinfiteme) – Information item. (input)

  • str (char*) – String corresponding to the bound information item item. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_linkfiletoenvstream
MSKrescodee (MSKAPI MSK_linkfiletoenvstream) (
  MSKenv_t env,
  MSKstreamtypee whichstream,
  const char * filename,
  MSKint32t append)

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • whichstream (MSKstreamtypee) – Index of the stream. (input)

  • filename (char*) – A valid file name. (input)

  • append (MSKint32t) – If this argument is 0 the file will be overwritten, otherwise it will be appended to. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichstream (MSKstreamtypee) – Index of the stream. (input)

  • filename (char*) – A valid file name. (input)

  • append (MSKint32t) – If this argument is 0 the output file will be overwritten, otherwise it will be appended to. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging

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

Connects a user-defined function to a stream.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • whichstream (MSKstreamtypee) – Index of the stream. (input)

  • handle (MSKuserhandle_t) – A user-defined handle which is passed to the user-defined function func. (input)

  • func (MSKstreamfunc) – All output to the stream whichstream is passed to func. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging, Callback

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

Connects a user-defined function to a task stream.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichstream (MSKstreamtypee) – Index of the stream. (input)

  • handle (MSKuserhandle_t) – A user-defined handle which is passed to the user-defined function func. (input)

  • func (MSKstreamfunc) – All output to the stream whichstream is passed to func. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging, Callback

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

Creates a new optimization task.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

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

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

Parameters
  • env (MSKenv_t by reference) – The MOSEK environment. (output)

  • dbgfile (char*) – A user-defined memory debug file. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

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

Creates a new task.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • maxnumcon (MSKint32t) – An optional estimate on the maximum number of constraints in the task. Can be \(0\) if no such estimate is known. (input)

  • maxnumvar (MSKint32t) – An optional estimate on the maximum number of variables in the task. Can be \(0\) if no such estimate is known. (input)

  • task (MSKtask_t by reference) – An optimization task. (output)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

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

Prints a short summary of a specified solution.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Logging, Solution information

MSK_optimize
MSKrescodee (MSKAPI MSK_optimize) (
  MSKtask_t task)

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

Response codes come in three categories:

  • Errors: Indicate that an error has occurred during the optimization, e.g the optimizer has run out of memory (MSK_RES_ERR_SPACE).

  • Warnings: Less fatal than errors. E.g MSK_RES_WRN_LARGE_CJ indicating possibly problematic problem data.

  • Termination codes: Relaying information about the conditions under which the optimizer terminated. E.g MSK_RES_TRM_MAX_ITERATIONS indicates that the optimizer finished because it reached the maximum number of iterations specified by the user.

Parameters

task (MSKtask_t) – An optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Optimization

MSK_optimizebatch
MSKrescodee (MSKAPI MSK_optimizebatch) (
  MSKenv_t env,
  MSKbooleant israce,
  MSKrealt maxtime,
  MSKint32t numthreads,
  MSKint64t numtask,
  const MSKtask_t * task,
  MSKrescodee * trmcode,
  MSKrescodee * rcode)

Optimize a number of tasks in parallel using a specified number of threads. All callbacks and log output streams are disabled.

Assuming that each task takes about same time and there many more tasks than number of threads then a linear speedup can be achieved, also known as strong scaling. A typical application of this method is to solve many small tasks of similar type; in this case it is recommended that each of them is allocated a single thread by setting MSK_IPAR_NUM_THREADS to \(1\).

If the parameters israce or maxtime are used, then the result may not be deterministic, in the sense that the tasks which complete first may vary between runs.

The remaining behavior, including termination and response codes returned for each task, are the same as if each task was optimized separately.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • israce (MSKbooleant) – If nonzero, then the function is terminated after the first task has been completed. (input)

  • maxtime (MSKrealt) – Time limit for the function: if nonnegative, then the function is terminated after maxtime (seconds) has expired. (input)

  • numthreads (MSKint32t) – Number of threads to be employed. (input)

  • numtask (MSKint64t) – Number of tasks to optimize. Length of the task array. (input)

  • task (MSKtask_t*) – An array of tasks to optimize in parallel. (input)

  • trmcode (MSKrescodee*) – The termination code for each task. (output)

  • rcode (MSKrescodee*) – The response code for each task. (output)

Return

(MSKrescodee)

Groups

Optimization

MSK_optimizermt
MSKrescodee (MSKAPI MSK_optimizermt) (
  MSKtask_t task,
  const char * address,
  const char * accesstoken,
  MSKrescodee * trmcode)

Offload the optimization task to an instance of OptServer specified by addr, which should be a valid URL, for example http://server:port or https://server:port. The call will block until a result is available or the connection closes.

If the server requires authentication, the authentication token can be passed in the accesstoken argument.

If the server requires encryption, the keys can be passed using one of the solver parameters MSK_SPAR_REMOTE_TLS_CERT or MSK_SPAR_REMOTE_TLS_CERT_PATH.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • address (char*) – Address of the OptServer. (input)

  • accesstoken (char*) – Access token. (input)

  • trmcode (MSKrescodee by reference) – Is either MSK_RES_OK or a termination response code. (output)

Return

(MSKrescodee) – The function response code.

Groups

Remote optimization

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

Prints a short summary with optimizer statistics from last optimization.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Logging

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

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

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

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Optimization

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • uplo (MSKuploe) – Indicates whether the upper or lower triangular part of the matrix is stored. (input)

  • n (MSKint32t) – Dimension of the symmetric matrix. (input)

  • a (MSKrealt*) – A symmetric matrix stored in column-major order. Only the lower or the upper triangular part is used, accordingly with the uplo parameter. It will contain the result on exit. (input/output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

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

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • wlc (MSKrealt*) – \((w_l^c)_i\) is the weight associated with relaxing the lower bound on constraint \(i\). If the weight is negative, then the lower bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)

  • wuc (MSKrealt*) – \((w_u^c)_i\) is the weight associated with relaxing the upper bound on constraint \(i\). If the weight is negative, then the upper bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)

  • wlx (MSKrealt*) – \((w_l^x)_j\) is the weight associated with relaxing the lower bound on variable \(j\). If the weight is negative, then the lower bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)

  • wux (MSKrealt*) – \((w_l^x)_i\) is the weight associated with relaxing the upper bound on variable \(j\). If the weight is negative, then the upper bound is not relaxed. Moreover, if the argument is NULL, then all the weights are assumed to be \(1\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Infeasibility diagnostic

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

Calculates sensitivity information for bounds on variables and constraints. For details on sensitivity analysis, the definitions of shadow price and linearity interval and an example see Section 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_printparam
MSKrescodee (MSKAPI MSK_printparam) (
  MSKtask_t task)

Prints the current parameter settings to the message stream.

Parameters

task (MSKtask_t) – An optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Logging

MSK_probtypetostr
MSKrescodee (MSKAPI MSK_probtypetostr) (
  MSKtask_t task,
  MSKproblemtypee probtype,
  char * str)

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • probtype (MSKproblemtypee) – Problem type. (input)

  • str (char*) – String corresponding to the problem type key probtype. (output)

Return

(MSKrescodee) – The function response code.

Groups

Inspecting the task, Names

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • problemsta (MSKprostae) – Problem status. (input)

  • str (char*) – String corresponding to the status key prosta. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Names

MSK_putacc
MSKrescodee (MSKAPI MSK_putacc) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint64t domidx,
  MSKint64t numafeidx,
  const MSKint64t * afeidxlist,
  const MSKrealt * b)

Puts an affine conic constraint. This method overwrites an existing affine conic constraint number accidx with new data specified in the same format as in MSK_appendacc.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Affine conic constraint index. (input)

  • domidx (MSKint64t) – Domain index. (input)

  • numafeidx (MSKint64t) – Number of affine expressions in the affine expression list (must equal the dimension of the domain). (input)

  • afeidxlist (MSKint64t*) – List of affine expression indexes. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_putaccb
MSKrescodee (MSKAPI MSK_putaccb) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint64t lengthb,
  const MSKrealt * b)

Updates an existing affine conic constraint number accidx by putting a new vector \(b\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Affine conic constraint index. (input)

  • lengthb (MSKint64t) – Length of the vector (must equal the dimension of this constraint). (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_putaccbj
MSKrescodee (MSKAPI MSK_putaccbj) (
  MSKtask_t task,
  MSKint64t accidx,
  MSKint64t j,
  MSKrealt bj)

Sets one value \(b[j]\) in the \(b\) vector for the affine conic constraint number accidx.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Affine conic constraint index. (input)

  • j (MSKint64t) – The index of an element in b to change. (input)

  • bj (MSKrealt) – The new value of \(b[j]\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_putaccdoty
MSKrescodee (MSKAPI MSK_putaccdoty) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKint64t accidx,
  MSKrealt * doty)

Puts the \(\dot{y}\) vector for a solution (the dual values of an affine conic constraint).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • accidx (MSKint64t) – The index of the affine conic constraint. (input)

  • doty (MSKrealt*) – The dual values for this affine conic constraint. The array should have length equal to the dimension of the constraint. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual, Problem data - affine conic constraints

MSK_putacclist
MSKrescodee (MSKAPI MSK_putacclist) (
  MSKtask_t task,
  MSKint64t numaccs,
  const MSKint64t * accidxs,
  const MSKint64t * domidxs,
  MSKint64t numafeidx,
  const MSKint64t * afeidxlist,
  const MSKrealt * b)

Puts affine conic constraints. This method overwrites existing affine conic constraints whose numbers are provided in the list accidxs with new data which is a concatenation of individual constraint descriptions in the same format as in MSK_appendacc (see also MSK_appendaccs).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numaccs (MSKint64t) – The number of affine conic constraints to append. (input)

  • accidxs (MSKint64t*) – Affine conic constraint indices. (input)

  • domidxs (MSKint64t*) – Domain indices. (input)

  • numafeidx (MSKint64t) – Number of affine expressions in the affine expression list (must equal the sum of dimensions of the domains). (input)

  • afeidxlist (MSKint64t*) – List of affine expression indexes. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine conic constraints

MSK_putaccname
MSKrescodee (MSKAPI MSK_putaccname) (
  MSKtask_t task,
  MSKint64t accidx,
  const char * name)

Sets the name of an affine conic constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • accidx (MSKint64t) – Index of the affine conic constraint. (input)

  • name (char*) – The name of the affine conic constraint. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - affine conic constraints

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

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

\[a_{\mathtt{subj}[k],\mathtt{j}} = \mathtt{valj}[k], \quad k=\idxbeg,\ldots,\idxend{\mathtt{nzj}}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of a column in \(A\). (input)

  • nzj (MSKint32t) – Number of non-zeros in column \(j\) of \(A\). (input)

  • subj (MSKint32t*) – Row indexes of non-zero values in column \(j\) of \(A\). (input)

  • valj (MSKrealt*) – New non-zero values of column \(j\) in \(A\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{\mathtt{num}}\\ & a_{\mathtt{asub}[k],\mathtt{sub}[i]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of columns of \(A\) to replace. (input)

  • sub (MSKint32t*) – Indexes of columns that should be replaced, no duplicates. (input)

  • ptrb (MSKint32t*) – Array of pointers to the first element in each column. (input)

  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each column. (input)

  • asub (MSKint32t*) – Row indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{\mathtt{num}}\\ & a_{\mathtt{asub}[k],\mathtt{sub}[i]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of columns of \(A\) to replace. (input)

  • sub (MSKint32t*) – Indexes of columns that should be replaced, no duplicates. (input)

  • ptrb (MSKint64t*) – Array of pointers to the first element in each column. (input)

  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each column. (input)

  • asub (MSKint32t*) – Row indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1\\ & a_{\mathtt{asub}[k],i} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i-\mathtt{first}\idxorg],\ldots,\mathtt{ptre}[i-\mathtt{first}\idxorg]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First column in the slice. (input)

  • last (MSKint32t) – Last column plus one in the slice. (input)

  • ptrb (MSKint32t*) – Array of pointers to the first element in each column. (input)

  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each column. (input)

  • asub (MSKint32t*) – Row indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1\\ & a_{\mathtt{asub}[k],i} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i-\mathtt{first}\idxorg],\ldots,\mathtt{ptre}[i-\mathtt{first}\idxorg]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First column in the slice. (input)

  • last (MSKint32t) – Last column plus one in the slice. (input)

  • ptrb (MSKint64t*) – Array of pointers to the first element in each column. (input)

  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each column. (input)

  • asub (MSKint32t*) – Row indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

MSK_putafebarfblocktriplet
MSKrescodee (MSKAPI MSK_putafebarfblocktriplet) (
  MSKtask_t task,
  MSKint64t numtrip,
  const MSKint64t * afeidx,
  const MSKint32t * barvaridx,
  const MSKint32t * subk,
  const MSKint32t * subl,
  const MSKrealt * valkl)

Inputs the \(\barF\) matrix data in block triplet form.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numtrip (MSKint64t) – Number of elements in the block triplet form. (input)

  • afeidx (MSKint64t*) – Constraint index. (input)

  • barvaridx (MSKint32t*) – Symmetric matrix variable index. (input)

  • subk (MSKint32t*) – Block row index. (input)

  • subl (MSKint32t*) – Block column index. (input)

  • valkl (MSKrealt*) – The numerical value associated with each block triplet. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_putafebarfentry
MSKrescodee (MSKAPI MSK_putafebarfentry) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t barvaridx,
  MSKint64t numterm,
  const MSKint64t * termidx,
  const MSKrealt * termweight)

This function sets one entry \(\barF_{ij}\) where \(i=\mathrm{afeidx}\) is the row index in the store of affine expressions and \(j=\mathrm{barvaridx}\) is the index of a symmetric variable. That is, the expression

\[\langle \barF_{ij}, \barX_j\rangle\]

will be added to the \(i\)-th affine expression.

The matrix \(\barF_{ij}\) is specified as a weighted sum of symmetric matrices from the symmetric matrix storage \(E\), so \(\barF_{ij}\) is a symmetric matrix, precisely:

\[\barF_{\mathrm{afeidx},\mathrm{barvaridx}} = \sum_{k} \mathrm{termweight}[k] \cdot E_{\mathrm{termidx}[k]}.\]

By default all elements in \(\barF\) are 0, so only non-zero elements need be added. Setting the same entry 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)

  • afeidx (MSKint64t) – Row index of \(\barF\). (input)

  • barvaridx (MSKint32t) – Semidefinite variable index. (input)

  • numterm (MSKint64t) – The number of terms in the weighted sum that forms the \(\barF\) entry being specified. (input)

  • termidx (MSKint64t*) – Indices in \(E\) of the matrices appearing in the weighted sum for the \(\barF\) entry being specified. (input)

  • termweight (MSKrealt*) – termweight[k] is the coefficient of the termidx[k]-th element of \(E\) in the weighted sum the \(\barF\) entry being specified. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_putafebarfentrylist
MSKrescodee (MSKAPI MSK_putafebarfentrylist) (
  MSKtask_t task,
  MSKint64t numafeidx,
  const MSKint64t * afeidx,
  const MSKint32t * barvaridx,
  const MSKint64t * numterm,
  const MSKint64t * ptrterm,
  MSKint64t lenterm,
  const MSKint64t * termidx,
  const MSKrealt * termweight)

This function sets a list of entries in \(\barF\). Each entry should be described as in MSK_putafebarfentry and all those descriptions should be combined (for example concatenated) in the input to this method. That means the \(k\)-th entry set will have row index afeidx[k], symmetric variable index barvaridx[k] and the description of this term consists of indices in \(E\) and weights appearing in positions

\[\mathrm{ptrterm}[k],\ldots,\mathrm{ptrterm}[k] + (\mathrm{lenterm}[k] - 1)\]

in the corresponding arrays termidx and termweight. See MSK_putafebarfentry for details.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numafeidx (MSKint64t) – Number of elements in the list. (input)

  • afeidx (MSKint64t*) – Row indexes of \(\barF\). (input)

  • barvaridx (MSKint32t*) – Semidefinite variable indexes. (input)

  • numterm (MSKint64t*) – The number of terms in the weighted sums that form each entry. (input)

  • ptrterm (MSKint64t*) – The pointer to the beginning of the description of each entry. (input)

  • lenterm (MSKint64t) – Length of the index and weight lists. (input)

  • termidx (MSKint64t*) – Concatenated lists of indices in \(E\) of the matrices appearing in the weighted sums for the \(\barF\) being specified. (input)

  • termweight (MSKrealt*) – Concatenated lists of weights appearing in the weighted sums forming the \(\barF\) elements being specified. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_putafebarfrow
MSKrescodee (MSKAPI MSK_putafebarfrow) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t numentr,
  const MSKint32t * barvaridx,
  const MSKint64t * numterm,
  const MSKint64t * ptrterm,
  MSKint64t lenterm,
  const MSKint64t * termidx,
  const MSKrealt * termweight)

This function inputs one row in \(\barF\). It first clears the row, i.e. sets \(\barF_{\mathrm{afeidx},*}=0\) and then sets the new entries. Each entry should be described as in MSK_putafebarfentry and all those descriptions should be combined (for example concatenated) in the input to this method. That means the \(k\)-th entry set will have row index afeidx, symmetric variable index barvaridx[k] and the description of this term consists of indices in \(E\) and weights appearing in positions

\[\mathrm{ptrterm}[k],\ldots,\mathrm{ptrterm}[k] + (\mathrm{numterm}[k] - 1)\]

in the corresponding arrays termidx and termweight. See MSK_putafebarfentry for details.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Row index of \(\barF\). (input)

  • numentr (MSKint32t) – Number of entries in the row of \(\barF\); length of barvaridx, numterm, ptrterm. (input)

  • barvaridx (MSKint32t*) – Semidefinite variable indexes. (input)

  • numterm (MSKint64t*) – The number of terms in the weighted sums that form each entry. (input)

  • ptrterm (MSKint64t*) – The pointer to the beginning of the description of each entry. (input)

  • lenterm (MSKint64t) – Length of the index and weight lists. (input)

  • termidx (MSKint64t*) – Concatenated lists of indices in \(E\) of the matrices appearing in the weighted sums for the \(\barF\) entries in the row. (input)

  • termweight (MSKrealt*) – Concatenated lists of weights appearing in the weighted sums forming the \(\barF\) entries in the row. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions, Problem data - semidefinite

MSK_putafefcol
MSKrescodee (MSKAPI MSK_putafefcol) (
  MSKtask_t task,
  MSKint32t varidx,
  MSKint64t numnz,
  const MSKint64t * afeidx,
  const MSKrealt * val)

Change one column of the matrix \(F\) of affine expressions. Resets all the elements in column varidx to zero and then sets

\[F_{\mathtt{afeidx}[k],\mathtt{varidx}} = \mathtt{val}[k], \quad k=\idxbeg,\ldots,\idxend{\mathtt{numnz}}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • varidx (MSKint32t) – Index of a column in \(F\). (input)

  • numnz (MSKint64t) – Number of non-zeros in the column of \(F\). (input)

  • afeidx (MSKint64t*) – Row indexes of non-zero values in the column of \(F\). (input)

  • val (MSKrealt*) – New non-zero values in the column of \(F\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_putafefentry
MSKrescodee (MSKAPI MSK_putafefentry) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t varidx,
  MSKrealt value)

Replaces one entry in the affine expression store \(F\), that is it sets:

\[F_{\mathrm{afeidx}, \mathrm{varidx}} = \mathrm{value}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Row index in \(F\). (input)

  • varidx (MSKint32t) – Column index in \(F\). (input)

  • value (MSKrealt) – Value of \(F_{\mathrm{afeidx},\mathrm{varidx}}\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_putafefentrylist
MSKrescodee (MSKAPI MSK_putafefentrylist) (
  MSKtask_t task,
  MSKint64t numentr,
  const MSKint64t * afeidx,
  const MSKint32t * varidx,
  const MSKrealt * val)

Replaces a number of entries in the affine expression store \(F\), that is it sets:

\[F_{\mathrm{afeidxs}[k], \mathrm{varidx}[k]} = \mathrm{val}[k]\]

for all \(k\).

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numentr (MSKint64t) – Number of entries. (input)

  • afeidx (MSKint64t*) – Row indices in \(F\). (input)

  • varidx (MSKint32t*) – Column indices in \(F\). (input)

  • val (MSKrealt*) – Values of the entries in \(F\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_putafefrow
MSKrescodee (MSKAPI MSK_putafefrow) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKint32t numnz,
  const MSKint32t * varidx,
  const MSKrealt * val)

Change one row of the matrix \(F\) of affine expressions. Resets all the elements in row afeidx to zero and then sets

\[F_{\mathtt{afeidx},\mathtt{varidx}[k]} = \mathtt{val}[k], \quad k=\idxbeg,\ldots,\idxend{\mathtt{numnz}}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Index of a row in \(F\). (input)

  • numnz (MSKint32t) – Number of non-zeros in the row of \(F\). (input)

  • varidx (MSKint32t*) – Column indexes of non-zero values in the row of \(F\). (input)

  • val (MSKrealt*) – New non-zero values in the row of \(F\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_putafefrowlist
MSKrescodee (MSKAPI MSK_putafefrowlist) (
  MSKtask_t task,
  MSKint64t numafeidx,
  const MSKint64t * afeidx,
  const MSKint32t * numnzrow,
  const MSKint64t * ptrrow,
  MSKint64t lenidxval,
  const MSKint32t * varidx,
  const MSKrealt * val)

Clears and then changes a number of rows of the matrix \(F\) of affine expressions. The \(k\)-th of the rows to be changed has index \(i = \mathrm{afeidx}[k]\), contains \(\mathrm{numnzrow}[k]\) nonzeros and its description as in MSK_putafefrow starts in position \(\mathrm{ptrrow}[k]\) of the arrays varidx and val. Formally, the row with index \(i\) is cleared and then set as:

\[F_{i,\mathrm{varidx}[\mathrm{ptrrow}[k]+j]} = \mathrm{val}[\mathrm{ptrrow}[k] + j], \quad j=0,\ldots,\mathrm{numnzrow}[k]-1.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numafeidx (MSKint64t) – The number of rows of \(F\) to modify; length of afeidx. (input)

  • afeidx (MSKint64t*) – Indices of rows in \(F\). (input)

  • numnzrow (MSKint32t*) – Number of non-zeros in each of the modified rows of \(F\). (input)

  • ptrrow (MSKint64t*) – Pointer to the first nonzero in each row of \(F\). (input)

  • lenidxval (MSKint64t) – Length of arrays varidx and val with indexes and values of nonzeros in the modified rows. (input)

  • varidx (MSKint32t*) – Column indexes of non-zero values. (input)

  • val (MSKrealt*) – New non-zero values in the rows of \(F\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_putafeg
MSKrescodee (MSKAPI MSK_putafeg) (
  MSKtask_t task,
  MSKint64t afeidx,
  MSKrealt g)

Change one element of the vector \(g\) in affine expressions i.e.

\[g_{\mathtt{afeidx}} = \mathtt{gi}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • afeidx (MSKint64t) – Index of an entry in \(g\). (input)

  • g (MSKrealt) – New value for \(g_{\mathrm{afeidx}}\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_putafeglist
MSKrescodee (MSKAPI MSK_putafeglist) (
  MSKtask_t task,
  MSKint64t numafeidx,
  const MSKint64t * afeidx,
  const MSKrealt * g)

Changes a list of elements of the vector \(g\) in affine expressions i.e. for all \(k\) it sets

\[g_{\mathrm{afeidx}[k]} = \mathrm{glist}[k].\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numafeidx (MSKint64t) – Number of entries to change; length of afeidxlist. (input)

  • afeidx (MSKint64t*) – Indices of entries in \(g\). (input)

  • g (MSKrealt*) – New values for \(g\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

MSK_putafegslice
MSKrescodee (MSKAPI MSK_putafegslice) (
  MSKtask_t task,
  MSKint64t first,
  MSKint64t last,
  const MSKrealt * slice)

Modifies a slice in the vector \(g\) of constant terms in affine expressions using the principle

\[g_{\mathtt{j}} = \mathtt{slice[j-first\idxorg]}, \quad j=\mathrm{first},..,\mathrm{last}-1\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint64t) – First index in the sequence. (input)

  • last (MSKint64t) – Last index plus 1 in the sequence. (input)

  • slice (MSKrealt*) – The slice of \(g\) as a dense vector. The length is last-first. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - affine expressions

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

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

\[a_{i,j} = \mathtt{aij}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Constraint (row) index. (input)

  • j (MSKint32t) – Variable (column) index. (input)

  • aij (MSKrealt) – New coefficient for \(a_{i,j}\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

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

Duplicates are not allowed.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of coefficients that should be changed. (input)

  • subi (MSKint32t*) – Constraint (row) indices. (input)

  • subj (MSKint32t*) – Variable (column) indices. (input)

  • valij (MSKrealt*) – New coefficient values for \(a_{i,j}\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

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

Duplicates are not allowed.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t) – Number of coefficients that should be changed. (input)

  • subi (MSKint32t*) – Constraint (row) indices. (input)

  • subj (MSKint32t*) – Variable (column) indices. (input)

  • valij (MSKrealt*) – New coefficient values for \(a_{i,j}\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[a_{\mathtt{i},\mathtt{subi}[k]} = \mathtt{vali}[k], \quad k=\idxbeg,\ldots,\idxend{\mathtt{nzi}}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of a row in \(A\). (input)

  • nzi (MSKint32t) – Number of non-zeros in row \(i\) of \(A\). (input)

  • subi (MSKint32t*) – Column indexes of non-zero values in row \(i\) of \(A\). (input)

  • vali (MSKrealt*) – New non-zero values of row \(i\) in \(A\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{\mathtt{num}} \\ & a_{\mathtt{sub}[i],\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of rows of \(A\) to replace. (input)

  • sub (MSKint32t*) – Indexes of rows that should be replaced, no duplicates. (input)

  • ptrb (MSKint32t*) – Array of pointers to the first element in each row. (input)

  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each row. (input)

  • asub (MSKint32t*) – Column indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\idxbeg,\ldots,\idxend{\mathtt{num}} \\ & a_{\mathtt{sub}[i],\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i],\ldots,\mathtt{ptre}[i]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of rows of \(A\) to replace. (input)

  • sub (MSKint32t*) – Indexes of rows that should be replaced, no duplicates. (input)

  • ptrb (MSKint64t*) – Array of pointers to the first element in each row. (input)

  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each row. (input)

  • asub (MSKint32t*) – Column indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1 \\ & a_{i,\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i-\mathtt{first}\idxorg],\ldots,\mathtt{ptre}[i-\mathtt{first}\idxorg]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First row in the slice. (input)

  • last (MSKint32t) – Last row plus one in the slice. (input)

  • ptrb (MSKint32t*) – Array of pointers to the first element in each row. (input)

  • ptre (MSKint32t*) – Array of pointers to the last element plus one in each row. (input)

  • asub (MSKint32t*) – Column indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

\[\begin{split}\begin{array}{rl} \mathtt{for} & i=\mathtt{first},\ldots,\mathtt{last}-1 \\ & a_{i,\mathtt{asub}[k]} = \mathtt{aval}[k],\quad k=\mathtt{ptrb}[i-\mathtt{first}\idxorg],\ldots,\mathtt{ptre}[i-\mathtt{first}\idxorg]-1. \end{array}\end{split}\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First row in the slice. (input)

  • last (MSKint32t) – Last row plus one in the slice. (input)

  • ptrb (MSKint64t*) – Array of pointers to the first element in each row. (input)

  • ptre (MSKint64t*) – Array of pointers to the last element plus one in each row. (input)

  • asub (MSKint32t*) – Column indexes of new elements. (input)

  • aval (MSKrealt*) – Coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

MSK_putatruncatetol
MSKrescodee (MSKAPI MSK_putatruncatetol) (
  MSKtask_t task,
  MSKrealt tolzero)

Truncates (sets to zero) all elements in \(A\) that satisfy

\[|a_{i,j}| \leq \mathtt{tolzero}.\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • tolzero (MSKrealt) – Truncation tolerance. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t) – Number of elements in the block triplet form. (input)

  • subi (MSKint32t*) – Constraint index. (input)

  • subj (MSKint32t*) – Symmetric matrix variable index. (input)

  • subk (MSKint32t*) – Block row index. (input)

  • subl (MSKint32t*) – Block column index. (input)

  • valijkl (MSKrealt*) – The numerical value associated with each block triplet. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Row index of \(\barA\). (input)

  • j (MSKint32t) – Column index of \(\barA\). (input)

  • num (MSKint64t) – The number of terms in the weighted sum that forms \(\barA_{ij}\). (input)

  • sub (MSKint64t*) – Indices in \(E\) of the matrices appearing in the weighted sum for \(\barA_{ij}\). (input)

  • weights (MSKrealt*) – weights[k] is the coefficient of the sub[k]-th element of \(E\) in the weighted sum forming \(\barA_{ij}\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

MSK_putbaraijlist
MSKrescodee (MSKAPI MSK_putbaraijlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subi,
  const MSKint32t * subj,
  const MSKint64t * alphaptrb,
  const MSKint64t * alphaptre,
  const MSKint64t * matidx,
  const MSKrealt * weights)

This function sets a list of elements 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)

  • num (MSKint32t) – Number of \(\barA\) entries to add. (input)

  • subi (MSKint32t*) – Row index of \(\barA\). (input)

  • subj (MSKint32t*) – Column index of \(\barA\). (input)

  • alphaptrb (MSKint64t*) – Start entries for terms in the weighted sum that forms \(\barA_{ij}\). (input)

  • alphaptre (MSKint64t*) – End entries for terms in the weighted sum that forms \(\barA_{ij}\). (input)

  • matidx (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

Problem data - semidefinite

MSK_putbararowlist
MSKrescodee (MSKAPI MSK_putbararowlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subi,
  const MSKint64t * ptrb,
  const MSKint64t * ptre,
  const MSKint32t * subj,
  const MSKint64t * nummat,
  const MSKint64t * matidx,
  const MSKrealt * weights)

This function replaces a list of rows in the \(\barA\) matrix.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of \(\barA\) entries to add. (input)

  • subi (MSKint32t*) – Row indexes of \(\barA\). (input)

  • ptrb (MSKint64t*) – Start of rows in \(\barA\). (input)

  • ptre (MSKint64t*) – End of rows in \(\barA\). (input)

  • subj (MSKint32t*) – Column index of \(\barA\). (input)

  • nummat (MSKint64t*) – Number of entries in weighted sum of matrixes. (input)

  • matidx (MSKint64t*) – Matrix indexes for weighted sum of matrixes. (input)

  • weights (MSKrealt*) – Weights for weighted sum of matrixes. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint64t) – Number of elements in the block triplet form. (input)

  • subj (MSKint32t*) – Symmetric matrix variable index. (input)

  • subk (MSKint32t*) – Block row index. (input)

  • subl (MSKint32t*) – Block column index. (input)

  • valjkl (MSKrealt*) – The numerical value associated with each block triplet. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the element in \(\barC\) that should be changed. (input)

  • num (MSKint64t) – The number of elements in the weighted sum that forms \(\barC_j\). (input)

  • sub (MSKint64t*) – Indices in \(E\) of matrices appearing in the weighted sum for \(\barC_j\) (input)

  • weights (MSKrealt*) – weights[k] is the coefficient of the sub[k]-th element of \(E\) in the weighted sum forming \(\barC_j\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite, Problem data - objective

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

Sets the dual solution for a semidefinite variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • j (MSKint32t) – Index of the semidefinite variable. (input)

  • barsj (MSKrealt*) – Value of \(\barS_j\). Format as in MSK_getbarsj. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - semidefinite

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

Sets the name of a semidefinite variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the variable. (input)

  • name (char*) – The variable name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - semidefinite

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

Sets the primal solution for a semidefinite variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • j (MSKint32t) – Index of the semidefinite variable. (input)

  • barxj (MSKrealt*) – Value of \(\barX_j\). Format as in MSK_getbarxj. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - semidefinite

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

Sets a user-defined progress callback function of type MSKcallbackfunc. The callback function is called frequently during the optimization process. See Section 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 NULL, then a previously defined callback function is removed. The progress function has the type MSKcallbackfunc. (input)

  • handle (MSKuserhandle_t) – A pointer to a user-defined data structure. Whenever the function func is called, then handle is passed to the function. (input)

Return

(MSKrescodee) – The function response code.

Groups

Callback

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • cfix (MSKrealt) – Fixed term in the objective. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - objective

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the variable for which \(c\) should be changed. (input)

  • cj (MSKrealt) – New value of \(c_j\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - objective

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

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

\[c_{\mathtt{subj[t]}} = \mathtt{val[t]}, \quad t=\idxbeg,\ldots,\idxend{\mathtt{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

Problem data - linear part, Problem data - variables, Problem data - objective

MSK_putconbound
MSKrescodee (MSKAPI MSK_putconbound) (
  MSKtask_t task,
  MSKint32t i,
  MSKboundkeye bkc,
  MSKrealt blc,
  MSKrealt buc)

Changes the bounds for one constraint.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the constraint. (input)

  • bkc (MSKboundkeye) – New bound key. (input)

  • blc (MSKrealt) – New lower bound. (input)

  • buc (MSKrealt) – New upper bound. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - constraints, Problem data - bounds

MSK_putconboundlist
MSKrescodee (MSKAPI MSK_putconboundlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKboundkeye * bkc,
  const MSKrealt * blc,
  const MSKrealt * buc)

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of bounds that should be changed. (input)

  • sub (MSKint32t*) – List of constraint indexes. (input)

  • bkc (MSKboundkeye*) – Bound keys for the constraints. (input)

  • blc (MSKrealt*) – Lower bounds for the constraints. (input)

  • buc (MSKrealt*) – Upper bounds for the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - constraints, Problem data - bounds

MSK_putconboundlistconst
MSKrescodee (MSKAPI MSK_putconboundlistconst) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  MSKboundkeye bkc,
  MSKrealt blc,
  MSKrealt buc)

Changes the bounds for one or more constraints. Data checks are performed as in MSK_putconbound.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of bounds that should be changed. (input)

  • sub (MSKint32t*) – List of constraint indexes. (input)

  • bkc (MSKboundkeye) – New bound key for all constraints in the list. (input)

  • blc (MSKrealt) – New lower bound for all constraints in the list. (input)

  • buc (MSKrealt) – New upper bound for all constraints in the list. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - constraints, Problem data - bounds

MSK_putconboundslice
MSKrescodee (MSKAPI MSK_putconboundslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKboundkeye * bkc,
  const MSKrealt * blc,
  const MSKrealt * buc)

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • bkc (MSKboundkeye*) – Bound keys for the constraints. (input)

  • blc (MSKrealt*) – Lower bounds for the constraints. (input)

  • buc (MSKrealt*) – Upper bounds for the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - constraints, Problem data - bounds

MSK_putconboundsliceconst
MSKrescodee (MSKAPI MSK_putconboundsliceconst) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKboundkeye bkc,
  MSKrealt blc,
  MSKrealt buc)

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • bkc (MSKboundkeye) – New bound key for all constraints in the slice. (input)

  • blc (MSKrealt) – New lower bound for all constraints in the slice. (input)

  • buc (MSKrealt) – New upper bound for all constraints in the slice. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - constraints, Problem data - bounds

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • k (MSKint32t) – Index of the cone. (input)

  • ct (MSKconetypee) – Specifies the type of the cone. (input)

  • conepar (MSKrealt) – For the power cone it denotes the exponent alpha. For other cone types it is unused and can be set to 0. (input)

  • nummem (MSKint32t) – Number of member variables in the cone. (input)

  • submem (MSKint32t*) – Variable subscripts of the members in the cone. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - cones (deprecated)

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

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the cone. (input)

  • name (char*) – The name of the cone. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - cones (deprecated)

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

Sets the name of a constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the constraint. (input)

  • name (char*) – The name of the constraint. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - constraints, Problem data - linear part

MSK_putconsolutioni
MSKrescodee (MSKAPI MSK_putconsolutioni) (
  MSKtask_t task,
  MSKint32t i,
  MSKsoltypee whichsol,
  MSKstakeye sk,
  MSKrealt x,
  MSKrealt sl,
  MSKrealt su)

Sets the primal and dual solution information for a single constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the constraint. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • sk (MSKstakeye) – Status key of the constraint. (input)

  • x (MSKrealt) – Primal solution value of the constraint. (input)

  • sl (MSKrealt) – Solution value of the dual variable associated with the lower bound. (input)

  • su (MSKrealt) – Solution value of the dual variable associated with the upper bound. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - primal, Solution - dual

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

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

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

Data checks are performed as in MSK_putcj.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First element in the slice of \(c\). (input)

  • last (MSKint32t) – Last element plus 1 of the slice in \(c\) to be changed. (input)

  • slice (MSKrealt*) – New numerical values for coefficients in \(c\) that should be modified. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - objective

MSK_putdjc
MSKrescodee (MSKAPI MSK_putdjc) (
  MSKtask_t task,
  MSKint64t djcidx,
  MSKint64t numdomidx,
  const MSKint64t * domidxlist,
  MSKint64t numafeidx,
  const MSKint64t * afeidxlist,
  const MSKrealt * b,
  MSKint64t numterms,
  const MSKint64t * termsizelist)

Inputs a disjunctive constraint. The constraint has the form

\[T_1\ \mathrm{or}\ T_2\ \mathrm{or}\ \cdots\ \mathrm{or}\ T_{\mathrm{numterms}}\]

For each \(i=1,\ldots\mathrm{numterms}\) the \(i\)-th clause (term) \(T_i\) has the form a sequence of affine expressions belongs to a product of domains, where the number of domains is \(\mathrm{termsizelist}[i]\) and the number of affine expressions is equal to the sum of dimensions of all domains appearing in \(T_i\).

All the domains and all the affine expressions appearing in the above description are arranged sequentially in the lists domidxlist and afeidxlist, respectively. In particular, the length of domidxlist must be equal to the sum of elements of termsizelist, and the length of afeidxlist must be equal to the sum of dimensions of all the domains appearing in domidxlist.

The elements of domidxlist are indexes of domains previously defined with one of the append...domain functions.

The elements of afeidxlist are indexes to the store of affine expressions, i.e. the \(k\)-th affine expression appearing in the disjunctive constraint is going to be

\[F_{\mathrm{afeidxlist}[k],:}x + g_{\mathrm{afeidxlist}[k]}\]

If an optional vector b of the same length as afeidxlist is specified then the \(k\)-th affine expression appearing in the disjunctive constraint will be taken as

\[F_{\mathrm{afeidxlist}[k],:}x + g_{\mathrm{afeidxlist}[k]} - b_k\]
Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • numdomidx (MSKint64t) – Number of domains. (input)

  • domidxlist (MSKint64t*) – List of domain indexes. (input)

  • numafeidx (MSKint64t) – Number of affine expressions. (input)

  • afeidxlist (MSKint64t*) – List of affine expression indexes. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. (input)

  • numterms (MSKint64t) – Number of terms in disjunctive constraint. (input)

  • termsizelist (MSKint64t*) – List of term sizes. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints

MSK_putdjcname
MSKrescodee (MSKAPI MSK_putdjcname) (
  MSKtask_t task,
  MSKint64t djcidx,
  const char * name)

Sets the name of a disjunctive constraint.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • djcidx (MSKint64t) – Index of the disjunctive constraint. (input)

  • name (char*) – The name of the disjunctive constraint. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - disjunctive constraints

MSK_putdjcslice
MSKrescodee (MSKAPI MSK_putdjcslice) (
  MSKtask_t task,
  MSKint64t idxfirst,
  MSKint64t idxlast,
  MSKint64t numdomidx,
  const MSKint64t * domidxlist,
  MSKint64t numafeidx,
  const MSKint64t * afeidxlist,
  const MSKrealt * b,
  MSKint64t numterms,
  const MSKint64t * termsizelist,
  const MSKint64t * termsindjc)

Inputs a slice of disjunctive constraints.

The array termsindjc should have length \(\mathrm{idxlast}-\mathrm{idxfirst}\) and contain the number of terms in consecutive constraints forming the slice.

The rest of the input consists of concatenated descriptions of individual constraints, where each constraint is described as in MSK_putdjc.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • idxfirst (MSKint64t) – Index of the first disjunctive constraint in the slice. (input)

  • idxlast (MSKint64t) – Index of the last disjunctive constraint in the slice plus 1. (input)

  • numdomidx (MSKint64t) – Number of domains. (input)

  • domidxlist (MSKint64t*) – List of domain indexes. (input)

  • numafeidx (MSKint64t) – Number of affine expressions. (input)

  • afeidxlist (MSKint64t*) – List of affine expression indexes. (input)

  • b (MSKrealt*) – The vector of constant terms modifying affine expressions. Optional, can be NULL if not required. (input)

  • numterms (MSKint64t) – Number of terms in the disjunctive constraints. (input)

  • termsizelist (MSKint64t*) – List of term sizes. (input)

  • termsindjc (MSKint64t*) – Number of terms in each of the disjunctive constraints in the slice. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - disjunctive constraints

MSK_putdomainname
MSKrescodee (MSKAPI MSK_putdomainname) (
  MSKtask_t task,
  MSKint64t domidx,
  const char * name)

Sets the name of a domain.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • domidx (MSKint64t) – Index of the domain. (input)

  • name (char*) – The name of the domain. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - domain

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

Sets the value of a double parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • param (MSKdparame) – Which parameter. (input)

  • parvalue (MSKrealt) – Parameter value. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • exitfunc (MSKexitfunc) – A user-defined exit function. (input)

  • handle (MSKuserhandle_t) – A pointer to a user-defined data structure which is passed to exitfunc when called. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging, Callback

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

Sets the value of an integer parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • param (MSKiparame) – Which parameter. (input)

  • parvalue (MSKint32t) – Parameter value. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

Input a runtime license code. This function has an effect only before the first optimization.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • code (MSKint32t*) – A runtime license code. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • licdebug (MSKint32t) – Whether license checkout debug info should be printed. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

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

Set the path to the license file. This function has an effect only before the first optimization.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • licensepath (char*) – A path specifying where to search for the license. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

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

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

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • licwait (MSKint32t) – Whether MOSEK should wait for a license if no license is available. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

MSK_putmaxnumacc
MSKrescodee (MSKAPI MSK_putmaxnumacc) (
  MSKtask_t task,
  MSKint64t maxnumacc)

Sets the number of preallocated affine conic constraints in the optimization task. When this number is reached MOSEK will automatically allocate more space. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumacc (MSKint64t) – Number of preallocated affine conic constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - affine conic constraints

MSK_putmaxnumafe
MSKrescodee (MSKAPI MSK_putmaxnumafe) (
  MSKtask_t task,
  MSKint64t maxnumafe)

Sets the number of preallocated affine expressions in the optimization task. When this number is reached MOSEK will automatically allocate more space for affine expressions. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumafe (MSKint64t) – Number of preallocated affine expressions. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - affine expressions

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

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

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumanz (MSKint64t) – Number of preallocated non-zeros in \(A\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - linear part

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumbarvar (MSKint32t) – Number of preallocated symmetric matrix variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - semidefinite

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

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumcon (MSKint32t) – Number of preallocated constraints in the optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - constraints

MSK_putmaxnumcone Deprecated
MSKrescodee (MSKAPI MSK_putmaxnumcone) (
  MSKtask_t task,
  MSKint32t maxnumcone)

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

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

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumcone (MSKint32t) – Number of preallocated conic constraints in the optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - cones (deprecated)

MSK_putmaxnumdjc
MSKrescodee (MSKAPI MSK_putmaxnumdjc) (
  MSKtask_t task,
  MSKint64t maxnumdjc)

Sets the number of preallocated disjunctive constraints in the optimization task. When this number is reached MOSEK will automatically allocate more space. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumdjc (MSKint64t) – Number of preallocated disjunctive constraints in the task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - disjunctive constraints

MSK_putmaxnumdomain
MSKrescodee (MSKAPI MSK_putmaxnumdomain) (
  MSKtask_t task,
  MSKint64t maxnumdomain)

Sets the number of preallocated domains in the optimization task. When this number is reached MOSEK will automatically allocate more space. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumdomain (MSKint64t) – Number of preallocated domains. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - domain

MSK_putmaxnumqnz
MSKrescodee (MSKAPI MSK_putmaxnumqnz) (
  MSKtask_t task,
  MSKint64t maxnumqnz)

Sets the number of preallocated non-zero entries in quadratic terms.

MOSEK stores only the non-zero elements in \(Q\). Therefore, MOSEK cannot predict how much storage is required to store \(Q\). Using this function it is possible to specify the number non-zeros to preallocate for storing \(Q\) (both objective and constraints).

It may be advantageous to reserve more non-zeros for \(Q\) than actually needed since it may improve the internal efficiency of MOSEK, however, it is never worthwhile to specify more than the double of the anticipated number of non-zeros in \(Q\).

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumqnz (MSKint64t) – Number of non-zero elements preallocated in quadratic coefficient matrices. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - quadratic part

MSK_putmaxnumvar
MSKrescodee (MSKAPI MSK_putmaxnumvar) (
  MSKtask_t task,
  MSKint32t maxnumvar)

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

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

Please note that maxnumvar must be larger than the current number of variables in the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumvar (MSKint32t) – Number of preallocated variables in the optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management, Problem data - variables

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

Sets the value of a named double parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • paramname (char*) – Name of a parameter. (input)

  • parvalue (MSKrealt) – Parameter value. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

Sets the value of a named integer parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • paramname (char*) – Name of a parameter. (input)

  • parvalue (MSKint32t) – Parameter value. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

Sets the value of a named string parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • paramname (char*) – Name of a parameter. (input)

  • parvalue (char*) – Parameter value. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

MSK_putobjname
MSKrescodee (MSKAPI MSK_putobjname) (
  MSKtask_t task,
  const char * objname)

Assigns a new name to the objective.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • objname (char*) – Name of the objective. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Names, Problem data - objective

MSK_putobjsense
MSKrescodee (MSKAPI MSK_putobjsense) (
  MSKtask_t task,
  MSKobjsensee sense)

Sets the objective sense of the task.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - objective

MSK_putoptserverhost
MSKrescodee (MSKAPI MSK_putoptserverhost) (
  MSKtask_t task,
  const char * host)

Specify an OptServer URL for remote calls. The URL should contain protocol, host and port in the form http://server:port or https://server:port. If the URL is set using this function, all subsequent calls to any MOSEK function that involves synchronous optimization will be sent to the specified OptServer instead of being executed locally. Passing NULL or empty string deactivates this redirection.

Has the same effect as setting the parameter MSK_SPAR_REMOTE_OPTSERVER_HOST.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • host (char*) – A URL specifying the optimization server to be used. (input)

Return

(MSKrescodee) – The function response code.

Groups

Remote optimization

MSK_putparam
MSKrescodee (MSKAPI MSK_putparam) (
  MSKtask_t task,
  const char * parname,
  const char * parvalue)

Checks if parname is valid parameter name. If it is, the parameter is assigned the value specified by parvalue.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • parname (char*) – Parameter name. (input)

  • parvalue (char*) – Parameter value. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

MSK_putqcon
MSKrescodee (MSKAPI MSK_putqcon) (
  MSKtask_t task,
  MSKint32t numqcnz,
  const MSKint32t * qcsubk,
  const MSKint32t * qcsubi,
  const MSKint32t * qcsubj,
  const MSKrealt * qcval)

Replace all quadratic entries in the constraints. The list of constraints has the form

\[l_k^c \leq \half \sum_{i=\idxbeg}^{\idxend{\mathtt{numvar}}} \sum_{j=\idxbeg}^{\idxend{\mathtt{numvar}}} q_{ij}^k x_i x_j + \sum_{j=\idxbeg}^{\idxend{\mathtt{numvar}}} a_{kj} x_j \leq u_k^c, ~\ k=\idxbeg,\ldots,\idxend{m}.\]

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{\mathtt{numqcnz}}\).

Please note that:

  • For large problems it is essential for the efficiency that the function MSK_putmaxnumqnz is employed to pre-allocate space.

  • Only the lower triangular parts should be specified because the \(Q\) matrices are symmetric. Specifying entries where \(i < j\) will result in an error.

  • Only non-zero elements should be specified.

  • The order in which the non-zero elements are specified is insignificant.

  • Duplicate elements are added together as shown above. Hence, it is usually not recommended to specify the same entry multiple times.

For a code example see Section Quadratic Optimization

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • numqcnz (MSKint32t) – Number of quadratic terms. (input)

  • qcsubk (MSKint32t*) – Constraint subscripts for quadratic coefficients. (input)

  • qcsubi (MSKint32t*) – Row subscripts for quadratic constraint matrix. (input)

  • qcsubj (MSKint32t*) – Column subscripts for quadratic constraint matrix. (input)

  • qcval (MSKrealt*) – Quadratic constraint coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - quadratic part

MSK_putqconk
MSKrescodee (MSKAPI MSK_putqconk) (
  MSKtask_t task,
  MSKint32t k,
  MSKint32t numqcnz,
  const MSKint32t * qcsubi,
  const MSKint32t * qcsubj,
  const MSKrealt * qcval)

Replaces all the quadratic entries in one constraint. This function performs the same operations as MSK_putqcon but only with respect to constraint number k and it does not modify the other constraints. See the description of MSK_putqcon for definitions and important remarks.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • k (MSKint32t) – The constraint in which the new \(Q\) elements are inserted. (input)

  • numqcnz (MSKint32t) – Number of quadratic terms. (input)

  • qcsubi (MSKint32t*) – Row subscripts for quadratic constraint matrix. (input)

  • qcsubj (MSKint32t*) – Column subscripts for quadratic constraint matrix. (input)

  • qcval (MSKrealt*) – Quadratic constraint coefficient values. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - quadratic part

MSK_putqobj
MSKrescodee (MSKAPI MSK_putqobj) (
  MSKtask_t task,
  MSKint32t numqonz,
  const MSKint32t * qosubi,
  const MSKint32t * qosubj,
  const MSKrealt * qoval)

Replace all quadratic terms in the objective. If the objective has the form

\[\half \sum_{i=\idxbeg}^{\idxend{\mathtt{numvar}}} \sum_{j=\idxbeg}^{\idxend{\mathtt{numvar}}} q_{ij}^o x_i x_j + \sum_{j=\idxbeg}^{\idxend{\mathtt{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{\mathtt{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

Problem data - quadratic part, Problem data - objective

MSK_putqobjij
MSKrescodee (MSKAPI MSK_putqobjij) (
  MSKtask_t task,
  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
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Row index for the coefficient to be replaced. (input)

  • j (MSKint32t) – Column index for the coefficient to be replaced. (input)

  • qoij (MSKrealt) – The new value for \(q_{ij}^o\). (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - quadratic part, Problem data - objective

MSK_putresponsefunc
MSKrescodee (MSKAPI MSK_putresponsefunc) (
  MSKtask_t task,
  MSKresponsefunc responsefunc,
  MSKuserhandle_t handle)

Inputs a user-defined error callback which is called when an error or warning occurs.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • responsefunc (MSKresponsefunc) – A user-defined response handling function. (input)

  • handle (MSKuserhandle_t) – A user-defined data structure that is passed to the function responsefunc whenever it is called. (input)

Return

(MSKrescodee) – The function response code.

Groups

Callback, Logging

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

Sets the status keys for the constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • skc (MSKstakeye*) – Status keys for the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Sets the status keys for a slice of the constraints.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • skc (MSKstakeye*) – Status keys for the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Sets the status keys for the scalar variables.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • skx (MSKstakeye*) – Status keys for the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Sets the status keys for a slice of the variables.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • skx (MSKstakeye*) – Status keys for the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

MSK_putsolution
MSKrescodee (MSKAPI MSK_putsolution) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  const MSKstakeye * skc,
  const MSKstakeye * skx,
  const MSKstakeye * skn,
  const MSKrealt * xc,
  const MSKrealt * xx,
  const MSKrealt * y,
  const MSKrealt * slc,
  const MSKrealt * suc,
  const MSKrealt * slx,
  const MSKrealt * sux,
  const MSKrealt * snx)

Inserts a solution into the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • skc (MSKstakeye*) – Status keys for the constraints. (input)

  • skx (MSKstakeye*) – Status keys for the variables. (input)

  • skn (MSKstakeye*) – Status keys for the conic constraints. (input)

  • xc (MSKrealt*) – Primal constraint solution. (input)

  • xx (MSKrealt*) – Primal variable solution. (input)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (input)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (input)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (input)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (input)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (input)

  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - primal, Solution - dual

MSK_putsolutionnew
MSKrescodee (MSKAPI MSK_putsolutionnew) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  const MSKstakeye * skc,
  const MSKstakeye * skx,
  const MSKstakeye * skn,
  const MSKrealt * xc,
  const MSKrealt * xx,
  const MSKrealt * y,
  const MSKrealt * slc,
  const MSKrealt * suc,
  const MSKrealt * slx,
  const MSKrealt * sux,
  const MSKrealt * snx,
  const MSKrealt * doty)

Inserts a solution into the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • skc (MSKstakeye*) – Status keys for the constraints. (input)

  • skx (MSKstakeye*) – Status keys for the variables. (input)

  • skn (MSKstakeye*) – Status keys for the conic constraints. (input)

  • xc (MSKrealt*) – Primal constraint solution. (input)

  • xx (MSKrealt*) – Primal variable solution. (input)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (input)

  • slc (MSKrealt*) – Dual variables corresponding to the lower bounds on the constraints. (input)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (input)

  • slx (MSKrealt*) – Dual variables corresponding to the lower bounds on the variables. (input)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (input)

  • snx (MSKrealt*) – Dual variables corresponding to the conic constraints on the variables. (input)

  • doty (MSKrealt*) – Dual variables corresponding to affine conic constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - primal, Solution - dual

MSK_putsolutionyi
MSKrescodee (MSKAPI MSK_putsolutionyi) (
  MSKtask_t task,
  MSKint32t i,
  MSKsoltypee whichsol,
  MSKrealt y)

Inputs the dual variable of a solution.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • i (MSKint32t) – Index of the dual variable. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • y (MSKrealt) – Solution value of the dual variable. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - dual

MSK_putstrparam
MSKrescodee (MSKAPI MSK_putstrparam) (
  MSKtask_t task,
  MSKsparame param,
  const char * parvalue)

Sets the value of a string parameter.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • param (MSKsparame) – Which parameter. (input)

  • parvalue (char*) – Parameter value. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • suc (MSKrealt*) – Dual variables corresponding to the upper bounds on the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • sux (MSKrealt*) – Dual variables corresponding to the upper bounds on the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

MSK_puttaskname
MSKrescodee (MSKAPI MSK_puttaskname) (
  MSKtask_t task,
  const char * taskname)

Assigns a new name to the task.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • taskname (char*) – Name assigned to the task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Environment and task management

MSK_putvarbound
MSKrescodee (MSKAPI MSK_putvarbound) (
  MSKtask_t task,
  MSKint32t j,
  MSKboundkeye bkx,
  MSKrealt blx,
  MSKrealt bux)

Changes the bounds for one variable.

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the variable. (input)

  • bkx (MSKboundkeye) – New bound key. (input)

  • blx (MSKrealt) – New lower bound. (input)

  • bux (MSKrealt) – New upper bound. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - variables, Problem data - bounds

MSK_putvarboundlist
MSKrescodee (MSKAPI MSK_putvarboundlist) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  const MSKboundkeye * bkx,
  const MSKrealt * blx,
  const MSKrealt * bux)

Changes the bounds for one or more variables. If multiple bound changes are specified for a variable, then only the last change takes effect. Data checks are performed as in MSK_putvarbound.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of bounds that should be changed. (input)

  • sub (MSKint32t*) – List of variable indexes. (input)

  • bkx (MSKboundkeye*) – Bound keys for the variables. (input)

  • blx (MSKrealt*) – Lower bounds for the variables. (input)

  • bux (MSKrealt*) – Upper bounds for the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - variables, Problem data - bounds

MSK_putvarboundlistconst
MSKrescodee (MSKAPI MSK_putvarboundlistconst) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * sub,
  MSKboundkeye bkx,
  MSKrealt blx,
  MSKrealt bux)

Changes the bounds for one or more variables. Data checks are performed as in MSK_putvarbound.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of bounds that should be changed. (input)

  • sub (MSKint32t*) – List of variable indexes. (input)

  • bkx (MSKboundkeye) – New bound key for all variables in the list. (input)

  • blx (MSKrealt) – New lower bound for all variables in the list. (input)

  • bux (MSKrealt) – New upper bound for all variables in the list. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - variables, Problem data - bounds

MSK_putvarboundslice
MSKrescodee (MSKAPI MSK_putvarboundslice) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  const MSKboundkeye * bkx,
  const MSKrealt * blx,
  const MSKrealt * bux)

Changes the bounds for a slice of the variables. Data checks are performed as in MSK_putvarbound.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • bkx (MSKboundkeye*) – Bound keys for the variables. (input)

  • blx (MSKrealt*) – Lower bounds for the variables. (input)

  • bux (MSKrealt*) – Upper bounds for the variables. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - variables, Problem data - bounds

MSK_putvarboundsliceconst
MSKrescodee (MSKAPI MSK_putvarboundsliceconst) (
  MSKtask_t task,
  MSKint32t first,
  MSKint32t last,
  MSKboundkeye bkx,
  MSKrealt blx,
  MSKrealt bux)

Changes the bounds for a slice of the variables. Data checks are performed as in MSK_putvarbound.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • bkx (MSKboundkeye) – New bound key for all variables in the slice. (input)

  • blx (MSKrealt) – New lower bound for all variables in the slice. (input)

  • bux (MSKrealt) – New upper bound for all variables in the slice. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - linear part, Problem data - variables, Problem data - bounds

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

Sets the name of a variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the variable. (input)

  • name (char*) – The variable name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Names, Problem data - variables, Problem data - linear part

MSK_putvarsolutionj
MSKrescodee (MSKAPI MSK_putvarsolutionj) (
  MSKtask_t task,
  MSKint32t j,
  MSKsoltypee whichsol,
  MSKstakeye sk,
  MSKrealt x,
  MSKrealt sl,
  MSKrealt su,
  MSKrealt sn)

Sets the primal and dual solution information for a single variable.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • j (MSKint32t) – Index of the variable. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • sk (MSKstakeye) – Status key of the variable. (input)

  • x (MSKrealt) – Primal solution value of the variable. (input)

  • sl (MSKrealt) – Solution value of the dual variable associated with the lower bound. (input)

  • su (MSKrealt) – Solution value of the dual variable associated with the upper bound. (input)

  • sn (MSKrealt) – Solution value of the dual variable associated with the conic constraint. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution information, Solution - primal, Solution - dual

MSK_putvartype
MSKrescodee (MSKAPI MSK_putvartype) (
  MSKtask_t task,
  MSKint32t j,
  MSKvariabletypee vartype)

Sets the variable type of one variable.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Problem data - variables

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

Sets the variable type for one or more variables. If the same index is specified multiple times in subj only the last entry takes effect.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of variables for which the variable type should be set. (input)

  • subj (MSKint32t*) – A list of variable indexes for which the variable type should be changed. (input)

  • vartype (MSKvariabletypee*) – A list of variable types that should be assigned to the variables specified by subj. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - variables

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • xc (MSKrealt*) – Primal constraint solution. (output)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • xc (MSKrealt*) – Primal constraint solution. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • xx (MSKrealt*) – Primal variable solution. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • xx (MSKrealt*) – Primal variable solution. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - primal

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

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

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • first (MSKint32t) – First index in the sequence. (input)

  • last (MSKint32t) – Last index plus 1 in the sequence. (input)

  • y (MSKrealt*) – Vector of dual variables corresponding to the constraints. (input)

Return

(MSKrescodee) – The function response code.

Groups

Solution - dual

MSK_readbsolution
MSKrescodee (MSKAPI MSK_readbsolution) (
  MSKtask_t task,
  const char * filename,
  MSKcompresstypee compress)

Read a binary dump of the task solution.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

  • compress (MSKcompresstypee) – Data compression type. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readdata
MSKrescodee (MSKAPI MSK_readdata) (
  MSKtask_t task,
  const char * filename)

Reads an optimization problem and associated data from a file. The extension of the file name is used to deduce the file format.

For a list of supported file types and their extensions see Supported File Formats.

Data is read from the file filename if it is a nonempty string. Otherwise data is read from the file specified by MSK_SPAR_DATA_FILE_NAME.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readdataautoformat
MSKrescodee (MSKAPI MSK_readdataautoformat) (
  MSKtask_t task,
  const char * filename)

Reads an optimization problem and associated data from a file.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readdatacb
MSKrescodee (MSKAPI MSK_readdatacb) (
  MSKtask_t task,
  MSKhreadfunc hread,
  MSKuserhandle_t h,
  MSKdataformate format,
  MSKcompresstypee compress,
  const char * path)

Reads an optimization problem and associated data from a handle.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readdataformat
MSKrescodee (MSKAPI MSK_readdataformat) (
  MSKtask_t task,
  const char * filename,
  MSKdataformate format,
  MSKcompresstypee compress)

Reads an optimization problem and associated data from a file.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

  • format (MSKdataformate) – File data format. (input)

  • compress (MSKcompresstypee) – File compression type. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readjsonsol
MSKrescodee (MSKAPI MSK_readjsonsol) (
  MSKtask_t task,
  const char * filename)

Reads a solution file in JSON format (JSOL file) and inserts it in the task. Only the section Task/solutions is taken into consideration.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readjsonstring
MSKrescodee (MSKAPI MSK_readjsonstring) (
  MSKtask_t task,
  const char * data)

Load task data from a JSON string, replacing any data that already exists in the task object. All problem data, parameters and other settings are resorted, but if the string contains solutions, the solution status after loading a file is set to unknown, even if it is optimal or otherwise well-defined.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • data (char*) – Problem data in text format. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readlpstring
MSKrescodee (MSKAPI MSK_readlpstring) (
  MSKtask_t task,
  const char * data)

Load task data from a string in LP format, replacing any data that already exists in the task object.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • data (char*) – Problem data in text format. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readopfstring
MSKrescodee (MSKAPI MSK_readopfstring) (
  MSKtask_t task,
  const char * data)

Load task data from a string in OPF format, replacing any data that already exists in the task object.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • data (char*) – Problem data in text format. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readparamfile
MSKrescodee (MSKAPI MSK_readparamfile) (
  MSKtask_t task,
  const char * filename)

Reads MOSEK parameters from a file. Data is read from the file filename if it is a nonempty string. Otherwise data is read from the file specified by MSK_SPAR_PARAM_READ_FILE_NAME.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output, Parameters

MSK_readptfstring
MSKrescodee (MSKAPI MSK_readptfstring) (
  MSKtask_t task,
  const char * data)

Load task data from a PTF string, replacing any data that already exists in the task object. All problem data, parameters and other settings are resorted, but if the string contains solutions, the solution status after loading a file is set to unknown, even if it is optimal or otherwise well-defined.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • data (char*) – Problem data in text format. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readsolution
MSKrescodee (MSKAPI MSK_readsolution) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  const char * filename)

Reads a solution file and inserts it as a specified solution in the task. Data is read from the file filename if it is a nonempty string. Otherwise data is read from one of the files specified by MSK_SPAR_BAS_SOL_FILE_NAME, MSK_SPAR_ITR_SOL_FILE_NAME or MSK_SPAR_INT_SOL_FILE_NAME depending on which solution is chosen.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_readsolutionfile
MSKrescodee (MSKAPI MSK_readsolutionfile) (
  MSKtask_t task,
  const char * filename)

Read solution file in format determined by the filename

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

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

Prints a short summary of last file that was read.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Input/Output, Inspecting the task

MSK_readtask
MSKrescodee (MSKAPI MSK_readtask) (
  MSKtask_t task,
  const char * filename)

Load task data from a file, replacing any data that already exists in the task object. All problem data, parameters and other settings are resorted, but if the file contains solutions, the solution status after loading a file is set to unknown, even if it was optimal or otherwise well-defined when the file was dumped.

See section The Task Format for a description of the Task format.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_removebarvars
MSKrescodee (MSKAPI MSK_removebarvars) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subset)

The function removes a subset of the symmetric matrices from the optimization task. This implies that the remaining symmetric matrices are renumbered.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of symmetric matrices which should be removed. (input)

  • subset (MSKint32t*) – Indexes of symmetric matrices which should be removed. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - semidefinite

MSK_removecones Deprecated
MSKrescodee (MSKAPI MSK_removecones) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subset)

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Removes a number of conic constraints from the problem. This implies that the remaining conic constraints are renumbered. In general, it is much more efficient to remove a cone with a high index than a low index.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of cones which should be removed. (input)

  • subset (MSKint32t*) – Indexes of cones which should be removed. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - cones (deprecated)

MSK_removecons
MSKrescodee (MSKAPI MSK_removecons) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subset)

The function removes a subset of the constraints from the optimization task. This implies that the remaining constraints are renumbered.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of constraints which should be removed. (input)

  • subset (MSKint32t*) – Indexes of constraints which should be removed. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - constraints, Problem data - linear part

MSK_removevars
MSKrescodee (MSKAPI MSK_removevars) (
  MSKtask_t task,
  MSKint32t num,
  const MSKint32t * subset)

The function removes a subset of the variables from the optimization task. This implies that the remaining variables are renumbered.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • num (MSKint32t) – Number of variables which should be removed. (input)

  • subset (MSKint32t*) – Indexes of variables which should be removed. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - variables, Problem data - linear part

MSK_rescodetostr
MSKrescodee (MSKAPI MSK_rescodetostr) (
  MSKrescodee res,
  char * str)

Obtains an identifier string corresponding to a response code.

Parameters
  • res (MSKrescodee) – Response code. (input)

  • str (char*) – String corresponding to the bound response code res. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_resetexpirylicenses
MSKrescodee (MSKAPI MSK_resetexpirylicenses) (
  MSKenv_t env)

Reset the license expiry reporting startpoint.

Parameters

env (MSKenv_t) – The MOSEK environment. (input)

Return

(MSKrescodee) – The function response code.

Groups

License system

MSK_resizetask
MSKrescodee (MSKAPI MSK_resizetask) (
  MSKtask_t task,
  MSKint32t maxnumcon,
  MSKint32t maxnumvar,
  MSKint32t maxnumcone,
  MSKint64t maxnumanz,
  MSKint64t maxnumqnz)

Sets the amount of preallocated space assigned for each type of data in an optimization task.

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

Please note that the procedure is destructive in the sense that all existing data stored in the task is destroyed.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • maxnumcon (MSKint32t) – New maximum number of constraints. (input)

  • maxnumvar (MSKint32t) – New maximum number of variables. (input)

  • maxnumcone (MSKint32t) – New maximum number of cones. (input)

  • maxnumanz (MSKint64t) – New maximum number of non-zeros in \(A\). (input)

  • maxnumqnz (MSKint64t) – New maximum number of non-zeros in all \(Q\) matrices. (input)

Return

(MSKrescodee) – The function response code.

Groups

Environment and task management

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

Reads a sensitivity format file from a location given by MSK_SPAR_SENSITIVITY_FILE_NAME and writes the result to the stream whichstream. If MSK_SPAR_SENSITIVITY_RES_FILE_NAME is set to a non-empty string, then the sensitivity report is also written to a file of this name.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Sensitivity analysis

MSK_setdefaults
MSKrescodee (MSKAPI MSK_setdefaults) (
  MSKtask_t task)

Resets all the parameters to their default values.

Parameters

task (MSKtask_t) – An optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Parameters

MSK_sktostr
MSKrescodee (MSKAPI MSK_sktostr) (
  MSKtask_t task,
  MSKstakeye sk,
  char * str)

Obtains a status key abbreviation string, one of UN, BS, SB, LL, UL, EQ, **.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • sk (MSKstakeye) – A valid status key. (input)

  • str (char*) – Abbreviation string corresponding to the status key sk. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_solstatostr
MSKrescodee (MSKAPI MSK_solstatostr) (
  MSKtask_t task,
  MSKsolstae solutionsta,
  char * str)

Obtains an explanatory string corresponding to a solution status.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • solutionsta (MSKsolstae) – Solution status. (input)

  • str (char*) – String corresponding to the solution status solsta. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_solutiondef
MSKrescodee (MSKAPI MSK_solutiondef) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  MSKbooleant * isdef)

Checks whether a solution is defined.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Solution information

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

Prints a short summary of the current solutions.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Logging, Solution information

MSK_solvewithbasis
MSKrescodee (MSKAPI MSK_solvewithbasis) (
  MSKtask_t task,
  MSKbooleant transp,
  MSKint32t numnz,
  MSKint32t * sub,
  MSKrealt * val,
  MSKint32t * numnzout)

If a basic solution is available, then exactly \(numcon\) basis variables are defined. These \(numcon\) basis variables are denoted the basis. Associated with the basis is a basis matrix denoted \(B\). This function solves either the linear equation system

(15.3)\[B \barX = b\]

or the system

(15.4)\[B^T \barX = b\]

for the unknowns \(\barX\), with \(b\) being a user-defined vector. In order to make sense of the solution \(\barX\) it is important to know the ordering of the variables in the basis because the ordering specifies how \(B\) is constructed. When calling MSK_initbasissolve an ordering of the basis variables is obtained, which can be used to deduce how MOSEK has constructed \(B\). Indeed if the \(k\)-th basis variable is variable \(x_j\) it implies that

\[B_{i,k} = A_{i,j}, ~i=\idxbeg,\ldots,\idxend{\mathtt{numcon}}.\]

Otherwise if the \(k\)-th basis variable is variable \(x_j^c\) it implies that

\[\begin{split}B_{i,k} = \left\{ \begin{array}{ll} -1, & i = j, \\ 0 , & i \neq j. \\ \end{array} \right.\end{split}\]

The function MSK_initbasissolve must be called before a call to this function. Please note that this function exploits the sparsity in the vector \(b\) to speed up the computations.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • transp (MSKbooleant) – If this argument is zero, then (15.3) is solved, if non-zero then (15.4) is solved. (input)

  • numnz (MSKint32t) – The number of non-zeros in \(b\). (input)

  • sub (MSKint32t*) – As input it contains the positions of non-zeros in \(b\). As output it contains the positions of the non-zeros in \(\barX\). It must have room for \(numcon\) elements. (input/output)

  • val (MSKrealt*) – As input it is the vector \(b\) as a dense vector (although the positions of non-zeros are specified in sub it is required that \(\mathtt{val}[i] = 0\) when \(b[i] = 0\)). As output val is the vector \(\barX\) as a dense vector. It must have length \(numcon\). (input/output)

  • numnzout (MSKint32t by reference) – The number of non-zeros in \(\barX\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Solving systems with basis matrix

MSK_sparsetriangularsolvedense
MSKrescodee (MSKAPI MSK_sparsetriangularsolvedense) (
  MSKenv_t env,
  MSKtransposee transposed,
  MSKint32t n,
  const MSKint32t * lnzc,
  const MSKint64t * lptrc,
  MSKint64t lensubnval,
  const MSKint32t * lsubc,
  const MSKrealt * lvalc,
  MSKrealt * b)

The function solves a triangular system of the form

\[L x = b\]

or

\[L^T x = b\]

where \(L\) is a sparse lower triangular nonsingular matrix. This implies in particular that diagonals in \(L\) are nonzero.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • transposed (MSKtransposee) – Controls whether to use with \(L\) or \(L^T\). (input)

  • n (MSKint32t) – Dimension of \(L\). (input)

  • lnzc (MSKint32t*) – lnzc[j] is the number of nonzeros in column j. (input)

  • lptrc (MSKint64t*) – lptrc[j] is a pointer to the first row index and value in column j. (input)

  • lensubnval (MSKint64t) – Number of elements in lsubc and lvalc. (input)

  • lsubc (MSKint32t*) – Row indexes for each column stored sequentially. Must be stored in increasing order for each column. (input)

  • lvalc (MSKrealt*) – The value corresponding to the row index stored in lsubc. (input)

  • b (MSKrealt*) – The right-hand side of linear equation system to be solved as a dense vector. (input/output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

MSK_strtoconetype Deprecated
MSKrescodee (MSKAPI MSK_strtoconetype) (
  MSKtask_t task,
  const char * str,
  MSKconetypee * conetype)

NOTE: This interface to conic optimization is deprecated and will be removed in a future major release. Conic problems should be specified using the affine conic constraints interface (ACC), see Sec. 6.2 (From Linear to Conic Optimization) for details.

Obtains cone type code corresponding to a cone type string.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • str (char*) – String corresponding to the cone type code conetype. (input)

  • conetype (MSKconetypee by reference) – The cone type corresponding to the string str. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_strtosk
MSKrescodee (MSKAPI MSK_strtosk) (
  MSKtask_t task,
  const char * str,
  MSKstakeye * sk)

Obtains the status key corresponding to an abbreviation string.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • str (char*) – A status key abbreviation string. (input)

  • sk (MSKstakeye by reference) – Status key corresponding to the string. (output)

Return

(MSKrescodee) – The function response code.

Groups

Names

MSK_syeig
MSKrescodee (MSKAPI MSK_syeig) (
  MSKenv_t env,
  MSKuploe uplo,
  MSKint32t n,
  const MSKrealt * a,
  MSKrealt * w)

Computes all eigenvalues of a real symmetric matrix \(A\). Given a matrix \(A\in\real^{n\times n}\) it returns a vector \(w\in\real^n\) containing the eigenvalues of \(A\).

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • uplo (MSKuploe) – Indicates whether the upper or lower triangular part is used. (input)

  • n (MSKint32t) – Dimension of the symmetric input matrix. (input)

  • a (MSKrealt*) – A symmetric matrix \(A\) stored in column-major order. Only the part indicated by uplo is used. (input)

  • w (MSKrealt*) – Array of length at least n containing the eigenvalues of \(A\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

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

Computes all the eigenvalues and eigenvectors a real symmetric matrix. Given the input matrix \(A\in \real^{n\times n}\), this function returns a vector \(w\in \real^n\) containing the eigenvalues of \(A\) and it also computes the eigenvectors of \(A\). Therefore, this function computes the eigenvalue decomposition of \(A\) as

\[A= U V U^T,\]

where \(V=\diag(w)\) and \(U\) contains the eigenvectors of \(A\).

Note that the matrix \(U\) overwrites the input data \(A\).

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • uplo (MSKuploe) – Indicates whether the upper or lower triangular part is used. (input)

  • n (MSKint32t) – Dimension of the symmetric input matrix. (input)

  • a (MSKrealt*) – A symmetric matrix \(A\) stored in column-major order. Only the part indicated by uplo is used. On exit it will be overwritten by the matrix \(U\). (input/output)

  • w (MSKrealt*) – Array of length at least n containing the eigenvalues of \(A\). (output)

Return

(MSKrescodee) – The function response code.

Groups

Linear algebra

MSK_symnamtovalue
MSKbooleant (MSKAPI MSK_symnamtovalue) (
  const char * name,
  char * value)

Obtains the value corresponding to a symbolic name defined by MOSEK.

Parameters
  • name (char*) – Symbolic name. (input)

  • value (char*) – The corresponding value. (output)

Return

(MSKbooleant) – Indicates if the symbolic name has been converted.

Groups

Parameters

MSK_syrk
MSKrescodee (MSKAPI MSK_syrk) (
  MSKenv_t env,
  MSKuploe uplo,
  MSKtransposee trans,
  MSKint32t n,
  MSKint32t k,
  MSKrealt alpha,
  const MSKrealt * a,
  MSKrealt beta,
  MSKrealt * c)

Performs a symmetric rank-\(k\) update for a symmetric matrix.

Given a symmetric matrix \(C\in \real^{n\times n}\), two scalars \(\alpha,\beta\) and a matrix \(A\) of rank \(k\leq n\), it computes either

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

when trans is set to MSK_TRANSPOSE_NO and \(A\in \real^{n\times k}\), or

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

when trans is set to MSK_TRANSPOSE_YES and \(A\in \real^{k\times n}\).

Only the part of \(C\) indicated by uplo is used and only that part is updated with the result. It must not overlap with the other input arrays.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • uplo (MSKuploe) – Indicates whether the upper or lower triangular part of \(C\) is used. (input)

  • trans (MSKtransposee) – Indicates whether the matrix \(A\) must be transposed. (input)

  • n (MSKint32t) – Specifies the order of \(C\). (input)

  • k (MSKint32t) – Indicates the number of rows or columns of \(A\), depending on whether or not it is transposed, and its rank. (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)

  • 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_toconic Deprecated
MSKrescodee (MSKAPI MSK_toconic) (
  MSKtask_t task)

This function tries to reformulate a given Quadratically Constrained Quadratic Optimization problem (QCQO) as a Conic Quadratic Optimization problem (CQO). The first step of the reformulation is to convert the quadratic term of the objective function, if any, into a constraint. Then the following steps are repeated for each quadratic constraint:

  • a conic constraint is added along with a suitable number of auxiliary variables and constraints;

  • the original quadratic constraint is not removed, but all its coefficients are zeroed out.

Note that the reformulation preserves all the original variables.

The conversion is performed in-place, i.e. the task passed as argument is modified on exit. That also means that if the reformulation fails, i.e. the given QCQP is not representable as a CQO, then the task has an undefined state. In some cases, users may want to clone the task to ensure a clean copy is preserved.

Parameters

task (MSKtask_t) – An optimization task. (input)

Return

(MSKrescodee) – The function response code.

Groups

Problem data - quadratic part

MSK_unlinkfuncfromenvstream
MSKrescodee (MSKAPI MSK_unlinkfuncfromenvstream) (
  MSKenv_t env,
  MSKstreamtypee whichstream)

Disconnects a user-defined function from a stream.

Parameters
  • env (MSKenv_t) – The MOSEK environment. (input)

  • whichstream (MSKstreamtypee) – Index of the stream. (input)

Return

(MSKrescodee) – The function response code.

Groups

Logging, Callback

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

Disconnects a user-defined function from a task stream.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Logging, Callback

MSK_updatesolutioninfo
MSKrescodee (MSKAPI MSK_updatesolutioninfo) (
  MSKtask_t task,
  MSKsoltypee whichsol)

Update the information items related to the solution.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

Return

(MSKrescodee) – The function response code.

Groups

Information items and statistics

MSK_utf8towchar
MSKrescodee (MSKAPI MSK_utf8towchar) (
  const size_t outputlen,
  size_t * len,
  size_t * conv,
  MSKwchart * output,
  const char * input)

Converts an UTF8 string to a MSKwchart string.

Parameters
  • outputlen (size_t) – The length of the output buffer. (input)

  • len (size_t*) – The length of the string contained in the output buffer. (output)

  • conv (size_t*) – Returns the number of characters converted, i.e. input[conv] is the first character which was not converted. If the whole string was converted, then input[conv]=0. (output)

  • output (MSKwchart*) – The input string converted to a MSKwchart string. (output)

  • input (char*) – The UTF8 input string. (input)

Return

(MSKrescodee) – The function response code.

Groups

System, memory and debugging

MSK_wchartoutf8
MSKrescodee (MSKAPI MSK_wchartoutf8) (
  const size_t outputlen,
  size_t * len,
  size_t * conv,
  char * output,
  const MSKwchart * input)

Converts a MSKwchart string to an UTF8 string.

Parameters
  • outputlen (size_t) – The length of the output buffer. (input)

  • len (size_t*) – The length of the string contained in the output buffer. (output)

  • conv (size_t*) – Returns the number of characters from converted, i.e. input[conv] is the first char which was not converted. If the whole string was converted, then input[conv]=0. (output)

  • output (char*) – The input string converted to a UTF8 string. (output)

  • input (MSKwchart*) – The MSKwchart input string. (input)

Return

(MSKrescodee) – The function response code.

Groups

System, memory and debugging

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

Checks if parname is a valid parameter name. If yes then partype and param denote the type and the index of the parameter, respectively.

Parameters
Return

(MSKrescodee) – The function response code.

Groups

Parameters, Names

MSK_writebsolution
MSKrescodee (MSKAPI MSK_writebsolution) (
  MSKtask_t task,
  const char * filename,
  MSKcompresstypee compress)

Write a binary dump of the task solution.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

  • compress (MSKcompresstypee) – Data compression type. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_writebsolutionhandle
MSKrescodee (MSKAPI MSK_writebsolutionhandle) (
  MSKtask_t task,
  MSKhwritefunc func,
  MSKuserhandle_t handle,
  MSKcompresstypee compress)

Write a binary dump of the task solution.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • func (MSKhwritefunc) – A user-defined write function which receives the data. (input)

  • handle (MSKuserhandle_t) – A user-defined handle which is passed to the user-defined function func (can be NULL). (input)

  • compress (MSKcompresstypee) – Data compression type. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_writedata
MSKrescodee (MSKAPI MSK_writedata) (
  MSKtask_t task,
  const char * filename)

Writes problem data associated with the optimization task to a file in one of the supported formats. See Section Supported File Formats for the complete list.

The data file format is determined by the file name extension. To write in compressed format append the extension .gz. E.g to write a gzip compressed MPS file use the extension mps.gz.

Please note that MPS, LP and OPF files require all variables to have unique names. If a task contains no names, it is possible to write the file with automatically generated anonymous names by setting the MSK_IPAR_WRITE_GENERIC_NAMES parameter to MSK_ON.

Data is written to the file filename if it is a nonempty string. Otherwise data is written to the file specified by MSK_SPAR_DATA_FILE_NAME.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_writedatahandle
MSKrescodee (MSKAPI MSK_writedatahandle) (
  MSKtask_t task,
  MSKhwritefunc func,
  MSKuserhandle_t handle,
  MSKdataformate format,
  MSKcompresstypee compress)

Writes an optimization problem and associated data using a user-defined stream write function func.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • func (MSKhwritefunc) – A user-defined write function which receives the data. (input)

  • handle (MSKuserhandle_t) – A user-defined handle which is passed to the user-defined function func (can be NULL). (input)

  • format (MSKdataformate) – Selects data format. (input)

  • compress (MSKcompresstypee) – Selects compression type. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_writejsonsol
MSKrescodee (MSKAPI MSK_writejsonsol) (
  MSKtask_t task,
  const char * filename)

Saves the current solutions and solver information items in a JSON file. If the file name has the extensions .gz or .zst, then the file is gzip or Zstd compressed respectively.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_writeparamfile
MSKrescodee (MSKAPI MSK_writeparamfile) (
  MSKtask_t task,
  const char * filename)

Writes all the parameters to a parameter file.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output, Parameters

MSK_writesolution
MSKrescodee (MSKAPI MSK_writesolution) (
  MSKtask_t task,
  MSKsoltypee whichsol,
  const char * filename)

Saves the current basic, interior-point, or integer solution to a file.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • whichsol (MSKsoltypee) – Selects a solution. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_writesolutionfile
MSKrescodee (MSKAPI MSK_writesolutionfile) (
  MSKtask_t task,
  const char * filename)

Write solution file in format determined by the filename

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output

MSK_writetask
MSKrescodee (MSKAPI MSK_writetask) (
  MSKtask_t task,
  const char * filename)

Write a binary dump of the task data. This format saves all problem data, coefficients and parameter settings. See section The Task Format for a description of the Task format.

Parameters
  • task (MSKtask_t) – An optimization task. (input)

  • filename (char*) – A valid file name. (input)

Return

(MSKrescodee) – The function response code.

Groups

Input/Output