# NAG FL Interfacee04mzf (qpconvex1_​sparse_​mps)

Note: this routine is deprecated. Replaced by e04mxf.

#### Old Code

```mpslst = .False.    ! Or = .True.
Call e04mzf(infile,maxn,maxm,maxnnz,xbldef,xbudef,mpslst,n,m,nnz,iobj,   &
ncolh,a,irowa,iccola,bl,bu,start,pnames,nname,crname,xs,     &
istate,ifail)

if (ifail == 1 .Or. ifail == 2 .Or. ifail == 3) then
! not enough memory, allocate bigger arrays as given in m, n, nnz
! and call e04mzf again
else if (ifail >= 4 .And. ifail <= 16) then
! mps input file formating error
! stop
else if (ifail == 17) then
! wrong arguments to e04mzf
! stop
else if (ifail == 0) then
! data successfully read, call solver
end if```

#### New Code

```mpslst = 0      ! or = 1
Call e04mxf(infile,maxn,maxm,maxnnz,maxncolh,maxnnzh,maxlintvar,mpslst,  &
n,m,nnz,ncolh,nnzh,lintvar,iobj,a,irowa,iccola,bl,bu,pnames, &
nname,crname,h,irowh,iccolh,minmax,intvar,ifail)

if (ifail == 2) then
! not enough memory, allocate bigger arrays as given in m, n, nnz, ncolh,
! nnzh, lintvar and call e04mxf again
else if (ifail >= 3 .And. ifail <= 35) then
! MPS input file formatting error
! stop
else if (ifail == 36) then
! wrong input argument
! stop
else if (ifail=-999) then
! internal memory allocation error
! stop
else if (ifail == 0 .Or. ifail == 1) then
! data successfully read (with possible warning)
start = 'C'
do j=1,n
xs(j) = min(max(0.0_nag_wp,bl(j)),bu(j))
istate(j) = 0.0_nag_wp
end do
! call solver
end if```
e04mxf has extended the functionality of e04mzf and the interface has changed substantially. If there are Integer variables, a quadratic part of the objective function or OBJSENSE section (see Section 3.1 in e04mxf), e04mxf will read them and return them in the new arguments (lintvar, intvar, ncolh, nnzh, h, irowh, iccolh and minmax), with e04mzf these caused a file formatting error. The new routine e04mxf might also accept a slightly misformatted input file and return a warning ${\mathbf{ifail}}={\mathbf{1}}$.
The type of the argument mpslst has changed from logical to integer.
The parameters xbldef and xbudef of e04mzf were removed and fixed in e04mxf to their default values $0$ and ${10}^{20}$, respectively. Note that value ${10}^{20}$ within bounds is interpreted in our solvers as $+\infty$ (unconstrained).
Parameters start, xs and istate were present in e04mzf only for the convenience of calling the solver routine e04nkf/​e04nka and have been removed from e04mxf.
Should you need any assistance, please do not hesitate to contact the NAG Technical Support Service.

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

e04mzf reads data for a sparse linear programming or quadratic programming problem from an external file which is in standard or compatible MPSX input format.

## 2Specification

Fortran Interface
 Subroutine e04mzf ( maxn, maxm, n, m, nnz, iobj, a, ha, ka, bl, bu, xs,
 Integer, Intent (In) :: infile, maxn, maxm, maxnnz Integer, Intent (Inout) :: ifail Integer, Intent (Out) :: n, m, nnz, iobj, ncolh, ha(maxnnz), ka(maxn+1), nname, istate(maxn+maxm) Real (Kind=nag_wp), Intent (In) :: xbldef, xbudef Real (Kind=nag_wp), Intent (Out) :: a(maxnnz), bl(maxn+maxm), bu(maxn+maxm), xs(maxn+maxm) Logical, Intent (In) :: mpslst Character (1), Intent (Out) :: start Character (8), Intent (InOut) :: names(5) Character (8), Intent (Out) :: crname(maxn+maxm)
#include <nag.h>
 void e04mzf_ (const Integer *infile, const Integer *maxn, const Integer *maxm, const Integer *maxnnz, const double *xbldef, const double *xbudef, const logical *mpslst, Integer *n, Integer *m, Integer *nnz, Integer *iobj, Integer *ncolh, double a[], Integer ha[], Integer ka[], double bl[], double bu[], char *start, char names[], Integer *nname, char crname[], double xs[], Integer istate[], Integer *ifail, const Charlen length_start, const Charlen length_names, const Charlen length_crname)
The routine may be called by the names e04mzf or nagf_opt_qpconvex1_sparse_mps.

## 3Description

e04mzf reads Linear Programming (LP) or Quadratic Programming (QP) problem data from an external file which is prepared in standard or compatible MPSX (see IBM (1971)) input format and then initializes $n$ (the number of variables), $m$ (the number of general linear constraints), the $m×n$ matrix $A$, and the vectors $l$, $u$ and $c$ (stored in row iobj of $A$) for use with e04nkf, which is designed to solve problems of the form
 $minimize x∈Rn cTx+12xTHx subject to l≤{ x Ax } ≤u.$
For LP problems, $H=0$. For QP problems, you must set ${\mathbf{ncolh}}>0$ (see Section 5) and provide a subroutine to e04nkf to compute $Hx$ for any given vector $x$. The optional parameter Maximize may be used to specify an alternative problem in which the objective function is maximized (see Section 12.1 in e04nkf/​e04nka).
MPSX input format
The input file of data may only contain two types of lines:
1. 1.Indicator lines (specifying the type of data which is to follow).
2. 2.Data lines (specifying the actual data).
The input file must not contain any blank lines. Any characters beyond column 80 are ignored. Indicator lines must not contain leading blank characters (in other words they must begin in column 1). The following displays the order in which the indicator lines must appear in the file:
 NAME user-supplied name ROWS data line(s) COLUMNS data line(s) RHS data line(s) RANGES (optional) data line(s) BOUNDS (optional) data line(s) ENDATA
The ‘user-supplied name’ specifies a name for the problem and must occupy columns $15–22$. The name can either be blank or up to a maximum of $8$ characters.
A data line follows the same fixed format made up of fields defined below. The contents of the fields may have different significance depending upon the section of data in which they appear.
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6
Columns $2–3$ $5–12$ $15–22$ $25–36$ $40–47$ $50–61$
Contents Code Name Name Value Name Value
The names and codes consist of ‘alphanumeric’ characters (i.e., a–z, A–Z, $0$$9$, $+$, $-$, $*$, blank ( ), :, \$ or full stop (.) only) and the names must not contain leading blank characters. Values are read using Fortran format $\text{E12.0}$. This allows values to be entered in several equivalent forms. For example, $1.2345678$, $\text{1.2345678E+0}$, $\text{123.45678E−2}$ and $\text{12345678E−07}$ all represent the same number. It is safest to include an explicit decimal point.
Note that in order to ensure numeric values are interpreted as intended, they should be right-justified in the $12$-character field, with no trailing blanks. This is because in some situations trailing blanks may be interpreted as zeros and this can dramatically affect the interpretation of the value. This is relevant if the value contains an exponent, or if it contains neither an exponent nor an explicit decimal point. For example, the fields
```%%%%1.23E-2%
%%%%%%%123%%```
may be interpreted as $\text{1.23E−20}$ and $12300$ respectively (where % denotes a blank). The actual behaviour is system-dependent.
Comment lines are allowed in the data file. These must have an asterisk (*) in column 1 and any characters in columns 2–80. In any data line, a dollar sign (\$) as the first character in Field 3 or 5 indicates that the information from that point through column 80 consists of comments.
Columns outside the six fields must be blank, except for columns 72–80, whose contents are ignored by the routine. These columns may be used to enter a sequence number. A non-blank character outside the predefined six fields and columns 72–80 is considered to be a major error (${\mathbf{ifail}}={\mathbf{13}}$; see Section 6), unless it is part of a comment.
ROWS Data Lines
These lines specify row (constraint) names and their inequality types (i.e., $=$, $\ge$ or $\le$).
Field 1: defines the constraint type. It may be in column 2 or column 3.
 N free row, that is no constraint. It may be used to define the objective row. G greater than or equal to (i.e., $\ge$). L less than or equal to (i.e., $\le$). E exactly equal to (i.e., $=$).
Field 2: defines the row name.
Row type N stands for ‘Not binding’, also known as ‘Free’. It can be used to define the objective row. The objective row is a free row that specifies the vector $c$ in the linear objective term ${c}^{\mathrm{T}}x$. It is taken to be the first free row, unless some other free row name is specified by the names array (see Section 5). Note that $c$ is assumed to be zero if (for example) the line
`%N%%DUMMYROW`
(where % denotes a blank) appears in the ROWS section of the MPSX data file, and the row name DUMMYROW is omitted from the COLUMNS section.
COLUMNS Data Lines
These lines specify the names to be assigned to the variables (columns) in the general linear constraint matrix $A$, and define, in terms of column vectors, the actual values of the corresponding matrix elements.
 Field 1: blank (ignored). Field 2: gives the name of the column associated with the elements specified in the following fields. Field 3: contains the name of a row. Field 4: used in conjunction with Field 3 contains the value of the matrix element. Field 5: is optional (may be used like Field 3). Field 6: is optional (may be used like Field 4).
Note that only the nonzero elements of $A$ and $c$ need to be specified in the COLUMNS section, as any zero elements of $A$ are removed and any unspecified elements of $c$ are assumed to be zero. In addition, any nonzero elements in the $\mathit{j}$th column of $A$ must be grouped together before those in the $\left(\mathit{j}+1\right)$th column, for $\mathit{j}=1,2,\dots ,n-1$. Nonzero elements within a column may however appear in any order.
RHS Data Lines
This section specifies the right-hand side values of the general linear constraint matrix $A$ (if any). The lines specify the name to be given to the right-hand side (RHS) vector along with the numerical values of the elements of the vector, which may appear in any order. The data lines have exactly the same format as the COLUMNS data lines, except that the column name is replaced by the RHS name. Only the nonzero elements need be specified. Note that this section may be empty, in which case the RHS vector is assumed to be zero.
RANGES Data Lines (optional)
Ranges are used for constraints of the form $l\le Ax\le u$, where both $l$ and $u$ are finite. The range of the constraint is $r=u-l$. Either $l$ or $u$ must be specified in the RHS section and $r$ must be defined in this section. The data lines have exactly the same format as the COLUMNS data lines, except that the column name is replaced by the RANGES name.
BOUNDS Data Lines (optional)
These lines specify limits on the values of the variables ($l$ and $u$ in $l\le x\le u$). If the variable is not specified in the bound set then it is automatically assumed to lie between default lower and upper bounds (usually $0$ and $+\infty$). Like an RHS column which is given a name, the set of variables in one bound set is also given a name.
Field 1: specifies the type of bound or defines the variable type.
 LO lower bound UP upper bound FX fixed variable FR free variable ($-\infty$ to $+\infty$) MI lower bound is $-\infty$ PL upper bound is $+\infty$. This is the default variable type.
Field 2: identifies a name for the bound set.
Field 3: identifies the column name of the variable belonging to this set.
Field 4: identifies the value of the bound; this has a numerical value only in association with LO, UP, FX in Field 1, otherwise it is blank.
Field 5: is blank and ignored.
Field 6: is blank and ignored.
Note that if RANGES and BOUNDS sections are both present, the RANGES section must appear first.

## 4References

IBM (1971) MPSX – Mathematical programming system Program Number 5734 XM4 IBM Trade Corporation, New York

## 5Arguments

1: $\mathbf{infile}$Integer Input
On entry: the unit number associated with the MPSX data file.
Constraint: $0\le {\mathbf{infile}}\le 2147483647$.
2: $\mathbf{maxn}$Integer Input
On entry: an upper limit for the number of variables in the problem.
Constraint: ${\mathbf{maxn}}\ge 1$.
3: $\mathbf{maxm}$Integer Input
On entry: an upper limit for the number of constraints (including the objective row) in the problem.
Constraint: ${\mathbf{maxm}}\ge 1$.
4: $\mathbf{maxnnz}$Integer Input
On entry: an upper limit for the number of nonzeros (including the objective row) in the problem.
Constraint: ${\mathbf{maxnnz}}\ge 1$.
5: $\mathbf{xbldef}$Real (Kind=nag_wp) Input
On entry: the default lower bound to be used for the variables in the problem when none is specified in the BOUNDS section of the MPSX data file. For a standard LP or QP problem xbldef would normally be set to zero.
6: $\mathbf{xbudef}$Real (Kind=nag_wp) Input
On entry: the default upper bound to be used for the variables in the problem when none is specified in the BOUNDS section of the MPSX data file. For a standard LP or QP problem xbudef would normally be set to ‘infinity’ (i.e., ${\mathbf{xbudef}}\ge {10}^{20}$).
Constraint: ${\mathbf{xbudef}}\ge {\mathbf{xbldef}}$.
7: $\mathbf{mpslst}$Logical Input
On entry: if ${\mathbf{mpslst}}=\mathrm{.TRUE.}$, a listing of the input data is sent to the current advisory message unit (as defined by x04abf). This can be useful for debugging the MPSX data file. If ${\mathbf{mpslst}}=\mathrm{.FALSE.}$, no listing is produced.
8: $\mathbf{n}$Integer Output
On exit: $n$, the actual number of variables in the problem.
9: $\mathbf{m}$Integer Output
On exit: $m$, the actual number of general linear constraints in the problem (including the objective row).
10: $\mathbf{nnz}$Integer Output
On exit: the actual number of nonzeros in the problem (including the objective row).
11: $\mathbf{iobj}$Integer Output
On exit: if ${\mathbf{iobj}}>0$, row iobj of $A$ is a free row containing the nonzero coefficients of the vector $c$.
If ${\mathbf{iobj}}=0$, the coefficients of $c$ are assumed to be zero.
If ${\mathbf{iobj}}=-1$, no such row was found and the routine terminates with ${\mathbf{ifail}}={\mathbf{4}}$ or ${\mathbf{5}}$ (see Section 6).
12: $\mathbf{ncolh}$Integer Output
On exit: ${\mathbf{ncolh}}=0$. For QP problems, ncolh is the number of leading nonzero columns of the Hessian matrix $H$ and must, therefore, be set $\text{}>0$ before calling e04nkf.
13: $\mathbf{a}\left({\mathbf{maxnnz}}\right)$Real (Kind=nag_wp) array Output
On exit: the nonzero elements of $A$, ordered by increasing column index.
14: $\mathbf{ha}\left({\mathbf{maxnnz}}\right)$Integer array Output
On exit: the row indices of the nonzero elements stored in a.
15: $\mathbf{ka}\left({\mathbf{maxn}}+1\right)$Integer array Output
On exit: a set of pointers to the beginning of each column of $A$. More precisely, ${\mathbf{ka}}\left(\mathit{i}\right)$ contains the index in a of the start of the $\mathit{i}$th column, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$. Note that ${\mathbf{ka}}\left(1\right)=1$ and ${\mathbf{ka}}\left({\mathbf{n}}+1\right)={\mathbf{nnz}}+1$.
16: $\mathbf{bl}\left({\mathbf{maxn}}+{\mathbf{maxm}}\right)$Real (Kind=nag_wp) array Output
17: $\mathbf{bu}\left({\mathbf{maxn}}+{\mathbf{maxm}}\right)$Real (Kind=nag_wp) array Output
On exit: bl contains the vector $l$ (the lower bounds) and bu contains the vector $u$ (the upper bounds), for all the variables and constraints in the following order. The first n elements of each array contain the bounds on the variables $x$ and the next m elements contain the bounds for the linear objective term ${c}^{\mathrm{T}}x$ and the general linear constraints $Ax$ (if any). Note that an ‘infinite’ lower bound is indicated by ${\mathbf{bl}}\left(j\right)=-\text{1.0E+20}$, an ‘infinite’ upper bound by ${\mathbf{bu}}\left(j\right)=-\text{1.0E+20}$ and an equality constraint by ${\mathbf{bl}}\left(j\right)={\mathbf{bu}}\left(j\right)$. (The lower bound for ${c}^{\mathrm{T}}x$, stored in ${\mathbf{bl}}\left({\mathbf{n}}+{\mathbf{iobj}}\right)$, is set to $-{\mathbf{xbudef}}$. The corresponding upper bound, stored in ${\mathbf{bu}}\left({\mathbf{n}}+{\mathbf{iobj}}\right)$, is set to xbudef.)
Note that e04mzf uses an ‘infinite’ bound size of ${10}^{20}$ in the definition of $l$ and $u$. In other words, any element of $u$ greater than or equal to ${10}^{20}$ will be regarded as $+\infty$ (and similarly any element of $l$ less than or equal to $-{10}^{20}$ will be regarded as $-\infty$). If this value is deemed to be ‘inappropriate’, you are recommended to reset the value of the optional parameter Infinite Bound Size and make any necessary changes to bl and/or bu before calling e04nkf.
18: $\mathbf{start}$Character(1) Output
On exit: ${\mathbf{start}}=\text{'C'}$ and an internal Crash procedure will be used by e04nkf to choose an initial basis.
19: $\mathbf{names}\left(5\right)$Character(8) array Input/Output
On entry: a set of names associated with the MPSX form of the problem.
${\mathbf{names}}\left(1\right)$
Must contain either the name of the problem or be blank.
${\mathbf{names}}\left(2\right)$
Must contain either the name of the objective row or be blank (in which case the first objective free row is used).
${\mathbf{names}}\left(3\right)$
Must contain either the name of the RHS set to be used or be blank (in which case the first RHS set is used).
${\mathbf{names}}\left(4\right)$
Must contain either the name of the RANGE set to be used or be blank (in which case the first RANGE set (if any) is used).
${\mathbf{names}}\left(5\right)$
Must contain either the name of the BOUNDS set to be used or be blank (in which case the first BOUNDS set (if any) is used).
On exit: a set of names associated with the problem as defined in the MPSX data file as follows:
${\mathbf{names}}\left(1\right)$
Contains the name of the problem (or blank if none).
${\mathbf{names}}\left(2\right)$
Contains the name of the objective row (or blank if none).
${\mathbf{names}}\left(3\right)$
Contains the name of the RHS set (or blank if none).
${\mathbf{names}}\left(4\right)$
Contains the name of the RANGE set (or blank if none).
${\mathbf{names}}\left(5\right)$
Contains the name of the BOUNDS set (or blank if none).
20: $\mathbf{nname}$Integer Output
On exit: $n+m$, the total number of variables and constraints in the problem.
21: $\mathbf{crname}\left({\mathbf{maxn}}+{\mathbf{maxm}}\right)$Character(8) array Output
On exit: the MPSX names of all the variables and constraints in the problem in the following order. The first n elements contain the MPSX names for the variables and the next m elements contain the MPSX names for the objective row and general linear constraints (if any). Note that the MPSX name for the objective row is stored in ${\mathbf{crname}}\left({\mathbf{n}}+{\mathbf{iobj}}\right)$.
22: $\mathbf{xs}\left({\mathbf{maxn}}+{\mathbf{maxm}}\right)$Real (Kind=nag_wp) array Output
On exit: a set of initial values for the variables and constraints in the problem. More precisely,
${\mathbf{xs}}\left(\mathit{j}\right)=\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left(\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(0.0,{\mathbf{bl}}\left(\mathit{j}\right)\right),{\mathbf{bu}}\left(\mathit{j}\right)\right)$, for $\mathit{j}=1,2,\dots ,{\mathbf{nname}}$.
23: $\mathbf{istate}\left({\mathbf{maxn}}+{\mathbf{maxm}}\right)$Integer array Output
On exit: a set of initial states for the variables and constraints in the problem. More precisely, ${\mathbf{istate}}\left(\mathit{j}\right)=1$ if ${\mathbf{xs}}\left(\mathit{j}\right)={\mathbf{bu}}\left(\mathit{j}\right)$ and $0$ otherwise, for $\mathit{j}=1,2,\dots ,{\mathbf{nname}}$.
24: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $0$ is recommended. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-1$, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
Note: the error exits ${\mathbf{ifail}}={\mathbf{4}}$ to ${\mathbf{ifail}}={\mathbf{16}}$ are caused by having either a corrupt or a nonstandard MPSX data file. Refer to Section 3 for a detailed description of the MPSX format which can be read by e04mzf. If ${\mathbf{mpslst}}=\mathrm{.TRUE.}$, the last line of printed output refers to the line in the MPSX data file which contains the reported error.
${\mathbf{ifail}}=1$
Too many rows. Limit is $⟨\mathit{\text{value}}⟩$, but the actual number required is $⟨\mathit{\text{value}}⟩$.
Increase maxm by at least $\left({\mathbf{m}}-{\mathbf{maxm}}\right)$ and rerun e04mzf.
${\mathbf{ifail}}=2$
Too many columns. Limit is $⟨\mathit{\text{value}}⟩$, but the actual number required is $⟨\mathit{\text{value}}⟩$.
Increase maxn by at least $\left({\mathbf{n}}-{\mathbf{maxn}}\right)$ and rerun e04mzf.
${\mathbf{ifail}}=3$
Too many nonzeros. Limit is $⟨\mathit{\text{value}}⟩$, but the actual number required is $⟨\mathit{\text{value}}⟩$.
Increase maxnnz by at least $\left({\mathbf{nnz}}-{\mathbf{maxnnz}}\right)$ and rerun e04mzf.
${\mathbf{ifail}}=4$
No objective row found.
There must be at least one row in the ROWS section with row type N for the objective row.
${\mathbf{ifail}}=5$
Objective row name $⟨\mathit{\text{value}}⟩$ is not defined in the ROWS section.
${\mathbf{ifail}}=6$
No rows specified.
${\mathbf{ifail}}=7$
Illegal constraint type $⟨\mathit{\text{value}}⟩$.
An illegal constraint type was detected in the ROWS section. The constraint type must be either N, L, G or E.
${\mathbf{ifail}}=8$
Row name with leading blank or non-alphanumeric character: $⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=9$
Column name with leading blank or non-alphanumeric character: $⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=10$
Illegal bound type $⟨\mathit{\text{value}}⟩$.
An illegal bound type was detected in the BOUNDS section. The bound type must be either LO, UP, FX, FR, MI or PL.
${\mathbf{ifail}}=11$
Column name $⟨\mathit{\text{value}}⟩$ is not defined in the COLUMNS section.
An unknown column name was detected in the BOUNDS section. All the column names must be specified in the COLUMNS section.
${\mathbf{ifail}}=12$
The last line must be the ENDATA indicator line.
${\mathbf{ifail}}=13$
Line $⟨\mathit{\text{value}}⟩$ is not a comment nor a valid line.
${\mathbf{ifail}}=14$
Row name $⟨\mathit{\text{value}}⟩$ is not defined in the ROWS section.
An unknown row name was detected in COLUMNS, RHS or RANGES section. All the row names must be specified in the ROWS section.
${\mathbf{ifail}}=15$
No columns specified.
${\mathbf{ifail}}=16$
BOUNDS name $⟨\mathit{\text{value}}⟩$ was not found.
RANGES name $⟨\mathit{\text{value}}⟩$ was not found.
RHS name $⟨\mathit{\text{value}}⟩$ was not found.
${\mathbf{ifail}}=17$
On entry, ${\mathbf{infile}}=⟨\mathit{\text{value}}⟩$.
Constraint: $0\le {\mathbf{infile}}\le 2147483647$.
On entry, ${\mathbf{maxm}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{maxm}}\ge 1$.
On entry, ${\mathbf{maxn}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{maxn}}\ge 1$.
On entry, ${\mathbf{maxnnz}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{maxnnz}}\ge 1$.
On entry, ${\mathbf{xbldef}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{xbudef}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{xbldef}}\le {\mathbf{xbudef}}$.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

Not applicable.

## 8Parallelism and Performance

e04mzf is not threaded in any implementation.

None.

## 10Example

This example solves the quadratic programming problem
 $minimize cT x + 12 xT H x subject to l ≤Ax ≤u, −2 ≤Ax ≤2,$
where
 $c= ( -4.0 -1.0 -1.0 -1.0 -1.0 -1.0 -1.0 -0.1 -0.3 ) , H= ( 2 1 1 1 1 0 0 0 0 1 2 1 1 1 0 0 0 0 1 1 2 1 1 0 0 0 0 1 1 1 2 1 0 0 0 0 1 1 1 1 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ) , ncolh=5,$
 $A= ( 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 4.0 1.0 2.0 3.0 4.0 -2.0 1.0 1.0 1.0 1.0 1.0 -1.0 1.0 -1.0 1.0 1.0 1.0 1.0 1.0 ) ,$
 $l= ( -2.0 -2.0 -2.0 ) and u= ( 1.5 1.5 4.0 ) .$
The optimal solution (to five figures) is
 $x*=(2.0,-0.23333,-0.26667,-0.3,-0.1,2.0,2.0,-1.7777,-0.45555)T.$
Three bound constraints and two general linear constraints are active at the solution. Note that, although the Hessian matrix is positive semidefinite, the point ${x}^{*}$ is unique.
The MPSX representation of the problem is given in Section 10.2.

### 10.1Program Text

Program Text (e04mzfe.f90)

### 10.2Program Data

Note: the MPSX data which is read by e04mzf begins with the second record of this data file; the first record is a caption which is read by the example program.
Program Options (e04mzfe.opt)

### 10.3Program Results

Program Results (e04mzfe.r)