NAG FL Interface
e04mxf (miqp_​mps_​read)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

e04mxf reads data for sparse linear programming, mixed integer linear programming, quadratic programming or mixed integer quadratic programming problems from an external file which is in standard or compatible MPS input format.

2 Specification

Fortran Interface
Integer, Intent (In) :: infile, maxn, maxm, maxnnz, maxncolh, maxnnzh, maxlintvar, mpslst
Integer, Intent (Inout) :: ifail
Integer, Intent (Out) :: n, m, nnz, ncolh, nnzh, lintvar, iobj, irowa(maxnnz), iccola(maxn+1), nname, irowh(maxnnzh), iccolh(maxncolh+1), minmax, intvar(maxlintvar)
Real (Kind=nag_wp), Intent (Out) :: a(maxnnz), bl(maxn+maxm), bu(maxn+maxm), h(maxnnzh)
Character (8), Intent (InOut) :: pnames(5)
Character (8), Intent (Out) :: crname(maxn+maxm)
C Header Interface
#include <nag.h>
void  e04mxf_ (const Integer *infile, const Integer *maxn, const Integer *maxm, const Integer *maxnnz, const Integer *maxncolh, const Integer *maxnnzh, const Integer *maxlintvar, const Integer *mpslst, Integer *n, Integer *m, Integer *nnz, Integer *ncolh, Integer *nnzh, Integer *lintvar, Integer *iobj, double a[], Integer irowa[], Integer iccola[], double bl[], double bu[], char pnames[], Integer *nname, char crname[], double h[], Integer irowh[], Integer iccolh[], Integer *minmax, Integer intvar[], Integer *ifail, const Charlen length_pnames, const Charlen length_crname)
The routine may be called by the names e04mxf or nagf_opt_miqp_mps_read.

3 Description

e04mxf reads data for Linear Programming (LP) or Quadratic Programming (QP) problems (or their mixed integer variants) from an external file which is prepared in standard or compatible MPS (see IBM (1971)) input format. It then initializes n (the number of variables), m (the number of general linear constraints), the m×n matrix A, the vectors l, u, c (stored in row iobj of A) and the n×n Hessian matrix H for use with e04nkf/​e04nka and e04nqf. These routines are designed to solve problems of the form
minimize x cTx+12xTHx   subject to  l{ x Ax } u.  

3.1 MPS 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).
A section is a combination of an indicator line and its corresponding data line(s). 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 (optional)
OBJSENSE (optional)
data line
OBJNAME (optional)
data line
ROWS
data line(s)
COLUMNS
data line(s)
RHS
data line(s)
RANGES (optional)
data line(s)
BOUNDS (optional)
data line(s)
QUADOBJ (optional)
data line(s)
ENDATA
A data line follows a fixed format, being made up of fields as 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 23 512 1522 2536 4047 5061
Contents Code Name Name Value Name Value
Each name and code must consist of ‘printable’ characters only; names and codes supplied must match the case used in the following descriptions. Values are read using a field width of 12. This allows values to be entered in several equivalent forms. For example, 1.2345678, 1.2345678E+0, 123.45678E−2 and 12345678E−07 all represent the same number. It is safest to include an explicit decimal point.
Lines with an asterisk (*) in column 1 will be considered comment lines and will be ignored by the routine.
Columns outside the six fields must be blank, except for columns 72–80, whose contents are ignored by the routine. A non-blank character outside the predefined six fields and columns 72–80 is considered to be a major error (ifail=16; see Section 6), unless it is part of a comment.

3.1.1 NAME Section (optional)

The NAME section is the only section where the data must be on the same line as the indicator. The ‘user-supplied name’ must be in field 3 but may be blank.
Field Required Description
3 No Name of the problem

3.1.2 OBJSENSE Section (optional)

The data line in this section can be used to specify the sense of the objective function. If this section is present it must contain only one data line. If the section is missing or empty, minimization is assumed.
Field Required Description
2 No Sense of the objective function
Field 2 may contain either MIN, MAX, MINIMIZE or MAXIMIZE.

3.1.3 OBJNAME Section (optional)

The data line in this section can be used to specify the name of a free row (see Section 3.1.4) that should be used as the objective function. If this section is present it must contain only one data line. If the section is missing or is empty, the first free row will be chosen instead. Alternatively, OBJNAME can be overridden by setting nonempty pnames(2) (see Section 5).
Field Required Description
2 No Row name to be used as the objective function
Field 2 must contain a valid row name.

3.1.4 ROWS Section

The data lines in this section specify unique row (constraint) names and their inequality types (i.e., unconstrained, =, or ).
Field Required Description
1 Yes Inequality key
2 Yes Row name
The inequality key specifies each row's type. It must be E, G, L or N and can be in either column 2 or 3.
Inequality
Key

Description

l

u
N Free row -
G Greater than or equal to finite
L Less than or equal to - finite
E Equal to finite l
Row type N stands for ‘Not binding’. 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 cTx. If there is more than one free row, the first free row is chosen, unless another free row name is specified by OBJNAME (see Section 3.1.3) or pnames(2) (see Section 5). Note that c is assumed to be zero if either the chosen row does not appear in the COLUMNS section (i.e., has no nonzero elements) or there are no free rows defined in the ROWS section.

3.1.5 COLUMNS Section

Data lines in this section 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 Required Description
2 Yes Column name
3 Yes Row name
4 Yes Value
5 No Row name
6 No Value
Each data line in the COLUMNS section defines the nonzero elements of A or c. Any elements of A or c that are undefined are assumed to be zero. Nonzero elements of A must be grouped by column, that is to say that all of the nonzero elements in the jth column of A must be specified before those in the j+1th column, for j=1,2,,n-1. Rows may appear in any order within the column.
3.1.5.1 Integer Markers
For backward compatibility e04mxf allows you to define the integer variables within the COLUMNS section using integer markers, although this is not recommended as markers can be treated differently by different MPS readers; you should instead define any integer variables in the BOUNDS section (see below). Each marker line must have the following format:
Field Required Description
2 No Marker ID
3 Yes Marker tag
5 Yes Marker type
The marker tag must be 'MARKER'. The marker type must be 'INTORG' to start reading integer variables and 'INTEND' to finish reading integer variables. This implies that a row cannot be named 'MARKER', 'INTORG' or 'INTEND'. Please note that both marker tag and marker type comprise of 8 characters as a ' is the mandatory first and last character in the string. You may wish to have several integer marker sections within the COLUMNS section, in which case each marker section must begin with an 'INTORG' marker and end with an 'INTEND' marker and there should not be another marker between them.
Field 2 is ignored by e04mxf. When an integer variable is declared it will keep its default bounds unless they are changed in the BOUNDS section. This may vary between different MPS readers.

3.1.6 RHS Section

This section specifies the right-hand side values (if any) of the general linear constraint matrix A.
Field Required Description
2 Yes RHS name
3 Yes Row name
4 Yes Value
5 No Row name
6 No Value
The MPS file may contain several RHS sets distinguished by RHS name. If an RHS name is defined in pnames(3) (see Section 5) then e04mxf will read in only that RHS vector, otherwise the first RHS set will be used.
Only the nonzero RHS elements need to be specified. Note that if an RHS is given to the objective function it will be ignored by e04mxf. An RHS given to the objective function is dealt with differently by different MPS readers, therefore, it is safer to not define an RHS of the objective function in your MPS file. Note that this section may be empty, in which case the RHS vector is assumed to be zero.

3.1.7 RANGES Section (optional)

Ranges are used to modify the interpretation of constraints defined in the ROWS section (see Section 3.1.4) to the form lAxu, where both l and u are finite. The range of the constraint is r=u-l.
Field Required Description
2 Yes Range name
3 Yes Row name
4 Yes Value
5 No Row name
6 No Value
The range of each constraint implies an upper and lower bound dependent on the inequality key of each constraint, on the RHS b of the constraint (as defined in the RHS section), and on the range r.
Inequality
Key

Sign of r

l

u
E + b b+r
E - b+r b
G +/- b b+|r|
L +/- b-|r| b
N +/- - +
If a range name is defined in pnames(4) (see Section 5) then the routine will read in only the range set of that name, otherwise the first set will be used.

3.1.8 BOUNDS Section (optional)

These lines specify limits on the values of the variables (the quantities l and u in lxu). If a variable is not specified in the bound set then it is automatically assumed to lie between 0 and +.
Field Required Description
1 Yes Bound type identifier
2 Yes Bound name
3 Yes Column name
4 Yes/No Value
Note: field 4 is required only if the bound type identifier is one of UP, LO, FX, UI or LI in which case it gives the value k below. If the bound type identifier is FR, MI, PL or BV, field 4 is ignored and it is recommended to leave it blank.
The table below describes the acceptable bound type identifiers and how each determines the variables' bounds.
Bound Type
Identifier

l

u
Integer
Variable?
UP unchanged k No
LO k unchanged No
FX k k No
FR - No
MI - unchanged No
PL unchanged No
BV 0 1 Yes
UI unchanged k Yes
LI k unchanged Yes
If a bound name is defined in pnames(5) (see Section 5) then the routine will read in only the bound set of that name, otherwise the first set will be used.

3.1.9 QUADOBJ Section (optional)

The QUADOBJ section defines nonzero elements of the upper or lower triangle of the Hessian matrix H.
Field Required Description
2 Yes Column name (HColumn Index)
3 Yes Column name (HRow Index)
4 Yes Value
5 No Column name (HRow Index)
6 No Value
Each data line in the QUADOBJ section defines one (or optionally two) nonzero elements Hij of the matrix H. Each element Hij is given as a triplet of row index i, column index j and a value. The column names (as defined in the COLUMNS section) are used to link the names of the variables and the indices i and j. More precisely, the matrix H on output will have a nonzero element
Hij = Value  
where index j belongs to HColumn Index and index i to one of the HRow Indices such that
It is only necessary to define either the upper or lower triangle of the H matrix; either will suffice. Any elements that have been defined in the upper triangle of the matrix will be moved to the lower triangle of the matrix, then any repeated nonzeros will be summed.
Note: it is much more efficient for e04nkf/​e04nka and e04nqf to have the H matrix defined by the first ncolh column names. If the nonzeros of H are defined by any columns that are not in the first ncolh of n then e04mxf will rearrange the matrices A and H so that they are.

3.2 Query Mode

e04mxf offers a ‘query mode’ to quickly give upper estimates on the sizes of user arrays. In this mode any expensive checks of the data and of the file format are skipped, providing a prompt count of the number of variables, constraints and matrix nonzeros. This might be useful in the common case where the size of the problem is not known in advance.
You may activate query mode by setting any of the following: maxn<1, maxm<1, maxnnz<1, maxncolh<0 or maxnnzh<0. If no major formatting error is detected in the data file, ifail=0 is returned and the upper estimates are given as stated in Table 1. Alternatively, the routine switches to query mode while the file is being read if it is discovered that the provided space is insufficient (that is, if n>maxn, m>maxm, nnz>maxnnz, ncolh>maxncolh, nnzh>maxnnzh or lintvar>maxlintvar). In this case ifail=2 is returned.
Table 1
Argument Name Upper Estimate for
n maxn
m maxm
nnz maxnnz
ncolh maxncolh
nnzh maxnnzh
lintvar maxlintvar

4 References

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

5 Arguments

1: infile Integer Input
On entry: the ID of the MPSX data file to be read as returned by a call to x04acf.
Constraint: infile0.
2: maxn Integer Input
On entry: an upper limit for the number of variables in the problem.
If maxn<1, e04mxf will start in query mode (see Section 3.2).
3: maxm Integer Input
On entry: an upper limit for the number of general linear constraints (including the objective row) in the problem.
If maxm<1, e04mxf will start in query mode (see Section 3.2).
4: maxnnz Integer Input
On entry: an upper limit for the number of nonzeros (including the objective row) in the problem.
If maxnnz<1, e04mxf will start in query mode (see Section 3.2).
5: maxncolh Integer Input
On entry: an upper limit for the dimension of the matrix H.
If maxncolh<0, e04mxf will start in query mode (see Section 3.2).
6: maxnnzh Integer Input
On entry: an upper limit for the number of nonzeros of the matrix H.
If maxnnzh<0, e04mxf will start in query mode (see Section 3.2).
7: maxlintvar Integer Input
On entry: if maxlintvar0, an upper limit for the number of integer variables.
If maxlintvar<0, e04mxf will treat all integer variables in the file as continuous variables.
8: mpslst Integer Input
On entry: if mpslst0, summary messages are sent to the current advisory message unit (as defined by x04abf) as e04mxf reads through the data file. This can be useful for debugging the file. If mpslst=0, then no summary is produced.
9: n Integer Output
On exit: if e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, an upper estimate of the number of variables of the problem. Otherwise, n, the actual number of variables in the problem.
10: m Integer Output
On exit: if e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, an upper estimate of the number of general linear constraints in the problem (including the objective row). Otherwise, m, the actual number of general linear constraints of the problem.
11: nnz Integer Output
On exit: if e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, an upper estimate of the number of nonzeros in the problem (including the objective row). Otherwise, the actual number of nonzeros in the problem (including the objective row).
12: ncolh Integer Output
On exit: if e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, an upper estimate of the value of ncolh required by e04nkf/​e04nka and e04nqf. In this context ncolh is the number of leading nonzero columns of the Hessian matrix H. Otherwise, the actual dimension of the matrix H.
13: nnzh Integer Output
On exit: if e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, an upper estimate of the number of nonzeros of the matrix H. Otherwise, the actual number of nonzeros of the matrix H.
14: lintvar Integer Output
On exit: if on entry maxlintvar<0, all integer variables are treated as continuous and lintvar=−1.
If e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, an upper estimate of the number of integer variables of the problem. Otherwise, the actual number of integer variables of the problem.
15: iobj Integer Output
On exit: if iobj>0, row iobj of A is a free row containing the nonzero coefficients of the vector c.
If iobj=0, the coefficients of c are assumed to be zero.
If e04mxf is run in query mode (see Section 3.2) iobj is not referenced.
16: a(maxnnz) Real (Kind=nag_wp) array Output
On exit: the nonzero elements of A, ordered by increasing column index.
If e04mxf is run in query mode (see Section 3.2), a is not referenced.
17: irowa(maxnnz) Integer array Output
On exit: the row indices of the nonzero elements stored in a.
If e04mxf is run in query mode (see Section 3.2), irowa is not referenced.
18: iccola(maxn+1) Integer array Output
On exit: a set of pointers to the beginning of each column of A. More precisely, iccola(i) contains the index in a of the start of the ith column, for i=1,2,,n. Note that iccola(1)=1 and iccola(n+1)=nnz+1.
If e04mxf is run in query mode (see Section 3.2), iccola is not referenced.
19: bl(maxn+maxm) Real (Kind=nag_wp) array Output
20: bu(maxn+maxm) 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 contains the bounds on the variables x and the next m elements contains the bounds for the linear objective term cTx and for the general linear constraints Ax (if any). Note that an ‘infinite’ lower bound is indicated by bl(j) = -1.0E+20 and an ‘infinite’ upper bound by bu(j)=+1.0E+20. In other words, any element of u greater than or equal to 1020 will be regarded as + (and similarly any element of l less than or equal to -1020 will be regarded as -). If this value is deemed to be ‘inappropriate’, before calling e04nkf/​e04nka or e04nqf you are recommended to reset the value of its optional parameter e04nkf/​e04nka and e04nqf and make any necessary changes to bl and/or bu.
If e04mxf is run in query mode (see Section 3.2), bl and bu are not referenced.
21: pnames(5) Character(8) array Input/Output
On entry: a set of names associated with the MPSX form of the problem.
pnames(1)
Must either contain the name of the problem or be blank.
pnames(2)
Must either be blank or contain the name of the objective row (in which case it overrides OBJNAME section and the default choice of the first objective free row).
pnames(3)
Must either contain the name of the RHS set to be used or be blank (in which case the first RHS set is used).
pnames(4)
Must either contain the name of the RANGE set to be used or be blank (in which case the first RANGE set (if any) is used).
pnames(5)
Must either contain 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:
pnames(1)
Contains the name of the problem (or blank if none).
pnames(2)
Contains the name of the objective row (or blank if none).
pnames(3)
Contains the name of the RHS set (or blank if none).
pnames(4)
Contains the name of the RANGE set (or blank if none).
pnames(5)
Contains the name of the BOUNDS set (or blank if none).
If e04mxf is run in query mode (see Section 3.2), pnames is not referenced.
22: nname Integer Output
On exit: n+m, the total number of variables and constraints in the problem (including the objective row).
If e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, nname is not set.
23: crname(maxn+maxm) Character(8) array Output
On exit: the MPS names of all the variables and constraints in the problem in the following order. The first n elements contain the MPS names for the variables and the next m elements contain the MPS names for the objective row and general linear constraints (if any). Note that the MPS name for the objective row is stored in crname(n+iobj).
If e04mxf is run in query mode (see Section 3.2), crname is not referenced.
24: h(maxnnzh) Real (Kind=nag_wp) array Output
On exit: the nnzh nonzero elements of H, arranged by increasing column index.
If e04mxf is run in query mode (see Section 3.2), h is not referenced.
25: irowh(maxnnzh) Integer array Output
On exit: the nnzh row indices of the elements stored in H.
If e04mxf is run in query mode (see Section 3.2), irowh is not referenced.
26: iccolh(maxncolh+1) Integer array Output
On exit: a set of pointers to the beginning of each column of H. More precisely, iccolh(i) contains the index in H of the start of the ith column, for i=1,2,,ncolh. Note that iccolh(1)=1 and iccolh(ncolh+1)=nnzh+1.
If e04mxf is run in query mode (see Section 3.2), iccolh is not referenced.
27: minmax Integer Output
On exit: minmax defines the direction of the optimization as read from the MPS file. By default the routine assumes the objective function should be minimized and will return minmax=−1. If the routine discovers in the OBJSENSE section that the objective function should be maximized it will return minmax=1. If the routine discovers that there is neither the linear objective term c (the objective row) nor the Hessian matrix H, the problem is considered as a feasible point problem and minmax=0 is returned.
If e04mxf was run in query mode (see Section 3.2), or returned with ifail=2, minmax is not set.
28: intvar(maxlintvar) Integer array Output
On exit: if maxlintvar>0 on entry, intvar contains pointers to the columns that are defined as integer variables. More precisely, intvar(i)=k, where k is the index of a column that is defined as an integer variable, for i=1,2,,lintvar.
If maxlintvar0 on entry, or e04mxf was run in query mode (see Section 3.2), or it returned with ifail=2, intvar is not set.
29: 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 -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).
Note that if any of the relevant arguments are accidentally set to zero, or not set and assume zero values, then the routine will have executed in query mode. In this case only the size of the problem is returned and other arguments are not set. See Section 3.2.

6 Error Indicators and Warnings

If on entry 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:
ifail=1
Warning: MPS file not strictly fixed format, although the problem was read anyway. The data may have been read incorrectly. You should set mpslst=1 and repeat the call to e04mxf for more details.
ifail=2
At least one of maxm, maxn, maxnnz, maxnnzh, maxncolh or maxlintvar is too small. Suggested values are returned in m, n, nnz, nnzh, ncolh and lintvar respectively.
ifail=3
Incorrect ordering of indicator lines.
OBJNAME indicator line found after ROWS indicator line.
ifail=4
Incorrect ordering of indicator lines.
COLUMNS indicator line found before ROWS indicator line.
ifail=5
Incorrect ordering of indicator lines.
RHS indicator line found before COLUMNS indicator line.
ifail=6
Incorrect ordering of indicator lines.
RANGES indicator line found before RHS indicator line.
ifail=7
Incorrect ordering of indicator lines.
BOUNDS indicator line found before COLUMNS indicator line.
ifail=8
Incorrect ordering of indicator lines.
QUADOBJ indicator line found before BOUNDS indicator line.
ifail=9
Incorrect ordering of indicator lines.
QUADOBJ indicator line found before COLUMNS indicator line.
ifail=10
Unknown indicator line ‘value’.
ifail=12
Indicator line ‘value’ has been found more than once in the MPS file.
ifail=13
End of file found before ENDATA indicator line.
ifail=14
No indicator line found in file. It may be an empty file.
ifail=15
At least one mandatory section not found in MPS file.
ifail=16
An illegal line was detected in ‘value’ section.
This is neither a comment nor a valid data line.
ifail=17
Unknown inequality key ‘value’ in ROWS section.
Expected ‘N’, ‘G’, ‘L’ or ‘E’.
ifail=18
Empty ROWS section.
Neither the objective row nor the constraints were defined.
ifail=19
The supplied name, in pnames(2) or in OBJNAME, of the objective row was not found among the free rows in the ROWS section.
ifail=20
The supplied name, in pnames(5), of the BOUNDS set to be used was not found in the BOUNDS section.
ifail=21
The supplied name, in pnames(3), of the RHS set to be used was not found in the RHS section.
ifail=22
The supplied name, in pnames(4), of the RANGES set to be used was not found in the RANGES section.
ifail=23
Illegal row name.
Row names must consist of printable characters only.
ifail=24
Illegal column name.
Column names must consist of printable characters only.
ifail=25
Row name ‘value’ has been defined more than once in the ROWS section.
ifail=26
Column ‘value’ has been defined more than once in the COLUMNS section. Column definitions must be continuous. (See Section 3.1.5).
ifail=27
Found 'INTORG' marker within 'INTORG' to 'INTEND' range.
ifail=28
Found 'INTEND' marker without previous marker being 'INTORG'.
ifail=29
Found 'INTORG' but not 'INTEND' before the end of the COLUMNS section.
ifail=30
Illegal marker type ‘value’.
Should be either 'INTORG' or 'INTEND'.
ifail=31
Unknown row name ‘value’ in value section.
All row names must be specified in the ROWS section.
ifail=32
Unknown column name ‘value’ in value section.
All column names must be specified in the COLUMNS section.
ifail=33
Inconsistent bounds for column ‘value’.
Inconsistent bounds for row ‘value’.
Unknown bound type ‘value’ in BOUNDS section.
Inconsistent bounds are reported when the lower bound is greater than or equal to 1.0E+20 or the upper bound is less than or equal to -1.0E+20, or when the lower bound is greater than the upper bound.
ifail=34
More than one nonzero of A has row name ‘value’ and column name ‘value’ in the COLUMNS section.
ifail=35
Field value did not contain a number (see Section 3).
ifail=36
On entry, infile=value.
Constraint: infile0.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
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.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
e04mxf makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.

9 Further Comments

None.

10 Example

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 ) ,  
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 only positive semidefinite, the point x* is unique.
The MPS representation of the problem is given in Section 10.2.
Another example which shows how to use e04mxf together with the NAG optimization modelling suite is associated with e04rjf.

10.1 Program Text

Program Text (e04mxfe.f90)

10.2 Program Data

Program Options (e04mxfe.opt)

10.3 Program Results

Program Results (e04mxfe.r)