7. Command reference


After studying the examples presented in the previous chapter, then it should be possible to use most of facilities in the MOSEK optimization toolbox. Nevertheless a specification of the main data structures employed by MOSEK and a command reference is provided in the present chapter.

7.1. Data structures

In each of the subsequent sections the most important data structures employed by MOSEK are discussed.

7.1.1. prob

Description:

The prob data structure is used to communicate an optimization problem to MOSEK or for MOSEK to return an optimization problem to the user. This structure is used to represent an optimization problem using a number of subfields.

Subfields:
.names

Is a MATLAB structure which contain the problem name, the name of the objective, and so forth. See Section7.1.2.

.qosubi

i subscript for element [[MathCmd 158]] in [[MathCmd 159]]. See (7.1.6).

.qosubj

j subscript for element [[MathCmd 158]] in [[MathCmd 159]]. See (7.1.6).

.qoval

Numerical value for element [[MathCmd 158]] in [[MathCmd 159]]. See (7.1.6).

.qcsubk

k subscript for element [[MathCmd 164]] in [[MathCmd 165]]. See (7.1.7).

.qcsubi

i subscript for element [[MathCmd 164]] in [[MathCmd 165]]. See (7.1.7).

.qcsubj

j subscript for element [[MathCmd 164]] in [[MathCmd 165]]. See (7.1.7).

.qcval

Numerical value for element [[MathCmd 164]] in [[MathCmd 165]]. See (7.1.7).

.c

Liner term in the objective.

.a

Is the constraint matrix and it must be a sparse matrix having the same number of rows and columns as there are constraints and variables in the problem. This field should always be defined. Even in the case the problem does not have any constraints. In that case a sparse matrix having zero rows and the correct number of columns is the appropriate definition of the field.

.blc

Lower bounds on the constraints. - denotes an infinite lower bound. If the field is not defined or blc==[], then all the lower bounds are assumed to be equal to -.

.buc

Upper bounds on the constraints. denotes an infinite upper bound. If the field is not defined or buc==[], then all the upper bounds are assumed to be equal to .

.blx

Lower bounds on the variables. - denotes an infinite lower bound. If the field is not defined or blx==[], then all the lower bounds are assumed to be equal to -.

.bux

Upper bounds on the variables. denotes an infinite upper bound. If the field is not defined or bux==[], then all the upper bounds are assumed to be equal to .

.ints

A MATLAB structure which has the subfields

.sub; % Required.
.pri; % Subfields.
                                 

ints.sub is a one dimensional which contains the indexes of the integer constrained variables. Hence, ints.sub is identical to the set [[MathCmd 172]] in (7.1.5). ints.pri is also a one dimensional array of the length as ints.pri. The ints.pri(k) is the branching priority assigned to the variable ints.sub(k).

.cones

A MATLAB cell array which used to define the conic constraint (7.1.4). See Section 7.1.3 for a details about this structure.

.sol

A MATLAB structure which contains a guess for the optimal solution which some of the optimizers in MOSEK may exploit. See Section 7.1.4 for datails about this structure.

.prisen

A MATLAB structure which has the subfields:

.cons.subu

Indexes of constraints, where upper bounds are analyzed for sensitivity.

.cons.subl

Indexes of constraints, where lower bounds are analyzed for sensitivity.

.vars.subu

Indexes of variables, where upper bounds are analyzed for sensitivity.

.vars.subl

Indexes of variables, where lower bounds are analyzed for sensitivity.

.sub

Index of variables where coefficients are analysed for sensitivity.

Comments:

MOSEK solves an optimization problem which has the form of minimizing or maximizing an objective function

\begin{math}\nonumber{}\frac{1}{2}\sum _{{i=1}}^{{n}}\sum _{{j=1}}^{{n}}q_{{ij}}^{o}x_{i}x_{j}+c_{j}x_{j}\end{math} (7.1.1)

subject to the functional constraints

\begin{math}\nonumber{}l_{k}^{c}\leq{}\frac{1}{2}\sum _{{i=1}}^{{n}}\sum _{{j=1}}^{{n}}q_{{ij}}^{p}x_{i}x_{j}+\sum _{{j=1}}^{{n}}a_{{kj}}x_{j}\leq{}u_{k}^{c},~k=1,\ldots ,m,\end{math} (7.1.2)

the variable bound constraints

\begin{math}\nonumber{}l_{j}^{x}\leq{}x_{j}\leq{}u_{j}^{x},~j=1,\ldots ,n.\end{math} (7.1.3)

and the conic constraint

\begin{math}\nonumber{}x\in{}\mathcal{C}.\end{math} (7.1.4)

Finally, some variables may be integer constrained i.e.

\begin{math}\nonumber{}x_{j}\mbox{ integer constrained for all }j\in{}\mathcal{J}.\end{math} (7.1.5)

x is the decision variables and all the other quantities are the parameters of the problem and they are presented below:

  • The quadratic terms [[MathCmd 178]] in the objective are stored in the matrix [[MathCmd 159]] as follows

    \begin{displaymath}\nonumber{}Q^{o}=\left[\begin{array}{ccc}\nonumber{}q_{{11}}^{o} & \cdots  & q_{{1n}}^{o}\\\nonumber{}\vdots  & \cdots  & \vdots \\\nonumber{}q_{{n1}}^{0} & \cdots  & q_{{nn}}^{o}\end{array}\right].\end{displaymath}

    In MOSEK it is assumed that [[MathCmd 159]] is symmetric i.e.

    \begin{displaymath}\nonumber{}q_{{ij}}^{o}=q_{{ji}}^{o}\end{displaymath}

    and therefore only the lower triangular part in [[MathCmd 159]] should be specified.

  • It is the linear part of the objective specifying the [[MathCmd 184]] in the linear term [[MathCmd 185]].
  • The quadratic terms [[MathCmd 186]] in the kth constraint are stored in the matrix [[MathCmd 165]] as follows

    \begin{displaymath}\nonumber{}Q^{p}=\left[\begin{array}{ccc}\nonumber{}q_{{11}}^{p} & \cdots  & q_{{1n}}^{p}\\\nonumber{}\vdots  & \cdots  & \vdots \\\nonumber{}q_{{n1}}^{p} & \cdots  & q_{{nn}}^{p}\end{array}\right].\end{displaymath}

    MOSEK assumes that [[MathCmd 165]] is symmetric i.e.

    \begin{displaymath}\nonumber{}q_{{ij}}^{p}=q_{{ji}}^{p}\end{displaymath}

    and therefore only the lower triangular part in [[MathCmd 165]] should be specified.

  • The constraint matrix A is given by

    \begin{displaymath}\nonumber{}A=\left[\begin{array}{ccc}\nonumber{}a_{{11}} & \cdots  & a_{{1n}}\\\nonumber{}\vdots  & \cdots  & \vdots \\\nonumber{}a_{{m1}} & \cdots  & a_{{mn}}\end{array}\right].\end{displaymath}

    In MOSEK it is assumed that A is a sparse matrix i.e. most of the coefficients in A are zero. Therefore, only nonzeros elements in A are stored and worked with. This usually saves a lot of storage and speeds up the computations.

  • Specifies the lower bounds on the constraints.
  • Specifies the upper bounds on the constraints.
  • Specifies the lower bounds on the variables.
  • Specifies the upper bounds on the variables.
  • Specifies the conic constraint. Let

    \begin{displaymath}\nonumber{}x^{t}\in{}{R}^{{n^{t}}},~t=1,\ldots ,k\end{displaymath}

    be vectors comprised of parts of the decision variables x such that each decision variable is a member of exactly one vector [[MathCmd 25]]. For example we could have

    \begin{displaymath}\nonumber{}x^{1}=\left[\begin{array}{c}\nonumber{}x_{1}\\\nonumber{}x_{4}\\\nonumber{}x_{7}\end{array}\right]\mbox{ and }x^{2}=\left[\begin{array}{c}\nonumber{}x_{6}\\\nonumber{}x_{5}\\\nonumber{}x_{{3}}\\\nonumber{}x_{2}\end{array}\right].\end{displaymath}

    Next define

    \begin{displaymath}\nonumber{}\mathcal{C}:=\left\lbrace{}x\in{}{R}^{n}:~x^{t}\in{}\mathcal{C}_{t},~t=1,\ldots ,k\right\rbrace{}\end{displaymath}

    where [[MathCmd 28]] must have one of the following forms

    • [[MathCmd 29]] set:

      \begin{displaymath}\nonumber{}\mathcal{C}_{t}=\lbrace{}x\in{}{R}^{{n^{t}}}\rbrace{}.\end{displaymath}
    • Quadratic cone:

      \begin{displaymath}\nonumber{}\mathcal{C}_{t}=\left\lbrace{}x\in{}{R}^{{n^{t}}}:x_{1}\geq{}\sqrt{\sum \limits _{{j=2}}^{{n^{t}}}x_{j}^{2}}\right\rbrace{}.\end{displaymath}
    • Rotated quadratic cone:

      \begin{displaymath}\nonumber{}\mathcal{C}_{t}=\left\lbrace{}x\in{}{R}^{{n^{t}}}:2x_{1}x_{2}\geq{}\sqrt{\sum \limits _{{j=3}}^{{n^{t}}}x_{j}^{2}},~x_{1},x_{2}\geq{}0\right\rbrace{}.\end{displaymath}

All the parameters of the optimization problem are stored using one or more subfields of the prob structure using the naming convention in Table 7.1.

Field name Type Dimen- Optio- Problem
  sion nal parameter
qosubi int length(qoval) Yes [[MathCmd 158]]
qosubj int length(qoval) Yes [[MathCmd 158]]
qoval double length(qoval) Yes [[MathCmd 158]]
c double n Yes [[MathCmd 184]]
qcsubk int length(qcval) Yes [[MathCmd 164]]
qcsubi int length(qcval) Yes [[MathCmd 164]]
qcsubj int length(qcval) Yes [[MathCmd 164]]
qcval double length(qcval) Yes [[MathCmd 164]]
a Sparse matrix [[MathCmd 210]] No [[MathCmd 211]]
blc double m Yes [[MathCmd 212]]
buc double m Yes [[MathCmd 213]]
blx double n Yes [[MathCmd 214]]
bux double n Yes [[MathCmd 215]]
ints MATLAB structure [[MathCmd 216]] Yes [[MathCmd 172]]
cones MATLAB cell array k Yes [[MathCmd 21]]
Table 7.1: The relation between fields and problem parameters.

In Table 7.1 all the parameters is assigned a type where the type int means that all the values in this particular field must be integer. Whereas the type double means that the values in the field can be any real number. The relationship between [[MathCmd 159]] and [[MathCmd 165]] and the subfields of the prob structure is as follows:

  • The quadratic terms in the objective:

    \begin{math}\nonumber{}q_{{{qosubi(t)},{qoval(t)}}}^{o}={qoval(t)},~t=1,2,\ldots ,{length(qoval)}.\end{math} (7.1.6)

    Due to [[MathCmd 159]] by assumption is symmetric, then all elements are assumed to belong to the lower triangular part. If the an element is specified multiple times, then the different elements are added together.

  • The quadratic terms in the constraints:

    \begin{math}\nonumber{}q_{{{qcsubi(t)},{qcsubj(t)}}}^{{qcsubk(t)}}={qcval(t)},~t=1,2,\ldots ,{length(qcval)}.\end{math} (7.1.7)

    Due to [[MathCmd 165]] by assumption is symmetric, then all elements are assumed to belong to the lower triangular part. If the an element is specified multiple times, then the different elements are added together.

7.1.2. names

This structure is used to store all the names on individual items in the optimization problem such as the constraints and the variables. The structure contains the subfields:

.name

Contains the problem name.

.obj

Contains the name of the objective.

.con

Is a MATLAB cell array where names.con{i} contains the name of the ith constraint.

.var

Is a MATLAB cell array where names.var{j} contains the name of the jth constraint.

.cone

Is a MATLAB cell array where names.cone{t} contains the name of the tth conic constraint.

7.1.3. cones

cones is a MATLAB cell array containing one structure per cone in the optimization problem i.e. cones{t} is used to specify the tth cone in the optimization problem.

The structure contains the subfields:

.type

cones{t}.type contains the cone type for the tth cone. The type subfield can have either value 'MSK_CT_QUAD' or 'MSK_CT_RQUAD' which implies the cone is quadratic or rotated quadratic cone respectively.

.sub

cones{t}.sub is list of variables indexes specifying which variables are member of the cone.

7.1.4. sol

Description:

A MATLAB structure which is used store one or more solution to an optimization problem. The structure has subfield for possible solution type.

Subfields:
.itr

Interior (point) solution which is computed by the interior-point optimizer.

.bas

Basis solution which computed by the simplex optimizers and basis identification procedure.

.int

Integer solution which is computed by the mixed integer optimizer.

Comments

Each of the solutions sol.itr, sol.bas, and sol.int may contain one or more the fields:

.prosta

Problem status. See Section D.34.

.solsta

Solution status. See Section D.44.

.skc

Constraint status keys. See Section 6.1.

.skx

Variable status keys. See Section 6.1.

.skn

Conic status keys. See Section 6.1.

.xc

Constraint activities i.e. [[MathCmd 225]] where x is the optimal solution.

.xx

Variable activities i.e. the optimal x solution.

.y

Identical sol.slc-sol.suc.

.slc

Dual solution corresponding to the lower constraint bounds.

.suc

Dual solution corresponding to the upper constraint bounds.

.slx

Dual solution corresponding to the lower variable bounds.

.sux

Dual solution corresponding to the upper variable bounds.

.snx

Dual solution corresponding to the conic constraint.

The fields .skn and .snx cannot occur in the .bas .int solutions. In addition the fields .y, .slc, .suc, .slx, and .sux cannot occur in the int solution because integer problems does not have a well-defined dual and hence cannot have a dual solution.

7.1.5. prisen

Description:

Results of primal sensitivity analysis.

Subfields:
.cons

MATLAB structure with subfields:

.lr_bl

Left value [[MathCmd 226]] in the linearity interval for a lower bound.

.rr_bl

Right value [[MathCmd 227]] in the linearity interval for a lower bound.

.ls_bl

Left shadow price [[MathCmd 228]] for a lower bound.

.rs_bl

Right shadow price [[MathCmd 229]] for a lower bound.

.lr_bu

Left value [[MathCmd 226]] in the linearity interval for an upper bound.

.rr_bu

Right value [[MathCmd 227]] in the linearity interval for an upper bound.

.ls_bu

Left shadow price [[MathCmd 228]] for an upper bound.

.rs_bu

Right shadow price [[MathCmd 229]] for an upper bound.

.var

MATLAB structure with subfields:

.lr_bl

Left value [[MathCmd 226]] in the linearity interval for a lower bound on a varable.

.rr_bl

Right value [[MathCmd 227]] in the linearity interval for a lower bound on a varable.

.ls_bl

Left shadow price [[MathCmd 228]] for a lower bound on a varable.

.rs_bl

Right shadow price [[MathCmd 229]] for lower bound on a varable.

.lr_bu

Left value [[MathCmd 226]] in the linearity interval for an upper bound on a varable.

.rr_bu

Right value [[MathCmd 227]] in the linearity interval for an upper bound on a varable.

.ls_bu

Left shadow price [[MathCmd 228]] for an upper bound on a varables.

.rs_bu

Right shadow price [[MathCmd 229]] for an upper bound on a varables.

7.1.6. duasen

Description:

Results of dual sensitivity analysis.

Subfields:
.lr_c

Left value [[MathCmd 226]] of linearity interval for an objective coefficient.

.rr_c

Right value [[MathCmd 227]] of linearity interval for an objective coefficient.

.ls_c

Left shadow price [[MathCmd 228]] for an objective coefficients .

.rs_c

Right shadow price [[MathCmd 229]] for an objective coefficients.

7.1.7. info

info is a MATLAB structure containing a subfield for each item in the MOSEK optimization task database. For instance the field info.MSK_DINF_BI_CPUTIME specifies the amount of time spend in the basis identification in the last optimization. In Sections D.15 and D.11 are all the items in the task information database shown.

7.1.8. symbcon

symbcon is a MATLAB structure containing a subfield for each item MOSEK symbolic constant. For instance the field symbcon.MSK_DINF_BI_CPUTIME specifies the value of the symbolic constant MSK_DINF_BI_CPUTIME. In Section D are all the symbolic constants shown.

7.1.9. callback

callback is a MATLAB structure containing which contains the subfields (all are optional):

.loghandle

A MATLAB data structure or just [].

.log

Is the name of a user defined function which must accept two input arguments i.e. for instance

function myfunc(handle,str)

handle will be identical to callback.handle when myfunc is called and str is a line of the log file.

.iterhandle

A MATLAB data structure or just [].

.iter

Is the name of a user defined function which must accept three input arguments i.e. for instance

function myfunc(handle,where,info)

handle will be identical to callback.iterhandle when myfunc is called and str is a line of the log file. info is the current information database. See 7.1.7 for further details about info data structure.

7.2. An example of a command reference

All functions are documented using the format:

7.3. Functions provided by the MOSEK optimization toolbox

7.4. MATLAB optimization toolbox compatible functions

The functions presented in this section are provided as a part of both the MOSEK and MATLAB optimization toolboxes. The MOSEK versions are intended to be highly compatible with MATLAB versions and in practice the small differences should not cause any problems.

7.4.1. For linear and quadratic optimization

  • linprog

    Description

    Solves the linear optimization problem:

    \begin{displaymath}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{minimize} & f^{T}x &  & \\\nonumber{}\mbox{subject to} & Ax & \leq{} & b,\\\nonumber{} & Bx & = & c,\\\nonumber{} & l\leq{}x\leq{}u. &  &\end{array}\end{displaymath}
    Syntax:
    [x,fval,exitflag,output,lambda]
      = linprog(f,A,b,B,c,l,u,x0,options) 
    Arguments:
    f

    The objective function.

    A

    Constraint matrix for the less-than equal inequalities. Use A=[] if there are no inequalities.

    b

    Right-hand side for the less-than equal inequalities. Use b=[] if there are no inequalities.

    B

    (optional) Constraint matrix for the equalities. Use B=[] if there are no equalities.

    c

    (optional) Right-hand side for the equalities. Use c=[] if there are no inequalities.

    l

    (optional) Lower bounds for the variables. Please use - to represent infinite lower bounds.

    u

    (optional) Upper bounds for the variables. Please use to represent infinite lower bounds.

    x0

    (optional) An initial guess for the starting point. This information is ignored by MOSEK.

    options

    (optional) An optimization options structure. See the function optionset for the definition of the optimizations options structure. linprog uses the options.

    .Diagnostics
    .Display
    .MaxIter
    Returns:
    x

    The optimal x solution.

    fval

    Optimal objective value i.e. [[MathCmd 247]].

    exitflag

    Is a number which has the interpretation:

    <0

    The problem is likely to be either primal or dual infeasible.

    =0

    The maximum number of iterations was reached.

    >0

    x is an optimal solution.

    output
    .iterations

    Number of iterations spend to reach the optimum.

    .algorithm

    Always defined to be 'large-scale: interior-point'.

    lambda
    .lower

    Lagrange multipliers for lower bounds l.

    .upper

    Lagrange multipliers for upper bounds u.

    .ineqlin

    Lagrange multipliers for the inequalities.

    .eqlin

    Lagrange multipliers for the equalities.

    Examples:
    % Optimizes problem only
    % having linear inequalities.
    x = linprog(f,A,b); 
  • quadprog

    Description

    Solves the quadratic optimization problem:

    \begin{math}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{minimize} & \frac{1}{2}x^{T}Hx+f^{T}x &  & \\\nonumber{}\mbox{subject to} & Ax & \leq{} & b,\\\nonumber{} & Bx & = & c,\\\nonumber{} & l\leq{}x\leq{}u. &  &\end{array}\end{math} (7.4.1)
    Syntax:
    [x,fval,exitflag,output,lambda]
      = quadprog(H,f,A,b,B,c,l,u,x0,options) 
    Arguments:
    H

    Hessian of the objective function. H must be a symmetric matrix. Contrary to MATLAB optimization toolbox, then MOSEK only handles the case where H is positive semidefinite. On the hand MOSEK always computes a global optimum i.e. the objective function does have to be strictly convex.

    f

    See (7.4.1) for the definition.

    A

    Constraint matrix for the less-than equal inequalities. Use A=[] if there are no inequalities.

    b

    Right-hand side for the less-than equal inequalities. Use b=[] if there are no inequalities.

    B

    (optional) Constraint matrix for the equalities. Use B=[] if there are no inequalities.

    c

    (optional) Right-hand side for the equalities. Use c=[] if there are no inequalities.

    l

    (optional) Lower bounds for the variables. Please use - to represent infinite lower bounds.

    u

    (optional) Upper bounds for the variables. Please use to represent infinite lower bounds.

    x0

    (optional) An initial guess for the starting point. This information is ignored by MOSEK.

    options

    (optional) An optimization options structure. See the function optimset for the definition of the optimizations options structure. quadprog uses the options.

    .Diagnostics
    .Display
    .MaxIter
    Returns:
    x

    x solution.

    fval

    Optimal objective value i.e. [[MathCmd 249]].

    exitflag

    Is a scalar which has the interpretation:

    <0

    The problem is likely to be either primal or dual infeasible.

    =0

    The maximum number of iterations was reached.

    >0

    x is optimal solution.

    output
    .iterations

    Number of iterations spend to reach the optimum.

    .algorithm

    Always defined to be 'large-scale: interior-point'.

    lambda
    .lower

    Lagrange multipliers for lower bounds l.

    .upper

    Lagrange multipliers for upper bounds u.

    .ineqlin

    Lagrange multipliers for inequalities.

    .eqlin

    Lagrange multipliers for equalities.

    Examples:
    % Optimizes problem only
    % having linear inequalities.
    x = quadprog(H,f,A,b); 

7.4.2. For linear least squares problems

  • lsqlin

    Description

    Solves the linear linear least squares problem:

    \begin{math}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{minimize} & \frac{1}{2}\left\|Cx-d\right\|_{2}^{2} &  & \\\nonumber{}\mbox{subject to} & Ax & \leq{} & b,\\\nonumber{} & Bx & = & c,\\\nonumber{} & l\leq{}x\leq{}u. &  &\end{array}\end{math} (7.4.2)
    Syntax:
    [x,resnorm,residual,exitflag,output,lambda]
      = lsqlin(C,d,A,b,B,c,l,u,x0,options,options) 
    Arguments:
    C

    A matrix. See problem (7.4.2) for the purpose of the argument.

    d

    A vector. See problem (7.4.2) for the purpose of the argument.

    A

    Constraint matrix for the less-than equal inequalities. Use A=[] if there are no inequalities.

    b

    Right-hand side for the less-than equal inequalities. Use b=[] if there are no inequalities.

    B

    (optional) Constraint matrix for the equalities. Use B=[] if there are no equalities.

    c

    (optional) Right-hand side for the equalities. Use c=[] if there are no equalities.

    l

    (optional) Lower bounds for the variables. Please use - to represent infinite lower bounds.

    u

    (optional) Upper bounds for the variables. Please use - to represent infinite lower bounds.

    x0

    (optional) An initial guess for the starting point. This information is ignored by MOSEK.

    x0

    (optional) An initial guess for the starting point. This information is ignored by MOSEK.

    options

    (optional) An optimization options structure. See the function optionset for the definition of the optimizations options structure. lsqprog uses the options.

    .Diagnostics
    .Display
    .MaxIter
    Returns:
    x

    The optimal x solution.

    resnorm

    The squared norm of the residuals i.e. [[MathCmd 251]] evaluated at the optimal solution.

    residual

    Is the residual Cx-d.

    exitflag

    Is a scalar which has the interpretation:

    <0

    The problem is likely to be either primal or dual infeasible.

    =0

    The maximum number of iterations was reached.

    >0

    x is optimal solution.

    output
    .iterations

    Number of iterations spend to reach the optimum.

    .algorithm

    Always defined to be 'large-scale: interior-point'.

    lambda
    .lower

    Lagrange multipliers for lower bounds l.

    .upper

    Lagrange multipliers for upper bounds u.

    .ineqlin

    Lagrange multipliers for inequalities.

    .eqlin

    Lagrange multipliers for equalities.

    Comments:

    Examples:
    % Solves a linear least
    % squares problem.
    x = lsqlin(C,d,A,b);
        
  • lsqnonneg

    Description

    Solves the linear least squares problem:

    \begin{math}\nonumber{}\begin{array}{lccl}\nonumber{}\mbox{minimize} & \frac{1}{2}\left\|Cx-d\right\|_{2}^{2} & \\\nonumber{}\mbox{subject to} & x\geq{}0. &\end{array}\end{math} (7.4.3)
    Syntax:
    [x,resnorm,residual,exitflag,output,lambda]
      = lsqnonneg(C,d,x0,options,options) 
    Arguments:
    C

    See problem (7.4.3).

    d

    See problem (7.4.3).

    x0

    (optional) An initial guess for the starting point. This information is ignored by MOSEK.

    options

    (optional) An optimizations options structure. See the function optionset for the definition of the optimizations options structure. lsqlin uses the options.

    .Diagnostics
    .Display
    .MaxIter
    Returns:
    x

    x solution.

    resnorm

    Squared of the optimal residuals i.e.

    \begin{displaymath}\nonumber{}\left\|Cx-d\right\|^{2}\end{displaymath}

    evaluated at the optimal solution.

    residual

    Is the residual Cx-d.

    exitflag

    Is a number which has the interpretation:

    <0

    The problem is likely to be either primal or dual infeasible.

    =0

    The maximum number of iterations was reached.

    >0

    x is optimal solution.

    output
    .iterations

    Number of iterations spend to reach the optimum.

    .algorithm

    Always defined to be 'large-scale: interior-point'.

    lambda
    .lower

    Lagrange multipliers for lower bounds l.

    .upper

    Lagrange multipliers for upper bounds u.

    .ineqlin

    Lagrange multipliers for inequalities.

    .eqlin

    Lagrange multipliers for equalities.

    Comments:

    This procedure just provides an easy interface to lsqlin. Indeed all the procedure does is to call lsqlin with the appropriate arguments.

    Examples:
    % Solves the problem
    x = lsqnonneg(C,d); 

7.4.3. The optimization options

The procedures in the optimization toolbox is in general dependent on some options which for example control the amount of information displayed and the stopping criteria.

In general due to the MOSEK and MATLAB optimization toolboxes employs different algorithms then the toolboxes uses different options. Therefore, the MOSEK optimization toolbox ignores most of the options recognized by the MATLAB toolbox. In the description of the procedure optimset it is shown which MATLAB options MOSEK recoginize.

7.4.3.1. Viewing and modifying the optimization options

  • optimget

    Description

    Obtains a value of an optimization parameter.

    Syntax:
    val = optimget(options,param,default) 
    Arguments:
    options

    The optimization options structure.

    param

    Name of the optimization parameter for which the value should be obtained.

    default

    (optional) If param is not defined, then the value default is returned.

    Returns:
    val

    Value of the required option. If the option does not exists, then [] is returned unless the value 'default' is defined in which case the default value is returned.

    Comments:

    See the procedure optimset for which parameters that can be set.

    Examples:
    % Obtain the value of the diagnostics
    % option
    val = optimget(options,'Diagnostics');
    
    % val is equal to the default value.
    val = optimget(options,'Nopar',1.0e-1); 
  • optimset

    Description

    Obtains and modifies the optimization options structure. Only a subset of the fields in the optimization structure recognized by the MATLAB optimization toolbox is recognized by MOSEK.

    However, the optimization option structure can be used to modify all the MOSEK parameters. For a discussion of the MOSEK parameters see Section 6.17.

    .Diagnostics

    Used to control how much diagnostic information which is print. It can take the following values:

    off

    No diagnostic information is printed.

    on

    Diagnostic information is printed.

    .Display

    Is a string which can take the following values.

    off

    No output is displayed.

    iter

    Some output is displayed for each iteration.

    final

    Only the final output is displayed.

    .MaxIter

    Maximum number of iterations allowed.

    Syntax:
    options = optionset(arg1,arg2,
                        param1,value1,
                        param2,value2,...) 
    Arguments:
    arg1

    (optional) Is allowed to be any of the following two things:

    Any string

    Is the same as using no argument.

    A structure

    The argument is assumed to be a structure containing options. These options are copied to the return options.

    param1

    (optional) Is a string containing the name of a parameter that should be modified.

    value1

    (optional) New value assigned to the parameter with the name param1.

    param2

    (optional) Has the same interpretation as param1.

    value2

    (optional) Has the same interpretation as value1.

    Returns:
    options

    The updated optimization options structure.

    Examples:
    % Obtain the default options.
    opt = optimset
    
    % Modifies the value of parameter
    % display in the optimization
    % options structure
    opt = optionset(opt,'display,'off');
    
    % Returns default options
    opt = optimset('whatever')
    
    % Modify a MOSEK parameter.
    opt = [];
    opt = optionset(opt,'MSK_DPAR_INTPNT_TOLMURED',1.0e-14);  
Mon Sep 14 15:56:07 2009