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
- 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
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 theappend...domain
functions.The length of the affine expression list
afeidxlist
must be equal to the dimension \(n\) of the domain. The elements ofafeidxlist
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 asafeidxlist
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 beNULL
if not required. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 inMSK_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 indomainsidxs
.- 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 beNULL
if not required. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 theappend...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 lengthnumafeidx
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 beNULL
if not required. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofMSK_appendaccs
, that is it assumes that the affine expressions appearing in the affine conic constraints are sequential in the affine expression store, starting from positionafeidxfirst
.- 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 beNULL
if not required. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_appendafes¶
MSKrescodee (MSKAPI MSK_appendafes) ( MSKtask_t task, MSKint64t num)
Appends a number of empty affine expressions to the task.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 byct
.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
- 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 indexj
and the lastj+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
- 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 dimensionnummem[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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_appenddjcs¶
MSKrescodee (MSKAPI MSK_appenddjcs) ( MSKtask_t task, MSKint64t num)
Appends a number of empty disjunctive constraints to the task.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
) – Dimmension of the domain. (input)domidx
(MSKint64t
by reference) – Index of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
, andvalij
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
- 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
, andvalij
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
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 seeMSK_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
andtrm
should be ignored. (output)resp
(MSKrescodee
by reference) – Is the response code from the remote solver. (output)trm
(MSKrescodee
by reference) – Is eitherMSK_RES_OK
or a termination response code. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 examplehttp://server:port
orhttps://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
orMSK_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
- 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 seeMSK_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
andtrm
should be ignored. (output)resp
(MSKrescodee
by reference) – Is the response code from the remote solver. (output)trm
(MSKrescodee
by reference) – Is eitherMSK_RES_OK
or a termination response code. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 seeMSK_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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)nrmbasis
(MSKrealt
by reference) – An estimate for the 1-norm of the basis. (output)nrminvbasis
(MSKrealt
by reference) – An estimate for the 1-norm of the inverse of the basis. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 codebk
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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 lengthnumber
where each element is of sizesize
.- 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
- 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 lengthnumber
where each element is of sizesize
.- 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
- 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
- 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
- MSK_checkmemenv¶
MSKrescodee (MSKAPI MSK_checkmemenv) ( MSKenv_t env, const char * file, MSKint32t line)
Checks the memory allocated by the environment.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_checkmemtask¶
MSKrescodee (MSKAPI MSK_checkmemtask) ( MSKtask_t task, const char * file, MSKint32t line)
Checks the memory allocated by the task.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 ofMSK_RES_ERR_NEWER_DLL
,MSK_RES_ERR_OLDER_DLL
otherwise.
- 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, thenvalue
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, thenvalue
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
task
(MSKtask_t
) – An optimization task. (input)clonedtask
(MSKtask_t
by reference) – The cloned task. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 inasubc
. (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 inlsubc
andlvalc
. (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 inlsubc
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 codect
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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 itemitem
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_dot¶
MSKrescodee (MSKAPI MSK_dot) ( MSKenv_t env, MSKint32t n, const MSKrealt * x, const MSKrealt * y, MSKrealt * xty)
Computes the inner product of two vectors \(x,y\) of length \(n\geq 0\), i.e
\[x\cdot y= \sum_{i=1}^n x_i y_i.\]Note that if \(n=0\), then the result of the operation is 0.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsubj
. (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
- 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
- MSK_echointro¶
MSKrescodee (MSKAPI MSK_echointro) ( MSKenv_t env, MSKint32t longver)
Prints an intro to message stream.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_echotask¶
MSKrescodee (MSKAPIVA MSK_echotask) ( 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
- MSK_emptyafebarfrow¶
MSKrescodee (MSKAPI MSK_emptyafebarfrow) ( MSKtask_t task, MSKint64t afeidx)
Clears a row in \(\barF\) i.e. sets \(\barF_{\mathrm{afeidx},*} = 0\).
- Parameters
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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 toMSK_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
- 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
isMSK_TRANSPOSE_NO
then the update is\[y := \alpha A x + \beta y,\]and if
trans
isMSK_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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
andblk_val
must benumtrip
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
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)accfnnz
(MSKint64t
by reference) – Number of non-zeros in \(F\) implied by ACCs. (output)
- 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
- 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
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)n
(MSKint64t
by reference) – The total dimension of all affine conic constraints. (output)
- 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 byMSK_getnumacc
. The output arraysafeidxlist
andb
must have at least length determined byMSK_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
- 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
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of the column. (input)nzj
(MSKint32t
by reference) – Number of non-zeros in the \(j\)-th column of \(A\). (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 arrayssub
andval
. (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
- 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 arrayssub
andval
. (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
- 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
- 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
- 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
satisfiesfirst <= j < last
. The triplets corresponding to nonzero entries are stored in the arrayssubi
,subj
andval
.- 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 arrayssubi
,subj
, andval
. (input)subi
(MSKint32t
*
) – Constraint subscripts. (output)subj
(MSKint32t
*
) – Column subscripts. (output)val
(MSKrealt
*
) – Values. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
andvalkl
must bemaxnumtrip
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
- 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
andtermweight
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
task
(MSKtask_t
) – An optimization task. (input)numnz
(MSKint64t
by reference) – Number of non-zeros in \(F\). (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 rowafeidx
of \(F\). (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getafeftrip¶
MSKrescodee (MSKAPI MSK_getafeftrip) ( MSKtask_t task, MSKint64t * afeidx, MSKint32t * varidx, MSKrealt * val)
Obtains the \(F\) in triplet format.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
orMSK_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
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of the row. (input)nzi
(MSKint32t
by reference) – Number of non-zeros in the \(i\)-th row of \(A\). (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 arrayssub
andval
. (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
- 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 arrayssub
andval
. (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
- 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
- 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
- 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
satisfiesfirst <= i < last
. The triplets corresponding to nonzero entries are stored in the arrayssubi
,subj
andval
.- 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 arrayssubi
,subj
, andval
. (input)subi
(MSKint32t
*
) – Constraint subscripts. (output)subj
(MSKint32t
*
) – Column subscripts. (output)val
(MSKrealt
*
) – Values. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
andval
.- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getatruncatetol¶
MSKrescodee (MSKAPI MSK_getatruncatetol) ( MSKtask_t task, MSKrealt * tolzero)
Obtains the tolerance value set with
MSK_putatruncatetol
.- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
andvalijkl
must bemaxnum
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
- 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
andweights
must be at leastmaxnum
long. (input)i
(MSKint32t
by reference) – Row index of the element at positionidx
. (output)j
(MSKint32t
by reference) – Column index of the element at positionidx
. (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
- 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
task
(MSKtask_t
) – An optimization task. (input)idx
(MSKint64t
) – Position of the element in the vectorized form. (input)i
(MSKint32t
by reference) – Row index of the element at positionidx
. (output)j
(MSKint32t
by reference) – Column index of the element at positionidx
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
andMSK_getbaraidx
.- Parameters
task
(MSKtask_t
) – An optimization task. (input)maxnumnz
(MSKint64t
) – The arrayidxij
must be at leastmaxnumnz
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
- 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
andvaljkl
must bemaxnum
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
- 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
andweights
must be at leastmaxnum
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
- 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
- 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
- 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 usingMSK_getbarcidxinfo
andMSK_getbarcidx
.- Parameters
task
(MSKtask_t
) – An optimization task. (input)maxnumnz
(MSKint64t
) –idxj
must be at leastmaxnumnz
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
- 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
- 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 arraybarsslice
. (input)barsslice
(MSKrealt
*
) – Dual solution values of symmetric matrix variables in the slice, stored sequentially. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getbarvarname¶
MSKrescodee (MSKAPI MSK_getbarvarname) ( MSKtask_t task, MSKint32t i, MSKint32t sizename, char * name)
Obtains the name of a semidefinite variable.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 namesomename
is assigned to some semidefinite variable. (output)index
(MSKint32t
by reference) – The index of a semidefinite variable with the namesomename
(if one exists). (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getbarvarnamelen¶
MSKrescodee (MSKAPI MSK_getbarvarnamelen) ( MSKtask_t task, MSKint32t i, MSKint32t * len)
Obtains the length of the name of a semidefinite variable.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of the variable. (input)len
(MSKint32t
by reference) – Returns the length of the indicated name. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 arraybarxslice
. (input)barxslice
(MSKrealt
*
) – Solution values of symmetric matrix variables in the slice, stored sequentially. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- MSK_getc¶
MSKrescodee (MSKAPI MSK_getc) ( MSKtask_t task, MSKrealt * c)
Obtains all objective coefficients \(c\).
- Parameters
- 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 functionMSKcallbackfunc
associated withtask
. Iffunc
is identical toNULL
, then no callback function is associated with thetask
. (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
- MSK_getcfix¶
MSKrescodee (MSKAPI MSK_getcfix) ( MSKtask_t task, MSKrealt * cfix)
Obtains the fixed term in the objective.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)cfix
(MSKrealt
by reference) – Fixed term in the objective. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 tocode
. (output)str
(char
*
) – Obtains a short description of a response code. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getconbound¶
MSKrescodee (MSKAPI MSK_getconbound) ( MSKtask_t task, MSKint32t i, MSKboundkeye * bk, MSKrealt * bl, MSKrealt * bu)
Obtains bound information for one constraint.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of the constraint for which the bound information should be obtained. (input)bk
(MSKboundkeye
by reference) – Bound keys. (output)bl
(MSKrealt
by reference) – Values for lower bounds. (output)bu
(MSKrealt
by reference) – Values for upper bounds. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
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
- 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
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)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 namesomename
is assigned to some cone. (output)index
(MSKint32t
by reference) – If the namesomename
is assigned to some cone, thenindex
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
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of the cone. (input)len
(MSKint32t
by reference) – Returns the length of the indicated name. (output)
- 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
- 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 namesomename
is assigned to some constraint. (output)index
(MSKint32t
by reference) – If the namesomename
is assigned to a constraint, thenindex
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
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of the constraint. (input)len
(MSKint32t
by reference) – Returns the length of the indicated name. (output)
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getdjcb¶
MSKrescodee (MSKAPI MSK_getdjcb) ( MSKtask_t task, MSKint64t djcidx, MSKrealt * b)
Obtains the optional constant term vector of a disjunctive constraint.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getdjcdomainidxlist¶
MSKrescodee (MSKAPI MSK_getdjcdomainidxlist) ( MSKtask_t task, MSKint64t djcidx, MSKint64t * domidxlist)
Obtains the list of domain indexes in a disjunctive constraint.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getdjcname¶
MSKrescodee (MSKAPI MSK_getdjcname) ( MSKtask_t task, MSKint64t djcidx, MSKint32t sizename, char * name)
Obtains the name of a disjunctive constraint.
- Parameters
- 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
- 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
- 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
- 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
- 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
- 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
- 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
byMSK_getdjcnumdomaintot
,afeidxlist
andb
byMSK_getdjcnumafetot
,termsizelist
byMSK_getdjcnumtermtot
andnumterms
byMSK_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
- MSK_getdjctermsizelist¶
MSKrescodee (MSKAPI MSK_getdjctermsizelist) ( MSKtask_t task, MSKint64t djcidx, MSKint64t * termsizelist)
Obtains the list of term sizes in a disjunctive constraint.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getdomainn¶
MSKrescodee (MSKAPI MSK_getdomainn) ( MSKtask_t task, MSKint64t domidx, MSKint64t * n)
Obtains the dimension of the domain.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)domidx
(MSKint64t
) – Index of the domain. (input)n
(MSKint64t
by reference) – Dimension of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getdomainname¶
MSKrescodee (MSKAPI MSK_getdomainname) ( MSKtask_t task, MSKint64t domidx, MSKint32t sizename, char * name)
Obtains the name of a domain.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getdomainnamelen¶
MSKrescodee (MSKAPI MSK_getdomainnamelen) ( MSKtask_t task, MSKint64t domidx, MSKint32t * len)
Obtains the length of the name of a domain.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)domidx
(MSKint64t
) – Index of a domain. (input)len
(MSKint32t
by reference) – Returns the length of the indicated name. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getdomaintype¶
MSKrescodee (MSKAPI MSK_getdomaintype) ( MSKtask_t task, MSKint64t domidx, MSKdomaintypee * domtype)
Returns the type of the domain.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)domidx
(MSKint64t
) – Index of the domain. (input)domtype
(MSKdomaintypee
by reference) – The type of the domain. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- MSK_getdouparam¶
MSKrescodee (MSKAPI MSK_getdouparam) ( MSKtask_t task, MSKdparame param, MSKrealt * parvalue)
Obtains the value of a double parameter.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)param
(MSKdparame
) – Which parameter. (input)parvalue
(MSKrealt
by reference) – Parameter value. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)nrmy
(MSKrealt
by reference) – The norm of the \(y\) vector. (output)nrmslc
(MSKrealt
by reference) – The norm of the \(s_l^c\) vector. (output)nrmsuc
(MSKrealt
by reference) – The norm of the \(s_u^c\) vector. (output)nrmslx
(MSKrealt
by reference) – The norm of the \(s_l^x\) vector. (output)nrmsux
(MSKrealt
by reference) – The norm of the \(s_u^x\) vector. (output)nrmsnx
(MSKrealt
by reference) – The norm of the \(s_n^x\) vector. (output)nrmbars
(MSKrealt
by reference) – The norm of the \(\barS\) vector. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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 constraintsub[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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
- 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 ofsub
andviol
. (input)sub
(MSKint32t
*
) – An array of indexes of constraints. (input)viol
(MSKrealt
*
) –viol[k]
is the violation of dual solution associated with the constraintsub[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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 constraintsub[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (input)sub
(MSKint32t
*
) – An array of indexes of \(x\) variables. (input)viol
(MSKrealt
*
) –viol[k]
is the violation of dual solution associated with the variablesub[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getenv¶
MSKrescodee (MSKAPI MSK_getenv) ( MSKtask_t task, MSKenv_t * env)
Obtains the environment used to create the task.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)env
(MSKenv_t
by reference) – The MOSEK environment. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- MSK_getintparam¶
MSKrescodee (MSKAPI MSK_getintparam) ( MSKtask_t task, MSKiparame param, MSKint32t * parvalue)
Obtains the value of an integer parameter.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)param
(MSKiparame
) – Which parameter. (input)parvalue
(MSKint32t
by reference) – Parameter value. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
returnsMSK_RES_OK
andlastmsg
returns an empty string, otherwise the last response code different fromMSK_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 thelastmsg
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
- 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
returnsMSK_RES_OK
andlastmsg
returns an empty string, otherwise the last response code different fromMSK_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 thelastmsg
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
- 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
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)maxlen
(MSKint32t
by reference) – The maximum length of any name. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)meminuse
(MSKint64t
by reference) – Amount of memory currently used by thetask
. (output)maxmemuse
(MSKint64t
by reference) – Maximum amount of memory used by thetask
until now. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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 bufferparvalue
. (input)len
(MSKint32t
by reference) – Length of the string inparvalue
. (output)parvalue
(char
*
) – Parameter value. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 invalue
. (input)value
(char
*
by reference) – Parameter value. MOSEK will allocate this char buffer of size equal to the actual length of the string parameter plusnumaddchr
. This memory must be freed byMSK_freetask
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getnumacc¶
MSKrescodee (MSKAPI MSK_getnumacc) ( MSKtask_t task, MSKint64t * num)
Obtains the number of affine conic constraints.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)num
(MSKint64t
by reference) – The number of affine conic constraints. (output)
- 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
task
(MSKtask_t
) – An optimization task. (input)numafe
(MSKint64t
by reference) – Number of affine expressions. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- MSK_getnumbarvar¶
MSKrescodee (MSKAPI MSK_getnumbarvar) ( MSKtask_t task, MSKint32t * numbarvar)
Obtains the number of semidefinite variables.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)numbarvar
(MSKint32t
by reference) – Number of semidefinite variables in the problem. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getnumcon¶
MSKrescodee (MSKAPI MSK_getnumcon) ( MSKtask_t task, MSKint32t * numcon)
Obtains the number of constraints.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)numcon
(MSKint32t
by reference) – Number of constraints. (output)
- 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
task
(MSKtask_t
) – An optimization task. (input)numcone
(MSKint32t
by reference) – Number of conic constraints. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)k
(MSKint32t
) – Index of the cone. (input)nummem
(MSKint32t
by reference) – Number of member variables in the cone. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getnumdjc¶
MSKrescodee (MSKAPI MSK_getnumdjc) ( MSKtask_t task, MSKint64t * num)
Obtains the number of disjunctive constraints.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)num
(MSKint64t
by reference) – The number of disjunctive constraints. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getnumdomain¶
MSKrescodee (MSKAPI MSK_getnumdomain) ( MSKtask_t task, MSKint64t * numdomain)
Obtain the number of domains defined.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)numdomain
(MSKint64t
by reference) – Number of domains in the task. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getnumintvar¶
MSKrescodee (MSKAPI MSK_getnumintvar) ( MSKtask_t task, MSKint32t * numintvar)
Obtains the number of integer-constrained variables.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)numintvar
(MSKint32t
by reference) – Number of integer variables. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getnumparam¶
MSKrescodee (MSKAPI MSK_getnumparam) ( MSKtask_t task, MSKparametertypee partype, MSKint32t * numparam)
Obtains the number of parameters of a given type.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)partype
(MSKparametertypee
) – Parameter type. (input)numparam
(MSKint32t
by reference) – The number of parameters of typepartype
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- MSK_getnumsymmat¶
MSKrescodee (MSKAPI MSK_getnumsymmat) ( MSKtask_t task, MSKint64t * num)
Obtains the number of symmetric matrices stored in the vector \(E\).
- Parameters
task
(MSKtask_t
) – An optimization task. (input)num
(MSKint64t
by reference) – The number of symmetric sparse matrices. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getnumvar¶
MSKrescodee (MSKAPI MSK_getnumvar) ( MSKtask_t task, MSKint32t * numvar)
Obtains the number of variables.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)numvar
(MSKint32t
by reference) – Number of variables. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getobjname¶
MSKrescodee (MSKAPI MSK_getobjname) ( MSKtask_t task, MSKint32t sizeobjname, char * objname)
Obtains the name assigned to the objective function.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getobjnamelen¶
MSKrescodee (MSKAPI MSK_getobjnamelen) ( MSKtask_t task, MSKint32t * len)
Obtains the length of the name assigned to the objective function.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)len
(MSKint32t
by reference) – Assigned the length of the objective name. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getobjsense¶
MSKrescodee (MSKAPI MSK_getobjsense) ( MSKtask_t task, MSKobjsensee * sense)
Gets the objective sense of the task.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)sense
(MSKobjsensee
by reference) – The returned objective sense. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)partype
(MSKparametertypee
) – Parameter type. (input)parammax
(MSKint32t
by reference) – The maximum index (plus 1) of the given parameter type. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getparamname¶
MSKrescodee (MSKAPI MSK_getparamname) ( MSKtask_t task, MSKparametertypee partype, MSKint32t param, char * parname)
Obtains the name for a parameter
param
of typepartype
.- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)domidx
(MSKint64t
) – Index of the domain. (input)n
(MSKint64t
by reference) – Dimension of the domain. (output)nleft
(MSKint64t
by reference) – Number of variables on the left hand side. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- MSK_getprimalsolutionnorms¶
MSKrescodee (MSKAPI MSK_getprimalsolutionnorms) ( MSKtask_t task, MSKsoltypee whichsol, MSKrealt * nrmxc, MSKrealt * nrmxx, MSKrealt * nrmbarx)
Compute norms of the primal solution.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)nrmxc
(MSKrealt
by reference) – The norm of the \(x^c\) vector. (output)nrmxx
(MSKrealt
by reference) – The norm of the \(x\) vector. (output)nrmbarx
(MSKrealt
by reference) – The norm of the \(\barX\) vector. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getprobtype¶
MSKrescodee (MSKAPI MSK_getprobtype) ( MSKtask_t task, MSKproblemtypee * probtype)
Obtains the problem type.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)probtype
(MSKproblemtypee
by reference) – The problem type. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getprosta¶
MSKrescodee (MSKAPI MSK_getprosta) ( MSKtask_t task, MSKsoltypee whichsol, MSKprostae * problemsta)
Obtains the problem status.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)problemsta
(MSKprostae
by reference) – Problem status. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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 numberaccidxlist[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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
- 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 ofsub
andviol
. (input)sub
(MSKint32t
*
) – An array of indexes of constraints. (input)viol
(MSKrealt
*
) –viol[k]
is the violation associated with the solution for the constraintsub[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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 numbersub[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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 numberdjcidxlist[k]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsub
andviol
. (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
- 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
, andqcval
.- Parameters
task
(MSKtask_t
) – An optimization task. (input)k
(MSKint32t
) – Which constraint. (input)maxnumqcnz
(MSKint32t
) – Length of the arraysqcsubi
,qcsubj
, andqcval
. (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
, andqcval
.- Parameters
task
(MSKtask_t
) – An optimization task. (input)k
(MSKint32t
) – Which constraint. (input)maxnumqcnz
(MSKint64t
) – Length of the arraysqcsubi
,qcsubj
, andqcval
. (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
, andqoval
.- Parameters
task
(MSKtask_t
) – An optimization task. (input)maxnumqonz
(MSKint32t
) – The length of the arraysqosubi
,qosubj
, andqoval
. (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
- 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
, andqoval
.- Parameters
task
(MSKtask_t
) – An optimization task. (input)maxnumqonz
(MSKint64t
) – The length of the arraysqosubi
,qosubj
, andqoval
. (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
- 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
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Row index of the coefficient. (input)j
(MSKint32t
) – Column index of coefficient. (input)qoij
(MSKrealt
by reference) – The required coefficient. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- MSK_getresponseclass¶
MSKrescodee (MSKAPI MSK_getresponseclass) ( MSKrescodee r, MSKrescodetypee * rc)
Obtain the class of a response code.
- Parameters
r
(MSKrescodee
) – A response code indicating the result of function call. (input)rc
(MSKrescodetypee
by reference) – The response class. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- MSK_getsolsta¶
MSKrescodee (MSKAPI MSK_getsolsta) ( MSKtask_t task, MSKsoltypee whichsol, MSKsolstae * solutionsta)
Obtains the solution status.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)solutionsta
(MSKsolstae
by reference) – Solution status. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsolsta
are:MSK_SOL_STA_OPTIMAL
: An optimal solution satisfying the optimality criteria for continuous problems is returned.MSK_SOL_STA_INTEGER_OPTIMAL
: An optimal solution satisfying the optimality criteria for integer problems is returned.MSK_SOL_STA_PRIM_FEAS
: A solution satisfying the feasibility criteria.MSK_SOL_STA_PRIM_INFEAS_CER
: A primal certificate of infeasibility is returned.MSK_SOL_STA_DUAL_INFEAS_CER
: A dual certificate of infeasibility is returned.
In order to retrieve the primal and dual values of semidefinite variables see
MSK_getbarxj
andMSK_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
- 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
task
(MSKtask_t
) – An optimization task. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)pobj
(MSKrealt
by reference) – The primal objective value as computed byMSK_getprimalobj
. (output)pviolcon
(MSKrealt
by reference) – Maximal primal violation of the solution associated with the \(x^c\) variables where the violations are computed byMSK_getpviolcon
. (output)pviolvar
(MSKrealt
by reference) – Maximal primal violation of the solution for the \(x\) variables where the violations are computed byMSK_getpviolvar
. (output)pviolbarvar
(MSKrealt
by reference) – Maximal primal violation of solution for the \(\barX\) variables where the violations are computed byMSK_getpviolbarvar
. (output)pviolcone
(MSKrealt
by reference) – Maximal primal violation of solution for the conic constraints where the violations are computed byMSK_getpviolcones
. (output)pviolitg
(MSKrealt
by reference) – Maximal violation in the integer constraints. The violation for an integer variable \(x_j\) is given by \(\min(x_j-\lfloor x_j \rfloor,\lceil x_j \rceil - x_j)\). This number is always zero for the interior-point and basic solutions. (output)dobj
(MSKrealt
by reference) – Dual objective value as computed byMSK_getdualobj
. (output)dviolcon
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the \(x^c\) variable as computed byMSK_getdviolcon
. (output)dviolvar
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the \(x\) variable as computed byMSK_getdviolvar
. (output)dviolbarvar
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the \(\barS\) variable as computed byMSK_getdviolbarvar
. (output)dviolcone
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the dual conic constraints as computed byMSK_getdviolcones
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
task
(MSKtask_t
) – An optimization task. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)pobj
(MSKrealt
by reference) – The primal objective value as computed byMSK_getprimalobj
. (output)pviolcon
(MSKrealt
by reference) – Maximal primal violation of the solution associated with the \(x^c\) variables where the violations are computed byMSK_getpviolcon
. (output)pviolvar
(MSKrealt
by reference) – Maximal primal violation of the solution for the \(x\) variables where the violations are computed byMSK_getpviolvar
. (output)pviolbarvar
(MSKrealt
by reference) – Maximal primal violation of solution for the \(\barX\) variables where the violations are computed byMSK_getpviolbarvar
. (output)pviolcone
(MSKrealt
by reference) – Maximal primal violation of solution for the conic constraints where the violations are computed byMSK_getpviolcones
. (output)pviolacc
(MSKrealt
by reference) – Maximal primal violation of solution for the affine conic constraints where the violations are computed byMSK_getpviolacc
. (output)pvioldjc
(MSKrealt
by reference) – Maximal primal violation of solution for the disjunctive constraints where the violations are computed byMSK_getpvioldjc
. (output)pviolitg
(MSKrealt
by reference) – Maximal violation in the integer constraints. The violation for an integer variable \(x_j\) is given by \(\min(x_j-\lfloor x_j \rfloor,\lceil x_j \rceil - x_j)\). This number is always zero for the interior-point and basic solutions. (output)dobj
(MSKrealt
by reference) – Dual objective value as computed byMSK_getdualobj
. (output)dviolcon
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the \(x^c\) variable as computed byMSK_getdviolcon
. (output)dviolvar
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the \(x\) variable as computed byMSK_getdviolvar
. (output)dviolbarvar
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the \(\barS\) variable as computed byMSK_getdviolbarvar
. (output)dviolcone
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the dual conic constraints as computed byMSK_getdviolcones
. (output)dviolacc
(MSKrealt
by reference) – Maximal violation of the dual solution associated with the affine conic constraints as computed byMSK_getdviolacc
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
andMSK_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
- 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 parametersolitem
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 invalues
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 arrayssubi
,subj
andvalij
. (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
- 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 theparvalue
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
- 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 invalue
. (input)value
(char
*
by reference) – Parameter value. MOSEK will allocate this char buffer of size equal to the actual length of the string parameter plusnumaddchr
. This memory must be freed byMSK_freetask
. (input/output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getstrparamlen¶
MSKrescodee (MSKAPI MSK_getstrparamlen) ( MSKtask_t task, MSKsparame param, MSKint32t * len)
Obtains the length of a string parameter.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)param
(MSKsparame
) – Which parameter. (input)len
(MSKint32t
by reference) – The length of the parameter value. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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 thevalue
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
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)idx
(MSKint64t
) – Index of the matrix for which information is requested. (input)dim
(MSKint32t
by reference) – Returns the dimension of the requested matrix. (output)nz
(MSKint64t
by reference) – Returns the number of non-zeros in the requested matrix. (output)mattype
(MSKsymmattypee
by reference) – Returns the type of the requested matrix. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_gettaskname¶
MSKrescodee (MSKAPI MSK_gettaskname) ( MSKtask_t task, MSKint32t sizetaskname, char * taskname)
Obtains the name assigned to the task.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_gettasknamelen¶
MSKrescodee (MSKAPI MSK_gettasknamelen) ( MSKtask_t task, MSKint32t * len)
Obtains the length the task name.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)len
(MSKint32t
by reference) – Returns the length of the task name. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getvarbound¶
MSKrescodee (MSKAPI MSK_getvarbound) ( MSKtask_t task, MSKint32t i, MSKboundkeye * bk, MSKrealt * bl, MSKrealt * bu)
Obtains bound information for one variable.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of the variable for which the bound information should be obtained. (input)bk
(MSKboundkeye
by reference) – Bound keys. (output)bl
(MSKrealt
by reference) – Values for lower bounds. (output)bu
(MSKrealt
by reference) – Values for upper bounds. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
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
- 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 namesomename
is assigned to a variable. (output)index
(MSKint32t
by reference) – If the namesomename
is assigned to a variable, thenindex
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
task
(MSKtask_t
) – An optimization task. (input)i
(MSKint32t
) – Index of a variable. (input)len
(MSKint32t
by reference) – Returns the length of the indicated name. (output)
- 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
task
(MSKtask_t
) – An optimization task. (input)j
(MSKint32t
) – Index of the variable. (input)vartype
(MSKvariabletypee
by reference) – Variable type of the \(j\)-th variable. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 variablesubj[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 bysubj
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_getversion¶
MSKrescodee (MSKAPI MSK_getversion) ( MSKint32t * major, MSKint32t * minor, MSKint32t * revision)
Obtains MOSEK version information.
- Parameters
major
(MSKint32t
by reference) – Major version number. (output)minor
(MSKint32t
by reference) – Minor version number. (output)revision
(MSKint32t
by reference) – Revision number. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- 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 itemitem
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_infeasibilityreport¶
MSKrescodee (MSKAPI MSK_infeasibilityreport) ( MSKtask_t task, MSKstreamtypee whichstream, MSKsoltypee whichsol)
Prints the infeasibility report to an output stream.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
immediately before the first call to
MSK_solvewithbasis
, andimmediately before any subsequent call to
MSK_solvewithbasis
if the task has been modified.
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
- 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 towhichvalue
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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 itemitem
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 byfilename
.- 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
- 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 filefilename
.- 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
- 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 functionfunc
. (input)func
(MSKstreamfunc
) – All output to the streamwhichstream
is passed tofunc
. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 functionfunc
. (input)func
(MSKstreamfunc
) – All output to the streamwhichstream
is passed tofunc
. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_makeemptytask¶
MSKrescodee (MSKAPI MSK_makeemptytask) ( MSKenv_t env, MSKtask_t * task)
Creates a new optimization task.
- Parameters
env
(MSKenv_t
) – The MOSEK environment. (input)task
(MSKtask_t
by reference) – An optimization task. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_makeenv¶
MSKrescodee (MSKAPI MSK_makeenv) ( MSKenv_t * env, const char * dbgfile)
Creates a new MOSEK environment. The environment must be shared among all tasks in a program.
- Parameters
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
- 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
- MSK_onesolutionsummary¶
MSKrescodee (MSKAPI MSK_onesolutionsummary) ( MSKtask_t task, MSKstreamtypee whichstream, MSKsoltypee whichsol)
Prints a short summary of a specified solution.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
ormaxtime
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 thetask
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
- Groups
- 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 examplehttp://server:port
orhttps://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
orMSK_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 eitherMSK_RES_OK
or a termination response code. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_optimizersummary¶
MSKrescodee (MSKAPI MSK_optimizersummary) ( MSKtask_t task, MSKstreamtypee whichstream)
Prints a short summary with optimizer statistics from last optimization.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 argumenttrmcode
.- Parameters
task
(MSKtask_t
) – An optimization task. (input)trmcode
(MSKrescodee
by reference) – Is eitherMSK_RES_OK
or a termination response code. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 theuplo
parameter. It will contain the result on exit. (input/output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 isNULL
, 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 isNULL
, 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 isNULL
, 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 isNULL
, then all the weights are assumed to be \(1\). (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 ofsubi
andmarki
. (input)subi
(MSKint32t
*
) – Indexes of constraints to analyze. (input)marki
(MSKmarke
*
) – The value ofmarki[i]
indicates for which bound of constraintsubi[i]
sensitivity analysis is performed. Ifmarki[i]
=MSK_MARK_UP
the upper bound of constraintsubi[i]
is analyzed, and ifmarki[i]
=MSK_MARK_LO
the lower bound is analyzed. Ifsubi[i]
is an equality constraint, eitherMSK_MARK_LO
orMSK_MARK_UP
can be used to select the constraint for sensitivity analysis. (input)numj
(MSKint32t
) – Number of bounds on variables to be analyzed. Length ofsubj
andmarkj
. (input)subj
(MSKint32t
*
) – Indexes of variables to analyze. (input)markj
(MSKmarke
*
) – The value ofmarkj[j]
indicates for which bound of variablesubj[j]
sensitivity analysis is performed. Ifmarkj[j]
=MSK_MARK_UP
the upper bound of variablesubj[j]
is analyzed, and ifmarkj[j]
=MSK_MARK_LO
the lower bound is analyzed. Ifsubj[j]
is a fixed variable, eitherMSK_MARK_LO
orMSK_MARK_UP
can be used to select the bound for sensitivity analysis. (input)leftpricei
(MSKrealt
*
) –leftpricei[i]
is the left shadow price for the boundmarki[i]
of constraintsubi[i]
. (output)rightpricei
(MSKrealt
*
) –rightpricei[i]
is the right shadow price for the boundmarki[i]
of constraintsubi[i]
. (output)leftrangei
(MSKrealt
*
) –leftrangei[i]
is the left range \(\beta_1\) for the boundmarki[i]
of constraintsubi[i]
. (output)rightrangei
(MSKrealt
*
) –rightrangei[i]
is the right range \(\beta_2\) for the boundmarki[i]
of constraintsubi[i]
. (output)leftpricej
(MSKrealt
*
) –leftpricej[j]
is the left shadow price for the boundmarkj[j]
of variablesubj[j]
. (output)rightpricej
(MSKrealt
*
) –rightpricej[j]
is the right shadow price for the boundmarkj[j]
of variablesubj[j]
. (output)leftrangej
(MSKrealt
*
) –leftrangej[j]
is the left range \(\beta_1\) for the boundmarkj[j]
of variablesubj[j]
. (output)rightrangej
(MSKrealt
*
) –rightrangej[j]
is the right range \(\beta_2\) for the boundmarkj[j]
of variablesubj[j]
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 keyprobtype
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 keyprosta
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 inMSK_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 beNULL
if not required. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 beNULL
if not required. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 inMSK_appendacc
(see alsoMSK_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 beNULL
if not required. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_putaccname¶
MSKrescodee (MSKAPI MSK_putaccname) ( MSKtask_t task, MSKint64t accidx, const char * name)
Sets the name of an affine conic constraint.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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 thetermidx[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 indexafeidx[k]
, symmetric variable indexbarvaridx[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
andtermweight
. SeeMSK_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 indexafeidx
, symmetric variable indexbarvaridx[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
andtermweight
. SeeMSK_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 ofbarvaridx
,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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 arraysvaridx
andval
. 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 ofafeidx
. (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 arraysvaridx
andval
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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 thesub[k]
-th element of \(E\) in the weighted sum forming \(\barA_{ij}\). (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 thesub[k]
-th element of \(E\) in the weighted sum forming \(\barA_{ij}\). (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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 thesub[k]
-th element of \(E\) in the weighted sum forming \(\barC_j\). (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 inMSK_getbarsj
. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_putbarvarname¶
MSKrescodee (MSKAPI MSK_putbarvarname) ( MSKtask_t task, MSKint32t j, const char * name)
Sets the name of a semidefinite variable.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 inMSK_getbarxj
. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 isNULL
, then a previously defined callback function is removed. The progress function has the typeMSKcallbackfunc
. (input)handle
(MSKuserhandle_t
) – A pointer to a user-defined data structure. Whenever the functionfunc
is called, thenhandle
is passed to the function. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_putcfix¶
MSKrescodee (MSKAPI MSK_putcfix) ( MSKtask_t task, MSKrealt cfix)
Replaces the fixed term in the objective by a new one.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 exceedsMSK_DPAR_DATA_TOL_CJ_LARGE
, a warning is generated, but the coefficient is inputted as specified.- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 inMSK_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 thanMSK_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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_putconname¶
MSKrescodee (MSKAPI MSK_putconname) ( MSKtask_t task, MSKint32t i, const char * name)
Sets the name of a constraint.
- Parameters
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
andafeidxlist
, respectively. In particular, the length ofdomidxlist
must be equal to the sum of elements oftermsizelist
, and the length ofafeidxlist
must be equal to the sum of dimensions of all the domains appearing indomidxlist
.The elements of
domidxlist
are indexes of domains previously defined with one of theappend...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 asafeidxlist
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
- MSK_putdjcname¶
MSKrescodee (MSKAPI MSK_putdjcname) ( MSKtask_t task, MSKint64t djcidx, const char * name)
Sets the name of a disjunctive constraint.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 beNULL
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
- MSK_putdomainname¶
MSKrescodee (MSKAPI MSK_putdomainname) ( MSKtask_t task, MSKint64t domidx, const char * name)
Sets the name of a domain.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 toexitfunc
when called. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_putlicensedebug¶
MSKrescodee (MSKAPI MSK_putlicensedebug) ( MSKenv_t env, MSKint32t licdebug)
Enables debug information for the license system. If
licdebug
is non-zero, then MOSEK will print debug info regarding the license checkout.- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 forlicwait-1
milliseconds between each check for an available license.- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
andmaxnumvar
are zero.- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_putnadouparam¶
MSKrescodee (MSKAPI MSK_putnadouparam) ( MSKtask_t task, const char * paramname, MSKrealt parvalue)
Sets the value of a named double parameter.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_putnaintparam¶
MSKrescodee (MSKAPI MSK_putnaintparam) ( MSKtask_t task, const char * paramname, MSKint32t parvalue)
Sets the value of a named integer parameter.
- Parameters
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- MSK_putobjsense¶
MSKrescodee (MSKAPI MSK_putobjsense) ( MSKtask_t task, MSKobjsensee sense)
Sets the objective sense of the task.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)sense
(MSKobjsensee
) – The objective sense of the task. The valuesMSK_OBJECTIVE_SENSE_MAXIMIZE
andMSK_OBJECTIVE_SENSE_MINIMIZE
mean that the problem is maximized or minimized respectively. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
orhttps://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. PassingNULL
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
- 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 byparvalue
.- 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
- 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
- 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 numberk
and it does not modify the other constraints. See the description ofMSK_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
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 functionresponsefunc
whenever it is called. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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 thanMSK_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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- MSK_putvartype¶
MSKrescodee (MSKAPI MSK_putvartype) ( MSKtask_t task, MSKint32t j, MSKvariabletypee vartype)
Sets the variable type of one variable.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)j
(MSKint32t
) – Index of the variable. (input)vartype
(MSKvariabletypee
) – The new variable type. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 bysubj
. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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 byMSK_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
- 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
- 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
task
(MSKtask_t
) – An optimization task. (input)hread
(MSKhreadfunc
) – Handle read function. (input)h
(MSKuserhandle_t
) – Handle for reading. (input)format
(MSKdataformate
) – File data dormat. (input)compress
(MSKcompresstypee
) – Data compression type. (input)path
(char
*
)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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
- 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 byMSK_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
- 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
- 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 byMSK_SPAR_BAS_SOL_FILE_NAME
,MSK_SPAR_ITR_SOL_FILE_NAME
orMSK_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
- 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
- MSK_readsummary¶
MSKrescodee (MSKAPI MSK_readsummary) ( MSKtask_t task, MSKstreamtypee whichstream)
Prints a short summary of last file that was read.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 coderes
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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 streamwhichstream
. IfMSK_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
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 keysk
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 statussolsta
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_solutiondef¶
MSKrescodee (MSKAPI MSK_solutiondef) ( MSKtask_t task, MSKsoltypee whichsol, MSKbooleant * isdef)
Checks whether a solution is defined.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichsol
(MSKsoltypee
) – Selects a solution. (input)isdef
(MSKbooleant
by reference) – Is non-zero if the requested solution is defined. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- MSK_solutionsummary¶
MSKrescodee (MSKAPI MSK_solutionsummary) ( MSKtask_t task, MSKstreamtypee whichstream)
Prints a short summary of the current solutions.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 insub
it is required that \(\mathtt{val}[i] = 0\) when \(b[i] = 0\)). As outputval
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
- 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 columnj
. (input)lptrc
(MSKint64t
*
) –lptrc[j]
is a pointer to the first row index and value in columnj
. (input)lensubnval
(MSKint64t
) – Number of elements inlsubc
andlvalc
. (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 inlsubc
. (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
- 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 codeconetype
. (input)conetype
(MSKconetypee
by reference) – The cone type corresponding to the stringstr
. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 byuplo
is used. (input)w
(MSKrealt
*
) – Array of length at leastn
containing the eigenvalues of \(A\). (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 byuplo
is used. On exit it will be overwritten by the matrix \(U\). (input/output)w
(MSKrealt
*
) – Array of length at leastn
containing the eigenvalues of \(A\). (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 toMSK_TRANSPOSE_NO
and \(A\in \real^{n\times k}\), or\[C := \alpha A^T A + \beta C,\]when
trans
is set toMSK_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
- 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
- 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
- MSK_unlinkfuncfromtaskstream¶
MSKrescodee (MSKAPI MSK_unlinkfuncfromtaskstream) ( MSKtask_t task, MSKstreamtypee whichstream)
Disconnects a user-defined function from a task stream.
- Parameters
task
(MSKtask_t
) – An optimization task. (input)whichstream
(MSKstreamtypee
) – Index of the stream. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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, theninput[conv]=0
. (output)output
(MSKwchart
*
) – The input string converted to aMSKwchart
string. (output)input
(char
*
) – The UTF8 input string. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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, theninput[conv]=0
. (output)output
(char
*
) – The input string converted to a UTF8 string. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 thenpartype
andparam
denote the type and the index of the parameter, respectively.- Parameters
task
(MSKtask_t
) – An optimization task. (input)parname
(char
*
) – Parameter name. (input)partype
(MSKparametertypee
by reference) – Parameter type. (output)param
(MSKint32t
by reference) – Which parameter. (output)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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 functionfunc
(can beNULL
). (input)compress
(MSKcompresstypee
) – Data compression type. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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 extensionmps.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 toMSK_ON
.Data is written to the file
filename
if it is a nonempty string. Otherwise data is written to the file specified byMSK_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
- 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 functionfunc
(can beNULL
). (input)format
(MSKdataformate
) – Selects data format. (input)compress
(MSKcompresstypee
) – Selects compression type. (input)
- Return
(
MSKrescodee
) – The function response code.- Groups
- 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
- 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
- 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
- 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
- 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