8. Command reference


After studying the examples presented in the previous chapter, it should be possible to use most of the facilities in the MOSEK optimization toolbox. A more formal specification of the main data structures employed by MOSEK and a command reference are provided in this chapter.

8.1. Data structures

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

8.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. It defines an optimization problem using a number of subfields.

Subfields:
.names

A MATLAB structure which contains the problem name, the name of the objective, and so forth. See Section 8.1.2.

.qosubi

i subscript for element [[MathCmd 160]] in [[MathCmd 161]]. See (8.1.6).

.qosubj

j subscript for element [[MathCmd 160]] in [[MathCmd 161]]. See (8.1.6).

.qoval

Numerical value for element [[MathCmd 160]] in [[MathCmd 161]]. See (8.1.6).

.qcsubk

k subscript for element [[MathCmd 166]] in [[MathCmd 167]]. See (8.1.7).

.qcsubi

i subscript for element [[MathCmd 166]] in [[MathCmd 167]]. See (8.1.7).

.qcsubj

j subscript for element [[MathCmd 166]] in [[MathCmd 167]]. See (8.1.7).

.qcval

Numerical value for element [[MathCmd 166]] in [[MathCmd 167]]. See (8.1.7).

.c

Linear term in the objective.

.a

The constraint matrix. It must be a sparse matrix having the number of rows and columns equivalent to the number of constraints and variables in the problem. This field should always be defined, even if 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 of 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 of 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 array containing the indexes of the integer-constrained variables. Hence, ints.sub is identical to the set [[MathCmd 174]] in (8.1.5). ints.pri is also a one dimensional array of the same length as ints.sub. The ints.pri(k) is the branching priority assigned to variable index ints.sub(k).

.cones

A MATLAB cell array defining the conic constraints (8.1.4). See Section 8.1.3 for details on this structure.

.sol

A MATLAB structure containing a guess on the optimal solution which some of the optimizers in MOSEK may exploit. See Section 8.1.4 for details on 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} (8.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} (8.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} (8.1.3)

and the conic constraint

\begin{math}\nonumber{}x\in{}\mathcal{C}.\end{math} (8.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} (8.1.5)

where 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 180]] in the objective are stored in the matrix [[MathCmd 161]] 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 161]] is symmetric, i.e.

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

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

  • It is the linear part of the objective specifying the [[MathCmd 186]] in the linear term [[MathCmd 187]].
  • The quadratic terms [[MathCmd 188]] in the kth constraint are stored in the [[MathCmd 167]] matrix 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 167]] is symmetric, i.e.

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

    and therefore only the lower triangular part in [[MathCmd 167]] 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 non-zeros elements in A are stored and worked with. This usually saves a lot of storage and speeds up the computations.

  • Specifies the lower bounds of the constraints.
  • Specifies the upper bounds of 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{}\mathbb{R}^{{n^{t}}},~t=1,\ldots ,k\end{displaymath}

    be vectors comprised of disjoined subsets of the decision variables x (each decision variable is a member of exactly one [[MathCmd 25]]), e.g.

    \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{}\mathbb{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{}\mathbb{R}^{{n^{t}}}\rbrace{}.\end{displaymath}
    • Quadratic cone:

      \begin{displaymath}\nonumber{}\mathcal{C}_{t}=\left\lbrace{}x\in{}\mathbb{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{}\mathbb{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 8.1.

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

In Table 8.1 all the parameters are listed with their corresponding type. The int type indicates that the field must contain an integer value, double indicates a real number. The relationship between [[MathCmd 161]] and [[MathCmd 167]] 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} (8.1.6)

    Since [[MathCmd 161]] by assumption is symmetric, all elements are assumed to belong to the lower triangular part. If an element is specified multiple times, 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} (8.1.7)

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

8.1.2. names

This structure is used to store all the names of 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.

8.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 has one of the values 'MSK_CT_QUAD' or 'MSK_CT_RQUAD', indicating if cone is a quadratic cone or a rotated quadratic cone.

.sub

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

8.1.4. sol

Description:

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

Subfields:
.itr

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

.bas

Basic solution computed by the simplex optimizers and basis identification procedure.

.int

Integer solution computed by the mixed-integer optimizer.

Comments:

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

.prosta

Problem status. See Appendix F.38.

.solsta

Solution status. See Appendix F.51.

.skc

Constraint status keys. See Table 7.1.

.skx

Variable status keys. See Table 7.1.

.skn

Conic status keys. See Section 7.1.

.xc

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

.xx

Variable activities, i.e. the optimal x solution.

.y

Identical to 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.

.pobjval

The primal objective value.

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

8.1.5. prisen

Description:

Results of the primal sensitivity analysis.

Subfields:
.cons

MATLAB structure with the subfields:

.lr_bl

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

.rr_bl

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

.ls_bl

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

.rs_bl

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

.lr_bu

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

.rr_bu

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

.ls_bu

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

.rs_bu

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

.var

MATLAB structure with the subfields:

.lr_bl

Left value [[MathCmd 228]] in the linearity interval for a lower bound on a variable.

.rr_bl

Right value [[MathCmd 229]] in the linearity interval for a lower bound on a variable.

.ls_bl

Left shadow price [[MathCmd 230]] for a lower bound on a variable.

.rs_bl

Right shadow price [[MathCmd 231]] for a lower bound on a variable.

.lr_bu

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

.rr_bu

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

.ls_bu

Left shadow price [[MathCmd 230]] for an upper bound on a variable.

.rs_bu

Right shadow price [[MathCmd 231]] for an upper bound on a variable.

8.1.6. duasen

Description:

Results of dual the sensitivity analysis.

Subfields:
.lr_c

Left value [[MathCmd 228]] in linearity interval for an objective coefficient.

.rr_c

Right value [[MathCmd 229]] in linearity interval for an objective coefficient.

.ls_c

Left shadow price [[MathCmd 230]] for an objective coefficient.

.rs_c

Right shadow price [[MathCmd 231]] for an objective coefficient.

8.1.7. info

info is a MATLAB structure containing a subfield for each item in the MOSEK optimization task database, e.g. the info.MSK_DINF_BI_CPUTIME field specifies the amount of time spent in the basis identification in the last optimization. In Sections F.13 and F.17 all the items in the task information database are listed.

8.1.8. symbcon

symbcon is a MATLAB structure containing a subfield for each MOSEK symbolic constant, e.g. the field symbcon.MSK_DINF_BI_CPUTIME specifies the value of the symbolic constant “MSK_DINF_BI_CPUTIME”. In Appendix F allthe symbolic constants are listed.

8.1.9. callback

callback A MATLAB structure containing the subfields (all of them are optional):

.loghandle

A MATLAB data structure or just [].

.log

The name of a user-defined function which must accept two input arguments, e.g.

function myfunc(handle,str)

where handle will be identical to callback.handle when myfunc is called, and str is a string of text from the log file.

.iterhandle

A MATLAB data structure or just [].

.iter

The name of a user-defined function which must accept three input arguments, e.g.

function myfunc(handle,where,info)

where handle will be identical to callback.iterhandle when myfunc is called, where indicates the current progress of the colver and info is the current information database. See 8.1.7 for further details about the info data structure.

8.2. An example of a command reference

All functions are documented using the format:

8.3. Functions provided by the MOSEK optimization toolbox

8.4. MATLAB optimization toolbox compatible functions

The functions presented in this section intents to provide compatibility with the corresponding MATLAB optimization toolbox functions. Although they are not perfectly compatible, the differences usually do not cause any problems.

8.4.1. 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 equalities.

    l

    (Optional) Lower bounds on the variables. Please use - to represent infinite lower bounds.

    u

    (Optional) Upper bounds on the variables. Please use to represent infinite upper bounds.

    x0

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

    options

    (Optional) An optimization options structure. See the optimset function for the definition of the optimization options structure. linprog uses the options

    .Diagnostics
    .Display
    .MaxIter
    Returns:
    x

    The optimal x solution.

    fval

    The optimal objective value, i.e. [[MathCmd 249]].

    exitflag

    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 spent to reach the optimum.

    .algorithm

    Always defined as '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:
    % Optimize a problem having only 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} (8.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 the MATLAB optimization toolbox, MOSEK handles only the cases where H is positive semi-definite. On the other hand MOSEK always computes a global optimum, i.e. the objective function has to be strictly convex.

    f

    See (8.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 equalities.

    c

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

    l

    (Optional) Lower bounds on the variables. Please use - to represent infinite lower bounds.

    u

    (Optional) Upper bounds on the variables. Please use to represent infinite upper bounds.

    x0

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

    options

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

    .Diagnostics
    .Display
    .MaxIter
    .Write
    Returns:
    x

    The x solution.

    fval

    The optimal objective value i.e. [[MathCmd 251]].

    exitflag

    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 an optimal solution.

    output
    .iterations

    Number of iterations spent to reach the optimum.

    .algorithm

    Always defined as '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);
    

8.4.2. For linear least squares problems

  • lsqlin

    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} & Ax & \leq{} & b,\\\nonumber{} & Bx & = & c,\\\nonumber{} & l\leq{}x\leq{}u. &  &\end{array}\end{math} (8.4.2)
    Syntax:
    [x,resnorm,residual,exitflag,output,lambda]
      = lsqlin(C,d,A,b,B,c,l,u,x0,options) 
    Arguments:
    C

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

    d

    A vector. See problem (8.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 on the variables. Please use - to represent infinite lower bounds.

    u

    (Optional) Upper bounds on 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 function for the definition of the optimization options structure. lsqprog uses the options

    .Diagnostics
    .Display
    .MaxIter
    Returns:
    x

    The optimal x solution.

    resnorm

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

    residual

    The residual Cx-d.

    exitflag

    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 the optimal solution.

    output
    .iterations

    Number of iterations spent to reach the optimum.

    .algorithm

    Always defined as '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:
    % Solve 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} (8.4.3)
    Syntax:
    [x,resnorm,residual,exitflag,output,lambda]
      = lsqnonneg(C,d,x0,options) 
    
    Arguments:
    C

    See problem (8.4.3).

    d

    See problem (8.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 optimset function for the definition of the optimization options structure. lsqlin uses the options

    .Diagnostics
    .Display
    .MaxIter
    Returns:
    x

    The x solution.

    resnorm

    The squared norm of the optimal residuals, i.e.

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

    evaluated at the optimal solution.

    residual

    The residual Cx-d.

    exitflag

    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:
    % Solve the problem
    x = lsqnonneg(C,d);
    

8.4.3. The optimization options

The procedures in the optimization toolbox accepts some options controlling e.g. the amount of information displayed or the stopping criterion.

In general, due to the fact that MOSEK and MATLAB optimization toolboxes employ different algorithms the toolboxes use different options. Therefore, the MOSEK optimization toolbox ignores most of the options recognized by the MATLAB toolbox. The description of the optimset function lists which MATLAB options MOSEK recoginizes.

8.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, the value of default is returned instead.

    Returns:
    val

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

    Comments:

    See the optimset function 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.

    In addition the optimization options structure can be used to modify all the MOSEK specific parameters defined in Appendix E.

    .Diagnostics

    Used to control how much diagnostic information is printed. Following values are accepted:

    off

    No diagnostic information is printed.

    on

    Diagnostic information is printed.

    .Display

    Defines what information is displayed. The following values are accepted:

    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.

    .Write

    A filename to write the problem to. If equal to the empty string no file is written. E.g the option

                Write(myfile.opf)
                

    writes the file myfile.opf in the opf format.

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

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

    Any string

    The same as using no argument.

    A structure

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

    param1

    (Optional) A string containing the name of a parameter that should be modified.

    value1

    (Optional) The 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
    
    % Modify the value of the parameter
    % display in the optimization
    % options structure
    opt = optimset(opt,'display','on');
    
    % Return default options
    opt = optimset('whatever')
    
    % Modify a MOSEK parameter.
    opt = [];
    opt = optimset(opt,'MSK_DPAR_INTPNT_TOLMURED',1.0e-14);
    
Wed Feb 29 16:16:54 2012