15.3 Functions in alphabetical order

analyzenames
function analyzenames(task::MSKtask,
                      whichstream::Streamtype,
                      nametype::Nametype)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Groups:

Names

analyzeproblem
function analyzeproblem(task::MSKtask,
                        whichstream::Streamtype)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Inspecting the task

analyzesolution
function analyzesolution(task::MSKtask,
                         whichstream::Streamtype,
                         whichsol::Soltype)

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) – An optimization task. (input)

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

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

Groups:

Solution information, Inspecting the task

appendacc
function appendacc(task::MSKtask,
                   domidx::Int64,
                   afeidxlist::Vector{Int64},
                   b::Union{Nothing,Vector{Float64}})
function appendacc(task::MSKtask,
                   domidx::T0,
                   afeidxlist::T1,
                   b::T2)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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

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

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

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

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

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

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

  • afeidxlist (Int64[]) – List of affine expression indexes. (input)

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

Groups:

Problem data - affine conic constraints

appendaccs
function appendaccs(task::MSKtask,
                    domidxs::Vector{Int64},
                    afeidxlist::Vector{Int64},
                    b::Union{Nothing,Vector{Float64}})
function appendaccs(task::MSKtask,
                    domidxs::T0,
                    afeidxlist::T1,
                    b::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidxs (Int64[]) – Domain indices. (input)

  • afeidxlist (Int64[]) – List of affine expression indexes. (input)

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

Groups:

Problem data - affine conic constraints

appendaccseq
function appendaccseq(task::MSKtask,
                      domidx::Int64,
                      afeidxfirst::Int64,
                      b::Union{Nothing,Vector{Float64}})
function appendaccseq(task::MSKtask,
                      domidx::T0,
                      afeidxfirst::T1,
                      b::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

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

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

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

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

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

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

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

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

Groups:

Problem data - affine conic constraints

appendaccsseq
function appendaccsseq(task::MSKtask,
                       domidxs::Vector{Int64},
                       numafeidx::Int64,
                       afeidxfirst::Int64,
                       b::Union{Nothing,Vector{Float64}})
function appendaccsseq(task::MSKtask,
                       domidxs::T0,
                       numafeidx::T1,
                       afeidxfirst::T2,
                       b::T3)
    where { T0<:AbstractVector{<:Integer},
            T1<:Integer,
            T2<:Integer,
            T3<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidxs (Int64[]) – Domain indices. (input)

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

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

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

Groups:

Problem data - affine conic constraints

appendafes
function appendafes(task::MSKtask,
                    num::Int64)
function appendafes(task::MSKtask,
                    num::T0)
    where { T0<:Integer }

Appends a number of empty affine expressions to the task.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Problem data - affine expressions

appendbarvars
function appendbarvars(task::MSKtask,
                       dim::Vector{Int32})
function appendbarvars(task::MSKtask,
                       dim::T0)
    where { T0<:AbstractVector{<:Integer} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • dim (Int32[]) – Dimensions of symmetric matrix variables to be added. (input)

Groups:

Problem data - semidefinite

appendcone Deprecated
function appendcone(task::MSKtask,
                    ct::Conetype,
                    conepar::Float64,
                    submem::Vector{Int32})
function appendcone(task::MSKtask,
                    ct::Conetype,
                    conepar::T0,
                    submem::T1)
    where { T0<:Number,
            T1<:AbstractVector{<:Integer} }

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

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

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

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

Define

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

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

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

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

    \[2 \hat{x}_0 \hat{x}_1 \geq \sum_{i=2}^{i<\mathtt{nummem}} \hat{x}^2_i, \quad \hat{x}_{0}, \hat{x}_1 \geq 0\]
  • Primal exponential cone (MSK_CT_PEXP, requires \(\mathtt{nummem}=3\)):

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

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

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

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

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

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

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

  • Zero cone (MSK_CT_ZERO):

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

  • submem (Int32[]) – Variable subscripts of the members in the cone. (input)

Groups:

Problem data - cones (deprecated)

appendconeseq Deprecated
function appendconeseq(task::MSKtask,
                       ct::Conetype,
                       conepar::Float64,
                       nummem::Int32,
                       j::Int32)
function appendconeseq(task::MSKtask,
                       ct::Conetype,
                       conepar::T0,
                       nummem::T1,
                       j::T2)
    where { T0<:Number,
            T1<:Integer,
            T2<:Integer }

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 appendcone. The function assumes the members of cone are sequential where the first member has index j and the last j+nummem-1.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

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

Groups:

Problem data - cones (deprecated)

appendconesseq Deprecated
function appendconesseq(task::MSKtask,
                        ct::Vector{Conetype},
                        conepar::Vector{Float64},
                        nummem::Vector{Int32},
                        j::Int32)
function appendconesseq(task::MSKtask,
                        ct::Vector{Conetype},
                        conepar::T0,
                        nummem::T1,
                        j::T2)
    where { T0<:AbstractVector{<:Number},
            T1<:AbstractVector{<:Integer},
            T2<:Integer }

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 appendcone. The \(k\)th cone is assumed to be of dimension nummem[k]. Moreover, it is assumed that the first variable of the first cone has index \(j\) and starting from there the sequentially following variables belong to the first cone, then to the second cone and so on.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • ct (Conetype[]) – Specifies the type of the cone. (input)

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

  • nummem (Int32[]) – Numbers of member variables in the cones. (input)

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

Groups:

Problem data - cones (deprecated)

appendcons
function appendcons(task::MSKtask,
                    num::Int32)
function appendcons(task::MSKtask,
                    num::T0)
    where { T0<:Integer }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Problem data - linear part, Problem data - constraints

appenddjcs
function appenddjcs(task::MSKtask,
                    num::Int64)
function appenddjcs(task::MSKtask,
                    num::T0)
    where { T0<:Integer }

Appends a number of empty disjunctive constraints to the task.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Problem data - disjunctive constraints

appenddualexpconedomain
function appenddualexpconedomain(task::MSKtask) -> domidx :: Int64

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) – An optimization task. (input)

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appenddualgeomeanconedomain
function appenddualgeomeanconedomain(task::MSKtask,
                                     n::Int64) -> domidx :: Int64
function appenddualgeomeanconedomain(task::MSKtask,
                                     n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appenddualpowerconedomain
function appenddualpowerconedomain(task::MSKtask,
                                   n::Int64,
                                   alpha::Vector{Float64}) -> domidx :: Int64
function appenddualpowerconedomain(task::MSKtask,
                                   n::T0,
                                   alpha::T1)
    where { T0<:Integer,
            T1<:AbstractVector{<:Number} }
    -> domidx :: Int64

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) – An optimization task. (input)

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

  • alpha (Float64[]) – The sequence proportional to exponents. Must be positive. (input)

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendprimalexpconedomain
function appendprimalexpconedomain(task::MSKtask) -> domidx :: Int64

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) – An optimization task. (input)

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendprimalgeomeanconedomain
function appendprimalgeomeanconedomain(task::MSKtask,
                                       n::Int64) -> domidx :: Int64
function appendprimalgeomeanconedomain(task::MSKtask,
                                       n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendprimalpowerconedomain
function appendprimalpowerconedomain(task::MSKtask,
                                     n::Int64,
                                     alpha::Vector{Float64}) -> domidx :: Int64
function appendprimalpowerconedomain(task::MSKtask,
                                     n::T0,
                                     alpha::T1)
    where { T0<:Integer,
            T1<:AbstractVector{<:Number} }
    -> domidx :: Int64

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) – An optimization task. (input)

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

  • alpha (Float64[]) – The sequence proportional to exponents. Must be positive. (input)

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendquadraticconedomain
function appendquadraticconedomain(task::MSKtask,
                                   n::Int64) -> domidx :: Int64
function appendquadraticconedomain(task::MSKtask,
                                   n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendrdomain
function appendrdomain(task::MSKtask,
                       n::Int64) -> domidx :: Int64
function appendrdomain(task::MSKtask,
                       n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendrminusdomain
function appendrminusdomain(task::MSKtask,
                            n::Int64) -> domidx :: Int64
function appendrminusdomain(task::MSKtask,
                            n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendrplusdomain
function appendrplusdomain(task::MSKtask,
                           n::Int64) -> domidx :: Int64
function appendrplusdomain(task::MSKtask,
                           n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendrquadraticconedomain
function appendrquadraticconedomain(task::MSKtask,
                                    n::Int64) -> domidx :: Int64
function appendrquadraticconedomain(task::MSKtask,
                                    n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendrzerodomain
function appendrzerodomain(task::MSKtask,
                           n::Int64) -> domidx :: Int64
function appendrzerodomain(task::MSKtask,
                           n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendsparsesymmat
function appendsparsesymmat(task::MSKtask,
                            dim::Int32,
                            subi::Vector{Int32},
                            subj::Vector{Int32},
                            valij::Vector{Float64}) -> idx :: Int64
function appendsparsesymmat(task::MSKtask,
                            dim::T0,
                            subi::T1,
                            subj::T2,
                            valij::T3)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }
    -> idx :: Int64
function appendsparsesymmat(task::MSKtask,
                            dim::T0,
                            data:: SparseMatrixCSC{Float64})
    where { T0<:Integer }
    -> idx :: Int64

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • subi (Int32[]) – Row subscript in the triplets. (input)

  • subj (Int32[]) – Column subscripts in the triplets. (input)

  • valij (Float64[]) – Values of each triplet. (input)

  • data (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Return:

idx (Int64) – Unique index assigned to the inputted matrix that can be used for later reference.

Groups:

Problem data - semidefinite

appendsparsesymmatlist
function appendsparsesymmatlist(task::MSKtask,
                                dims::Vector{Int32},
                                nz::Vector{Int64},
                                subi::Vector{Int32},
                                subj::Vector{Int32},
                                valij::Vector{Float64}) -> idx :: Vector{Int64}
function appendsparsesymmatlist(task::MSKtask,
                                dims::T0,
                                nz::T1,
                                subi::T2,
                                subj::T3,
                                valij::T4)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Number} }
    -> idx :: Vector{Int64}

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • dims (Int32[]) – Dimensions of the symmetric matrixes. (input)

  • nz (Int64[]) – Number of nonzeros for each matrix. (input)

  • subi (Int32[]) – Row subscript in the triplets. (input)

  • subj (Int32[]) – Column subscripts in the triplets. (input)

  • valij (Float64[]) – Values of each triplet. (input)

Return:

idx (Int64[]) – Unique index assigned to the inputted matrix that can be used for later reference.

Groups:

Problem data - semidefinite

appendsvecpsdconedomain
function appendsvecpsdconedomain(task::MSKtask,
                                 n::Int64) -> domidx :: Int64
function appendsvecpsdconedomain(task::MSKtask,
                                 n::T0)
    where { T0<:Integer }
    -> domidx :: Int64

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) – An optimization task. (input)

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

Return:

domidx (Int64) – Index of the domain.

Groups:

Problem data - domain

appendvars
function appendvars(task::MSKtask,
                    num::Int32)
function appendvars(task::MSKtask,
                    num::T0)
    where { T0<:Integer }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Problem data - linear part, Problem data - variables

asyncgetlog
function asyncgetlog(task::MSKtask,
                     addr::AbstractString,
                     accesstoken::Union{Nothing,AbstractString},
                     token::AbstractString)

Get the optimizer log from a remote job.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • addr (AbstractString) – Address of the solver server (input)

  • accesstoken (AbstractString) – Access token string or nothing if no token is given. (input)

  • token (AbstractString) – Job token (input)

Groups:

Remote optimization

asyncgetresult
function asyncgetresult(task::MSKtask,
                        address::AbstractString,
                        accesstoken::AbstractString,
                        token::AbstractString) -> (respavailable :: Bool,resp :: Rescode,trm :: Rescode)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • address (AbstractString) – Address of the OptServer. (input)

  • accesstoken (AbstractString) – Access token. (input)

  • token (AbstractString) – The task token. (input)

Return:
  • respavailable (Bool) – Indicates if a remote response is available. If this is not true, resp and trm should be ignored.

  • resp (Rescode) – Is the response code from the remote solver.

  • trm (Rescode) – Is either MSK_RES_OK or a termination response code.

Groups:

Remote optimization

asyncoptimize
function asyncoptimize(task::MSKtask,
                       address::AbstractString,
                       accesstoken::AbstractString) -> token :: String

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

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • address (AbstractString) – Address of the OptServer. (input)

  • accesstoken (AbstractString) – Access token. (input)

Return:

token (String) – Returns the task token.

Groups:

Remote optimization

asyncpoll
function asyncpoll(task::MSKtask,
                   address::AbstractString,
                   accesstoken::AbstractString,
                   token::AbstractString) -> (respavailable :: Bool,resp :: Rescode,trm :: Rescode)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • address (AbstractString) – Address of the OptServer. (input)

  • accesstoken (AbstractString) – Access token. (input)

  • token (AbstractString) – The task token. (input)

Return:
  • respavailable (Bool) – Indicates if a remote response is available. If this is not true, resp and trm should be ignored.

  • resp (Rescode) – Is the response code from the remote solver.

  • trm (Rescode) – Is either MSK_RES_OK or a termination response code.

Groups:

Remote optimization

asyncstop
function asyncstop(task::MSKtask,
                   address::AbstractString,
                   accesstoken::AbstractString,
                   token::AbstractString)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • address (AbstractString) – Address of the OptServer. (input)

  • accesstoken (AbstractString) – Access token. (input)

  • token (AbstractString) – The task token. (input)

Groups:

Remote optimization

basiscond
function basiscond(task::MSKtask) -> (nrmbasis :: Float64,nrminvbasis :: Float64)

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) – An optimization task. (input)

Return:
  • nrmbasis (Float64) – An estimate for the 1-norm of the basis.

  • nrminvbasis (Float64) – An estimate for the 1-norm of the inverse of the basis.

Groups:

Solving systems with basis matrix

bktostr
function bktostr(task::MSKtask,
                 bk::Boundkey) -> str :: String

Obtains an identifier string corresponding to a bound key.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

str (String) – String corresponding to the bound key code bk.

Groups:

Names

callbackcodetostr
function callbackcodetostr(code::Callbackcode) -> callbackcodestr :: String

Obtains the string representation of a callback code.

Parameters:

code (Callbackcode) – A callback code. (input)

Return:

callbackcodestr (String) – String corresponding to the callback code.

Groups:

Names

checkinall
function checkinall(env::MSKenv)
function checkinall()

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

Parameters:

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

Groups:

License system

checkinlicense
function checkinlicense(env::MSKenv,
                        feature::Feature)
function checkinlicense(feature::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 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) – The MOSEK environment. (input)

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

Groups:

License system

checkmem
function checkmem(task::MSKtask,
                  file::AbstractString,
                  line::Int32)
function checkmem(task::MSKtask,
                  file::Union{Nothing,AbstractString},
                  line::T0)
    where { T0<:Integer }

Checks the memory allocated by the task.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Groups:

System, memory and debugging

checkoutlicense
function checkoutlicense(env::MSKenv,
                         feature::Feature)
function checkoutlicense(feature::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 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 checkinlicense is called.

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

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

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

Groups:

License system

chgconbound
function chgconbound(task::MSKtask,
                     i::Int32,
                     lower::Int32,
                     finite::Int32,
                     value::Float64)
function chgconbound(task::MSKtask,
                     i::T0,
                     lower::T1,
                     finite::T2,
                     value::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Integer,
            T3<:Number }

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) – An optimization task. (input)

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

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

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

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

Groups:

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

chgvarbound
function chgvarbound(task::MSKtask,
                     j::Int32,
                     lower::Int32,
                     finite::Int32,
                     value::Float64)
function chgvarbound(task::MSKtask,
                     j::T0,
                     lower::T1,
                     finite::T2,
                     value::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Integer,
            T3<:Number }

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) – An optimization task. (input)

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

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

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

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

Groups:

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

clearcallbackfunc
function clearcallbackfunc(task::MSKtask)

Detaches a callback function.

Parameters:

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

Groups:

Logging, Callback

clearstreamfunc
function clearstreamfunc(task::MSKtask,
                         whichstream::Streamtype)

Detaches a stream callback function.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Logging, Callback

commitchanges
function commitchanges(task::MSKtask)

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) – An optimization task. (input)

Groups:

Environment and task management

computesparsecholesky
function computesparsecholesky(env::MSKenv,
                               numthreads::Int32,
                               ordermethod::Int32,
                               tolsingular::Float64,
                               anzc::Vector{Int32},
                               aptrc::Vector{Int64},
                               asubc::Vector{Int32},
                               avalc::Vector{Float64}) -> (perm :: Int32,diag :: Float64,lnzc :: Int32,lptrc :: Int64,lensubnval :: Int64,lsubc :: Int32,lvalc :: Float64)
function computesparsecholesky(env::MSKenv,
                               numthreads::T0,
                               ordermethod::T1,
                               tolsingular::T2,
                               anzc::T3,
                               aptrc::T4,
                               asubc::T5,
                               avalc::T6)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number,
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Integer},
            T6<:AbstractVector{<:Number} }
    -> (perm :: Int32,diag :: Float64,lnzc :: Int32,lptrc :: Int64,lensubnval :: Int64,lsubc :: Int32,lvalc :: Float64)
function computesparsecholesky(numthreads::Int32,
                               ordermethod::Int32,
                               tolsingular::Float64,
                               anzc::Vector{Int32},
                               aptrc::Vector{Int64},
                               asubc::Vector{Int32},
                               avalc::Vector{Float64}) -> (perm :: Int32,diag :: Float64,lnzc :: Int32,lptrc :: Int64,lensubnval :: Int64,lsubc :: Int32,lvalc :: Float64)
function computesparsecholesky(numthreads::T0,
                               ordermethod::T1,
                               tolsingular::T2,
                               anzc::T3,
                               aptrc::T4,
                               asubc::T5,
                               avalc::T6)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number,
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Integer},
            T6<:AbstractVector{<:Number} }
    -> (perm :: Int32,diag :: Float64,lnzc :: Int32,lptrc :: Int64,lensubnval :: Int64,lsubc :: Int32,lvalc :: Float64)

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.

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

  • numthreads (Int32) – 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 (Int32) – If nonzero, then a sparsity preserving ordering will be employed. (input)

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

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

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

  • asubc (Int32[]) – Row indexes for each column stored in increasing order. (input)

  • avalc (Float64[]) – The value corresponding to row indexed stored in asubc. (input)

Return:
  • perm (Int32) – Permutation array used to specify the permutation matrix \(P\) computed by the function.

  • diag (Float64) – The diagonal elements of matrix \(D\).

  • lnzc (Int32) – lnzc[j] is the number of non zero elements in column \(j\) of \(L\).

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

  • lensubnval (Int64) – Number of elements in lsubc and lvalc.

  • lsubc (Int32) – Row indexes for each column stored in increasing order.

  • lvalc (Float64) – The values corresponding to row indexed stored in lsubc.

Groups:

Linear algebra

conetypetostr Deprecated
function conetypetostr(task::MSKtask,
                       ct::Conetype) -> str :: String

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) – An optimization task. (input)

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

Return:

str (String) – String corresponding to the cone type code ct.

Groups:

Names

deletesolution
function deletesolution(task::MSKtask,
                        whichsol::Soltype)

Undefine a solution and free the memory it uses.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Environment and task management, Solution information

dinfitemtostr
function dinfitemtostr(item::Dinfitem) -> str :: String

Obtains an identifier string corresponding to a information item.

Parameters:

item (Dinfitem) – Information item. (input)

Return:

str (String) – String corresponding to the bound information item item.

Groups:

Names

dualsensitivity
function dualsensitivity(task::MSKtask,
                         subj::Vector{Int32}) -> (leftpricej :: Vector{Float64},rightpricej :: Vector{Float64},leftrangej :: Vector{Float64},rightrangej :: Vector{Float64})
function dualsensitivity(task::MSKtask,
                         subj::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> (leftpricej :: Vector{Float64},rightpricej :: Vector{Float64},leftrangej :: Vector{Float64},rightrangej :: Vector{Float64})

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) – An optimization task. (input)

  • subj (Int32[]) – Indexes of objective coefficients to analyze. (input)

Return:
  • leftpricej (Float64[]) – \(\mathtt{leftpricej}[j]\) is the left shadow price for the coefficient with index \(\mathtt{subj[j]}\).

  • rightpricej (Float64[]) – \(\mathtt{rightpricej}[j]\) is the right shadow price for the coefficient with index \(\mathtt{subj[j]}\).

  • leftrangej (Float64[]) – \(\mathtt{leftrangej}[j]\) is the left range \(\beta_1\) for the coefficient with index \(\mathtt{subj[j]}\).

  • rightrangej (Float64[]) – \(\mathtt{rightrangej}[j]\) is the right range \(\beta_2\) for the coefficient with index \(\mathtt{subj[j]}\).

Groups:

Sensitivity analysis

echointro
function echointro(env::MSKenv,
                   longver::Int32)
function echointro(env::MSKenv,
                   longver::T0)
    where { T0<:Integer }
function echointro(longver::Int32)
function echointro(longver::T0)
    where { T0<:Integer }

Prints an intro to message stream.

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

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

Groups:

Logging

emptyafebarfrow
function emptyafebarfrow(task::MSKtask,
                         afeidx::Int64)
function emptyafebarfrow(task::MSKtask,
                         afeidx::T0)
    where { T0<:Integer }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Problem data - affine expressions, Problem data - semidefinite

emptyafebarfrowlist
function emptyafebarfrowlist(task::MSKtask,
                             afeidxlist::Vector{Int64})
function emptyafebarfrowlist(task::MSKtask,
                             afeidxlist::T0)
    where { T0<:AbstractVector{<:Integer} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidxlist (Int64[]) – Indices of rows in \(\barF\) to clear. (input)

Groups:

Problem data - affine expressions, Problem data - semidefinite

emptyafefcol
function emptyafefcol(task::MSKtask,
                      varidx::Int32)
function emptyafefcol(task::MSKtask,
                      varidx::T0)
    where { T0<:Integer }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Problem data - affine expressions

emptyafefcollist
function emptyafefcollist(task::MSKtask,
                          varidx::Vector{Int32})
function emptyafefcollist(task::MSKtask,
                          varidx::T0)
    where { T0<:AbstractVector{<:Integer} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • varidx (Int32[]) – Indices of variables (columns) in \(F\) to clear. (input)

Groups:

Problem data - affine expressions

emptyafefrow
function emptyafefrow(task::MSKtask,
                      afeidx::Int64)
function emptyafefrow(task::MSKtask,
                      afeidx::T0)
    where { T0<:Integer }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Problem data - affine expressions

emptyafefrowlist
function emptyafefrowlist(task::MSKtask,
                          afeidx::Vector{Int64})
function emptyafefrowlist(task::MSKtask,
                          afeidx::T0)
    where { T0<:AbstractVector{<:Integer} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64[]) – Indices of rows in \(F\) to clear. (input)

Groups:

Problem data - affine expressions

evaluateacc
function evaluateacc(task::MSKtask,
                     whichsol::Soltype,
                     accidx::Int64) -> activity :: Vector{Float64}
function evaluateacc(task::MSKtask,
                     whichsol::Soltype,
                     accidx::T0)
    where { T0<:Integer }
    -> activity :: Vector{Float64}

Evaluates the activity of an affine conic constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:

activity (Float64[]) – The activity of the affine conic constraint. The array should have length equal to the dimension of the constraint.

Groups:

Solution - primal, Problem data - affine conic constraints

evaluateaccs
function evaluateaccs(task::MSKtask,
                      whichsol::Soltype) -> activity :: Vector{Float64}

Evaluates the activities of all affine conic constraints.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

activity (Float64[]) – The activity of affine conic constraints. The array should have length equal to the sum of dimensions of all affine conic constraints.

Groups:

Solution - primal, Problem data - affine conic constraints

expirylicenses
function expirylicenses(env::MSKenv) -> expiry :: Int64
function expirylicenses() -> expiry :: Int64

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 resetexpirylicenses, until now.

Parameters:

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

Return:

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

Groups:

License system

getaccafeidxlist
function getaccafeidxlist(task::MSKtask,
                          accidx::Int64) -> afeidxlist :: Vector{Int64}
function getaccafeidxlist(task::MSKtask,
                          accidx::T0)
    where { T0<:Integer }
    -> afeidxlist :: Vector{Int64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

afeidxlist (Int64[]) – List of indexes of affine expressions appearing in the constraint.

Groups:

Problem data - affine conic constraints, Inspecting the task

getaccb
function getaccb(task::MSKtask,
                 accidx::Int64) -> b :: Vector{Float64}
function getaccb(task::MSKtask,
                 accidx::T0)
    where { T0<:Integer }
    -> b :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

b (Float64[]) – The vector b appearing in the constraint.

Groups:

Problem data - affine conic constraints, Inspecting the task

getaccbarfblocktriplet
function getaccbarfblocktriplet(task::MSKtask) -> (numtrip :: Int64,acc_afe :: Vector{Int64},bar_var :: Vector{Int32},blk_row :: Vector{Int32},blk_col :: Vector{Int32},blk_val :: Vector{Float64})

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) – An optimization task. (input)

Return:
  • numtrip (Int64) – Number of elements in the block triplet form.

  • acc_afe (Int64[]) – Index of the AFE within the concatenated list of AFEs in ACCs.

  • bar_var (Int32[]) – Symmetric matrix variable index.

  • blk_row (Int32[]) – Block row index.

  • blk_col (Int32[]) – Block column index.

  • blk_val (Float64[]) – The numerical value associated with each block triplet.

Groups:

Problem data - affine expressions, Problem data - semidefinite

getaccbarfnumblocktriplets
function getaccbarfnumblocktriplets(task::MSKtask) -> numtrip :: Int64

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

Parameters:

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

Return:

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

Groups:

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

getaccdomain
function getaccdomain(task::MSKtask,
                      accidx::Int64) -> domidx :: Int64
function getaccdomain(task::MSKtask,
                      accidx::T0)
    where { T0<:Integer }
    -> domidx :: Int64

Obtains the domain appearing in the affine conic constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

domidx (Int64) – The index of domain in the affine conic constraint.

Groups:

Problem data - affine conic constraints, Inspecting the task

getaccdoty
function getaccdoty(task::MSKtask,
                    whichsol::Soltype,
                    accidx::Int64) -> doty :: Vector{Float64}
function getaccdoty(task::MSKtask,
                    whichsol::Soltype,
                    accidx::T0)
    where { T0<:Integer }
    -> doty :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:

doty (Float64[]) – The dual values for this affine conic constraint. The array should have length equal to the dimension of the constraint.

Groups:

Solution - dual, Problem data - affine conic constraints

getaccdotys
function getaccdotys(task::MSKtask,
                     whichsol::Soltype) -> doty :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

doty (Float64[]) – The dual values of affine conic constraints. The array should have length equal to the sum of dimensions of all affine conic constraints.

Groups:

Solution - dual, Problem data - affine conic constraints

getaccfnumnz
function getaccfnumnz(task::MSKtask) -> accfnnz :: Int64

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) – An optimization task. (input)

Return:

accfnnz (Int64) – Number of non-zeros in \(F\) implied by ACCs.

Groups:

Problem data - affine conic constraints, Inspecting the task

getaccftrip
function getaccftrip(task::MSKtask) -> (frow :: Vector{Int64},fcol :: Vector{Int32},fval :: Vector{Float64})

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

Parameters:

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

Return:
  • frow (Int64[]) – Row indices of nonzeros in the implied F matrix.

  • fcol (Int32[]) – Column indices of nonzeros in the implied F matrix.

  • fval (Float64[]) – Values of nonzero entries in the implied F matrix.

Groups:

Problem data - affine conic constraints, Inspecting the task

getaccgvector
function getaccgvector(task::MSKtask) -> g :: Vector{Float64}

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

Parameters:

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

Return:

g (Float64[]) – The \(g\) used within the ACCs as a dense vector. The length is sum of the dimensions of the ACCs.

Groups:

Inspecting the task, Problem data - affine conic constraints

getaccn
function getaccn(task::MSKtask,
                 accidx::Int64) -> n :: Int64
function getaccn(task::MSKtask,
                 accidx::T0)
    where { T0<:Integer }
    -> n :: Int64

Obtains the dimension of the affine conic constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

n (Int64) – The dimension of the affine conic constraint (equal to the dimension of its domain).

Groups:

Problem data - affine conic constraints, Inspecting the task

getaccname
function getaccname(task::MSKtask,
                    accidx::Int64) -> name :: String
function getaccname(task::MSKtask,
                    accidx::T0)
    where { T0<:Integer }
    -> name :: String

Obtains the name of an affine conic constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

name (String) – Returns the required name.

Groups:

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

getaccnamelen
function getaccnamelen(task::MSKtask,
                       accidx::Int64) -> len :: Int32
function getaccnamelen(task::MSKtask,
                       accidx::T0)
    where { T0<:Integer }
    -> len :: Int32

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

len (Int32) – Returns the length of the indicated name.

Groups:

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

getaccntot
function getaccntot(task::MSKtask) -> n :: Int64

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

Parameters:

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

Return:

n (Int64) – The total dimension of all affine conic constraints.

Groups:

Problem data - affine conic constraints, Inspecting the task

getaccs
function getaccs(task::MSKtask) -> (domidxlist :: Vector{Int64},afeidxlist :: Vector{Int64},b :: Vector{Float64})

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

Parameters:

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

Return:
  • domidxlist (Int64[]) – The list of domains appearing in all affine conic constraints.

  • afeidxlist (Int64[]) – The concatenation of index lists of affine expressions appearing in all affine conic constraints.

  • b (Float64[]) – The concatenation of vectors b appearing in all affine conic constraints.

Groups:

Problem data - affine conic constraints, Inspecting the task

getacol
function getacol(task::MSKtask,
                 j::Int32) -> (nzj :: Int32,subj :: Vector{Int32},valj :: Vector{Float64})
function getacol(task::MSKtask,
                 j::T0)
    where { T0<:Integer }
    -> (nzj :: Int32,subj :: Vector{Int32},valj :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • nzj (Int32) – Number of non-zeros in the column obtained.

  • subj (Int32[]) – Row indices of the non-zeros in the column obtained.

  • valj (Float64[]) – Numerical values in the column obtained.

Groups:

Problem data - linear part, Inspecting the task

getacolnumnz
function getacolnumnz(task::MSKtask,
                      i::Int32) -> nzj :: Int32
function getacolnumnz(task::MSKtask,
                      i::T0)
    where { T0<:Integer }
    -> nzj :: Int32

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the column. (input)

Return:

nzj (Int32) – Number of non-zeros in the \(j\)-th column of \(A\).

Groups:

Problem data - linear part, Inspecting the task

getacolslice
function getacolslice(task::MSKtask,
                      first::Int32,
                      last::Int32) -> (ptrb :: Vector{Int64},ptre :: Vector{Int64},sub :: Vector{Int32},val :: Vector{Float64})
function getacolslice(task::MSKtask,
                      first::T0,
                      last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> (ptrb :: Vector{Int64},ptre :: Vector{Int64},sub :: Vector{Int32},val :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • first (Int32) – Index of the first column in the sequence. (input)

  • last (Int32) – Index of the last column in the sequence plus one. (input)

Return:
  • ptrb (Int64[]) – ptrb[t] is an index pointing to the first element in the \(t\)-th column obtained.

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

  • sub (Int32[]) – Contains the row subscripts.

  • val (Float64[]) – Contains the coefficient values.

Groups:

Problem data - linear part, Inspecting the task

getacolslicenumnz
function getacolslicenumnz(task::MSKtask,
                           first::Int32,
                           last::Int32) -> numnz :: Int64
function getacolslicenumnz(task::MSKtask,
                           first::T0,
                           last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> numnz :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • first (Int32) – Index of the first column in the sequence. (input)

  • last (Int32) – Index of the last column plus one in the sequence. (input)

Return:

numnz (Int64) – Number of non-zeros in the slice.

Groups:

Problem data - linear part, Inspecting the task

getacolslicetrip
function getacolslicetrip(task::MSKtask,
                          first::Int32,
                          last::Int32) -> (subi :: Vector{Int32},subj :: Vector{Int32},val :: Vector{Float64})
function getacolslicetrip(task::MSKtask,
                          first::T0,
                          last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> (subi :: Vector{Int32},subj :: Vector{Int32},val :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • first (Int32) – Index of the first column in the sequence. (input)

  • last (Int32) – Index of the last column in the sequence plus one. (input)

Return:
  • subi (Int32[]) – Constraint subscripts.

  • subj (Int32[]) – Column subscripts.

  • val (Float64[]) – Values.

Groups:

Problem data - linear part, Inspecting the task

getafebarfblocktriplet
function getafebarfblocktriplet(task::MSKtask) -> (numtrip :: Int64,afeidx :: Vector{Int64},barvaridx :: Vector{Int32},subk :: Vector{Int32},subl :: Vector{Int32},valkl :: Vector{Float64})

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

Parameters:

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

Return:
  • numtrip (Int64) – Number of elements in the block triplet form.

  • afeidx (Int64[]) – Constraint index.

  • barvaridx (Int32[]) – Symmetric matrix variable index.

  • subk (Int32[]) – Block row index.

  • subl (Int32[]) – Block column index.

  • valkl (Float64[]) – The numerical value associated with each block triplet.

Groups:

Problem data - affine expressions, Problem data - semidefinite

getafebarfnumblocktriplets
function getafebarfnumblocktriplets(task::MSKtask) -> numtrip :: Int64

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

Parameters:

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

Return:

numtrip (Int64) – An upper bound on the number of elements in the block triplet form of \(\barF.\)

Groups:

Problem data - semidefinite, Inspecting the task

getafebarfnumrowentries
function getafebarfnumrowentries(task::MSKtask,
                                 afeidx::Int64) -> numentr :: Int32
function getafebarfnumrowentries(task::MSKtask,
                                 afeidx::T0)
    where { T0<:Integer }
    -> numentr :: Int32

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) – An optimization task. (input)

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

Return:

numentr (Int32) – Number of nonzero entries in a row of \(\barF\).

Groups:

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

getafebarfrow
function getafebarfrow(task::MSKtask,
                       afeidx::Int64) -> (barvaridx :: Vector{Int32},ptrterm :: Vector{Int64},numterm :: Vector{Int64},termidx :: Vector{Int64},termweight :: Vector{Float64})
function getafebarfrow(task::MSKtask,
                       afeidx::T0)
    where { T0<:Integer }
    -> (barvaridx :: Vector{Int32},ptrterm :: Vector{Int64},numterm :: Vector{Int64},termidx :: Vector{Int64},termweight :: Vector{Float64})

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • barvaridx (Int32[]) – Semidefinite variable indices of nonzero entries in the row of \(\barF\).

  • ptrterm (Int64[]) – Pointers to the start of each entry’s description.

  • numterm (Int64[]) – Number of terms in the weighted sum representation of each entry.

  • termidx (Int64[]) – Indices of semidefinite matrices from the matrix store \(E\).

  • termweight (Float64[]) – Weights appearing in the weighted sum representations of all entries.

Groups:

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

getafebarfrowinfo
function getafebarfrowinfo(task::MSKtask,
                           afeidx::Int64) -> (numentr :: Int32,numterm :: Int64)
function getafebarfrowinfo(task::MSKtask,
                           afeidx::T0)
    where { T0<:Integer }
    -> (numentr :: Int32,numterm :: Int64)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • numentr (Int32) – Number of nonzero entries in a row of \(\barF\).

  • numterm (Int64) – Number of terms in the weighted sums representation of the row of \(\barF\).

Groups:

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

getafefnumnz
function getafefnumnz(task::MSKtask) -> numnz :: Int64

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

Parameters:

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

Return:

numnz (Int64) – Number of non-zeros in \(F\).

Groups:

Problem data - affine expressions, Inspecting the task

getafefrow
function getafefrow(task::MSKtask,
                    afeidx::Int64) -> (numnz :: Int32,varidx :: Vector{Int32},val :: Vector{Float64})
function getafefrow(task::MSKtask,
                    afeidx::T0)
    where { T0<:Integer }
    -> (numnz :: Int32,varidx :: Vector{Int32},val :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • numnz (Int32) – Number of non-zeros in the row obtained.

  • varidx (Int32[]) – Column indices of the non-zeros in the row obtained.

  • val (Float64[]) – Values of the non-zeros in the row obtained.

Groups:

Problem data - affine expressions, Inspecting the task

getafefrownumnz
function getafefrownumnz(task::MSKtask,
                         afeidx::Int64) -> numnz :: Int32
function getafefrownumnz(task::MSKtask,
                         afeidx::T0)
    where { T0<:Integer }
    -> numnz :: Int32

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

numnz (Int32) – Number of non-zeros in row afeidx of \(F\).

Groups:

Problem data - affine expressions, Inspecting the task

getafeftrip
function getafeftrip(task::MSKtask) -> (afeidx :: Vector{Int64},varidx :: Vector{Int32},val :: Vector{Float64})

Obtains the \(F\) in triplet format.

Parameters:

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

Return:
  • afeidx (Int64[]) – Row indices of nonzeros.

  • varidx (Int32[]) – Column indices of nonzeros.

  • val (Float64[]) – Values of nonzero entries.

Groups:

Problem data - affine expressions, Inspecting the task

getafeg
function getafeg(task::MSKtask,
                 afeidx::Int64) -> g :: Float64
function getafeg(task::MSKtask,
                 afeidx::T0)
    where { T0<:Integer }
    -> g :: Float64

Obtains a single coefficient in \(g\).

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

g (Float64) – The value of \(g_{\mathrm{afeidx}}\).

Groups:

Problem data - affine expressions, Inspecting the task

getafegslice
function getafegslice(task::MSKtask,
                      first::Int64,
                      last::Int64) -> g :: Vector{Float64}
function getafegslice(task::MSKtask,
                      first::T0,
                      last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> g :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:

g (Float64[]) – The slice \(g\) as a dense vector. The length is last-first.

Groups:

Inspecting the task, Problem data - affine expressions

getaij
function getaij(task::MSKtask,
                i::Int32,
                j::Int32) -> aij :: Float64
function getaij(task::MSKtask,
                i::T0,
                j::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> aij :: Float64

Obtains a single coefficient in \(A\).

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:

aij (Float64) – The required coefficient \(a_{i,j}\).

Groups:

Problem data - linear part, Inspecting the task

getapiecenumnz
function getapiecenumnz(task::MSKtask,
                        firsti::Int32,
                        lasti::Int32,
                        firstj::Int32,
                        lastj::Int32) -> numnz :: Int32
function getapiecenumnz(task::MSKtask,
                        firsti::T0,
                        lasti::T1,
                        firstj::T2,
                        lastj::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Integer,
            T3<:Integer }
    -> numnz :: Int32

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 getarownumnz or getacolnumnz.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

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

Return:

numnz (Int32) – Number of non-zero \(A\) elements in the rectangular piece.

Groups:

Problem data - linear part, Inspecting the task

getarow
function getarow(task::MSKtask,
                 i::Int32) -> (nzi :: Int32,subi :: Vector{Int32},vali :: Vector{Float64})
function getarow(task::MSKtask,
                 i::T0)
    where { T0<:Integer }
    -> (nzi :: Int32,subi :: Vector{Int32},vali :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • nzi (Int32) – Number of non-zeros in the row obtained.

  • subi (Int32[]) – Column indices of the non-zeros in the row obtained.

  • vali (Float64[]) – Numerical values of the row obtained.

Groups:

Problem data - linear part, Inspecting the task

getarownumnz
function getarownumnz(task::MSKtask,
                      i::Int32) -> nzi :: Int32
function getarownumnz(task::MSKtask,
                      i::T0)
    where { T0<:Integer }
    -> nzi :: Int32

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

nzi (Int32) – Number of non-zeros in the \(i\)-th row of \(A\).

Groups:

Problem data - linear part, Inspecting the task

getarowslice
function getarowslice(task::MSKtask,
                      first::Int32,
                      last::Int32) -> (ptrb :: Vector{Int64},ptre :: Vector{Int64},sub :: Vector{Int32},val :: Vector{Float64})
function getarowslice(task::MSKtask,
                      first::T0,
                      last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> (ptrb :: Vector{Int64},ptre :: Vector{Int64},sub :: Vector{Int32},val :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • first (Int32) – Index of the first row in the sequence. (input)

  • last (Int32) – Index of the last row in the sequence plus one. (input)

Return:
  • ptrb (Int64[]) – ptrb[t] is an index pointing to the first element in the \(t\)-th row obtained.

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

  • sub (Int32[]) – Contains the column subscripts.

  • val (Float64[]) – Contains the coefficient values.

Groups:

Problem data - linear part, Inspecting the task

getarowslicenumnz
function getarowslicenumnz(task::MSKtask,
                           first::Int32,
                           last::Int32) -> numnz :: Int64
function getarowslicenumnz(task::MSKtask,
                           first::T0,
                           last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> numnz :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • first (Int32) – Index of the first row in the sequence. (input)

  • last (Int32) – Index of the last row plus one in the sequence. (input)

Return:

numnz (Int64) – Number of non-zeros in the slice.

Groups:

Problem data - linear part, Inspecting the task

getarowslicetrip
function getarowslicetrip(task::MSKtask,
                          first::Int32,
                          last::Int32) -> (subi :: Vector{Int32},subj :: Vector{Int32},val :: Vector{Float64})
function getarowslicetrip(task::MSKtask,
                          first::T0,
                          last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> (subi :: Vector{Int32},subj :: Vector{Int32},val :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • first (Int32) – Index of the first row in the sequence. (input)

  • last (Int32) – Index of the last row in the sequence plus one. (input)

Return:
  • subi (Int32[]) – Constraint subscripts.

  • subj (Int32[]) – Column subscripts.

  • val (Float64[]) – Values.

Groups:

Problem data - linear part, Inspecting the task

getatrip
function getatrip(task::MSKtask) -> (subi :: Vector{Int32},subj :: Vector{Int32},val :: Vector{Float64})

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

Parameters:

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

Return:
  • subi (Int32[]) – Constraint subscripts.

  • subj (Int32[]) – Column subscripts.

  • val (Float64[]) – Values.

Groups:

Problem data - linear part, Inspecting the task

getatruncatetol
function getatruncatetol(task::MSKtask) -> tolzero :: Vector{Float64}

Obtains the tolerance value set with putatruncatetol.

Parameters:

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

Return:

tolzero (Float64[]) – All elements \(|a_{i,j}|\) less than this tolerance is truncated to zero.

Groups:

Parameters, Problem data - linear part

getbarablocktriplet
function getbarablocktriplet(task::MSKtask) -> (num :: Int64,subi :: Vector{Int32},subj :: Vector{Int32},subk :: Vector{Int32},subl :: Vector{Int32},valijkl :: Vector{Float64})

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

Parameters:

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

Return:
  • num (Int64) – Number of elements in the block triplet form.

  • subi (Int32[]) – Constraint index.

  • subj (Int32[]) – Symmetric matrix variable index.

  • subk (Int32[]) – Block row index.

  • subl (Int32[]) – Block column index.

  • valijkl (Float64[]) – The numerical value associated with each block triplet.

Groups:

Problem data - semidefinite, Inspecting the task

getbaraidx
function getbaraidx(task::MSKtask,
                    idx::Int64) -> (i :: Int32,j :: Int32,num :: Int64,sub :: Vector{Int64},weights :: Vector{Float64})
function getbaraidx(task::MSKtask,
                    idx::T0)
    where { T0<:Integer }
    -> (i :: Int32,j :: Int32,num :: Int64,sub :: Vector{Int64},weights :: Vector{Float64})

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) – An optimization task. (input)

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

Return:
  • i (Int32) – Row index of the element at position idx.

  • j (Int32) – Column index of the element at position idx.

  • num (Int64) – Number of terms in weighted sum that forms the element.

  • sub (Int64[]) – A list indexes of the elements from symmetric matrix storage that appear in the weighted sum.

  • weights (Float64[]) – The weights associated with each term in the weighted sum.

Groups:

Problem data - semidefinite, Inspecting the task

getbaraidxij
function getbaraidxij(task::MSKtask,
                      idx::Int64) -> (i :: Int32,j :: Int32)
function getbaraidxij(task::MSKtask,
                      idx::T0)
    where { T0<:Integer }
    -> (i :: Int32,j :: Int32)

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) – An optimization task. (input)

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

Return:
  • i (Int32) – Row index of the element at position idx.

  • j (Int32) – Column index of the element at position idx.

Groups:

Problem data - semidefinite, Inspecting the task

getbaraidxinfo
function getbaraidxinfo(task::MSKtask,
                        idx::Int64) -> num :: Int64
function getbaraidxinfo(task::MSKtask,
                        idx::T0)
    where { T0<:Integer }
    -> num :: Int64

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 appendsparsesymmat for details about the weighted sum.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

num (Int64) – Number of terms in the weighted sum that form the specified element in \(\barA\).

Groups:

Problem data - semidefinite, Inspecting the task

getbarasparsity
function getbarasparsity(task::MSKtask) -> (numnz :: Int64,idxij :: Vector{Int64})

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 getbaraidxinfo and getbaraidx.

Parameters:

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

Return:
  • numnz (Int64) – Number of nonzero elements in \(\barA\).

  • idxij (Int64[]) – Position of each nonzero element in the vectorized form of \(\barA\).

Groups:

Problem data - semidefinite, Inspecting the task

getbarcblocktriplet
function getbarcblocktriplet(task::MSKtask) -> (num :: Int64,subj :: Vector{Int32},subk :: Vector{Int32},subl :: Vector{Int32},valjkl :: Vector{Float64})

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

Parameters:

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

Return:
  • num (Int64) – Number of elements in the block triplet form.

  • subj (Int32[]) – Symmetric matrix variable index.

  • subk (Int32[]) – Block row index.

  • subl (Int32[]) – Block column index.

  • valjkl (Float64[]) – The numerical value associated with each block triplet.

Groups:

Problem data - semidefinite, Inspecting the task

getbarcidx
function getbarcidx(task::MSKtask,
                    idx::Int64) -> (j :: Int32,num :: Int64,sub :: Vector{Int64},weights :: Vector{Float64})
function getbarcidx(task::MSKtask,
                    idx::T0)
    where { T0<:Integer }
    -> (j :: Int32,num :: Int64,sub :: Vector{Int64},weights :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • j (Int32) – Row index in \(\barC\).

  • num (Int64) – Number of terms in the weighted sum.

  • sub (Int64[]) – Elements appearing the weighted sum.

  • weights (Float64[]) – Weights of terms in the weighted sum.

Groups:

Problem data - semidefinite, Inspecting the task

getbarcidxinfo
function getbarcidxinfo(task::MSKtask,
                        idx::Int64) -> num :: Int64
function getbarcidxinfo(task::MSKtask,
                        idx::T0)
    where { T0<:Integer }
    -> num :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

num (Int64) – Number of terms that appear in the weighted sum that forms the requested element.

Groups:

Problem data - semidefinite, Inspecting the task

getbarcidxj
function getbarcidxj(task::MSKtask,
                     idx::Int64) -> j :: Int32
function getbarcidxj(task::MSKtask,
                     idx::T0)
    where { T0<:Integer }
    -> j :: Int32

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

j (Int32) – Row index in \(\barC\).

Groups:

Problem data - semidefinite, Inspecting the task

getbarcsparsity
function getbarcsparsity(task::MSKtask) -> (numnz :: Int64,idxj :: Vector{Int64})

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

Parameters:

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

Return:
  • numnz (Int64) – Number of nonzero elements in \(\barC\).

  • idxj (Int64[]) – Internal positions of the nonzeros elements in \(\barC\).

Groups:

Problem data - semidefinite, Inspecting the task

getbarsj
function getbarsj(task::MSKtask,
                  whichsol::Soltype,
                  j::Int32) -> barsj :: Vector{Float64}
function getbarsj(task::MSKtask,
                  whichsol::Soltype,
                  j::T0)
    where { T0<:Integer }
    -> barsj :: Vector{Float64}

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) – An optimization task. (input)

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

  • j (Int32) – Index of the semidefinite variable. (input)

Return:

barsj (Float64[]) – Value of \(\barS_j\).

Groups:

Solution - semidefinite

getbarsslice
function getbarsslice(task::MSKtask,
                      whichsol::Soltype,
                      first::Int32,
                      last::Int32,
                      slicesize::Int64) -> barsslice :: Vector{Float64}
function getbarsslice(task::MSKtask,
                      whichsol::Soltype,
                      first::T0,
                      last::T1,
                      slicesize::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Integer }
    -> barsslice :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • first (Int32) – Index of the first semidefinite variable in the slice. (input)

  • last (Int32) – Index of the last semidefinite variable in the slice plus one. (input)

  • slicesize (Int64) – Denotes the length of the array barsslice. (input)

Return:

barsslice (Float64[]) – Dual solution values of symmetric matrix variables in the slice, stored sequentially.

Groups:

Solution - semidefinite

getbarvarname
function getbarvarname(task::MSKtask,
                       i::Int32) -> name :: String
function getbarvarname(task::MSKtask,
                       i::T0)
    where { T0<:Integer }
    -> name :: String

Obtains the name of a semidefinite variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the variable. (input)

Return:

name (String) – The requested name is copied to this buffer.

Groups:

Names, Inspecting the task

getbarvarnameindex
function getbarvarnameindex(task::MSKtask,
                            somename::AbstractString) -> (asgn :: Int32,index :: Int32)

Obtains the index of semidefinite variable from its name.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • somename (AbstractString) – The name of the variable. (input)

Return:
  • asgn (Int32) – Non-zero if the name somename is assigned to some semidefinite variable.

  • index (Int32) – The index of a semidefinite variable with the name somename (if one exists).

Groups:

Names, Inspecting the task

getbarvarnamelen
function getbarvarnamelen(task::MSKtask,
                          i::Int32) -> len :: Int32
function getbarvarnamelen(task::MSKtask,
                          i::T0)
    where { T0<:Integer }
    -> len :: Int32

Obtains the length of the name of a semidefinite variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the variable. (input)

Return:

len (Int32) – Returns the length of the indicated name.

Groups:

Names, Inspecting the task

getbarxj
function getbarxj(task::MSKtask,
                  whichsol::Soltype,
                  j::Int32) -> barxj :: Vector{Float64}
function getbarxj(task::MSKtask,
                  whichsol::Soltype,
                  j::T0)
    where { T0<:Integer }
    -> barxj :: Vector{Float64}

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) – An optimization task. (input)

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

  • j (Int32) – Index of the semidefinite variable. (input)

Return:

barxj (Float64[]) – Value of \(\barX_j\).

Groups:

Solution - semidefinite

getbarxslice
function getbarxslice(task::MSKtask,
                      whichsol::Soltype,
                      first::Int32,
                      last::Int32,
                      slicesize::Int64) -> barxslice :: Vector{Float64}
function getbarxslice(task::MSKtask,
                      whichsol::Soltype,
                      first::T0,
                      last::T1,
                      slicesize::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Integer }
    -> barxslice :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • first (Int32) – Index of the first semidefinite variable in the slice. (input)

  • last (Int32) – Index of the last semidefinite variable in the slice plus one. (input)

  • slicesize (Int64) – Denotes the length of the array barxslice. (input)

Return:

barxslice (Float64[]) – Solution values of symmetric matrix variables in the slice, stored sequentially.

Groups:

Solution - semidefinite

getc
function getc(task::MSKtask) -> c :: Vector{Float64}

Obtains all objective coefficients \(c\).

Parameters:

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

Return:

c (Float64[]) – Linear terms of the objective as a dense vector. The length is the number of variables.

Groups:

Problem data - linear part, Inspecting the task, Problem data - variables

getcfix
function getcfix(task::MSKtask) -> cfix :: Float64

Obtains the fixed term in the objective.

Parameters:

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

Return:

cfix (Float64) – Fixed term in the objective.

Groups:

Problem data - linear part, Inspecting the task

getcj
function getcj(task::MSKtask,
               j::Int32) -> cj :: Float64
function getcj(task::MSKtask,
               j::T0)
    where { T0<:Integer }
    -> cj :: Float64

Obtains one coefficient of \(c\).

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable for which the \(c\) coefficient should be obtained. (input)

Return:

cj (Float64) – The value of \(c_j\).

Groups:

Problem data - linear part, Inspecting the task, Problem data - variables

getclist
function getclist(task::MSKtask,
                  subj::Vector{Int32}) -> c :: Vector{Float64}
function getclist(task::MSKtask,
                  subj::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> c :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subj (Int32[]) – A list of variable indexes. (input)

Return:

c (Float64[]) – Linear terms of the requested list of the objective as a dense vector.

Groups:

Inspecting the task, Problem data - linear part

getcodedesc
function getcodedesc(code::Rescode) -> (symname :: String,str :: String)

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

Parameters:

code (Rescode) – A valid MOSEK response code. (input)

Return:
  • symname (String) – Symbolic name corresponding to code.

  • str (String) – Obtains a short description of a response code.

Groups:

Names, Responses, errors and warnings

getconbound
function getconbound(task::MSKtask,
                     i::Int32) -> (bk :: Boundkey,bl :: Float64,bu :: Float64)
function getconbound(task::MSKtask,
                     i::T0)
    where { T0<:Integer }
    -> (bk :: Boundkey,bl :: Float64,bu :: Float64)

Obtains bound information for one constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the constraint for which the bound information should be obtained. (input)

Return:
  • bk (Boundkey) – Bound keys.

  • bl (Float64) – Values for lower bounds.

  • bu (Float64) – Values for upper bounds.

Groups:

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - constraints

getconboundslice
function getconboundslice(task::MSKtask,
                          first::Int32,
                          last::Int32) -> (bk :: Vector{Boundkey},bl :: Vector{Float64},bu :: Vector{Float64})
function getconboundslice(task::MSKtask,
                          first::T0,
                          last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> (bk :: Vector{Boundkey},bl :: Vector{Float64},bu :: Vector{Float64})

Obtains bounds information for a slice of the constraints.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:
  • bk (Boundkey[]) – Bound keys.

  • bl (Float64[]) – Values for lower bounds.

  • bu (Float64[]) – Values for upper bounds.

Groups:

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - constraints

getcone Deprecated
function getcone(task::MSKtask,
                 k::Int32) -> (ct :: Conetype,conepar :: Float64,nummem :: Int32,submem :: Vector{Int32})
function getcone(task::MSKtask,
                 k::T0)
    where { T0<:Integer }
    -> (ct :: Conetype,conepar :: Float64,nummem :: Int32,submem :: Vector{Int32})

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) – An optimization task. (input)

  • k (Int32) – Index of the cone. (input)

Return:
  • ct (Conetype) – Specifies the type of the cone.

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

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

  • submem (Int32[]) – Variable subscripts of the members in the cone.

Groups:

Inspecting the task, Problem data - cones (deprecated)

getconeinfo Deprecated
function getconeinfo(task::MSKtask,
                     k::Int32) -> (ct :: Conetype,conepar :: Float64,nummem :: Int32)
function getconeinfo(task::MSKtask,
                     k::T0)
    where { T0<:Integer }
    -> (ct :: Conetype,conepar :: Float64,nummem :: Int32)

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) – An optimization task. (input)

  • k (Int32) – Index of the cone. (input)

Return:
  • ct (Conetype) – Specifies the type of the cone.

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

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

Groups:

Inspecting the task, Problem data - cones (deprecated)

getconename Deprecated
function getconename(task::MSKtask,
                     i::Int32) -> name :: String
function getconename(task::MSKtask,
                     i::T0)
    where { T0<:Integer }
    -> name :: String

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) – An optimization task. (input)

  • i (Int32) – Index of the cone. (input)

Return:

name (String) – The required name.

Groups:

Names, Problem data - cones (deprecated), Inspecting the task

getconenameindex Deprecated
function getconenameindex(task::MSKtask,
                          somename::AbstractString) -> (asgn :: Int32,index :: Int32)

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) – An optimization task. (input)

  • somename (AbstractString) – The name which should be checked. (input)

Return:
  • asgn (Int32) – Is non-zero if the name somename is assigned to some cone.

  • index (Int32) – If the name somename is assigned to some cone, then index is the index of the cone.

Groups:

Names, Problem data - cones (deprecated), Inspecting the task

getconenamelen Deprecated
function getconenamelen(task::MSKtask,
                        i::Int32) -> len :: Int32
function getconenamelen(task::MSKtask,
                        i::T0)
    where { T0<:Integer }
    -> len :: Int32

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) – An optimization task. (input)

  • i (Int32) – Index of the cone. (input)

Return:

len (Int32) – Returns the length of the indicated name.

Groups:

Names, Problem data - cones (deprecated), Inspecting the task

getconname
function getconname(task::MSKtask,
                    i::Int32) -> name :: String
function getconname(task::MSKtask,
                    i::T0)
    where { T0<:Integer }
    -> name :: String

Obtains the name of a constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the constraint. (input)

Return:

name (String) – The required name.

Groups:

Names, Problem data - linear part, Problem data - constraints, Inspecting the task

getconnameindex
function getconnameindex(task::MSKtask,
                         somename::AbstractString) -> (asgn :: Int32,index :: Int32)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • somename (AbstractString) – The name which should be checked. (input)

Return:
  • asgn (Int32) – Is non-zero if the name somename is assigned to some constraint.

  • index (Int32) – If the name somename is assigned to a constraint, then index is the index of the constraint.

Groups:

Names, Problem data - linear part, Problem data - constraints, Inspecting the task

getconnamelen
function getconnamelen(task::MSKtask,
                       i::Int32) -> len :: Int32
function getconnamelen(task::MSKtask,
                       i::T0)
    where { T0<:Integer }
    -> len :: Int32

Obtains the length of the name of a constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the constraint. (input)

Return:

len (Int32) – Returns the length of the indicated name.

Groups:

Names, Problem data - linear part, Problem data - constraints, Inspecting the task

getcslice
function getcslice(task::MSKtask,
                   first::Int32,
                   last::Int32) -> c :: Vector{Float64}
function getcslice(task::MSKtask,
                   first::T0,
                   last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> c :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:

c (Float64[]) – Linear terms of the requested slice of the objective as a dense vector. The length is last-first.

Groups:

Inspecting the task, Problem data - linear part

getdimbarvarj
function getdimbarvarj(task::MSKtask,
                       j::Int32) -> dimbarvarj :: Int32
function getdimbarvarj(task::MSKtask,
                       j::T0)
    where { T0<:Integer }
    -> dimbarvarj :: Int32

Obtains the dimension of a symmetric matrix variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the semidefinite variable whose dimension is requested. (input)

Return:

dimbarvarj (Int32) – The dimension of the \(j\)-th semidefinite variable.

Groups:

Inspecting the task, Problem data - semidefinite

getdjcafeidxlist
function getdjcafeidxlist(task::MSKtask,
                          djcidx::Int64) -> afeidxlist :: Vector{Int64}
function getdjcafeidxlist(task::MSKtask,
                          djcidx::T0)
    where { T0<:Integer }
    -> afeidxlist :: Vector{Int64}

Obtains the list of affine expression indexes in a disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

Return:

afeidxlist (Int64[]) – List of affine expression indexes.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcb
function getdjcb(task::MSKtask,
                 djcidx::Int64) -> b :: Vector{Float64}
function getdjcb(task::MSKtask,
                 djcidx::T0)
    where { T0<:Integer }
    -> b :: Vector{Float64}

Obtains the optional constant term vector of a disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

Return:

b (Float64[]) – The vector b.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcdomainidxlist
function getdjcdomainidxlist(task::MSKtask,
                             djcidx::Int64) -> domidxlist :: Vector{Int64}
function getdjcdomainidxlist(task::MSKtask,
                             djcidx::T0)
    where { T0<:Integer }
    -> domidxlist :: Vector{Int64}

Obtains the list of domain indexes in a disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

Return:

domidxlist (Int64[]) – List of term sizes.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcname
function getdjcname(task::MSKtask,
                    djcidx::Int64) -> name :: String
function getdjcname(task::MSKtask,
                    djcidx::T0)
    where { T0<:Integer }
    -> name :: String

Obtains the name of a disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of a disjunctive constraint. (input)

Return:

name (String) – Returns the required name.

Groups:

Names, Problem data - disjunctive constraints, Inspecting the task

getdjcnamelen
function getdjcnamelen(task::MSKtask,
                       djcidx::Int64) -> len :: Int32
function getdjcnamelen(task::MSKtask,
                       djcidx::T0)
    where { T0<:Integer }
    -> len :: Int32

Obtains the length of the name of a disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of a disjunctive constraint. (input)

Return:

len (Int32) – Returns the length of the indicated name.

Groups:

Names, Problem data - disjunctive constraints, Inspecting the task

getdjcnumafe
function getdjcnumafe(task::MSKtask,
                      djcidx::Int64) -> numafe :: Int64
function getdjcnumafe(task::MSKtask,
                      djcidx::T0)
    where { T0<:Integer }
    -> numafe :: Int64

Obtains the number of affine expressions in the disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

Return:

numafe (Int64) – Number of affine expressions in the disjunctive constraint.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcnumafetot
function getdjcnumafetot(task::MSKtask) -> numafetot :: Int64

Obtains the total number of affine expressions in all disjunctive constraints.

Parameters:

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

Return:

numafetot (Int64) – Number of affine expressions in all disjunctive constraints.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcnumdomain
function getdjcnumdomain(task::MSKtask,
                         djcidx::Int64) -> numdomain :: Int64
function getdjcnumdomain(task::MSKtask,
                         djcidx::T0)
    where { T0<:Integer }
    -> numdomain :: Int64

Obtains the number of domains in the disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

Return:

numdomain (Int64) – Number of domains in the disjunctive constraint.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcnumdomaintot
function getdjcnumdomaintot(task::MSKtask) -> numdomaintot :: Int64

Obtains the total number of domains in all disjunctive constraints.

Parameters:

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

Return:

numdomaintot (Int64) – Number of domains in all disjunctive constraints.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcnumterm
function getdjcnumterm(task::MSKtask,
                       djcidx::Int64) -> numterm :: Int64
function getdjcnumterm(task::MSKtask,
                       djcidx::T0)
    where { T0<:Integer }
    -> numterm :: Int64

Obtains the number terms in the disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

Return:

numterm (Int64) – Number of terms in the disjunctive constraint.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcnumtermtot
function getdjcnumtermtot(task::MSKtask) -> numtermtot :: Int64

Obtains the total number of terms in all disjunctive constraints.

Parameters:

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

Return:

numtermtot (Int64) – Total number of terms in all disjunctive constraints.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjcs
function getdjcs(task::MSKtask) -> (domidxlist :: Vector{Int64},afeidxlist :: Vector{Int64},b :: Vector{Float64},termsizelist :: Vector{Int64},numterms :: Vector{Int64})

Obtains full data of all disjunctive constraints. The output arrays must have minimal lengths determined by the following methods: domainidxlist by getdjcnumdomaintot, afeidxlist and b by getdjcnumafetot, termsizelist by getdjcnumtermtot and numterms by getnumdomain.

Parameters:

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

Return:
  • domidxlist (Int64[]) – The concatenation of index lists of domains appearing in all disjunctive constraints.

  • afeidxlist (Int64[]) – The concatenation of index lists of affine expressions appearing in all disjunctive constraints.

  • b (Float64[]) – The concatenation of vectors b appearing in all disjunctive constraints.

  • termsizelist (Int64[]) – The concatenation of lists of term sizes appearing in all disjunctive constraints.

  • numterms (Int64[]) – The number of terms in each of the disjunctive constraints.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdjctermsizelist
function getdjctermsizelist(task::MSKtask,
                            djcidx::Int64) -> termsizelist :: Vector{Int64}
function getdjctermsizelist(task::MSKtask,
                            djcidx::T0)
    where { T0<:Integer }
    -> termsizelist :: Vector{Int64}

Obtains the list of term sizes in a disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

Return:

termsizelist (Int64[]) – List of term sizes.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getdomainn
function getdomainn(task::MSKtask,
                    domidx::Int64) -> n :: Int64
function getdomainn(task::MSKtask,
                    domidx::T0)
    where { T0<:Integer }
    -> n :: Int64

Obtains the dimension of the domain.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidx (Int64) – Index of the domain. (input)

Return:

n (Int64) – Dimension of the domain.

Groups:

Problem data - domain, Inspecting the task

getdomainname
function getdomainname(task::MSKtask,
                       domidx::Int64) -> name :: String
function getdomainname(task::MSKtask,
                       domidx::T0)
    where { T0<:Integer }
    -> name :: String

Obtains the name of a domain.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidx (Int64) – Index of a domain. (input)

Return:

name (String) – Returns the required name.

Groups:

Names, Problem data - domain, Inspecting the task

getdomainnamelen
function getdomainnamelen(task::MSKtask,
                          domidx::Int64) -> len :: Int32
function getdomainnamelen(task::MSKtask,
                          domidx::T0)
    where { T0<:Integer }
    -> len :: Int32

Obtains the length of the name of a domain.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidx (Int64) – Index of a domain. (input)

Return:

len (Int32) – Returns the length of the indicated name.

Groups:

Names, Problem data - domain, Inspecting the task

getdomaintype
function getdomaintype(task::MSKtask,
                       domidx::Int64) -> domtype :: Domaintype
function getdomaintype(task::MSKtask,
                       domidx::T0)
    where { T0<:Integer }
    -> domtype :: Domaintype

Returns the type of the domain.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidx (Int64) – Index of the domain. (input)

Return:

domtype (Domaintype) – The type of the domain.

Groups:

Problem data - domain, Inspecting the task

getdouinf
function getdouinf(task::MSKtask,
                   whichdinf::Dinfitem) -> dvalue :: Float64

Obtains a double information item from the task information database.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • whichdinf (Dinfitem) – Specifies a double information item. (input)

Return:

dvalue (Float64) – The value of the required double information item.

Groups:

Information items and statistics

getdouparam
function getdouparam(task::MSKtask,
                     param::Dparam) -> parvalue :: Float64

Obtains the value of a double parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Dparam) – Which parameter. (input)

Return:

parvalue (Float64) – Parameter value.

Groups:

Parameters

getdualobj
function getdualobj(task::MSKtask,
                    whichsol::Soltype) -> dualobj :: Float64

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) – An optimization task. (input)

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

Return:

dualobj (Float64) – Objective value corresponding to the dual solution.

Groups:

Solution information, Solution - dual

getdualproblem
function getdualproblem(task::MSKtask) -> dualtask :: MSKtask

Returns the dual problem as a task. The dual computed by this function is intended for demonstration, educational and debugging purposes. It closely follows the dual form introduced in the documentation, but need not exactly reflect dualization taking place internally in the solver.

The function attempts to detect sparse LMIs and remove redundant linear constraints, trying to formulate the most efficient dual LMI (i.e. SDP in primal form), unless MSK_IPAR_GETDUAL_CONVERT_LMIS is turned off.

Problems with quadratic objective or constraints are not supported. Integer variables and disjunctive constraints are ignored and only a warning is issued.

Parameters:

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

Return:

dualtask (MSKtask) – A new task containing the dualized problem.

Groups:

Environment and task management

getdualsolutionnorms
function getdualsolutionnorms(task::MSKtask,
                              whichsol::Soltype) -> (nrmy :: Float64,nrmslc :: Float64,nrmsuc :: Float64,nrmslx :: Float64,nrmsux :: Float64,nrmsnx :: Float64,nrmbars :: Float64)

Compute norms of the dual solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • nrmy (Float64) – The norm of the \(y\) vector.

  • nrmslc (Float64) – The norm of the \(s_l^c\) vector.

  • nrmsuc (Float64) – The norm of the \(s_u^c\) vector.

  • nrmslx (Float64) – The norm of the \(s_l^x\) vector.

  • nrmsux (Float64) – The norm of the \(s_u^x\) vector.

  • nrmsnx (Float64) – The norm of the \(s_n^x\) vector.

  • nrmbars (Float64) – The norm of the \(\barS\) vector.

Groups:

Solution information

getdviolacc
function getdviolacc(task::MSKtask,
                     whichsol::Soltype,
                     accidxlist::Vector{Int64}) -> viol :: Vector{Float64}
function getdviolacc(task::MSKtask,
                     whichsol::Soltype,
                     accidxlist::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • accidxlist (Int64[]) – An array of indexes of conic constraints. (input)

Return:

viol (Float64[]) – viol[k] is the violation of the dual solution associated with the conic constraint sub[k].

Groups:

Solution information

getdviolbarvar
function getdviolbarvar(task::MSKtask,
                        whichsol::Soltype,
                        sub::Vector{Int32}) -> viol :: Vector{Float64}
function getdviolbarvar(task::MSKtask,
                        whichsol::Soltype,
                        sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of \(\barX\) variables. (input)

Return:

viol (Float64[]) – viol[k] is the violation of the solution for the constraint \(\barS_{\mathtt{sub}[k]} \in \PSD\).

Groups:

Solution information

getdviolcon
function getdviolcon(task::MSKtask,
                     whichsol::Soltype,
                     sub::Vector{Int32}) -> viol :: Vector{Float64}
function getdviolcon(task::MSKtask,
                     whichsol::Soltype,
                     sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of constraints. (input)

Return:

viol (Float64[]) – viol[k] is the violation of dual solution associated with the constraint sub[k].

Groups:

Solution information

getdviolcones Deprecated
function getdviolcones(task::MSKtask,
                       whichsol::Soltype,
                       sub::Vector{Int32}) -> viol :: Vector{Float64}
function getdviolcones(task::MSKtask,
                       whichsol::Soltype,
                       sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of conic constraints. (input)

Return:

viol (Float64[]) – viol[k] is the violation of the dual solution associated with the conic constraint sub[k].

Groups:

Solution information

getdviolvar
function getdviolvar(task::MSKtask,
                     whichsol::Soltype,
                     sub::Vector{Int32}) -> viol :: Vector{Float64}
function getdviolvar(task::MSKtask,
                     whichsol::Soltype,
                     sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of \(x\) variables. (input)

Return:

viol (Float64[]) – viol[k] is the violation of dual solution associated with the variable sub[k].

Groups:

Solution information

getinfeasiblesubproblem
function getinfeasiblesubproblem(task::MSKtask,
                                 whichsol::Soltype) -> inftask :: MSKtask

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) – An optimization task. (input)

  • whichsol (Soltype) – Which solution to use when determining the infeasible subproblem. (input)

Return:

inftask (MSKtask) – A new task containing the infeasible subproblem.

Groups:

Infeasibility diagnostic

getinfname
function getinfname(task::MSKtask,
                    inftype::Inftype,
                    whichinf::Int32) -> infname :: String
function getinfname(task::MSKtask,
                    inftype::Inftype,
                    whichinf::T0)
    where { T0<:Integer }
    -> infname :: String

Obtains the name of an information item.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • inftype (Inftype) – Type of the information item. (input)

  • whichinf (Int32) – An information item. (input)

Return:

infname (String) – Name of the information item.

Groups:

Information items and statistics, Names

getintinf
function getintinf(task::MSKtask,
                   whichiinf::Iinfitem) -> ivalue :: Int32

Obtains an integer information item from the task information database.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • whichiinf (Iinfitem) – Specifies an integer information item. (input)

Return:

ivalue (Int32) – The value of the required integer information item.

Groups:

Information items and statistics

getintparam
function getintparam(task::MSKtask,
                     param::Iparam) -> parvalue :: Int32

Obtains the value of an integer parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Iparam) – Which parameter. (input)

Return:

parvalue (Int32) – Parameter value.

Groups:

Parameters

getlasterror
function getlasterror(task::MSKtask) -> (lastrescode :: Rescode,lastmsglen :: Int64,lastmsg :: String)

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

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

Parameters:

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

Return:
  • lastrescode (Rescode) – Returns the last error code reported in the task.

  • lastmsglen (Int64) – Returns the length of the last error message reported in the task.

  • lastmsg (String) – Returns the last error message reported in the task.

Groups:

Responses, errors and warnings

getlenbarvarj
function getlenbarvarj(task::MSKtask,
                       j::Int32) -> lenbarvarj :: Int64
function getlenbarvarj(task::MSKtask,
                       j::T0)
    where { T0<:Integer }
    -> lenbarvarj :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the semidefinite variable whose length if requested. (input)

Return:

lenbarvarj (Int64) – Number of scalar elements in the lower triangular part of the semidefinite variable.

Groups:

Inspecting the task, Problem data - semidefinite

getlintinf
function getlintinf(task::MSKtask,
                    whichliinf::Liinfitem) -> ivalue :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • whichliinf (Liinfitem) – Specifies a long information item. (input)

Return:

ivalue (Int64) – The value of the required long integer information item.

Groups:

Information items and statistics

getlintparam
function getlintparam(task::MSKtask,
                      param::Iparam) -> parvalue :: Int64

Obtains the value of an integer parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Iparam) – Which parameter. (input)

Return:

parvalue (Int64) – Parameter value.

Groups:

Parameters

getmaxnumanz
function getmaxnumanz(task::MSKtask) -> maxnumanz :: Int64

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) – An optimization task. (input)

Return:

maxnumanz (Int64) – Number of preallocated non-zero linear matrix elements.

Groups:

Inspecting the task, Problem data - linear part

getmaxnumbarvar
function getmaxnumbarvar(task::MSKtask) -> maxnumbarvar :: Int32

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

Parameters:

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

Return:

maxnumbarvar (Int32) – Maximum number of symmetric matrix variables for which space is currently preallocated.

Groups:

Inspecting the task, Problem data - semidefinite

getmaxnumcon
function getmaxnumcon(task::MSKtask) -> maxnumcon :: Int32

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) – An optimization task. (input)

Return:

maxnumcon (Int32) – Number of preallocated constraints in the optimization task.

Groups:

Inspecting the task, Problem data - linear part, Problem data - constraints

getmaxnumcone Deprecated
function getmaxnumcone(task::MSKtask) -> maxnumcone :: Int32

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) – An optimization task. (input)

Return:

maxnumcone (Int32) – Number of preallocated conic constraints in the optimization task.

Groups:

Inspecting the task, Problem data - cones (deprecated)

getmaxnumqnz
function getmaxnumqnz(task::MSKtask) -> maxnumqnz :: Int64

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) – An optimization task. (input)

Return:

maxnumqnz (Int64) – Number of non-zero elements preallocated in quadratic coefficient matrices.

Groups:

Inspecting the task, Problem data - quadratic part

getmaxnumvar
function getmaxnumvar(task::MSKtask) -> maxnumvar :: Int32

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) – An optimization task. (input)

Return:

maxnumvar (Int32) – Number of preallocated variables in the optimization task.

Groups:

Inspecting the task, Problem data - linear part, Problem data - variables

getmemusage
function getmemusage(task::MSKtask) -> (meminuse :: Int64,maxmemuse :: Int64)

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

Parameters:

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

Return:
  • meminuse (Int64) – Amount of memory currently used by the task.

  • maxmemuse (Int64) – Maximum amount of memory used by the task until now.

Groups:

System, memory and debugging

getnadouinf
function getnadouinf(task::MSKtask,
                     infitemname::AbstractString) -> dvalue :: Float64

Obtains a named double information item from task information database.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • infitemname (AbstractString) – The name of a double information item. (input)

Return:

dvalue (Float64) – The value of the required double information item.

Groups:

Information items and statistics

getnadouparam
function getnadouparam(task::MSKtask,
                       paramname::AbstractString) -> parvalue :: Float64

Obtains the value of a named double parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • paramname (AbstractString) – Name of a parameter. (input)

Return:

parvalue (Float64) – Parameter value.

Groups:

Parameters

getnaintinf
function getnaintinf(task::MSKtask,
                     infitemname::AbstractString) -> ivalue :: Int32

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • infitemname (AbstractString) – The name of an integer information item. (input)

Return:

ivalue (Int32) – The value of the required integer information item.

Groups:

Information items and statistics

getnaintparam
function getnaintparam(task::MSKtask,
                       paramname::AbstractString) -> parvalue :: Int32

Obtains the value of a named integer parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • paramname (AbstractString) – Name of a parameter. (input)

Return:

parvalue (Int32) – Parameter value.

Groups:

Parameters

getnastrparam
function getnastrparam(task::MSKtask,
                       paramname::AbstractString,
                       sizeparamname::Int32) -> (len :: Int32,parvalue :: String)
function getnastrparam(task::MSKtask,
                       paramname::Union{Nothing,AbstractString},
                       sizeparamname::T0)
    where { T0<:Integer }
    -> (len :: Int32,parvalue :: String)

Obtains the value of a named string parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • paramname (AbstractString) – Name of a parameter. (input)

  • sizeparamname (Int32) – Size of the name buffer parvalue. (input)

Return:
  • len (Int32) – Length of the string in parvalue.

  • parvalue (String) – Parameter value.

Groups:

Parameters, Names

getnumacc
function getnumacc(task::MSKtask) -> num :: Int64

Obtains the number of affine conic constraints.

Parameters:

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

Return:

num (Int64) – The number of affine conic constraints.

Groups:

Problem data - affine conic constraints, Inspecting the task

getnumafe
function getnumafe(task::MSKtask) -> numafe :: Int64

Obtains the number of affine expressions.

Parameters:

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

Return:

numafe (Int64) – Number of affine expressions.

Groups:

Problem data - affine expressions, Inspecting the task

getnumanz
function getnumanz(task::MSKtask) -> numanz :: Int64

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

Parameters:

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

Return:

numanz (Int64) – Number of non-zero elements in the linear constraint matrix.

Groups:

Inspecting the task, Problem data - linear part

getnumbarablocktriplets
function getnumbarablocktriplets(task::MSKtask) -> num :: Int64

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

Parameters:

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

Return:

num (Int64) – An upper bound on the number of elements in the block triplet form of \(\barA.\)

Groups:

Problem data - semidefinite, Inspecting the task

getnumbaranz
function getnumbaranz(task::MSKtask) -> nz :: Int64

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

Parameters:

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

Return:

nz (Int64) – The number of nonzero block elements in \(\barA\) i.e. the number of \(\barA_{ij}\) elements that are nonzero.

Groups:

Problem data - semidefinite, Inspecting the task

getnumbarcblocktriplets
function getnumbarcblocktriplets(task::MSKtask) -> num :: Int64

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

Parameters:

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

Return:

num (Int64) – An upper bound on the number of elements in the block triplet form of \(\barC.\)

Groups:

Problem data - semidefinite, Inspecting the task

getnumbarcnz
function getnumbarcnz(task::MSKtask) -> nz :: Int64

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

Parameters:

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

Return:

nz (Int64) – The number of nonzeros in \(\barC\) i.e. the number of elements \(\barC_j\) that are nonzero.

Groups:

Problem data - semidefinite, Inspecting the task

getnumbarvar
function getnumbarvar(task::MSKtask) -> numbarvar :: Int32

Obtains the number of semidefinite variables.

Parameters:

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

Return:

numbarvar (Int32) – Number of semidefinite variables in the problem.

Groups:

Inspecting the task, Problem data - semidefinite

getnumcon
function getnumcon(task::MSKtask) -> numcon :: Int32

Obtains the number of constraints.

Parameters:

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

Return:

numcon (Int32) – Number of constraints.

Groups:

Problem data - linear part, Problem data - constraints, Inspecting the task

getnumcone Deprecated
function getnumcone(task::MSKtask) -> numcone :: Int32

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) – An optimization task. (input)

Return:

numcone (Int32) – Number of conic constraints.

Groups:

Problem data - cones (deprecated), Inspecting the task

getnumconemem Deprecated
function getnumconemem(task::MSKtask,
                       k::Int32) -> nummem :: Int32
function getnumconemem(task::MSKtask,
                       k::T0)
    where { T0<:Integer }
    -> nummem :: Int32

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) – An optimization task. (input)

  • k (Int32) – Index of the cone. (input)

Return:

nummem (Int32) – Number of member variables in the cone.

Groups:

Problem data - cones (deprecated), Inspecting the task

getnumdjc
function getnumdjc(task::MSKtask) -> num :: Int64

Obtains the number of disjunctive constraints.

Parameters:

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

Return:

num (Int64) – The number of disjunctive constraints.

Groups:

Problem data - disjunctive constraints, Inspecting the task

getnumdomain
function getnumdomain(task::MSKtask) -> numdomain :: Int64

Obtain the number of domains defined.

Parameters:

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

Return:

numdomain (Int64) – Number of domains in the task.

Groups:

Inspecting the task, Problem data - domain

getnumintvar
function getnumintvar(task::MSKtask) -> numintvar :: Int32

Obtains the number of integer-constrained variables.

Parameters:

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

Return:

numintvar (Int32) – Number of integer variables.

Groups:

Inspecting the task, Problem data - variables

getnumparam
function getnumparam(task::MSKtask,
                     partype::Parametertype) -> numparam :: Int32

Obtains the number of parameters of a given type.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • partype (Parametertype) – Parameter type. (input)

Return:

numparam (Int32) – The number of parameters of type partype.

Groups:

Inspecting the task, Parameters

getnumqconknz
function getnumqconknz(task::MSKtask,
                       k::Int32) -> numqcnz :: Int64
function getnumqconknz(task::MSKtask,
                       k::T0)
    where { T0<:Integer }
    -> numqcnz :: Int64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • k (Int32) – Index of the constraint for which the number quadratic terms should be obtained. (input)

Return:

numqcnz (Int64) – Number of quadratic terms.

Groups:

Inspecting the task, Problem data - constraints, Problem data - quadratic part

getnumqobjnz
function getnumqobjnz(task::MSKtask) -> numqonz :: Int64

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

Parameters:

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

Return:

numqonz (Int64) – Number of non-zero elements in the quadratic objective terms.

Groups:

Inspecting the task, Problem data - quadratic part

getnumsymmat
function getnumsymmat(task::MSKtask) -> num :: Int64

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

Parameters:

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

Return:

num (Int64) – The number of symmetric sparse matrices.

Groups:

Problem data - semidefinite, Inspecting the task

getnumvar
function getnumvar(task::MSKtask) -> numvar :: Int32

Obtains the number of variables.

Parameters:

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

Return:

numvar (Int32) – Number of variables.

Groups:

Inspecting the task, Problem data - variables

getobjname
function getobjname(task::MSKtask) -> objname :: String

Obtains the name assigned to the objective function.

Parameters:

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

Return:

objname (String) – Assigned the objective name.

Groups:

Inspecting the task, Names

getobjnamelen
function getobjnamelen(task::MSKtask) -> len :: Int32

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

Parameters:

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

Return:

len (Int32) – Assigned the length of the objective name.

Groups:

Inspecting the task, Names

getobjsense
function getobjsense(task::MSKtask) -> sense :: Objsense

Gets the objective sense of the task.

Parameters:

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

Return:

sense (Objsense) – The returned objective sense.

Groups:

Problem data - linear part

getparamname
function getparamname(task::MSKtask,
                      partype::Parametertype,
                      param::Int32) -> parname :: String
function getparamname(task::MSKtask,
                      partype::Parametertype,
                      param::T0)
    where { T0<:Integer }
    -> parname :: String

Obtains the name for a parameter param of type partype.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • partype (Parametertype) – Parameter type. (input)

  • param (Int32) – Which parameter. (input)

Return:

parname (String) – Parameter name.

Groups:

Names, Parameters

getpowerdomainalpha
function getpowerdomainalpha(task::MSKtask,
                             domidx::Int64) -> alpha :: Vector{Float64}
function getpowerdomainalpha(task::MSKtask,
                             domidx::T0)
    where { T0<:Integer }
    -> alpha :: Vector{Float64}

Obtains the exponent vector \(\alpha\) of a primal or dual power cone domain.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidx (Int64) – Index of the domain. (input)

Return:

alpha (Float64[]) – The vector \(\alpha\).

Groups:

Problem data - domain, Inspecting the task

getpowerdomaininfo
function getpowerdomaininfo(task::MSKtask,
                            domidx::Int64) -> (n :: Int64,nleft :: Int64)
function getpowerdomaininfo(task::MSKtask,
                            domidx::T0)
    where { T0<:Integer }
    -> (n :: Int64,nleft :: Int64)

Obtains structural information about a primal or dual power cone domain.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidx (Int64) – Index of the domain. (input)

Return:
  • n (Int64) – Dimension of the domain.

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

Groups:

Problem data - domain, Inspecting the task

getprimalobj
function getprimalobj(task::MSKtask,
                      whichsol::Soltype) -> primalobj :: Float64

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) – An optimization task. (input)

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

Return:

primalobj (Float64) – Objective value corresponding to the primal solution.

Groups:

Solution information, Solution - primal

getprimalsolutionnorms
function getprimalsolutionnorms(task::MSKtask,
                                whichsol::Soltype) -> (nrmxc :: Float64,nrmxx :: Float64,nrmbarx :: Float64)

Compute norms of the primal solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • nrmxc (Float64) – The norm of the \(x^c\) vector.

  • nrmxx (Float64) – The norm of the \(x\) vector.

  • nrmbarx (Float64) – The norm of the \(\barX\) vector.

Groups:

Solution information

getprobtype
function getprobtype(task::MSKtask) -> probtype :: Problemtype

Obtains the problem type.

Parameters:

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

Return:

probtype (Problemtype) – The problem type.

Groups:

Inspecting the task

getprosta
function getprosta(task::MSKtask,
                   whichsol::Soltype) -> problemsta :: Prosta

Obtains the problem status.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

problemsta (Prosta) – Problem status.

Groups:

Solution information

getpviolacc
function getpviolacc(task::MSKtask,
                     whichsol::Soltype,
                     accidxlist::Vector{Int64}) -> viol :: Vector{Float64}
function getpviolacc(task::MSKtask,
                     whichsol::Soltype,
                     accidxlist::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • accidxlist (Int64[]) – An array of indexes of conic constraints. (input)

Return:

viol (Float64[]) – viol[k] is the violation of the solution associated with the affine conic constraint number accidxlist[k].

Groups:

Solution information

getpviolbarvar
function getpviolbarvar(task::MSKtask,
                        whichsol::Soltype,
                        sub::Vector{Int32}) -> viol :: Vector{Float64}
function getpviolbarvar(task::MSKtask,
                        whichsol::Soltype,
                        sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of \(\barX\) variables. (input)

Return:

viol (Float64[]) – viol[k] is how much the solution violates the constraint \(\barX_{\mathtt{sub}[k]} \in \PSD\).

Groups:

Solution information

getpviolcon
function getpviolcon(task::MSKtask,
                     whichsol::Soltype,
                     sub::Vector{Int32}) -> viol :: Vector{Float64}
function getpviolcon(task::MSKtask,
                     whichsol::Soltype,
                     sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of constraints. (input)

Return:

viol (Float64[]) – viol[k] is the violation associated with the solution for the constraint sub[k].

Groups:

Solution information

getpviolcones Deprecated
function getpviolcones(task::MSKtask,
                       whichsol::Soltype,
                       sub::Vector{Int32}) -> viol :: Vector{Float64}
function getpviolcones(task::MSKtask,
                       whichsol::Soltype,
                       sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of conic constraints. (input)

Return:

viol (Float64[]) – viol[k] is the violation of the solution associated with the conic constraint number sub[k].

Groups:

Solution information

getpvioldjc
function getpvioldjc(task::MSKtask,
                     whichsol::Soltype,
                     djcidxlist::Vector{Int64}) -> viol :: Vector{Float64}
function getpvioldjc(task::MSKtask,
                     whichsol::Soltype,
                     djcidxlist::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • djcidxlist (Int64[]) – An array of indexes of disjunctive constraints. (input)

Return:

viol (Float64[]) – viol[k] is the violation of the solution associated with the disjunctive constraint number djcidxlist[k].

Groups:

Solution information

getpviolvar
function getpviolvar(task::MSKtask,
                     whichsol::Soltype,
                     sub::Vector{Int32}) -> viol :: Vector{Float64}
function getpviolvar(task::MSKtask,
                     whichsol::Soltype,
                     sub::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> viol :: Vector{Float64}

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) – An optimization task. (input)

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

  • sub (Int32[]) – An array of indexes of \(x\) variables. (input)

Return:

viol (Float64[]) – viol[k] is the violation associated with the solution for the variable \(x_\mathtt{sub[k]}\).

Groups:

Solution information

getqconk
function getqconk(task::MSKtask,
                  k::Int32) -> (numqcnz :: Int64,qcsubi :: Vector{Int32},qcsubj :: Vector{Int32},qcval :: Vector{Float64})
function getqconk(task::MSKtask,
                  k::T0)
    where { T0<:Integer }
    -> (numqcnz :: Int64,qcsubi :: Vector{Int32},qcsubj :: Vector{Int32},qcval :: Vector{Float64})

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • k (Int32) – Which constraint. (input)

Return:
  • numqcnz (Int64) – Number of quadratic terms.

  • qcsubi (Int32[]) – Row subscripts for quadratic constraint matrix.

  • qcsubj (Int32[]) – Column subscripts for quadratic constraint matrix.

  • qcval (Float64[]) – Quadratic constraint coefficient values.

Groups:

Inspecting the task, Problem data - quadratic part, Problem data - constraints

getqobj
function getqobj(task::MSKtask) -> (numqonz :: Int64,qosubi :: Vector{Int32},qosubj :: Vector{Int32},qoval :: Vector{Float64})

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

Parameters:

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

Return:
  • numqonz (Int64) – Number of non-zero elements in the quadratic objective terms.

  • qosubi (Int32[]) – Row subscripts for quadratic objective coefficients.

  • qosubj (Int32[]) – Column subscripts for quadratic objective coefficients.

  • qoval (Float64[]) – Quadratic objective coefficient values.

Groups:

Inspecting the task, Problem data - quadratic part

getqobjij
function getqobjij(task::MSKtask,
                   i::Int32,
                   j::Int32) -> qoij :: Float64
function getqobjij(task::MSKtask,
                   i::T0,
                   j::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> qoij :: Float64

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Row index of the coefficient. (input)

  • j (Int32) – Column index of coefficient. (input)

Return:

qoij (Float64) – The required coefficient.

Groups:

Inspecting the task, Problem data - quadratic part

getreducedcosts
function getreducedcosts(task::MSKtask,
                         whichsol::Soltype,
                         first::Int32,
                         last::Int32) -> redcosts :: Vector{Float64}
function getreducedcosts(task::MSKtask,
                         whichsol::Soltype,
                         first::T0,
                         last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> redcosts :: Vector{Float64}

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) – An optimization task. (input)

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

  • first (Int32) – The index of the first variable in the sequence. (input)

  • last (Int32) – The index of the last variable in the sequence plus 1. (input)

Return:

redcosts (Float64[]) – The reduced costs for the required slice of variables.

Groups:

Solution - dual

getskc
function getskc(task::MSKtask,
                whichsol::Soltype) -> skc :: Vector{Stakey}

Obtains the status keys for the constraints.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

skc (Stakey[]) – Status keys for the constraints.

Groups:

Solution information

getskcslice
function getskcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32) -> skc :: Vector{Stakey}
function getskcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> skc :: Vector{Stakey}

Obtains the status keys for a slice of the constraints.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

skc (Stakey[]) – Status keys for the constraints.

Groups:

Solution information

getskn
function getskn(task::MSKtask,
                whichsol::Soltype) -> skn :: Vector{Stakey}

Obtains the status keys for the conic constraints.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

skn (Stakey[]) – Status keys for the conic constraints.

Groups:

Solution information

getskx
function getskx(task::MSKtask,
                whichsol::Soltype) -> skx :: Vector{Stakey}

Obtains the status keys for the scalar variables.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

skx (Stakey[]) – Status keys for the variables.

Groups:

Solution information

getskxslice
function getskxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32) -> skx :: Vector{Stakey}
function getskxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> skx :: Vector{Stakey}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

skx (Stakey[]) – Status keys for the variables.

Groups:

Solution information

getslc
function getslc(task::MSKtask,
                whichsol::Soltype) -> slc :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints.

Groups:

Solution - dual

getslcslice
function getslcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32) -> slc :: Vector{Float64}
function getslcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> slc :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints.

Groups:

Solution - dual

getslx
function getslx(task::MSKtask,
                whichsol::Soltype) -> slx :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables.

Groups:

Solution - dual

getslxslice
function getslxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32) -> slx :: Vector{Float64}
function getslxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> slx :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables.

Groups:

Solution - dual

getsnx
function getsnx(task::MSKtask,
                whichsol::Soltype) -> snx :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

snx (Float64[]) – Dual variables corresponding to the conic constraints on the variables.

Groups:

Solution - dual

getsnxslice
function getsnxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32) -> snx :: Vector{Float64}
function getsnxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> snx :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

snx (Float64[]) – Dual variables corresponding to the conic constraints on the variables.

Groups:

Solution - dual

getsolsta
function getsolsta(task::MSKtask,
                   whichsol::Soltype) -> solutionsta :: Solsta

Obtains the solution status.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

solutionsta (Solsta) – Solution status.

Groups:

Solution information

getsolution
function getsolution(task::MSKtask,
                     whichsol::Soltype) -> (problemsta :: Prosta,solutionsta :: Solsta,skc :: Vector{Stakey},skx :: Vector{Stakey},skn :: Vector{Stakey},xc :: Vector{Float64},xx :: Vector{Float64},y :: Vector{Float64},slc :: Vector{Float64},suc :: Vector{Float64},slx :: Vector{Float64},sux :: Vector{Float64},snx :: Vector{Float64})

Obtains the complete solution.

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

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

and the corresponding dual problem is

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

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

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

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

  • xx : Corresponds to variable \(x\) (also denoted \(x^x\)).

  • xc : Corresponds to \(x^c:=Ax\).

  • y : Corresponds to variable \(y\).

  • slc: Corresponds to variable \(s_l^c\).

  • suc: Corresponds to variable \(s_u^c\).

  • slx: Corresponds to variable \(s_l^x\).

  • sux: Corresponds to variable \(s_u^x\).

  • snx: Corresponds to variable \(s_n^x\).

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

In order to retrieve the primal and dual values of semidefinite variables see getbarxj and getbarsj.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • problemsta (Prosta) – Problem status.

  • solutionsta (Solsta) – Solution status.

  • skc (Stakey[]) – Status keys for the constraints.

  • skx (Stakey[]) – Status keys for the variables.

  • skn (Stakey[]) – Status keys for the conic constraints.

  • xc (Float64[]) – Primal constraint solution.

  • xx (Float64[]) – Primal variable solution.

  • y (Float64[]) – Vector of dual variables corresponding to the constraints.

  • slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints.

  • suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints.

  • slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables.

  • sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables.

  • snx (Float64[]) – Dual variables corresponding to the conic constraints on the variables.

Groups:

Solution information, Solution - primal, Solution - dual

getsolutioninfo
function getsolutioninfo(task::MSKtask,
                         whichsol::Soltype) -> (pobj :: Float64,pviolcon :: Float64,pviolvar :: Float64,pviolbarvar :: Float64,pviolcone :: Float64,pviolitg :: Float64,dobj :: Float64,dviolcon :: Float64,dviolvar :: Float64,dviolbarvar :: Float64,dviolcone :: Float64)

Obtains information about a solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • pobj (Float64) – The primal objective value as computed by getprimalobj.

  • pviolcon (Float64) – Maximal primal violation of the solution associated with the \(x^c\) variables where the violations are computed by getpviolcon.

  • pviolvar (Float64) – Maximal primal violation of the solution for the \(x\) variables where the violations are computed by getpviolvar.

  • pviolbarvar (Float64) – Maximal primal violation of solution for the \(\barX\) variables where the violations are computed by getpviolbarvar.

  • pviolcone (Float64) – Maximal primal violation of solution for the conic constraints where the violations are computed by getpviolcones.

  • pviolitg (Float64) – 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.

  • dobj (Float64) – Dual objective value as computed by getdualobj.

  • dviolcon (Float64) – Maximal violation of the dual solution associated with the \(x^c\) variable as computed by getdviolcon.

  • dviolvar (Float64) – Maximal violation of the dual solution associated with the \(x\) variable as computed by getdviolvar.

  • dviolbarvar (Float64) – Maximal violation of the dual solution associated with the \(\barS\) variable as computed by getdviolbarvar.

  • dviolcone (Float64) – Maximal violation of the dual solution associated with the dual conic constraints as computed by getdviolcones.

Groups:

Solution information

getsolutioninfonew
function getsolutioninfonew(task::MSKtask,
                            whichsol::Soltype) -> (pobj :: Float64,pviolcon :: Float64,pviolvar :: Float64,pviolbarvar :: Float64,pviolcone :: Float64,pviolacc :: Float64,pvioldjc :: Float64,pviolitg :: Float64,dobj :: Float64,dviolcon :: Float64,dviolvar :: Float64,dviolbarvar :: Float64,dviolcone :: Float64,dviolacc :: Float64)

Obtains information about a solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • pobj (Float64) – The primal objective value as computed by getprimalobj.

  • pviolcon (Float64) – Maximal primal violation of the solution associated with the \(x^c\) variables where the violations are computed by getpviolcon.

  • pviolvar (Float64) – Maximal primal violation of the solution for the \(x\) variables where the violations are computed by getpviolvar.

  • pviolbarvar (Float64) – Maximal primal violation of solution for the \(\barX\) variables where the violations are computed by getpviolbarvar.

  • pviolcone (Float64) – Maximal primal violation of solution for the conic constraints where the violations are computed by getpviolcones.

  • pviolacc (Float64) – Maximal primal violation of solution for the affine conic constraints where the violations are computed by getpviolacc.

  • pvioldjc (Float64) – Maximal primal violation of solution for the disjunctive constraints where the violations are computed by getpvioldjc.

  • pviolitg (Float64) – 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.

  • dobj (Float64) – Dual objective value as computed by getdualobj.

  • dviolcon (Float64) – Maximal violation of the dual solution associated with the \(x^c\) variable as computed by getdviolcon.

  • dviolvar (Float64) – Maximal violation of the dual solution associated with the \(x\) variable as computed by getdviolvar.

  • dviolbarvar (Float64) – Maximal violation of the dual solution associated with the \(\barS\) variable as computed by getdviolbarvar.

  • dviolcone (Float64) – Maximal violation of the dual solution associated with the dual conic constraints as computed by getdviolcones.

  • dviolacc (Float64) – Maximal violation of the dual solution associated with the affine conic constraints as computed by getdviolacc.

Groups:

Solution information

getsolutionnew
function getsolutionnew(task::MSKtask,
                        whichsol::Soltype) -> (problemsta :: Prosta,solutionsta :: Solsta,skc :: Vector{Stakey},skx :: Vector{Stakey},skn :: Vector{Stakey},xc :: Vector{Float64},xx :: Vector{Float64},y :: Vector{Float64},slc :: Vector{Float64},suc :: Vector{Float64},slx :: Vector{Float64},sux :: Vector{Float64},snx :: Vector{Float64},doty :: Vector{Float64})

Obtains the complete solution. See getsolution for further information.

In order to retrieve the primal and dual values of semidefinite variables see getbarxj and getbarsj.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:
  • problemsta (Prosta) – Problem status.

  • solutionsta (Solsta) – Solution status.

  • skc (Stakey[]) – Status keys for the constraints.

  • skx (Stakey[]) – Status keys for the variables.

  • skn (Stakey[]) – Status keys for the conic constraints.

  • xc (Float64[]) – Primal constraint solution.

  • xx (Float64[]) – Primal variable solution.

  • y (Float64[]) – Vector of dual variables corresponding to the constraints.

  • slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints.

  • suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints.

  • slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables.

  • sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables.

  • snx (Float64[]) – Dual variables corresponding to the conic constraints on the variables.

  • doty (Float64[]) – Dual variables corresponding to affine conic constraints.

Groups:

Solution information, Solution - primal, Solution - dual

getsolutionslice
function getsolutionslice(task::MSKtask,
                          whichsol::Soltype,
                          solitem::Solitem,
                          first::Int32,
                          last::Int32) -> values :: Vector{Float64}
function getsolutionslice(task::MSKtask,
                          whichsol::Soltype,
                          solitem::Solitem,
                          first::T0,
                          last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> values :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • solitem (Solitem) – Which part of the solution is required. (input)

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

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

Return:

values (Float64[]) – The values in the required sequence are stored sequentially in values.

Groups:

Solution - primal, Solution - dual, Solution information

getsparsesymmat
function getsparsesymmat(task::MSKtask,
                         idx::Int64) -> (subi :: Vector{Int32},subj :: Vector{Int32},valij :: Vector{Float64})
function getsparsesymmat(task::MSKtask,
                         idx::T0)
    where { T0<:Integer }
    -> (subi :: Vector{Int32},subj :: Vector{Int32},valij :: Vector{Float64})

Get a single symmetric matrix from the matrix store.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • idx (Int64) – Index of the matrix to retrieve. (input)

Return:
  • subi (Int32[]) – Row subscripts of the matrix non-zero elements.

  • subj (Int32[]) – Column subscripts of the matrix non-zero elements.

  • valij (Float64[]) – Coefficients of the matrix non-zero elements.

Groups:

Problem data - semidefinite, Inspecting the task

getstrparam
function getstrparam(task::MSKtask,
                     param::Sparam) -> (len :: Int32,parvalue :: String)

Obtains the value of a string parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Sparam) – Which parameter. (input)

Return:
  • len (Int32) – The length of the parameter value.

  • parvalue (String) – Parameter value.

Groups:

Names, Parameters

getstrparamlen
function getstrparamlen(task::MSKtask,
                        param::Sparam) -> len :: Int32

Obtains the length of a string parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Sparam) – Which parameter. (input)

Return:

len (Int32) – The length of the parameter value.

Groups:

Names, Parameters

getsuc
function getsuc(task::MSKtask,
                whichsol::Soltype) -> suc :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints.

Groups:

Solution - dual

getsucslice
function getsucslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32) -> suc :: Vector{Float64}
function getsucslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> suc :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints.

Groups:

Solution - dual

getsux
function getsux(task::MSKtask,
                whichsol::Soltype) -> sux :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables.

Groups:

Solution - dual

getsuxslice
function getsuxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32) -> sux :: Vector{Float64}
function getsuxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> sux :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables.

Groups:

Solution - dual

getsymmatinfo
function getsymmatinfo(task::MSKtask,
                       idx::Int64) -> (dim :: Int32,nz :: Int64,mattype :: Symmattype)
function getsymmatinfo(task::MSKtask,
                       idx::T0)
    where { T0<:Integer }
    -> (dim :: Int32,nz :: Int64,mattype :: Symmattype)

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) – An optimization task. (input)

  • idx (Int64) – Index of the matrix for which information is requested. (input)

Return:
  • dim (Int32) – Returns the dimension of the requested matrix.

  • nz (Int64) – Returns the number of non-zeros in the requested matrix.

  • mattype (Symmattype) – Returns the type of the requested matrix.

Groups:

Problem data - semidefinite, Inspecting the task

gettaskname
function gettaskname(task::MSKtask) -> taskname :: String

Obtains the name assigned to the task.

Parameters:

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

Return:

taskname (String) – Returns the task name.

Groups:

Names, Inspecting the task

gettasknamelen
function gettasknamelen(task::MSKtask) -> len :: Int32

Obtains the length the task name.

Parameters:

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

Return:

len (Int32) – Returns the length of the task name.

Groups:

Names, Inspecting the task

getvarbound
function getvarbound(task::MSKtask,
                     i::Int32) -> (bk :: Boundkey,bl :: Float64,bu :: Float64)
function getvarbound(task::MSKtask,
                     i::T0)
    where { T0<:Integer }
    -> (bk :: Boundkey,bl :: Float64,bu :: Float64)

Obtains bound information for one variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the variable for which the bound information should be obtained. (input)

Return:
  • bk (Boundkey) – Bound keys.

  • bl (Float64) – Values for lower bounds.

  • bu (Float64) – Values for upper bounds.

Groups:

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - variables

getvarboundslice
function getvarboundslice(task::MSKtask,
                          first::Int32,
                          last::Int32) -> (bk :: Vector{Boundkey},bl :: Vector{Float64},bu :: Vector{Float64})
function getvarboundslice(task::MSKtask,
                          first::T0,
                          last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> (bk :: Vector{Boundkey},bl :: Vector{Float64},bu :: Vector{Float64})

Obtains bounds information for a slice of the variables.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:
  • bk (Boundkey[]) – Bound keys.

  • bl (Float64[]) – Values for lower bounds.

  • bu (Float64[]) – Values for upper bounds.

Groups:

Problem data - linear part, Inspecting the task, Problem data - bounds, Problem data - variables

getvarname
function getvarname(task::MSKtask,
                    j::Int32) -> name :: String
function getvarname(task::MSKtask,
                    j::T0)
    where { T0<:Integer }
    -> name :: String

Obtains the name of a variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of a variable. (input)

Return:

name (String) – Returns the required name.

Groups:

Names, Problem data - linear part, Problem data - variables, Inspecting the task

getvarnameindex
function getvarnameindex(task::MSKtask,
                         somename::AbstractString) -> (asgn :: Int32,index :: Int32)

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • somename (AbstractString) – The name which should be checked. (input)

Return:
  • asgn (Int32) – Is non-zero if the name somename is assigned to a variable.

  • index (Int32) – If the name somename is assigned to a variable, then index is the index of the variable.

Groups:

Names, Problem data - linear part, Problem data - variables, Inspecting the task

getvarnamelen
function getvarnamelen(task::MSKtask,
                       i::Int32) -> len :: Int32
function getvarnamelen(task::MSKtask,
                       i::T0)
    where { T0<:Integer }
    -> len :: Int32

Obtains the length of the name of a variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of a variable. (input)

Return:

len (Int32) – Returns the length of the indicated name.

Groups:

Names, Problem data - linear part, Problem data - variables, Inspecting the task

getvartype
function getvartype(task::MSKtask,
                    j::Int32) -> vartype :: Variabletype
function getvartype(task::MSKtask,
                    j::T0)
    where { T0<:Integer }
    -> vartype :: Variabletype

Gets the variable type of one variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable. (input)

Return:

vartype (Variabletype) – Variable type of the \(j\)-th variable.

Groups:

Inspecting the task, Problem data - variables

getvartypelist
function getvartypelist(task::MSKtask,
                        subj::Vector{Int32}) -> vartype :: Vector{Variabletype}
function getvartypelist(task::MSKtask,
                        subj::T0)
    where { T0<:AbstractVector{<:Integer} }
    -> vartype :: Vector{Variabletype}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subj (Int32[]) – A list of variable indexes. (input)

Return:

vartype (Variabletype[]) – The variables types corresponding to the variables specified by subj.

Groups:

Inspecting the task, Problem data - variables

getversion
function getversion() -> (major :: Int32,minor :: Int32,revision :: Int32)

Obtains MOSEK version information.

Return:
  • major (Int32) – Major version number.

  • minor (Int32) – Minor version number.

  • revision (Int32) – Revision number.

Groups:

Versions

getxc
function getxc(task::MSKtask,
               whichsol::Soltype) -> xc :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

xc (Float64[]) – Primal constraint solution.

Groups:

Solution - primal

getxcslice
function getxcslice(task::MSKtask,
                    whichsol::Soltype,
                    first::Int32,
                    last::Int32) -> xc :: Vector{Float64}
function getxcslice(task::MSKtask,
                    whichsol::Soltype,
                    first::T0,
                    last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> xc :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

xc (Float64[]) – Primal constraint solution.

Groups:

Solution - primal

getxx
function getxx(task::MSKtask,
               whichsol::Soltype) -> xx :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

xx (Float64[]) – Primal variable solution.

Groups:

Solution - primal

getxxslice
function getxxslice(task::MSKtask,
                    whichsol::Soltype,
                    first::Int32,
                    last::Int32) -> xx :: Vector{Float64}
function getxxslice(task::MSKtask,
                    whichsol::Soltype,
                    first::T0,
                    last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> xx :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

xx (Float64[]) – Primal variable solution.

Groups:

Solution - primal

gety
function gety(task::MSKtask,
              whichsol::Soltype) -> y :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

y (Float64[]) – Vector of dual variables corresponding to the constraints.

Groups:

Solution - dual

getyslice
function getyslice(task::MSKtask,
                   whichsol::Soltype,
                   first::Int32,
                   last::Int32) -> y :: Vector{Float64}
function getyslice(task::MSKtask,
                   whichsol::Soltype,
                   first::T0,
                   last::T1)
    where { T0<:Integer,
            T1<:Integer }
    -> y :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

Return:

y (Float64[]) – Vector of dual variables corresponding to the constraints.

Groups:

Solution - dual

iinfitemtostr
function iinfitemtostr(item::Iinfitem) -> str :: String

Obtains an identifier string corresponding to a information item.

Parameters:

item (Iinfitem) – Information item. (input)

Return:

str (String) – String corresponding to the bound information item item.

Groups:

Names

infeasibilityreport
function infeasibilityreport(task::MSKtask,
                             whichstream::Streamtype,
                             whichsol::Soltype)

Prints the infeasibility report to an output stream.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Groups:

Infeasibility diagnostic

initbasissolve
function initbasissolve(task::MSKtask) -> basis :: Vector{Int32}

Prepare a task for use with the solvewithbasis function.

This function should be called

  • immediately before the first call to solvewithbasis, and

  • immediately before any subsequent call to 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) – An optimization task. (input)

Return:

basis (Int32[]) – 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\).

Groups:

Solving systems with basis matrix

inputdata
function inputdata(task::MSKtask,
                   maxnumcon::Int32,
                   maxnumvar::Int32,
                   c::Union{Nothing,Vector{Float64}},
                   cfix::Float64,
                   aptrb::Vector{Int64},
                   aptre::Vector{Int64},
                   asub::Vector{Int32},
                   aval::Vector{Float64},
                   bkc::Vector{Boundkey},
                   blc::Vector{Float64},
                   buc::Vector{Float64},
                   bkx::Vector{Boundkey},
                   blx::Vector{Float64},
                   bux::Vector{Float64})
function inputdata(task::MSKtask,
                   maxnumcon::T0,
                   maxnumvar::T1,
                   c::T2,
                   cfix::T3,
                   aptrb::T4,
                   aptre::T5,
                   asub::T6,
                   aval::T7,
                   bkc::Vector{Boundkey},
                   blc::T8,
                   buc::T9,
                   bkx::Vector{Boundkey},
                   blx::T10,
                   bux::T11)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number},
            T3<:Number,
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Integer},
            T6<:AbstractVector{<:Integer},
            T7<:AbstractVector{<:Number},
            T8<:AbstractVector{<:Number},
            T9<:AbstractVector{<:Number},
            T10<:AbstractVector{<:Number},
            T11<:AbstractVector{<:Number} }
function inputdata(task::MSKtask,
                   maxnumcon::T0,
                   maxnumvar::T1,
                   c::T2,
                   cfix::T3,
                   A:: SparseMatrixCSC{Float64},
                   bkc::Vector{Boundkey},
                   blc::T8,
                   buc::T9,
                   bkx::Vector{Boundkey},
                   blx::T10,
                   bux::T11)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number},
            T3<:Number,
            T8<:AbstractVector{<:Number},
            T9<:AbstractVector{<:Number},
            T10<:AbstractVector{<:Number},
            T11<:AbstractVector{<:Number} }

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) – An optimization task. (input)

  • maxnumcon (Int32) – Number of preallocated constraints in the optimization task. (input)

  • maxnumvar (Int32) – Number of preallocated variables in the optimization task. (input)

  • c (Float64[]) – Linear terms of the objective as a dense vector. The length is the number of variables. (input)

  • cfix (Float64) – Fixed term in the objective. (input)

  • aptrb (Int64[]) – Row or column start pointers. (input)

  • aptre (Int64[]) – Row or column end pointers. (input)

  • asub (Int32[]) – Coefficient subscripts. (input)

  • aval (Float64[]) – Coefficient values. (input)

  • bkc (Boundkey[]) – Bound keys for the constraints. (input)

  • blc (Float64[]) – Lower bounds for the constraints. (input)

  • buc (Float64[]) – Upper bounds for the constraints. (input)

  • bkx (Boundkey[]) – Bound keys for the variables. (input)

  • blx (Float64[]) – Lower bounds for the variables. (input)

  • bux (Float64[]) – Upper bounds for the variables. (input)

  • A (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Groups:

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

isdouparname
function isdouparname(task::MSKtask,
                      parname::AbstractString) -> param :: Dparam

Checks whether parname is a valid double parameter name.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • parname (AbstractString) – Parameter name. (input)

Return:

param (Dparam) – Returns the parameter corresponding to the name, if one exists.

Groups:

Parameters, Names

isintparname
function isintparname(task::MSKtask,
                      parname::AbstractString) -> param :: Iparam

Checks whether parname is a valid integer parameter name.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • parname (AbstractString) – Parameter name. (input)

Return:

param (Iparam) – Returns the parameter corresponding to the name, if one exists.

Groups:

Parameters, Names

isstrparname
function isstrparname(task::MSKtask,
                      parname::AbstractString) -> param :: Sparam

Checks whether parname is a valid string parameter name.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • parname (AbstractString) – Parameter name. (input)

Return:

param (Sparam) – Returns the parameter corresponding to the name, if one exists.

Groups:

Parameters, Names

licensecleanup
function licensecleanup()

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.

Groups:

License system

liinfitemtostr
function liinfitemtostr(item::Liinfitem) -> str :: String

Obtains an identifier string corresponding to a information item.

Parameters:

item (Liinfitem) – Information item. (input)

Return:

str (String) – String corresponding to the bound information item item.

Groups:

Names

linkfiletostream
function linkfiletostream(task::MSKtask,
                          whichstream::Streamtype,
                          filename::AbstractString,
                          append::Int32)
function linkfiletostream(task::MSKtask,
                          whichstream::Streamtype,
                          filename::Union{Nothing,AbstractString},
                          append::T0)
    where { T0<:Integer }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • filename (AbstractString) – A valid file name. (input)

  • append (Int32) – If this argument is 0 the output file will be overwritten, otherwise it will be appended to. (input)

Groups:

Logging

linkfiletostream
function linkfiletostream(env::MSKenv,
                          whichstream::Streamtype,
                          filename::AbstractString,
                          append::Int32)
function linkfiletostream(env::MSKenv,
                          whichstream::Streamtype,
                          filename::Union{Nothing,AbstractString},
                          append::T0)
    where { T0<:Integer }
function linkfiletostream(whichstream::Streamtype,
                          filename::AbstractString,
                          append::Int32)
function linkfiletostream(whichstream::Streamtype,
                          filename::Union{Nothing,AbstractString},
                          append::T0)
    where { T0<:Integer }

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

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

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

  • filename (AbstractString) – A valid file name. (input)

  • append (Int32) – If this argument is 0 the file will be overwritten, otherwise it will be appended to. (input)

Groups:

Logging

makeenv
function makeenv() -> newenv :: Env

Creates a new environment.

Return:

newenv (MSKenv) – A new environment.

Groups:

Environment and task management

maketask
function maketask() -> newtask :: Task
function maketask(task::Task) -> newtask :: Task
function maketask(env::Env) -> newtask :: Task

Creates a new task.

Parameters:
  • task (MSKtask) – A task that will be cloned. (input)

  • env (MSKenv) – Parent environment. (input)

Return:

newtask (MSKtask) – A new task.

Groups:

Environment and task management

onesolutionsummary
function onesolutionsummary(task::MSKtask,
                            whichstream::Streamtype,
                            whichsol::Soltype)

Prints a short summary of a specified solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Groups:

Logging, Solution information

optimize
function optimize(task::MSKtask) -> trmcode :: Rescode

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.

Parameters:

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

Return:

trmcode (Rescode) – Is either MSK_RES_OK or a termination response code.

Groups:

Optimization

optimizebatch
function optimizebatch(env::MSKenv,
                       israce::Bool,
                       maxtime::Float64,
                       numthreads::Int32,
                       task::Vector{MSKtask}) -> (trmcode :: Vector{Rescode},rcode :: Vector{Rescode})
function optimizebatch(env::MSKenv,
                       israce::Bool,
                       maxtime::T0,
                       numthreads::T1,
                       task::Vector{MSKtask})
    where { T0<:Number,
            T1<:Integer }
    -> (trmcode :: Vector{Rescode},rcode :: Vector{Rescode})
function optimizebatch(israce::Bool,
                       maxtime::Float64,
                       numthreads::Int32,
                       task::Vector{MSKtask}) -> (trmcode :: Vector{Rescode},rcode :: Vector{Rescode})
function optimizebatch(israce::Bool,
                       maxtime::T0,
                       numthreads::T1,
                       task::Vector{MSKtask})
    where { T0<:Number,
            T1<:Integer }
    -> (trmcode :: Vector{Rescode},rcode :: Vector{Rescode})

Optimize a number of tasks in parallel using a specified number of threads. All callbacks and log output streams are disabled.

Assuming that each task takes about same time and there many more tasks than number of threads then a linear speedup can be achieved, also known as strong scaling. A typical application of this method is to solve many small tasks of similar type; in this case it is recommended that each of them is allocated a single thread by setting MSK_IPAR_NUM_THREADS to \(1\).

If the parameters israce or maxtime are used, then the result may not be deterministic, in the sense that the tasks which complete first may vary between runs.

The remaining behavior, including termination and response codes returned for each task, are the same as if each task was optimized separately.

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

  • israce (Bool) – If nonzero, then the function is terminated after the first task has been completed. (input)

  • maxtime (Float64) – Time limit for the function: if nonnegative, then the function is terminated after maxtime (seconds) has expired. (input)

  • numthreads (Int32) – Number of threads to be employed. (input)

  • task (MSKtask[]) – An array of tasks to optimize in parallel. (input)

Return:
  • trmcode (Rescode[]) – The termination code for each task.

  • rcode (Rescode[]) – The response code for each task.

Groups:

Optimization

optimizermt
function optimizermt(task::MSKtask,
                     address::AbstractString,
                     accesstoken::AbstractString) -> trmcode :: Rescode

Offload the optimization task to an instance of OptServer specified by addr, which should be a valid URL, for example http://server:port or https://server:port. The call will block until a result is available or the connection closes.

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • address (AbstractString) – Address of the OptServer. (input)

  • accesstoken (AbstractString) – Access token. (input)

Return:

trmcode (Rescode) – Is either MSK_RES_OK or a termination response code.

Groups:

Remote optimization

optimizersummary
function optimizersummary(task::MSKtask,
                          whichstream::Streamtype)

Prints a short summary with optimizer statistics from last optimization.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Logging

primalrepair
function primalrepair(task::MSKtask,
                      wlc::Union{Nothing,Vector{Float64}},
                      wuc::Union{Nothing,Vector{Float64}},
                      wlx::Union{Nothing,Vector{Float64}},
                      wux::Union{Nothing,Vector{Float64}})
function primalrepair(task::MSKtask,
                      wlc::T0,
                      wuc::T1,
                      wlx::T2,
                      wux::T3)
    where { T0<:AbstractVector{<:Number},
            T1<:AbstractVector{<:Number},
            T2<:AbstractVector{<:Number},
            T3<:AbstractVector{<:Number} }

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) – An optimization task. (input)

  • wlc (Float64[]) – \((w_l^c)_i\) is the weight associated with relaxing the lower bound on constraint \(i\). If the weight is negative, then the lower bound is not relaxed. Moreover, if the argument is nothing, then all the weights are assumed to be \(1\). (input)

  • wuc (Float64[]) – \((w_u^c)_i\) is the weight associated with relaxing the upper bound on constraint \(i\). If the weight is negative, then the upper bound is not relaxed. Moreover, if the argument is nothing, then all the weights are assumed to be \(1\). (input)

  • wlx (Float64[]) – \((w_l^x)_j\) is the weight associated with relaxing the lower bound on variable \(j\). If the weight is negative, then the lower bound is not relaxed. Moreover, if the argument is nothing, then all the weights are assumed to be \(1\). (input)

  • wux (Float64[]) – \((w_l^x)_i\) is the weight associated with relaxing the upper bound on variable \(j\). If the weight is negative, then the upper bound is not relaxed. Moreover, if the argument is nothing, then all the weights are assumed to be \(1\). (input)

Groups:

Infeasibility diagnostic

primalsensitivity
function primalsensitivity(task::MSKtask,
                           subi::Vector{Int32},
                           marki::Vector{Mark},
                           subj::Vector{Int32},
                           markj::Vector{Mark}) -> (leftpricei :: Vector{Float64},rightpricei :: Vector{Float64},leftrangei :: Vector{Float64},rightrangei :: Vector{Float64},leftpricej :: Vector{Float64},rightpricej :: Vector{Float64},leftrangej :: Vector{Float64},rightrangej :: Vector{Float64})
function primalsensitivity(task::MSKtask,
                           subi::T0,
                           marki::Vector{Mark},
                           subj::T1,
                           markj::Vector{Mark})
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer} }
    -> (leftpricei :: Vector{Float64},rightpricei :: Vector{Float64},leftrangei :: Vector{Float64},rightrangei :: Vector{Float64},leftpricej :: Vector{Float64},rightpricej :: Vector{Float64},leftrangej :: Vector{Float64},rightrangej :: Vector{Float64})

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) – An optimization task. (input)

  • subi (Int32[]) – Indexes of constraints to analyze. (input)

  • marki (Mark[]) – The value of marki[i] indicates for which bound of constraint subi[i] sensitivity analysis is performed. If marki[i] = MSK_MARK_UP the upper bound of constraint subi[i] is analyzed, and if marki[i] = MSK_MARK_LO the lower bound is analyzed. If subi[i] is an equality constraint, either MSK_MARK_LO or MSK_MARK_UP can be used to select the constraint for sensitivity analysis. (input)

  • subj (Int32[]) – Indexes of variables to analyze. (input)

  • markj (Mark[]) – The value of markj[j] indicates for which bound of variable subj[j] sensitivity analysis is performed. If markj[j] = MSK_MARK_UP the upper bound of variable subj[j] is analyzed, and if markj[j] = MSK_MARK_LO the lower bound is analyzed. If subj[j] is a fixed variable, either MSK_MARK_LO or MSK_MARK_UP can be used to select the bound for sensitivity analysis. (input)

Return:
  • leftpricei (Float64[]) – leftpricei[i] is the left shadow price for the bound marki[i] of constraint subi[i].

  • rightpricei (Float64[]) – rightpricei[i] is the right shadow price for the bound marki[i] of constraint subi[i].

  • leftrangei (Float64[]) – leftrangei[i] is the left range \(\beta_1\) for the bound marki[i] of constraint subi[i].

  • rightrangei (Float64[]) – rightrangei[i] is the right range \(\beta_2\) for the bound marki[i] of constraint subi[i].

  • leftpricej (Float64[]) – leftpricej[j] is the left shadow price for the bound markj[j] of variable subj[j].

  • rightpricej (Float64[]) – rightpricej[j] is the right shadow price for the bound markj[j] of variable subj[j].

  • leftrangej (Float64[]) – leftrangej[j] is the left range \(\beta_1\) for the bound markj[j] of variable subj[j].

  • rightrangej (Float64[]) – rightrangej[j] is the right range \(\beta_2\) for the bound markj[j] of variable subj[j].

Groups:

Sensitivity analysis

printparam
function printparam(task::MSKtask)

Prints the current parameter settings to the message stream.

Parameters:

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

Groups:

Inspecting the task, Logging

probtypetostr
function probtypetostr(task::MSKtask,
                       probtype::Problemtype) -> str :: String

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • probtype (Problemtype) – Problem type. (input)

Return:

str (String) – String corresponding to the problem type key probtype.

Groups:

Inspecting the task, Names

prostatostr
function prostatostr(task::MSKtask,
                     problemsta::Prosta) -> str :: String

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • problemsta (Prosta) – Problem status. (input)

Return:

str (String) – String corresponding to the status key prosta.

Groups:

Solution information, Names

putacc
function putacc(task::MSKtask,
                accidx::Int64,
                domidx::Int64,
                afeidxlist::Vector{Int64},
                b::Union{Nothing,Vector{Float64}})
function putacc(task::MSKtask,
                accidx::T0,
                domidx::T1,
                afeidxlist::T2,
                b::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }

Puts an affine conic constraint. This method overwrites an existing affine conic constraint number accidx with new data specified in the same format as in appendacc.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • accidx (Int64) – Affine conic constraint index. (input)

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

  • afeidxlist (Int64[]) – List of affine expression indexes. (input)

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

Groups:

Problem data - affine conic constraints

putaccb
function putaccb(task::MSKtask,
                 accidx::Int64,
                 b::Union{Nothing,Vector{Float64}})
function putaccb(task::MSKtask,
                 accidx::T0,
                 b::T1)
    where { T0<:Integer,
            T1<:AbstractVector{<:Number} }

Updates an existing affine conic constraint number accidx by putting a new vector \(b\).

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • accidx (Int64) – Affine conic constraint index. (input)

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

Groups:

Problem data - affine conic constraints

putaccbj
function putaccbj(task::MSKtask,
                  accidx::Int64,
                  j::Int64,
                  bj::Float64)
function putaccbj(task::MSKtask,
                  accidx::T0,
                  j::T1,
                  bj::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number }

Sets one value \(b[j]\) in the \(b\) vector for the affine conic constraint number accidx.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • accidx (Int64) – Affine conic constraint index. (input)

  • j (Int64) – The index of an element in b to change. (input)

  • bj (Float64) – The new value of \(b[j]\). (input)

Groups:

Problem data - affine conic constraints

putaccdoty
function putaccdoty(task::MSKtask,
                    whichsol::Soltype,
                    accidx::Int64) -> doty :: Vector{Float64}
function putaccdoty(task::MSKtask,
                    whichsol::Soltype,
                    accidx::T0)
    where { T0<:Integer }
    -> doty :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

Return:

doty (Float64[]) – The dual values for this affine conic constraint. The array should have length equal to the dimension of the constraint.

Groups:

Solution - dual, Problem data - affine conic constraints

putacclist
function putacclist(task::MSKtask,
                    accidxs::Vector{Int64},
                    domidxs::Vector{Int64},
                    afeidxlist::Vector{Int64},
                    b::Union{Nothing,Vector{Float64}})
function putacclist(task::MSKtask,
                    accidxs::T0,
                    domidxs::T1,
                    afeidxlist::T2,
                    b::T3)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }

Puts affine conic constraints. This method overwrites existing affine conic constraints whose numbers are provided in the list accidxs with new data which is a concatenation of individual constraint descriptions in the same format as in appendacc (see also appendaccs).

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • accidxs (Int64[]) – Affine conic constraint indices. (input)

  • domidxs (Int64[]) – Domain indices. (input)

  • afeidxlist (Int64[]) – List of affine expression indexes. (input)

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

Groups:

Problem data - affine conic constraints

putaccname
function putaccname(task::MSKtask,
                    accidx::Int64,
                    name::Union{Nothing,AbstractString})
function putaccname(task::MSKtask,
                    accidx::T0,
                    name::Union{Nothing,AbstractString})
    where { T0<:Integer }

Sets the name of an affine conic constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • name (AbstractString) – The name of the affine conic constraint. (input)

Groups:

Names, Problem data - affine conic constraints

putacol
function putacol(task::MSKtask,
                 j::Int32,
                 subj::Vector{Int32},
                 valj::Vector{Float64})
function putacol(task::MSKtask,
                 j::T0,
                 subj::T1,
                 valj::T2)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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) – An optimization task. (input)

  • j (Int32) – Index of a column in \(A\). (input)

  • subj (Int32[]) – Row indexes of non-zero values in column \(j\) of \(A\). (input)

  • valj (Float64[]) – New non-zero values of column \(j\) in \(A\). (input)

Groups:

Problem data - linear part

putacollist
function putacollist(task::MSKtask,
                     sub::Vector{Int32},
                     ptrb::Vector{Int64},
                     ptre::Vector{Int64},
                     asub::Vector{Int32},
                     aval::Vector{Float64})
function putacollist(task::MSKtask,
                     sub::T0,
                     ptrb::T1,
                     ptre::T2,
                     asub::T3,
                     aval::T4)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Number} }
function putacollist(task::MSKtask,
                     sub::T0,
                     A:: SparseMatrixCSC{Float64})
    where { T0<:AbstractVector{<:Integer} }

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) – An optimization task. (input)

  • sub (Int32[]) – Indexes of columns that should be replaced, no duplicates. (input)

  • ptrb (Int64[]) – Array of pointers to the first element in each column. (input)

  • ptre (Int64[]) – Array of pointers to the last element plus one in each column. (input)

  • asub (Int32[]) – Row indexes of new elements. (input)

  • aval (Float64[]) – Coefficient values. (input)

  • A (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Groups:

Problem data - linear part

putacolslice
function putacolslice(task::MSKtask,
                      first::Int32,
                      last::Int32,
                      ptrb::Vector{Int64},
                      ptre::Vector{Int64},
                      asub::Vector{Int32},
                      aval::Vector{Float64})
function putacolslice(task::MSKtask,
                      first::T0,
                      last::T1,
                      ptrb::T2,
                      ptre::T3,
                      asub::T4,
                      aval::T5)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Number} }
function putacolslice(task::MSKtask,
                      first::T0,
                      last::T1,
                      A:: SparseMatrixCSC{Float64})
    where { T0<:Integer,
            T1<:Integer }

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) – An optimization task. (input)

  • first (Int32) – First column in the slice. (input)

  • last (Int32) – Last column plus one in the slice. (input)

  • ptrb (Int64[]) – Array of pointers to the first element in each column. (input)

  • ptre (Int64[]) – Array of pointers to the last element plus one in each column. (input)

  • asub (Int32[]) – Row indexes of new elements. (input)

  • aval (Float64[]) – Coefficient values. (input)

  • A (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Groups:

Problem data - linear part

putafebarfblocktriplet
function putafebarfblocktriplet(task::MSKtask,
                                afeidx::Vector{Int64},
                                barvaridx::Vector{Int32},
                                subk::Vector{Int32},
                                subl::Vector{Int32},
                                valkl::Vector{Float64})
function putafebarfblocktriplet(task::MSKtask,
                                afeidx::T0,
                                barvaridx::T1,
                                subk::T2,
                                subl::T3,
                                valkl::T4)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Number} }

Inputs the \(\barF\) matrix data in block triplet form.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64[]) – Constraint index. (input)

  • barvaridx (Int32[]) – Symmetric matrix variable index. (input)

  • subk (Int32[]) – Block row index. (input)

  • subl (Int32[]) – Block column index. (input)

  • valkl (Float64[]) – The numerical value associated with each block triplet. (input)

Groups:

Problem data - affine expressions, Problem data - semidefinite

putafebarfentry
function putafebarfentry(task::MSKtask,
                         afeidx::Int64,
                         barvaridx::Int32,
                         termidx::Vector{Int64},
                         termweight::Vector{Float64})
function putafebarfentry(task::MSKtask,
                         afeidx::T0,
                         barvaridx::T1,
                         termidx::T2,
                         termweight::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • barvaridx (Int32) – Semidefinite variable index. (input)

  • termidx (Int64[]) – Indices in \(E\) of the matrices appearing in the weighted sum for the \(\barF\) entry being specified. (input)

  • termweight (Float64[]) – termweight[k] is the coefficient of the termidx[k]-th element of \(E\) in the weighted sum the \(\barF\) entry being specified. (input)

Groups:

Problem data - affine expressions, Problem data - semidefinite

putafebarfentrylist
function putafebarfentrylist(task::MSKtask,
                             afeidx::Vector{Int64},
                             barvaridx::Vector{Int32},
                             numterm::Vector{Int64},
                             ptrterm::Vector{Int64},
                             termidx::Vector{Int64},
                             termweight::Vector{Float64})
function putafebarfentrylist(task::MSKtask,
                             afeidx::T0,
                             barvaridx::T1,
                             numterm::T2,
                             ptrterm::T3,
                             termidx::T4,
                             termweight::T5)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Number} }

This function sets a list of entries in \(\barF\). Each entry should be described as in putafebarfentry and all those descriptions should be combined (for example concatenated) in the input to this method. That means the \(k\)-th entry set will have row index afeidx[k], symmetric variable index barvaridx[k] and the description of this term consists of indices in \(E\) and weights appearing in positions

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

in the corresponding arrays termidx and termweight. See putafebarfentry for details.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64[]) – Row indexes of \(\barF\). (input)

  • barvaridx (Int32[]) – Semidefinite variable indexes. (input)

  • numterm (Int64[]) – The number of terms in the weighted sums that form each entry. (input)

  • ptrterm (Int64[]) – The pointer to the beginning of the description of each entry. (input)

  • termidx (Int64[]) – Concatenated lists of indices in \(E\) of the matrices appearing in the weighted sums for the \(\barF\) being specified. (input)

  • termweight (Float64[]) – Concatenated lists of weights appearing in the weighted sums forming the \(\barF\) elements being specified. (input)

Groups:

Problem data - affine expressions, Problem data - semidefinite

putafebarfrow
function putafebarfrow(task::MSKtask,
                       afeidx::Int64,
                       barvaridx::Vector{Int32},
                       numterm::Vector{Int64},
                       ptrterm::Vector{Int64},
                       termidx::Vector{Int64},
                       termweight::Vector{Float64})
function putafebarfrow(task::MSKtask,
                       afeidx::T0,
                       barvaridx::T1,
                       numterm::T2,
                       ptrterm::T3,
                       termidx::T4,
                       termweight::T5)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Number} }

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 putafebarfentry and all those descriptions should be combined (for example concatenated) in the input to this method. That means the \(k\)-th entry set will have row index afeidx, symmetric variable index barvaridx[k] and the description of this term consists of indices in \(E\) and weights appearing in positions

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

in the corresponding arrays termidx and termweight. See putafebarfentry for details.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • barvaridx (Int32[]) – Semidefinite variable indexes. (input)

  • numterm (Int64[]) – The number of terms in the weighted sums that form each entry. (input)

  • ptrterm (Int64[]) – The pointer to the beginning of the description of each entry. (input)

  • termidx (Int64[]) – Concatenated lists of indices in \(E\) of the matrices appearing in the weighted sums for the \(\barF\) entries in the row. (input)

  • termweight (Float64[]) – Concatenated lists of weights appearing in the weighted sums forming the \(\barF\) entries in the row. (input)

Groups:

Problem data - affine expressions, Problem data - semidefinite

putafefcol
function putafefcol(task::MSKtask,
                    varidx::Int32,
                    afeidx::Vector{Int64},
                    val::Vector{Float64})
function putafefcol(task::MSKtask,
                    varidx::T0,
                    afeidx::T1,
                    val::T2)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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) – An optimization task. (input)

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

  • afeidx (Int64[]) – Row indexes of non-zero values in the column of \(F\). (input)

  • val (Float64[]) – New non-zero values in the column of \(F\). (input)

Groups:

Problem data - affine expressions

putafefentry
function putafefentry(task::MSKtask,
                      afeidx::Int64,
                      varidx::Int32,
                      value::Float64)
function putafefentry(task::MSKtask,
                      afeidx::T0,
                      varidx::T1,
                      value::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number }

Replaces one entry in the affine expression store \(F\), that is it sets:

\[F_{\mathrm{afeidx}, \mathrm{varidx}} = \mathrm{value}.\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64) – Row index in \(F\). (input)

  • varidx (Int32) – Column index in \(F\). (input)

  • value (Float64) – Value of \(F_{\mathrm{afeidx},\mathrm{varidx}}\). (input)

Groups:

Problem data - affine expressions

putafefentrylist
function putafefentrylist(task::MSKtask,
                          afeidx::Vector{Int64},
                          varidx::Vector{Int32},
                          val::Vector{Float64})
function putafefentrylist(task::MSKtask,
                          afeidx::T0,
                          varidx::T1,
                          val::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

Replaces a number of entries in the affine expression store \(F\), that is it sets:

\[F_{\mathrm{afeidxs}[k], \mathrm{varidx}[k]} = \mathrm{val}[k]\]

for all \(k\).

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64[]) – Row indices in \(F\). (input)

  • varidx (Int32[]) – Column indices in \(F\). (input)

  • val (Float64[]) – Values of the entries in \(F\). (input)

Groups:

Problem data - affine expressions

putafefrow
function putafefrow(task::MSKtask,
                    afeidx::Int64,
                    varidx::Vector{Int32},
                    val::Vector{Float64})
function putafefrow(task::MSKtask,
                    afeidx::T0,
                    varidx::T1,
                    val::T2)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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) – An optimization task. (input)

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

  • varidx (Int32[]) – Column indexes of non-zero values in the row of \(F\). (input)

  • val (Float64[]) – New non-zero values in the row of \(F\). (input)

Groups:

Problem data - affine expressions

putafefrowlist
function putafefrowlist(task::MSKtask,
                        afeidx::Vector{Int64},
                        numnzrow::Vector{Int32},
                        ptrrow::Vector{Int64},
                        varidx::Vector{Int32},
                        val::Vector{Float64})
function putafefrowlist(task::MSKtask,
                        afeidx::T0,
                        numnzrow::T1,
                        ptrrow::T2,
                        varidx::T3,
                        val::T4)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Number} }

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 putafefrow starts in position \(\mathrm{ptrrow}[k]\) of the arrays varidx and val. Formally, the row with index \(i\) is cleared and then set as:

\[F_{i,\mathrm{varidx}[\mathrm{ptrrow}[k]+j]} = \mathrm{val}[\mathrm{ptrrow}[k] + j], \quad j=0,\ldots,\mathrm{numnzrow}[k]-1.\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64[]) – Indices of rows in \(F\). (input)

  • numnzrow (Int32[]) – Number of non-zeros in each of the modified rows of \(F\). (input)

  • ptrrow (Int64[]) – Pointer to the first nonzero in each row of \(F\). (input)

  • varidx (Int32[]) – Column indexes of non-zero values. (input)

  • val (Float64[]) – New non-zero values in the rows of \(F\). (input)

Groups:

Problem data - affine expressions

putafeg
function putafeg(task::MSKtask,
                 afeidx::Int64,
                 g::Float64)
function putafeg(task::MSKtask,
                 afeidx::T0,
                 g::T1)
    where { T0<:Integer,
            T1<:Number }

Change one element of the vector \(g\) in affine expressions i.e.

\[g_{\mathtt{afeidx}} = \mathtt{gi}.\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64) – Index of an entry in \(g\). (input)

  • g (Float64) – New value for \(g_{\mathrm{afeidx}}\). (input)

Groups:

Problem data - affine expressions

putafeglist
function putafeglist(task::MSKtask,
                     afeidx::Vector{Int64},
                     g::Vector{Float64})
function putafeglist(task::MSKtask,
                     afeidx::T0,
                     g::T1)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Number} }

Changes a list of elements of the vector \(g\) in affine expressions i.e. for all \(k\) it sets

\[g_{\mathrm{afeidx}[k]} = \mathrm{glist}[k].\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • afeidx (Int64[]) – Indices of entries in \(g\). (input)

  • g (Float64[]) – New values for \(g\). (input)

Groups:

Problem data - affine expressions

putafegslice
function putafegslice(task::MSKtask,
                      first::Int64,
                      last::Int64,
                      slice::Vector{Float64})
function putafegslice(task::MSKtask,
                      first::T0,
                      last::T1,
                      slice::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

Modifies a slice in the vector \(g\) of constant terms in affine expressions using the principle

\[g_{\mathtt{j}} = \mathtt{slice[j-first\idxorg]}, \quad j=\mathrm{first},..,\mathrm{last}-1\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

  • slice (Float64[]) – The slice of \(g\) as a dense vector. The length is last-first. (input)

Groups:

Problem data - affine expressions

putaij
function putaij(task::MSKtask,
                i::Int32,
                j::Int32,
                aij::Float64)
function putaij(task::MSKtask,
                i::T0,
                j::T1,
                aij::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number }

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

\[a_{i,j} = \mathtt{aij}.\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Constraint (row) index. (input)

  • j (Int32) – Variable (column) index. (input)

  • aij (Float64) – New coefficient for \(a_{i,j}\). (input)

Groups:

Problem data - linear part

putaijlist
function putaijlist(task::MSKtask,
                    subi::Vector{Int32},
                    subj::Vector{Int32},
                    valij::Vector{Float64})
function putaijlist(task::MSKtask,
                    subi::T0,
                    subj::T1,
                    valij::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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

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

Duplicates are not allowed.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subi (Int32[]) – Constraint (row) indices. (input)

  • subj (Int32[]) – Variable (column) indices. (input)

  • valij (Float64[]) – New coefficient values for \(a_{i,j}\). (input)

Groups:

Problem data - linear part

putarow
function putarow(task::MSKtask,
                 i::Int32,
                 subi::Vector{Int32},
                 vali::Vector{Float64})
function putarow(task::MSKtask,
                 i::T0,
                 subi::T1,
                 vali::T2)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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) – An optimization task. (input)

  • i (Int32) – Index of a row in \(A\). (input)

  • subi (Int32[]) – Column indexes of non-zero values in row \(i\) of \(A\). (input)

  • vali (Float64[]) – New non-zero values of row \(i\) in \(A\). (input)

Groups:

Problem data - linear part

putarowlist
function putarowlist(task::MSKtask,
                     sub::Vector{Int32},
                     ptrb::Vector{Int64},
                     ptre::Vector{Int64},
                     asub::Vector{Int32},
                     aval::Vector{Float64})
function putarowlist(task::MSKtask,
                     sub::T0,
                     ptrb::T1,
                     ptre::T2,
                     asub::T3,
                     aval::T4)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Number} }
function putarowlist(task::MSKtask,
                     sub::T0,
                     At:: SparseMatrixCSC{Float64})
    where { T0<:AbstractVector{<:Integer} }

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) – An optimization task. (input)

  • sub (Int32[]) – Indexes of rows that should be replaced, no duplicates. (input)

  • ptrb (Int64[]) – Array of pointers to the first element in each row. (input)

  • ptre (Int64[]) – Array of pointers to the last element plus one in each row. (input)

  • asub (Int32[]) – Column indexes of new elements. (input)

  • aval (Float64[]) – Coefficient values. (input)

  • At (SparseMatrixCSC{Float64}) – Transposed matrix defining the row values. Note that for efficiency reasons the columns of this matrix defines the rows to be replaced (input)

Groups:

Problem data - linear part

putarowslice
function putarowslice(task::MSKtask,
                      first::Int32,
                      last::Int32,
                      ptrb::Vector{Int64},
                      ptre::Vector{Int64},
                      asub::Vector{Int32},
                      aval::Vector{Float64})
function putarowslice(task::MSKtask,
                      first::T0,
                      last::T1,
                      ptrb::T2,
                      ptre::T3,
                      asub::T4,
                      aval::T5)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Number} }
function putarowslice(task::MSKtask,
                      first::T0,
                      last::T1,
                      At:: SparseMatrixCSC{Float64})
    where { T0<:Integer,
            T1<:Integer }

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) – An optimization task. (input)

  • first (Int32) – First row in the slice. (input)

  • last (Int32) – Last row plus one in the slice. (input)

  • ptrb (Int64[]) – Array of pointers to the first element in each row. (input)

  • ptre (Int64[]) – Array of pointers to the last element plus one in each row. (input)

  • asub (Int32[]) – Column indexes of new elements. (input)

  • aval (Float64[]) – Coefficient values. (input)

  • At (SparseMatrixCSC{Float64}) – Transposed matrix defining the row values. Note that for efficiency reasons the columns of this matrix defines the rows to be replaced (input)

Groups:

Problem data - linear part

putatruncatetol
function putatruncatetol(task::MSKtask,
                         tolzero::Float64)
function putatruncatetol(task::MSKtask,
                         tolzero::T0)
    where { T0<:Number }

Truncates (sets to zero) all elements in \(A\) that satisfy

\[|a_{i,j}| \leq \mathtt{tolzero}.\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • tolzero (Float64) – Truncation tolerance. (input)

Groups:

Problem data - linear part

putbarablocktriplet
function putbarablocktriplet(task::MSKtask,
                             subi::Vector{Int32},
                             subj::Vector{Int32},
                             subk::Vector{Int32},
                             subl::Vector{Int32},
                             valijkl::Vector{Float64})
function putbarablocktriplet(task::MSKtask,
                             subi::T0,
                             subj::T1,
                             subk::T2,
                             subl::T3,
                             valijkl::T4)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subi (Int32[]) – Constraint index. (input)

  • subj (Int32[]) – Symmetric matrix variable index. (input)

  • subk (Int32[]) – Block row index. (input)

  • subl (Int32[]) – Block column index. (input)

  • valijkl (Float64[]) – The numerical value associated with each block triplet. (input)

Groups:

Problem data - semidefinite

putbaraij
function putbaraij(task::MSKtask,
                   i::Int32,
                   j::Int32,
                   sub::Vector{Int64},
                   weights::Vector{Float64})
function putbaraij(task::MSKtask,
                   i::T0,
                   j::T1,
                   sub::T2,
                   weights::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Row index of \(\barA\). (input)

  • j (Int32) – Column index of \(\barA\). (input)

  • sub (Int64[]) – Indices in \(E\) of the matrices appearing in the weighted sum for \(\barA_{ij}\). (input)

  • weights (Float64[]) – weights[k] is the coefficient of the sub[k]-th element of \(E\) in the weighted sum forming \(\barA_{ij}\). (input)

Groups:

Problem data - semidefinite

putbaraijlist
function putbaraijlist(task::MSKtask,
                       subi::Vector{Int32},
                       subj::Vector{Int32},
                       alphaptrb::Vector{Int64},
                       alphaptre::Vector{Int64},
                       matidx::Vector{Int64},
                       weights::Vector{Float64})
function putbaraijlist(task::MSKtask,
                       subi::T0,
                       subj::T1,
                       alphaptrb::T2,
                       alphaptre::T3,
                       matidx::T4,
                       weights::T5)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Number} }
function putbaraijlist(task::MSKtask,
                       subi::T0,
                       subj::T1,
                       A:: SparseMatrixCSC{Float64})
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subi (Int32[]) – Row index of \(\barA\). (input)

  • subj (Int32[]) – Column index of \(\barA\). (input)

  • alphaptrb (Int64[]) – Start entries for terms in the weighted sum that forms \(\barA_{ij}\). (input)

  • alphaptre (Int64[]) – End entries for terms in the weighted sum that forms \(\barA_{ij}\). (input)

  • matidx (Int64[]) – Indices in \(E\) of the matrices appearing in the weighted sum for \(\barA_{ij}\). (input)

  • weights (Float64[]) – weights[k] is the coefficient of the sub[k]-th element of \(E\) in the weighted sum forming \(\barA_{ij}\). (input)

  • A (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Groups:

Problem data - semidefinite

putbararowlist
function putbararowlist(task::MSKtask,
                        subi::Vector{Int32},
                        ptrb::Vector{Int64},
                        ptre::Vector{Int64},
                        subj::Vector{Int32},
                        nummat::Vector{Int64},
                        matidx::Vector{Int64},
                        weights::Vector{Float64})
function putbararowlist(task::MSKtask,
                        subi::T0,
                        ptrb::T1,
                        ptre::T2,
                        subj::T3,
                        nummat::T4,
                        matidx::T5,
                        weights::T6)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Integer},
            T6<:AbstractVector{<:Number} }
function putbararowlist(task::MSKtask,
                        subi::T0,
                        A:: SparseMatrixCSC{Float64},
                        matidx::T5,
                        weights::T6)
    where { T0<:AbstractVector{<:Integer},
            T5<:AbstractVector{<:Integer},
            T6<:AbstractVector{<:Number} }

This function replaces a list of rows in the \(\barA\) matrix.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subi (Int32[]) – Row indexes of \(\barA\). (input)

  • ptrb (Int64[]) – Start of rows in \(\barA\). (input)

  • ptre (Int64[]) – End of rows in \(\barA\). (input)

  • subj (Int32[]) – Column index of \(\barA\). (input)

  • nummat (Int64[]) – Number of entries in weighted sum of matrixes. (input)

  • matidx (Int64[]) – Matrix indexes for weighted sum of matrixes. (input)

  • weights (Float64[]) – Weights for weighted sum of matrixes. (input)

  • A (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Groups:

Problem data - semidefinite

putbarcblocktriplet
function putbarcblocktriplet(task::MSKtask,
                             subj::Vector{Int32},
                             subk::Vector{Int32},
                             subl::Vector{Int32},
                             valjkl::Vector{Float64})
function putbarcblocktriplet(task::MSKtask,
                             subj::T0,
                             subk::T1,
                             subl::T2,
                             valjkl::T3)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subj (Int32[]) – Symmetric matrix variable index. (input)

  • subk (Int32[]) – Block row index. (input)

  • subl (Int32[]) – Block column index. (input)

  • valjkl (Float64[]) – The numerical value associated with each block triplet. (input)

Groups:

Problem data - semidefinite

putbarcj
function putbarcj(task::MSKtask,
                  j::Int32,
                  sub::Vector{Int64},
                  weights::Vector{Float64})
function putbarcj(task::MSKtask,
                  j::T0,
                  sub::T1,
                  weights::T2)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the element in \(\barC\) that should be changed. (input)

  • sub (Int64[]) – Indices in \(E\) of matrices appearing in the weighted sum for \(\barC_j\) (input)

  • weights (Float64[]) – weights[k] is the coefficient of the sub[k]-th element of \(E\) in the weighted sum forming \(\barC_j\). (input)

Groups:

Problem data - semidefinite, Problem data - objective

putbarsj
function putbarsj(task::MSKtask,
                  whichsol::Soltype,
                  j::Int32,
                  barsj::Vector{Float64})
function putbarsj(task::MSKtask,
                  whichsol::Soltype,
                  j::T0,
                  barsj::T1)
    where { T0<:Integer,
            T1<:AbstractVector{<:Number} }

Sets the dual solution for a semidefinite variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • j (Int32) – Index of the semidefinite variable. (input)

  • barsj (Float64[]) – Value of \(\barS_j\). Format as in getbarsj. (input)

Groups:

Solution - semidefinite

putbarvarname
function putbarvarname(task::MSKtask,
                       j::Int32,
                       name::Union{Nothing,AbstractString})
function putbarvarname(task::MSKtask,
                       j::T0,
                       name::Union{Nothing,AbstractString})
    where { T0<:Integer }

Sets the name of a semidefinite variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable. (input)

  • name (AbstractString) – The variable name. (input)

Groups:

Names, Problem data - semidefinite

putbarxj
function putbarxj(task::MSKtask,
                  whichsol::Soltype,
                  j::Int32,
                  barxj::Vector{Float64})
function putbarxj(task::MSKtask,
                  whichsol::Soltype,
                  j::T0,
                  barxj::T1)
    where { T0<:Integer,
            T1<:AbstractVector{<:Number} }

Sets the primal solution for a semidefinite variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • j (Int32) – Index of the semidefinite variable. (input)

  • barxj (Float64[]) – Value of \(\barX_j\). Format as in getbarxj. (input)

Groups:

Solution - semidefinite

putcallbackfunc
function putcallbackfunc(task::MSKtask,
                         f::Function)

Receive callbacks with solver status and information during optimization.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • f (Function) – The callback function. (input)

Groups:

Callback

putcfix
function putcfix(task::MSKtask,
                 cfix::Float64)
function putcfix(task::MSKtask,
                 cfix::T0)
    where { T0<:Number }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • cfix (Float64) – Fixed term in the objective. (input)

Groups:

Problem data - linear part, Problem data - objective

putcj
function putcj(task::MSKtask,
               j::Int32,
               cj::Float64)
function putcj(task::MSKtask,
               j::T0,
               cj::T1)
    where { T0<:Integer,
            T1<:Number }

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable for which \(c\) should be changed. (input)

  • cj (Float64) – New value of \(c_j\). (input)

Groups:

Problem data - linear part, Problem data - objective

putclist
function putclist(task::MSKtask,
                  subj::Vector{Int32},
                  val::Vector{Float64})
function putclist(task::MSKtask,
                  subj::T0,
                  val::T1)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Number} }

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subj (Int32[]) – Indices of variables for which the coefficient in \(c\) should be changed. (input)

  • val (Float64[]) – New numerical values for coefficients in \(c\) that should be modified. (input)

Groups:

Problem data - linear part, Problem data - variables, Problem data - objective

putconbound
function putconbound(task::MSKtask,
                     i::Int32,
                     bkc::Boundkey,
                     blc::Float64,
                     buc::Float64)
function putconbound(task::MSKtask,
                     i::T0,
                     bkc::Boundkey,
                     blc::T1,
                     buc::T2)
    where { T0<:Integer,
            T1<:Number,
            T2<:Number }

Changes the bounds for one constraint.

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the constraint. (input)

  • bkc (Boundkey) – New bound key. (input)

  • blc (Float64) – New lower bound. (input)

  • buc (Float64) – New upper bound. (input)

Groups:

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

putconboundlist
function putconboundlist(task::MSKtask,
                         sub::Vector{Int32},
                         bkc::Vector{Boundkey},
                         blc::Vector{Float64},
                         buc::Vector{Float64})
function putconboundlist(task::MSKtask,
                         sub::T0,
                         bkc::Vector{Boundkey},
                         blc::T1,
                         buc::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Number},
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • sub (Int32[]) – List of constraint indexes. (input)

  • bkc (Boundkey[]) – Bound keys for the constraints. (input)

  • blc (Float64[]) – Lower bounds for the constraints. (input)

  • buc (Float64[]) – Upper bounds for the constraints. (input)

Groups:

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

putconboundlistconst
function putconboundlistconst(task::MSKtask,
                              sub::Vector{Int32},
                              bkc::Boundkey,
                              blc::Float64,
                              buc::Float64)
function putconboundlistconst(task::MSKtask,
                              sub::T0,
                              bkc::Boundkey,
                              blc::T1,
                              buc::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:Number,
            T2<:Number }

Changes the bounds for one or more constraints. Data checks are performed as in putconbound.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • sub (Int32[]) – List of constraint indexes. (input)

  • bkc (Boundkey) – New bound key for all constraints in the list. (input)

  • blc (Float64) – New lower bound for all constraints in the list. (input)

  • buc (Float64) – New upper bound for all constraints in the list. (input)

Groups:

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

putconboundslice
function putconboundslice(task::MSKtask,
                          first::Int32,
                          last::Int32,
                          bkc::Vector{Boundkey},
                          blc::Vector{Float64},
                          buc::Vector{Float64})
function putconboundslice(task::MSKtask,
                          first::T0,
                          last::T1,
                          bkc::Vector{Boundkey},
                          blc::T2,
                          buc::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number},
            T3<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

  • bkc (Boundkey[]) – Bound keys for the constraints. (input)

  • blc (Float64[]) – Lower bounds for the constraints. (input)

  • buc (Float64[]) – Upper bounds for the constraints. (input)

Groups:

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

putconboundsliceconst
function putconboundsliceconst(task::MSKtask,
                               first::Int32,
                               last::Int32,
                               bkc::Boundkey,
                               blc::Float64,
                               buc::Float64)
function putconboundsliceconst(task::MSKtask,
                               first::T0,
                               last::T1,
                               bkc::Boundkey,
                               blc::T2,
                               buc::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number,
            T3<:Number }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

  • bkc (Boundkey) – New bound key for all constraints in the slice. (input)

  • blc (Float64) – New lower bound for all constraints in the slice. (input)

  • buc (Float64) – New upper bound for all constraints in the slice. (input)

Groups:

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

putcone Deprecated
function putcone(task::MSKtask,
                 k::Int32,
                 ct::Conetype,
                 conepar::Float64,
                 submem::Vector{Int32})
function putcone(task::MSKtask,
                 k::T0,
                 ct::Conetype,
                 conepar::T1,
                 submem::T2)
    where { T0<:Integer,
            T1<:Number,
            T2<:AbstractVector{<:Integer} }

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) – An optimization task. (input)

  • k (Int32) – Index of the cone. (input)

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

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

  • submem (Int32[]) – Variable subscripts of the members in the cone. (input)

Groups:

Problem data - cones (deprecated)

putconename Deprecated
function putconename(task::MSKtask,
                     j::Int32,
                     name::Union{Nothing,AbstractString})
function putconename(task::MSKtask,
                     j::T0,
                     name::Union{Nothing,AbstractString})
    where { T0<:Integer }

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) – An optimization task. (input)

  • j (Int32) – Index of the cone. (input)

  • name (AbstractString) – The name of the cone. (input)

Groups:

Names, Problem data - cones (deprecated)

putconname
function putconname(task::MSKtask,
                    i::Int32,
                    name::Union{Nothing,AbstractString})
function putconname(task::MSKtask,
                    i::T0,
                    name::Union{Nothing,AbstractString})
    where { T0<:Integer }

Sets the name of a constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the constraint. (input)

  • name (AbstractString) – The name of the constraint. (input)

Groups:

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

putconsolutioni
function putconsolutioni(task::MSKtask,
                         i::Int32,
                         whichsol::Soltype,
                         sk::Stakey,
                         x::Float64,
                         sl::Float64,
                         su::Float64)
function putconsolutioni(task::MSKtask,
                         i::T0,
                         whichsol::Soltype,
                         sk::Stakey,
                         x::T1,
                         sl::T2,
                         su::T3)
    where { T0<:Integer,
            T1<:Number,
            T2<:Number,
            T3<:Number }

Sets the primal and dual solution information for a single constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the constraint. (input)

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

  • sk (Stakey) – Status key of the constraint. (input)

  • x (Float64) – Primal solution value of the constraint. (input)

  • sl (Float64) – Solution value of the dual variable associated with the lower bound. (input)

  • su (Float64) – Solution value of the dual variable associated with the upper bound. (input)

Groups:

Solution information, Solution - primal, Solution - dual

putcslice
function putcslice(task::MSKtask,
                   first::Int32,
                   last::Int32,
                   slice::Vector{Float64})
function putcslice(task::MSKtask,
                   first::T0,
                   last::T1,
                   slice::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • first (Int32) – First element in the slice of \(c\). (input)

  • last (Int32) – Last element plus 1 of the slice in \(c\) to be changed. (input)

  • slice (Float64[]) – New numerical values for coefficients in \(c\) that should be modified. (input)

Groups:

Problem data - linear part, Problem data - objective

putdjc
function putdjc(task::MSKtask,
                djcidx::Int64,
                domidxlist::Vector{Int64},
                afeidxlist::Vector{Int64},
                b::Union{Nothing,Vector{Float64}},
                termsizelist::Vector{Int64})
function putdjc(task::MSKtask,
                djcidx::T0,
                domidxlist::T1,
                afeidxlist::T2,
                b::T3,
                termsizelist::T4)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number},
            T4<:AbstractVector{<:Integer} }

Inputs a disjunctive constraint. The constraint has the form

\[T_1\ \mathrm{or}\ T_2\ \mathrm{or}\ \cdots\ \mathrm{or}\ T_{\mathrm{numterms}}\]

For each \(i=1,\ldots\mathrm{numterms}\) the \(i\)-th clause (term) \(T_i\) has the form a sequence of affine expressions belongs to a product of domains, where the number of domains is \(\mathrm{termsizelist}[i]\) and the number of affine expressions is equal to the sum of dimensions of all domains appearing in \(T_i\).

All the domains and all the affine expressions appearing in the above description are arranged sequentially in the lists domidxlist and afeidxlist, respectively. In particular, the length of domidxlist must be equal to the sum of elements of termsizelist, and the length of afeidxlist must be equal to the sum of dimensions of all the domains appearing in domidxlist.

The elements of domidxlist are indexes of domains previously defined with one of the append...domain functions.

The elements of afeidxlist are indexes to the store of affine expressions, i.e. the \(k\)-th affine expression appearing in the disjunctive constraint is going to be

\[F_{\mathrm{afeidxlist}[k],:}x + g_{\mathrm{afeidxlist}[k]}\]

If an optional vector b of the same length as afeidxlist is specified then the \(k\)-th affine expression appearing in the disjunctive constraint will be taken as

\[F_{\mathrm{afeidxlist}[k],:}x + g_{\mathrm{afeidxlist}[k]} - b_k\]
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

  • domidxlist (Int64[]) – List of domain indexes. (input)

  • afeidxlist (Int64[]) – List of affine expression indexes. (input)

  • b (Float64[]) – The vector of constant terms modifying affine expressions. (input)

  • termsizelist (Int64[]) – List of term sizes. (input)

Groups:

Problem data - disjunctive constraints

putdjcname
function putdjcname(task::MSKtask,
                    djcidx::Int64,
                    name::Union{Nothing,AbstractString})
function putdjcname(task::MSKtask,
                    djcidx::T0,
                    name::Union{Nothing,AbstractString})
    where { T0<:Integer }

Sets the name of a disjunctive constraint.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • djcidx (Int64) – Index of the disjunctive constraint. (input)

  • name (AbstractString) – The name of the disjunctive constraint. (input)

Groups:

Names, Problem data - disjunctive constraints

putdjcslice
function putdjcslice(task::MSKtask,
                     idxfirst::Int64,
                     idxlast::Int64,
                     domidxlist::Vector{Int64},
                     afeidxlist::Vector{Int64},
                     b::Union{Nothing,Vector{Float64}},
                     termsizelist::Vector{Int64},
                     termsindjc::Vector{Int64})
function putdjcslice(task::MSKtask,
                     idxfirst::T0,
                     idxlast::T1,
                     domidxlist::T2,
                     afeidxlist::T3,
                     b::T4,
                     termsizelist::T5,
                     termsindjc::T6)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Integer},
            T4<:AbstractVector{<:Number},
            T5<:AbstractVector{<:Integer},
            T6<:AbstractVector{<:Integer} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • idxfirst (Int64) – Index of the first disjunctive constraint in the slice. (input)

  • idxlast (Int64) – Index of the last disjunctive constraint in the slice plus 1. (input)

  • domidxlist (Int64[]) – List of domain indexes. (input)

  • afeidxlist (Int64[]) – List of affine expression indexes. (input)

  • b (Float64[]) – The vector of constant terms modifying affine expressions. Optional, can be nothing if not required. (input)

  • termsizelist (Int64[]) – List of term sizes. (input)

  • termsindjc (Int64[]) – Number of terms in each of the disjunctive constraints in the slice. (input)

Groups:

Problem data - disjunctive constraints

putdomainname
function putdomainname(task::MSKtask,
                       domidx::Int64,
                       name::Union{Nothing,AbstractString})
function putdomainname(task::MSKtask,
                       domidx::T0,
                       name::Union{Nothing,AbstractString})
    where { T0<:Integer }

Sets the name of a domain.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • domidx (Int64) – Index of the domain. (input)

  • name (AbstractString) – The name of the domain. (input)

Groups:

Names, Problem data - domain

putdouparam
function putdouparam(task::MSKtask,
                     param::Dparam,
                     parvalue::Float64)
function putdouparam(task::MSKtask,
                     param::Dparam,
                     parvalue::T0)
    where { T0<:Number }

Sets the value of a double parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Dparam) – Which parameter. (input)

  • parvalue (Float64) – Parameter value. (input)

Groups:

Parameters

putintparam
function putintparam(task::MSKtask,
                     param::Iparam,
                     parvalue::Int32)
function putintparam(task::MSKtask,
                     param::Iparam,
                     parvalue::T0)
    where { T0<:Integer }

Sets the value of an integer parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Iparam) – Which parameter. (input)

  • parvalue (Int32) – Parameter value. (input)

Groups:

Parameters

putlicensecode
function putlicensecode(env::MSKenv,
                        code::Union{Nothing,Vector{Int32}})
function putlicensecode(env::MSKenv,
                        code::T0)
    where { T0<:AbstractVector{<:Integer} }
function putlicensecode(code::Union{Nothing,Vector{Int32}})
function putlicensecode(code::T0)
    where { T0<:AbstractVector{<:Integer} }

Input a runtime license code. This function has an effect only before the first optimization.

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

  • code (Int32[]) – A runtime license code. (input)

Groups:

License system

putlicensedebug
function putlicensedebug(env::MSKenv,
                         licdebug::Int32)
function putlicensedebug(env::MSKenv,
                         licdebug::T0)
    where { T0<:Integer }
function putlicensedebug(licdebug::Int32)
function putlicensedebug(licdebug::T0)
    where { T0<:Integer }

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

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

  • licdebug (Int32) – Whether license checkout debug info should be printed. (input)

Groups:

License system

putlicensepath
function putlicensepath(env::MSKenv,
                        licensepath::Union{Nothing,AbstractString})
function putlicensepath(licensepath::Union{Nothing,AbstractString})

Set the path to the license file. This function has an effect only before the first optimization.

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

  • licensepath (AbstractString) – A path specifying where to search for the license. (input)

Groups:

License system

putlicensewait
function putlicensewait(env::MSKenv,
                        licwait::Int32)
function putlicensewait(env::MSKenv,
                        licwait::T0)
    where { T0<:Integer }
function putlicensewait(licwait::Int32)
function putlicensewait(licwait::T0)
    where { T0<:Integer }

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

Parameters:
  • env (MSKenv) – The MOSEK environment. (input)

  • licwait (Int32) – Whether MOSEK should wait for a license if no license is available. (input)

Groups:

License system

putlintparam
function putlintparam(task::MSKtask,
                      param::Iparam,
                      parvalue::Int64)
function putlintparam(task::MSKtask,
                      param::Iparam,
                      parvalue::T0)
    where { T0<:Integer }

Sets the value of an integer parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Iparam) – Which parameter. (input)

  • parvalue (Int64) – Parameter value. (input)

Groups:

Parameters

putmaxnumacc
function putmaxnumacc(task::MSKtask,
                      maxnumacc::Int64)
function putmaxnumacc(task::MSKtask,
                      maxnumacc::T0)
    where { T0<:Integer }

Sets the number of preallocated affine conic constraints in the optimization task. When this number is reached MOSEK will automatically allocate more space. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumacc (Int64) – Number of preallocated affine conic constraints. (input)

Groups:

Environment and task management, Problem data - affine conic constraints

putmaxnumafe
function putmaxnumafe(task::MSKtask,
                      maxnumafe::Int64)
function putmaxnumafe(task::MSKtask,
                      maxnumafe::T0)
    where { T0<:Integer }

Sets the number of preallocated affine expressions in the optimization task. When this number is reached MOSEK will automatically allocate more space for affine expressions. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumafe (Int64) – Number of preallocated affine expressions. (input)

Groups:

Environment and task management, Problem data - affine expressions

putmaxnumanz
function putmaxnumanz(task::MSKtask,
                      maxnumanz::Int64)
function putmaxnumanz(task::MSKtask,
                      maxnumanz::T0)
    where { T0<:Integer }

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

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

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumanz (Int64) – Number of preallocated non-zeros in \(A\). (input)

Groups:

Environment and task management, Problem data - linear part

putmaxnumbarvar
function putmaxnumbarvar(task::MSKtask,
                         maxnumbarvar::Int32)
function putmaxnumbarvar(task::MSKtask,
                         maxnumbarvar::T0)
    where { T0<:Integer }

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumbarvar (Int32) – Number of preallocated symmetric matrix variables. (input)

Groups:

Environment and task management, Problem data - semidefinite

putmaxnumcon
function putmaxnumcon(task::MSKtask,
                      maxnumcon::Int32)
function putmaxnumcon(task::MSKtask,
                      maxnumcon::T0)
    where { T0<:Integer }

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumcon (Int32) – Number of preallocated constraints in the optimization task. (input)

Groups:

Environment and task management, Problem data - constraints

putmaxnumcone Deprecated
function putmaxnumcone(task::MSKtask,
                       maxnumcone::Int32)
function putmaxnumcone(task::MSKtask,
                       maxnumcone::T0)
    where { T0<:Integer }

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

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

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

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumcone (Int32) – Number of preallocated conic constraints in the optimization task. (input)

Groups:

Environment and task management, Problem data - cones (deprecated)

putmaxnumdjc
function putmaxnumdjc(task::MSKtask,
                      maxnumdjc::Int64)
function putmaxnumdjc(task::MSKtask,
                      maxnumdjc::T0)
    where { T0<:Integer }

Sets the number of preallocated disjunctive constraints in the optimization task. When this number is reached MOSEK will automatically allocate more space. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumdjc (Int64) – Number of preallocated disjunctive constraints in the task. (input)

Groups:

Environment and task management, Problem data - disjunctive constraints

putmaxnumdomain
function putmaxnumdomain(task::MSKtask,
                         maxnumdomain::Int64)
function putmaxnumdomain(task::MSKtask,
                         maxnumdomain::T0)
    where { T0<:Integer }

Sets the number of preallocated domains in the optimization task. When this number is reached MOSEK will automatically allocate more space. It is never mandatory to call this function, since MOSEK will reallocate any internal structures whenever it is required.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumdomain (Int64) – Number of preallocated domains. (input)

Groups:

Environment and task management, Problem data - domain

putmaxnumqnz
function putmaxnumqnz(task::MSKtask,
                      maxnumqnz::Int64)
function putmaxnumqnz(task::MSKtask,
                      maxnumqnz::T0)
    where { T0<:Integer }

Sets the number of preallocated non-zero entries in quadratic terms.

MOSEK stores only the non-zero elements in \(Q\). Therefore, MOSEK cannot predict how much storage is required to store \(Q\). Using this function it is possible to specify the number non-zeros to preallocate for storing \(Q\) (both objective and constraints).

It may be advantageous to reserve more non-zeros for \(Q\) than actually needed since it may improve the internal efficiency of MOSEK, however, it is never worthwhile to specify more than the double of the anticipated number of non-zeros in \(Q\).

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumqnz (Int64) – Number of non-zero elements preallocated in quadratic coefficient matrices. (input)

Groups:

Environment and task management, Problem data - quadratic part

putmaxnumvar
function putmaxnumvar(task::MSKtask,
                      maxnumvar::Int32)
function putmaxnumvar(task::MSKtask,
                      maxnumvar::T0)
    where { T0<:Integer }

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

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

Please note that maxnumvar must be larger than the current number of variables in the task.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • maxnumvar (Int32) – Number of preallocated variables in the optimization task. (input)

Groups:

Environment and task management, Problem data - variables

putnadouparam
function putnadouparam(task::MSKtask,
                       paramname::AbstractString,
                       parvalue::Float64)
function putnadouparam(task::MSKtask,
                       paramname::Union{Nothing,AbstractString},
                       parvalue::T0)
    where { T0<:Number }

Sets the value of a named double parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • paramname (AbstractString) – Name of a parameter. (input)

  • parvalue (Float64) – Parameter value. (input)

Groups:

Parameters

putnaintparam
function putnaintparam(task::MSKtask,
                       paramname::AbstractString,
                       parvalue::Int32)
function putnaintparam(task::MSKtask,
                       paramname::Union{Nothing,AbstractString},
                       parvalue::T0)
    where { T0<:Integer }

Sets the value of a named integer parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • paramname (AbstractString) – Name of a parameter. (input)

  • parvalue (Int32) – Parameter value. (input)

Groups:

Parameters

putnastrparam
function putnastrparam(task::MSKtask,
                       paramname::AbstractString,
                       parvalue::AbstractString)

Sets the value of a named string parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • paramname (AbstractString) – Name of a parameter. (input)

  • parvalue (AbstractString) – Parameter value. (input)

Groups:

Parameters

putobjname
function putobjname(task::MSKtask,
                    objname::AbstractString)

Assigns a new name to the objective.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • objname (AbstractString) – Name of the objective. (input)

Groups:

Problem data - linear part, Names, Problem data - objective

putobjsense
function putobjsense(task::MSKtask,
                     sense::Objsense)

Sets the objective sense of the task.

Parameters:
Groups:

Problem data - linear part, Problem data - objective

putoptserverhost
function putoptserverhost(task::MSKtask,
                          host::Union{Nothing,AbstractString})

Specify an OptServer URL for remote calls. The URL should contain protocol, host and port in the form http://server:port or https://server:port. If the URL is set using this function, all subsequent calls to any MOSEK function that involves synchronous optimization will be sent to the specified OptServer instead of being executed locally. Passing nothing or empty string deactivates this redirection.

Has the same effect as setting the parameter MSK_SPAR_REMOTE_OPTSERVER_HOST.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • host (AbstractString) – A URL specifying the optimization server to be used. (input)

Groups:

Remote optimization

putparam
function putparam(task::MSKtask,
                  parname::AbstractString,
                  parvalue::AbstractString)

Checks if parname is valid parameter name. If it is, the parameter is assigned the value specified by parvalue.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • parname (AbstractString) – Parameter name. (input)

  • parvalue (AbstractString) – Parameter value. (input)

Groups:

Parameters

putqcon
function putqcon(task::MSKtask,
                 qcsubk::Vector{Int32},
                 qcsubi::Vector{Int32},
                 qcsubj::Vector{Int32},
                 qcval::Vector{Float64})
function putqcon(task::MSKtask,
                 qcsubk::T0,
                 qcsubi::T1,
                 qcsubj::T2,
                 qcval::T3)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }

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 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) – An optimization task. (input)

  • qcsubk (Int32[]) – Constraint subscripts for quadratic coefficients. (input)

  • qcsubi (Int32[]) – Row subscripts for quadratic constraint matrix. (input)

  • qcsubj (Int32[]) – Column subscripts for quadratic constraint matrix. (input)

  • qcval (Float64[]) – Quadratic constraint coefficient values. (input)

Groups:

Problem data - quadratic part

putqconk
function putqconk(task::MSKtask,
                  k::Int32,
                  qcsubi::Vector{Int32},
                  qcsubj::Vector{Int32},
                  qcval::Vector{Float64})
function putqconk(task::MSKtask,
                  k::T0,
                  qcsubi::T1,
                  qcsubj::T2,
                  qcval::T3)
    where { T0<:Integer,
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }
function putqconk(task::MSKtask,
                  k::T0,
                  Qk:: SparseMatrixCSC{Float64})
    where { T0<:Integer }

Replaces all the quadratic entries in one constraint. This function performs the same operations as putqcon but only with respect to constraint number k and it does not modify the other constraints. See the description of putqcon for definitions and important remarks.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • k (Int32) – The constraint in which the new \(Q\) elements are inserted. (input)

  • qcsubi (Int32[]) – Row subscripts for quadratic constraint matrix. (input)

  • qcsubj (Int32[]) – Column subscripts for quadratic constraint matrix. (input)

  • qcval (Float64[]) – Quadratic constraint coefficient values. (input)

  • Qk (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Groups:

Problem data - quadratic part

putqobj
function putqobj(task::MSKtask,
                 qosubi::Vector{Int32},
                 qosubj::Vector{Int32},
                 qoval::Vector{Float64})
function putqobj(task::MSKtask,
                 qosubi::T0,
                 qosubj::T1,
                 qoval::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Number} }
function putqobj(task::MSKtask,
                 Qk:: SparseMatrixCSC{Float64})

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 putqcon for important remarks and example.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • qosubi (Int32[]) – Row subscripts for quadratic objective coefficients. (input)

  • qosubj (Int32[]) – Column subscripts for quadratic objective coefficients. (input)

  • qoval (Float64[]) – Quadratic objective coefficient values. (input)

  • Qk (SparseMatrixCSC{Float64}) – Sparse matrix defining the column values (input)

Groups:

Problem data - quadratic part, Problem data - objective

putqobjij
function putqobjij(task::MSKtask,
                   i::Int32,
                   j::Int32,
                   qoij::Float64)
function putqobjij(task::MSKtask,
                   i::T0,
                   j::T1,
                   qoij::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number }

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 putqobj instead whenever possible.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Row index for the coefficient to be replaced. (input)

  • j (Int32) – Column index for the coefficient to be replaced. (input)

  • qoij (Float64) – The new value for \(q_{ij}^o\). (input)

Groups:

Problem data - quadratic part, Problem data - objective

putskc
function putskc(task::MSKtask,
                whichsol::Soltype,
                skc::Vector{Stakey})

Sets the status keys for the constraints.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • skc (Stakey[]) – Status keys for the constraints. (input)

Groups:

Solution information

putskcslice
function putskcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32,
                     skc::Vector{Stakey})
function putskcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1,
                     skc::Vector{Stakey})
    where { T0<:Integer,
            T1<:Integer }

Sets the status keys for a slice of the constraints.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • skc (Stakey[]) – Status keys for the constraints. (input)

Groups:

Solution information

putskx
function putskx(task::MSKtask,
                whichsol::Soltype,
                skx::Vector{Stakey})

Sets the status keys for the scalar variables.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • skx (Stakey[]) – Status keys for the variables. (input)

Groups:

Solution information

putskxslice
function putskxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32,
                     skx::Vector{Stakey})
function putskxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1,
                     skx::Vector{Stakey})
    where { T0<:Integer,
            T1<:Integer }

Sets the status keys for a slice of the variables.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • skx (Stakey[]) – Status keys for the variables. (input)

Groups:

Solution information

putslc
function putslc(task::MSKtask,
                whichsol::Soltype,
                slc::Vector{Float64})
function putslc(task::MSKtask,
                whichsol::Soltype,
                slc::T0)
    where { T0<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints. (input)

Groups:

Solution - dual

putslcslice
function putslcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32,
                     slc::Vector{Float64})
function putslcslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1,
                     slc::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints. (input)

Groups:

Solution - dual

putslx
function putslx(task::MSKtask,
                whichsol::Soltype,
                slx::Vector{Float64})
function putslx(task::MSKtask,
                whichsol::Soltype,
                slx::T0)
    where { T0<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables. (input)

Groups:

Solution - dual

putslxslice
function putslxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32,
                     slx::Vector{Float64})
function putslxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1,
                     slx::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables. (input)

Groups:

Solution - dual

putsnx
function putsnx(task::MSKtask,
                whichsol::Soltype,
                sux::Vector{Float64})
function putsnx(task::MSKtask,
                whichsol::Soltype,
                sux::T0)
    where { T0<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables. (input)

Groups:

Solution - dual

putsnxslice
function putsnxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32,
                     snx::Vector{Float64})
function putsnxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1,
                     snx::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • snx (Float64[]) – Dual variables corresponding to the conic constraints on the variables. (input)

Groups:

Solution - dual

putsolution
function putsolution(task::MSKtask,
                     whichsol::Soltype,
                     skc::Vector{Stakey},
                     skx::Vector{Stakey},
                     skn::Vector{Stakey},
                     xc::Union{Nothing,Vector{Float64}},
                     xx::Union{Nothing,Vector{Float64}},
                     y::Union{Nothing,Vector{Float64}},
                     slc::Union{Nothing,Vector{Float64}},
                     suc::Union{Nothing,Vector{Float64}},
                     slx::Union{Nothing,Vector{Float64}},
                     sux::Union{Nothing,Vector{Float64}},
                     snx::Union{Nothing,Vector{Float64}})
function putsolution(task::MSKtask,
                     whichsol::Soltype,
                     skc::Vector{Stakey},
                     skx::Vector{Stakey},
                     skn::Vector{Stakey},
                     xc::T0,
                     xx::T1,
                     y::T2,
                     slc::T3,
                     suc::T4,
                     slx::T5,
                     sux::T6,
                     snx::T7)
    where { T0<:AbstractVector{<:Number},
            T1<:AbstractVector{<:Number},
            T2<:AbstractVector{<:Number},
            T3<:AbstractVector{<:Number},
            T4<:AbstractVector{<:Number},
            T5<:AbstractVector{<:Number},
            T6<:AbstractVector{<:Number},
            T7<:AbstractVector{<:Number} }

Inserts a solution into the task.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • skc (Stakey[]) – Status keys for the constraints. (input)

  • skx (Stakey[]) – Status keys for the variables. (input)

  • skn (Stakey[]) – Status keys for the conic constraints. (input)

  • xc (Float64[]) – Primal constraint solution. (input)

  • xx (Float64[]) – Primal variable solution. (input)

  • y (Float64[]) – Vector of dual variables corresponding to the constraints. (input)

  • slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints. (input)

  • suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints. (input)

  • slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables. (input)

  • sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables. (input)

  • snx (Float64[]) – Dual variables corresponding to the conic constraints on the variables. (input)

Groups:

Solution information, Solution - primal, Solution - dual

putsolutionnew
function putsolutionnew(task::MSKtask,
                        whichsol::Soltype,
                        skc::Vector{Stakey},
                        skx::Vector{Stakey},
                        skn::Vector{Stakey},
                        xc::Union{Nothing,Vector{Float64}},
                        xx::Union{Nothing,Vector{Float64}},
                        y::Union{Nothing,Vector{Float64}},
                        slc::Union{Nothing,Vector{Float64}},
                        suc::Union{Nothing,Vector{Float64}},
                        slx::Union{Nothing,Vector{Float64}},
                        sux::Union{Nothing,Vector{Float64}},
                        snx::Union{Nothing,Vector{Float64}},
                        doty::Union{Nothing,Vector{Float64}})
function putsolutionnew(task::MSKtask,
                        whichsol::Soltype,
                        skc::Vector{Stakey},
                        skx::Vector{Stakey},
                        skn::Vector{Stakey},
                        xc::T0,
                        xx::T1,
                        y::T2,
                        slc::T3,
                        suc::T4,
                        slx::T5,
                        sux::T6,
                        snx::T7,
                        doty::T8)
    where { T0<:AbstractVector{<:Number},
            T1<:AbstractVector{<:Number},
            T2<:AbstractVector{<:Number},
            T3<:AbstractVector{<:Number},
            T4<:AbstractVector{<:Number},
            T5<:AbstractVector{<:Number},
            T6<:AbstractVector{<:Number},
            T7<:AbstractVector{<:Number},
            T8<:AbstractVector{<:Number} }

Inserts a solution into the task.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • skc (Stakey[]) – Status keys for the constraints. (input)

  • skx (Stakey[]) – Status keys for the variables. (input)

  • skn (Stakey[]) – Status keys for the conic constraints. (input)

  • xc (Float64[]) – Primal constraint solution. (input)

  • xx (Float64[]) – Primal variable solution. (input)

  • y (Float64[]) – Vector of dual variables corresponding to the constraints. (input)

  • slc (Float64[]) – Dual variables corresponding to the lower bounds on the constraints. (input)

  • suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints. (input)

  • slx (Float64[]) – Dual variables corresponding to the lower bounds on the variables. (input)

  • sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables. (input)

  • snx (Float64[]) – Dual variables corresponding to the conic constraints on the variables. (input)

  • doty (Float64[]) – Dual variables corresponding to affine conic constraints. (input)

Groups:

Solution information, Solution - primal, Solution - dual

putsolutionyi
function putsolutionyi(task::MSKtask,
                       i::Int32,
                       whichsol::Soltype,
                       y::Float64)
function putsolutionyi(task::MSKtask,
                       i::T0,
                       whichsol::Soltype,
                       y::T1)
    where { T0<:Integer,
            T1<:Number }

Inputs the dual variable of a solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • i (Int32) – Index of the dual variable. (input)

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

  • y (Float64) – Solution value of the dual variable. (input)

Groups:

Solution information, Solution - dual

putstreamfunc
function putstreamfunc(task::MSKtask,
                       whichstream::Streamtype,
                       f::Function)

Directs all output from a task stream to a stream callback function. The function should accept a string.

Can for example be called as:

putstreamfunc(task, MSK_STREAM_LOG, msg -> print(msg))
Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • f (Function) – The stream handler function. (input)

Groups:

Logging, Callback

putstrparam
function putstrparam(task::MSKtask,
                     param::Sparam,
                     parvalue::AbstractString)

Sets the value of a string parameter.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Sparam) – Which parameter. (input)

  • parvalue (AbstractString) – Parameter value. (input)

Groups:

Parameters

putsuc
function putsuc(task::MSKtask,
                whichsol::Soltype,
                suc::Vector{Float64})
function putsuc(task::MSKtask,
                whichsol::Soltype,
                suc::T0)
    where { T0<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints. (input)

Groups:

Solution - dual

putsucslice
function putsucslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32,
                     suc::Vector{Float64})
function putsucslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1,
                     suc::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • suc (Float64[]) – Dual variables corresponding to the upper bounds on the constraints. (input)

Groups:

Solution - dual

putsux
function putsux(task::MSKtask,
                whichsol::Soltype,
                sux::Vector{Float64})
function putsux(task::MSKtask,
                whichsol::Soltype,
                sux::T0)
    where { T0<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables. (input)

Groups:

Solution - dual

putsuxslice
function putsuxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::Int32,
                     last::Int32,
                     sux::Vector{Float64})
function putsuxslice(task::MSKtask,
                     whichsol::Soltype,
                     first::T0,
                     last::T1,
                     sux::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • sux (Float64[]) – Dual variables corresponding to the upper bounds on the variables. (input)

Groups:

Solution - dual

puttaskname
function puttaskname(task::MSKtask,
                     taskname::AbstractString)

Assigns a new name to the task.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • taskname (AbstractString) – Name assigned to the task. (input)

Groups:

Names, Environment and task management

putvarbound
function putvarbound(task::MSKtask,
                     j::Int32,
                     bkx::Boundkey,
                     blx::Float64,
                     bux::Float64)
function putvarbound(task::MSKtask,
                     j::T0,
                     bkx::Boundkey,
                     blx::T1,
                     bux::T2)
    where { T0<:Integer,
            T1<:Number,
            T2<:Number }

Changes the bounds for one variable.

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable. (input)

  • bkx (Boundkey) – New bound key. (input)

  • blx (Float64) – New lower bound. (input)

  • bux (Float64) – New upper bound. (input)

Groups:

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

putvarboundlist
function putvarboundlist(task::MSKtask,
                         sub::Vector{Int32},
                         bkx::Vector{Boundkey},
                         blx::Vector{Float64},
                         bux::Vector{Float64})
function putvarboundlist(task::MSKtask,
                         sub::T0,
                         bkx::Vector{Boundkey},
                         blx::T1,
                         bux::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Number},
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • sub (Int32[]) – List of variable indexes. (input)

  • bkx (Boundkey[]) – Bound keys for the variables. (input)

  • blx (Float64[]) – Lower bounds for the variables. (input)

  • bux (Float64[]) – Upper bounds for the variables. (input)

Groups:

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

putvarboundlistconst
function putvarboundlistconst(task::MSKtask,
                              sub::Vector{Int32},
                              bkx::Boundkey,
                              blx::Float64,
                              bux::Float64)
function putvarboundlistconst(task::MSKtask,
                              sub::T0,
                              bkx::Boundkey,
                              blx::T1,
                              bux::T2)
    where { T0<:AbstractVector{<:Integer},
            T1<:Number,
            T2<:Number }

Changes the bounds for one or more variables. Data checks are performed as in putvarbound.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • sub (Int32[]) – List of variable indexes. (input)

  • bkx (Boundkey) – New bound key for all variables in the list. (input)

  • blx (Float64) – New lower bound for all variables in the list. (input)

  • bux (Float64) – New upper bound for all variables in the list. (input)

Groups:

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

putvarboundslice
function putvarboundslice(task::MSKtask,
                          first::Int32,
                          last::Int32,
                          bkx::Vector{Boundkey},
                          blx::Vector{Float64},
                          bux::Vector{Float64})
function putvarboundslice(task::MSKtask,
                          first::T0,
                          last::T1,
                          bkx::Vector{Boundkey},
                          blx::T2,
                          bux::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number},
            T3<:AbstractVector{<:Number} }

Changes the bounds for a slice of the variables. Data checks are performed as in putvarbound.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

  • bkx (Boundkey[]) – Bound keys for the variables. (input)

  • blx (Float64[]) – Lower bounds for the variables. (input)

  • bux (Float64[]) – Upper bounds for the variables. (input)

Groups:

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

putvarboundsliceconst
function putvarboundsliceconst(task::MSKtask,
                               first::Int32,
                               last::Int32,
                               bkx::Boundkey,
                               blx::Float64,
                               bux::Float64)
function putvarboundsliceconst(task::MSKtask,
                               first::T0,
                               last::T1,
                               bkx::Boundkey,
                               blx::T2,
                               bux::T3)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Number,
            T3<:Number }

Changes the bounds for a slice of the variables. Data checks are performed as in putvarbound.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

  • bkx (Boundkey) – New bound key for all variables in the slice. (input)

  • blx (Float64) – New lower bound for all variables in the slice. (input)

  • bux (Float64) – New upper bound for all variables in the slice. (input)

Groups:

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

putvarname
function putvarname(task::MSKtask,
                    j::Int32,
                    name::Union{Nothing,AbstractString})
function putvarname(task::MSKtask,
                    j::T0,
                    name::Union{Nothing,AbstractString})
    where { T0<:Integer }

Sets the name of a variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable. (input)

  • name (AbstractString) – The variable name. (input)

Groups:

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

putvarsolutionj
function putvarsolutionj(task::MSKtask,
                         j::Int32,
                         whichsol::Soltype,
                         sk::Stakey,
                         x::Float64,
                         sl::Float64,
                         su::Float64,
                         sn::Float64)
function putvarsolutionj(task::MSKtask,
                         j::T0,
                         whichsol::Soltype,
                         sk::Stakey,
                         x::T1,
                         sl::T2,
                         su::T3,
                         sn::T4)
    where { T0<:Integer,
            T1<:Number,
            T2<:Number,
            T3<:Number,
            T4<:Number }

Sets the primal and dual solution information for a single variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable. (input)

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

  • sk (Stakey) – Status key of the variable. (input)

  • x (Float64) – Primal solution value of the variable. (input)

  • sl (Float64) – Solution value of the dual variable associated with the lower bound. (input)

  • su (Float64) – Solution value of the dual variable associated with the upper bound. (input)

  • sn (Float64) – Solution value of the dual variable associated with the conic constraint. (input)

Groups:

Solution information, Solution - primal, Solution - dual

putvartype
function putvartype(task::MSKtask,
                    j::Int32,
                    vartype::Variabletype)
function putvartype(task::MSKtask,
                    j::T0,
                    vartype::Variabletype)
    where { T0<:Integer }

Sets the variable type of one variable.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • j (Int32) – Index of the variable. (input)

  • vartype (Variabletype) – The new variable type. (input)

Groups:

Problem data - variables

putvartypelist
function putvartypelist(task::MSKtask,
                        subj::Vector{Int32},
                        vartype::Vector{Variabletype})
function putvartypelist(task::MSKtask,
                        subj::T0,
                        vartype::Vector{Variabletype})
    where { T0<:AbstractVector{<:Integer} }

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) – An optimization task. (input)

  • subj (Int32[]) – A list of variable indexes for which the variable type should be changed. (input)

  • vartype (Variabletype[]) – A list of variable types that should be assigned to the variables specified by subj. (input)

Groups:

Problem data - variables

putxc
function putxc(task::MSKtask,
               whichsol::Soltype) -> xc :: Vector{Float64}

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

xc (Float64[]) – Primal constraint solution.

Groups:

Solution - primal

putxcslice
function putxcslice(task::MSKtask,
                    whichsol::Soltype,
                    first::Int32,
                    last::Int32,
                    xc::Vector{Float64})
function putxcslice(task::MSKtask,
                    whichsol::Soltype,
                    first::T0,
                    last::T1,
                    xc::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • xc (Float64[]) – Primal constraint solution. (input)

Groups:

Solution - primal

putxx
function putxx(task::MSKtask,
               whichsol::Soltype,
               xx::Vector{Float64})
function putxx(task::MSKtask,
               whichsol::Soltype,
               xx::T0)
    where { T0<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • xx (Float64[]) – Primal variable solution. (input)

Groups:

Solution - primal

putxxslice
function putxxslice(task::MSKtask,
                    whichsol::Soltype,
                    first::Int32,
                    last::Int32,
                    xx::Vector{Float64})
function putxxslice(task::MSKtask,
                    whichsol::Soltype,
                    first::T0,
                    last::T1,
                    xx::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • xx (Float64[]) – Primal variable solution. (input)

Groups:

Solution - primal

puty
function puty(task::MSKtask,
              whichsol::Soltype,
              y::Vector{Float64})
function puty(task::MSKtask,
              whichsol::Soltype,
              y::T0)
    where { T0<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • y (Float64[]) – Vector of dual variables corresponding to the constraints. (input)

Groups:

Solution - primal

putyslice
function putyslice(task::MSKtask,
                   whichsol::Soltype,
                   first::Int32,
                   last::Int32,
                   y::Vector{Float64})
function putyslice(task::MSKtask,
                   whichsol::Soltype,
                   first::T0,
                   last::T1,
                   y::T2)
    where { T0<:Integer,
            T1<:Integer,
            T2<:AbstractVector{<:Number} }

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

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

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

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

  • y (Float64[]) – Vector of dual variables corresponding to the constraints. (input)

Groups:

Solution - dual

readbsolution
function readbsolution(task::MSKtask,
                       filename::AbstractString,
                       compress::Compresstype)

Read a binary dump of the task solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

  • compress (Compresstype) – Data compression type. (input)

Groups:

Input/Output

readdata
function readdata(task::MSKtask,
                  filename::AbstractString)

Reads an optimization problem and associated data from a file.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

readdataformat
function readdataformat(task::MSKtask,
                        filename::AbstractString,
                        format::Dataformat,
                        compress::Compresstype)

Reads an optimization problem and associated data from a file.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

  • format (Dataformat) – File data format. (input)

  • compress (Compresstype) – File compression type. (input)

Groups:

Input/Output

readjsonsol
function readjsonsol(task::MSKtask,
                     filename::AbstractString)

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) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

readjsonstring
function readjsonstring(task::MSKtask,
                        data::AbstractString)

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) – An optimization task. (input)

  • data (AbstractString) – Problem data in text format. (input)

Groups:

Input/Output

readlpstring
function readlpstring(task::MSKtask,
                      data::AbstractString)

Load task data from a string in LP format, replacing any data that already exists in the task object.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • data (AbstractString) – Problem data in text format. (input)

Groups:

Input/Output

readopfstring
function readopfstring(task::MSKtask,
                       data::AbstractString)

Load task data from a string in OPF format, replacing any data that already exists in the task object.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • data (AbstractString) – Problem data in text format. (input)

Groups:

Input/Output

readparamfile
function readparamfile(task::MSKtask,
                       filename::AbstractString)

Reads MOSEK parameters from a file. Data is read from the file filename if it is a nonempty string. Otherwise data is read from the file specified by MSK_SPAR_PARAM_READ_FILE_NAME.

The parameter file must begin with BEGIN MOSEK and end with END MOSEK; empty lines and lines starting from a % sign are ignored; each remaining line contains a valid MOSEK parameter name followed by its value (using generic names as in the command-line tool syntax). Example:

BEGIN MOSEK
% This is a comment.
MSK_IPAR_PRESOLVE_USE         MSK_OFF
MSK_DPAR_INTPNT_TOL_PFEAS     1.0e-9
END MOSEK
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output, Parameters

readptfstring
function readptfstring(task::MSKtask,
                       data::AbstractString)

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) – An optimization task. (input)

  • data (AbstractString) – Problem data in text format. (input)

Groups:

Input/Output

readsolution
function readsolution(task::MSKtask,
                      whichsol::Soltype,
                      filename::AbstractString)

Reads a solution file and inserts it as a specified solution in the task. Data is read from the file filename if it is a nonempty string. Otherwise data is read from one of the files specified by MSK_SPAR_BAS_SOL_FILE_NAME, MSK_SPAR_ITR_SOL_FILE_NAME or MSK_SPAR_INT_SOL_FILE_NAME depending on which solution is chosen.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

readsolutionfile
function readsolutionfile(task::MSKtask,
                          filename::AbstractString)

Read solution file in format determined by the filename

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

readsummary
function readsummary(task::MSKtask,
                     whichstream::Streamtype)

Prints a short summary of last file that was read.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Input/Output, Inspecting the task

readtask
function readtask(task::MSKtask,
                  filename::AbstractString)

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) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

removebarvars
function removebarvars(task::MSKtask,
                       subset::Vector{Int32})
function removebarvars(task::MSKtask,
                       subset::T0)
    where { T0<:AbstractVector{<:Integer} }

The function removes a subset of the symmetric matrices from the optimization task. This implies that the remaining symmetric matrices are renumbered.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subset (Int32[]) – Indexes of symmetric matrices which should be removed. (input)

Groups:

Problem data - semidefinite

removecones Deprecated
function removecones(task::MSKtask,
                     subset::Vector{Int32})
function removecones(task::MSKtask,
                     subset::T0)
    where { T0<:AbstractVector{<:Integer} }

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

Removes a number of conic constraints from the problem. This implies that the remaining conic constraints are renumbered. In general, it is much more efficient to remove a cone with a high index than a low index.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subset (Int32[]) – Indexes of cones which should be removed. (input)

Groups:

Problem data - cones (deprecated)

removecons
function removecons(task::MSKtask,
                    subset::Vector{Int32})
function removecons(task::MSKtask,
                    subset::T0)
    where { T0<:AbstractVector{<:Integer} }

The function removes a subset of the constraints from the optimization task. This implies that the remaining constraints are renumbered.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subset (Int32[]) – Indexes of constraints which should be removed. (input)

Groups:

Problem data - constraints, Problem data - linear part

removevars
function removevars(task::MSKtask,
                    subset::Vector{Int32})
function removevars(task::MSKtask,
                    subset::T0)
    where { T0<:AbstractVector{<:Integer} }

The function removes a subset of the variables from the optimization task. This implies that the remaining variables are renumbered.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • subset (Int32[]) – Indexes of variables which should be removed. (input)

Groups:

Problem data - variables, Problem data - linear part

rescodetostr
function rescodetostr(res::Rescode) -> str :: String

Obtains an identifier string corresponding to a response code.

Parameters:

res (Rescode) – Response code. (input)

Return:

str (String) – String corresponding to the bound response code res.

Groups:

Names

resetdouparam
function resetdouparam(task::MSKtask,
                       param::Dparam)

Resets a double parameter to its default value.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Dparam) – Which parameter. (input)

Groups:

Parameters

resetexpirylicenses
function resetexpirylicenses(env::MSKenv)
function resetexpirylicenses()

Reset the license expiry reporting startpoint.

Parameters:

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

Groups:

License system

resetintparam
function resetintparam(task::MSKtask,
                       param::Iparam)

Resets an integer parameter to its default value.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Iparam) – Which parameter. (input)

Groups:

Parameters

resetparameters
function resetparameters(task::MSKtask)

Resets all the parameters to their default values.

Parameters:

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

Groups:

Parameters

resetstrparam
function resetstrparam(task::MSKtask,
                       param::Sparam)

Resets a string parameter to its defalt value.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • param (Sparam) – Which parameter. (input)

Groups:

Parameters

resizetask
function resizetask(task::MSKtask,
                    maxnumcon::Int32,
                    maxnumvar::Int32,
                    maxnumcone::Int32,
                    maxnumanz::Int64,
                    maxnumqnz::Int64)
function resizetask(task::MSKtask,
                    maxnumcon::T0,
                    maxnumvar::T1,
                    maxnumcone::T2,
                    maxnumanz::T3,
                    maxnumqnz::T4)
    where { T0<:Integer,
            T1<:Integer,
            T2<:Integer,
            T3<:Integer,
            T4<:Integer }

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) – An optimization task. (input)

  • maxnumcon (Int32) – New maximum number of constraints. (input)

  • maxnumvar (Int32) – New maximum number of variables. (input)

  • maxnumcone (Int32) – New maximum number of cones. (input)

  • maxnumanz (Int64) – New maximum number of non-zeros in \(A\). (input)

  • maxnumqnz (Int64) – New maximum number of non-zeros in all \(Q\) matrices. (input)

Groups:

Environment and task management

sensitivityreport
function sensitivityreport(task::MSKtask,
                           whichstream::Streamtype)

Reads a sensitivity format file from a location given by MSK_SPAR_SENSITIVITY_FILE_NAME and writes the result to the stream whichstream. If MSK_SPAR_SENSITIVITY_RES_FILE_NAME is set to a non-empty string, then the sensitivity report is also written to a file of this name.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Sensitivity analysis

solutiondef
function solutiondef(task::MSKtask,
                     whichsol::Soltype) -> isdef :: Bool

Checks whether a solution is defined.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Return:

isdef (Bool) – Is non-zero if the requested solution is defined.

Groups:

Solution information

solutionsummary
function solutionsummary(task::MSKtask,
                         whichstream::Streamtype)

Prints a short summary of the current solutions.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Logging, Solution information

solvewithbasis
function solvewithbasis(task::MSKtask,
                        transp::Bool,
                        numnz::Int32,
                        sub::Vector{Int32},
                        val::Vector{Float64}) -> numnzout :: Int32
function solvewithbasis(task::MSKtask,
                        transp::Bool,
                        numnz::T0,
                        sub::Vector{Int32},
                        val::Vector{Float64})
    where { T0<:Integer }
    -> numnzout :: Int32

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 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 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) – An optimization task. (input)

  • transp (Bool) – If this argument is zero, then (15.3) is solved, if non-zero then (15.4) is solved. (input)

  • numnz (Int32) – The number of non-zeros in \(b\). (input)

  • sub (Int32[]) – 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 (Float64[]) – As input it is the vector \(b\) as a dense vector (although the positions of non-zeros are specified in sub it is required that \(\mathtt{val}[i] = 0\) when \(b[i] = 0\)). As output val is the vector \(\barX\) as a dense vector. It must have length \(numcon\). (input/output)

Return:

numnzout (Int32) – The number of non-zeros in \(\barX\).

Groups:

Solving systems with basis matrix

sparsetriangularsolvedense
function sparsetriangularsolvedense(env::MSKenv,
                                    transposed::Transpose,
                                    lnzc::Vector{Int32},
                                    lptrc::Vector{Int64},
                                    lsubc::Vector{Int32},
                                    lvalc::Vector{Float64},
                                    b::Vector{Float64})
function sparsetriangularsolvedense(env::MSKenv,
                                    transposed::Transpose,
                                    lnzc::T0,
                                    lptrc::T1,
                                    lsubc::T2,
                                    lvalc::T3,
                                    b::Vector{Float64})
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }
function sparsetriangularsolvedense(transposed::Transpose,
                                    lnzc::Vector{Int32},
                                    lptrc::Vector{Int64},
                                    lsubc::Vector{Int32},
                                    lvalc::Vector{Float64},
                                    b::Vector{Float64})
function sparsetriangularsolvedense(transposed::Transpose,
                                    lnzc::T0,
                                    lptrc::T1,
                                    lsubc::T2,
                                    lvalc::T3,
                                    b::Vector{Float64})
    where { T0<:AbstractVector{<:Integer},
            T1<:AbstractVector{<:Integer},
            T2<:AbstractVector{<:Integer},
            T3<:AbstractVector{<:Number} }

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) – The MOSEK environment. (input)

  • transposed (Transpose) – Controls whether to use with \(L\) or \(L^T\). (input)

  • lnzc (Int32[]) – lnzc[j] is the number of nonzeros in column j. (input)

  • lptrc (Int64[]) – lptrc[j] is a pointer to the first row index and value in column j. (input)

  • lsubc (Int32[]) – Row indexes for each column stored sequentially. Must be stored in increasing order for each column. (input)

  • lvalc (Float64[]) – The value corresponding to the row index stored in lsubc. (input)

  • b (Float64[]) – The right-hand side of linear equation system to be solved as a dense vector. (input/output)

Groups:

Linear algebra

strtoconetype Deprecated
function strtoconetype(task::MSKtask,
                       str::AbstractString) -> conetype :: 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) – An optimization task. (input)

  • str (AbstractString) – String corresponding to the cone type code conetype. (input)

Return:

conetype (Conetype) – The cone type corresponding to the string str.

Groups:

Names

strtosk
function strtosk(task::MSKtask,
                 str::AbstractString) -> sk :: Stakey

Obtains the status key corresponding to an abbreviation string.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • str (AbstractString) – A status key abbreviation string. (input)

Return:

sk (Stakey) – Status key corresponding to the string.

Groups:

Names

updatesolutioninfo
function updatesolutioninfo(task::MSKtask,
                            whichsol::Soltype)

Update the information items related to the solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

Groups:

Information items and statistics

writebsolution
function writebsolution(task::MSKtask,
                        filename::AbstractString,
                        compress::Compresstype)

Write a binary dump of the task solution.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

  • compress (Compresstype) – Data compression type. (input)

Groups:

Input/Output

writedata
function writedata(task::MSKtask,
                   filename::AbstractString)

Writes problem data associated with the optimization task to a file in one of the supported formats. See Section Supported File Formats for the complete list.

The data file format is determined by the file name extension. To write in compressed format append the extension .gz. E.g to write a gzip compressed MPS file use the extension mps.gz.

Please note that MPS, LP and OPF files require all variables to have unique names. If a task contains no names, it is possible to write the file with automatically generated anonymous names by setting the MSK_IPAR_WRITE_GENERIC_NAMES parameter to MSK_ON.

Data is written to the file filename if it is a nonempty string. Otherwise data is written to the file specified by MSK_SPAR_DATA_FILE_NAME.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

writedatastream
function writedatastream(task::Task,
                         format::Dataformat,
                         compress::Compresstype,
                         stream::OutputStream)

Writes problem data associated with the optimization task to a stream in one of the supported formats.

Example:

        writedatastream(task,MSK_DATA_FORMAT_TASK, MSK_COMPRESS_NONE, open("outfile.task", "w"))
        writedatastream(task,MSK_DATA_FORMAT_PTF,  MSK_COMPRESS_NONE, stdout)
Parameters:
  • task (MSKtask) – An optimization task. (input)

  • format (mosek.dataformat) – Data format. (input)

  • compress (mosek.compresstype) – Selects compression type. (input)

  • stream (OutputStream) – The output stream. (input)

Groups:

Input/Output

writejsonsol
function writejsonsol(task::MSKtask,
                      filename::AbstractString)

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) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

writeparamfile
function writeparamfile(task::MSKtask,
                        filename::AbstractString)

Writes all the parameters to a parameter file.

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output, Parameters

writesolution
function writesolution(task::MSKtask,
                       whichsol::Soltype,
                       filename::AbstractString)

Saves the current basic, interior-point, or integer solution to a file.

Parameters:
  • task (MSKtask) – An optimization task. (input)

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

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

writesolutionfile
function writesolutionfile(task::MSKtask,
                           filename::AbstractString)

Write solution file in format determined by the filename

Parameters:
  • task (MSKtask) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output

writetask
function writetask(task::MSKtask,
                   filename::AbstractString)

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) – An optimization task. (input)

  • filename (AbstractString) – A valid file name. (input)

Groups:

Input/Output