# NAG CL Interfacee04mwc (miqp_​mps_​write)

Settings help

CL Name Style:

## 1Purpose

e04mwc writes data for sparse linear programming, mixed integer linear programming, quadratic programming or mixed integer quadratic programming problems to a file in MPS format.

## 2Specification

 #include
 void e04mwc (Nag_FileID fileid, Integer n, Integer m, Integer nnzc, Integer nnza, Integer ncolh, Integer nnzh, Integer lintvar, const Integer idxc[], const double c[], Integer iobj, const double a[], const Integer irowa[], const Integer iccola[], const double bl[], const double bu[], char pnames[], char crname[], const double h[], const Integer irowh[], const Integer iccolh[], Integer minmax, const Integer intvar[], NagError *fail)
The function may be called by the names: e04mwc or nag_opt_miqp_mps_write.

## 3Description

e04mwc writes data for Linear Programming (LP) or Quadratic Programming (QP) problems (or their mixed integer variants) from an optimization problem to a MPS output file, see Section 3.1 in e04mxc for the format description. The problem is expected in the form
 $minimize x ⁡ cTx+12xTHx subject to l≤{ x Ax } ≤u.$
Where $n$ is the number of variables, $m$ is the number of general linear constraints, $A$ is the linear constraint matrix with dimension $m×n$, the vectors $l$ and $u$ are the lower and upper bounds, respectively. $H$ is the Hessian matrix with dimension $n×n$, however, only leading ncolh columns might contain nonzero elements and the rest is assumed to be zero.
Note that the linear term of the objective function $c$ might be supplied either as c or via iobj. If c is supplied then idxc contains the indices of the nonzero elements of sparse vector $c$, whereas if iobj is supplied (${\mathbf{iobj}}>0$), row iobj of matrix $A$ is a free row storing the nonzero elements of $c$.
Note: that this function uses fixed MPS format, see IBM (1971).
IBM (1971) MPSX – Mathematical programming system Program Number 5734 XM4 IBM Trade Corporation, New York

## 5Arguments

1: $\mathbf{fileid}$Nag_FileID Input
On entry: the ID of the file to store the problem data as returned by a call to x04acc.
Constraint: ${\mathbf{fileid}}\ge 0$.
2: $\mathbf{n}$Integer Input
On entry: $n$, the number of variables in the problem.
Constraint: ${\mathbf{n}}\ge 1$.
3: $\mathbf{m}$Integer Input
On entry: $m$, the number of constraints in the problem. This is the number of rows in the linear constraint matrix $A$, including the free row (if any; see iobj).
Constraint: ${\mathbf{m}}\ge 0$.
4: $\mathbf{nnzc}$Integer Input
On entry: the number of nonzero elements in the sparse vector $c$.
If ${\mathbf{nnzc}}=0$, the vector $c$ is considered empty and the arrays idxc and c will not be referenced and may be NULL. In this case the linear term of the objective function, if any, may be provided via iobj.
Constraints:
• ${\mathbf{nnzc}}\ge 0$;
• if ${\mathbf{nnzc}}>0$, ${\mathbf{iobj}}=0$.
5: $\mathbf{nnza}$Integer Input
On entry: the number of nonzero elements in matrix $A$.
If ${\mathbf{nnza}}=0$, matrix $A$ is considered empty, arrays a and irowa will not be referenced and may be NULL, and iccola should be the array of $1$.
Constraint: ${\mathbf{nnza}}\ge 0$.
6: $\mathbf{ncolh}$Integer Input
On entry: the number of leading nonzero columns of the Hessian matrix $H$.
If ${\mathbf{ncolh}}=0$, the quadratic term $H$ of the objective function is considered zero (e.g., LP problems), and arrays h, irowh and iccolh will not be referenced and may be NULL.
Constraint: $0\le {\mathbf{ncolh}}\le {\mathbf{n}}$.
7: $\mathbf{nnzh}$Integer Input
On entry: the number of nonzero elements of the Hessian matrix $H$.
Constraints:
• if ${\mathbf{ncolh}}>0$, ${\mathbf{nnzh}}>0$;
• otherwise ${\mathbf{nnzh}}=0$.
8: $\mathbf{lintvar}$Integer Input
On entry: the number of integer variables in the problem.
If ${\mathbf{lintvar}}=0$, all variables are considered continuous and array intvar will not be referenced and may be NULL.
Constraint: ${\mathbf{lintvar}}\ge 0$.
9: $\mathbf{idxc}\left[{\mathbf{nnzc}}\right]$const Integer Input
10: $\mathbf{c}\left[{\mathbf{nnzc}}\right]$const double Input
On entry: the nonzero elements of sparse vector $c$. ${\mathbf{idxc}}\left[\mathit{i}-1\right]$ must contain the index of ${\mathbf{c}}\left[\mathit{i}-1\right]$ in the vector, for $\mathit{i}=1,2,\dots ,{\mathbf{nnzc}}$.
The elements are stored in ascending order.
Constraints:
• $1\le {\mathbf{idxc}}\left[\mathit{i}-1\right]\le {\mathbf{n}}$, for $\mathit{i}=1,2,\dots ,{\mathbf{nnzc}}$;
• ${\mathbf{idxc}}\left[\mathit{i}-1\right]<{\mathbf{idxc}}\left[\mathit{i}\right]$, for $\mathit{i}=1,2,\dots ,{\mathbf{nnzc}}$.
11: $\mathbf{iobj}$Integer Input
On entry: if ${\mathbf{iobj}}>0$, row iobj of $A$ is a free row containing the nonzero coefficients of the linear terms of the objective function. In this case nnzc is set to $0$.
If ${\mathbf{iobj}}=0$, there is no free row in $A$, and the linear terms might be supplied in array c.
Constraint: if ${\mathbf{iobj}}>0$, ${\mathbf{nnzc}}=0$.
12: $\mathbf{a}\left[{\mathbf{nnza}}\right]$const double Input
13: $\mathbf{irowa}\left[{\mathbf{nnza}}\right]$const Integer Input
14: $\mathbf{iccola}\left[\mathit{dim}\right]$const Integer Input
Note: the dimension, dim, of the array iccola must be at least
• ${\mathbf{n}}+1$ when ${\mathbf{nnza}}>0$.
On entry: the nonzero elements of matrix $A$ in compressed column storage (see Section 2.1.3 in the F11 Chapter Introduction). Arrays irowa and a store the row indices and the values of the nonzero elements, respectively. The elements are sorted by columns and within each column in nondecreasing order. Duplicate entries are not allowed. iccola contains the (one-based) indices to the beginning of each column in a and irowa.
If ${\mathbf{nnza}}=0$, a and irowa are not referenced and may be NULL.
Constraints:
• $1\le {\mathbf{irowa}}\left[\mathit{i}-1\right]\le {\mathbf{m}}$, for $\mathit{i}=1,2,\dots ,{\mathbf{nnza}}$;
• ${\mathbf{iccola}}\left[0\right]=1$;
• ${\mathbf{iccola}}\left[\mathit{i}-1\right]\le {\mathbf{iccola}}\left[\mathit{i}\right]$, for $\mathit{i}=1,2,\dots ,{\mathbf{n}}$;
• ${\mathbf{iccola}}\left[{\mathbf{n}}\right]={\mathbf{nnza}}+1$.
15: $\mathbf{bl}\left[{\mathbf{n}}+{\mathbf{m}}\right]$const double Input
16: $\mathbf{bu}\left[{\mathbf{n}}+{\mathbf{m}}\right]$const double Input
On entry: bl and bu contains the lower bounds $l$ and the upper bounds $u$, respectively.
The first n elements refer to the bounds for the variables $x$ and the rest to the bounds for the linear constraints (including the objective row iobj if present).
To specify a nonexistent lower bound (i.e., ${l}_{j}=-\mathrm{inf}$), set ${\mathbf{bl}}\left[j-1\right]\le {-10}^{20}$; to specify a nonexistent upper bound, set ${\mathbf{bu}}\left[j-1\right]\ge {10}^{20}$.
Constraints:
• ${\mathbf{bl}}\left[\mathit{j}-1\right]\le {\mathbf{bu}}\left[\mathit{j}-1\right]$, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{m}}$;
• ${\mathbf{bl}}\left[\mathit{j}-1\right]<{10}^{20}$, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{m}}$;
• ${\mathbf{bu}}\left[\mathit{j}-1\right]>-{10}^{20}$, for $\mathit{j}=1,2,\dots ,{\mathbf{n}}+{\mathbf{m}}$;
• if ${\mathbf{iobj}}>0$, ${\mathbf{bl}}\left[{\mathbf{iobj}}+{\mathbf{n}}-1\right]\le -{10}^{20}$ and ${\mathbf{bu}}\left[{\mathbf{iobj}}+{\mathbf{n}}-1\right]\ge {10}^{20}$.
17: $\mathbf{pnames}\left[5\right]\left[9\right]$char Input
On entry: a set of names associated with the MPSX form of the problem.
The names can be composed only from ‘printable’ characters (ASCII codes between $32$ and $127$).
If any of the names are blank, the default name is used.
${\mathbf{pnames}}\left[0\right]$
Contains the name of the problem.
${\mathbf{pnames}}\left[1\right]$
Contains the name of the objective row if the objective is provided in c instead of iobj and all names crname are given. The name must be nonempty and unique. In all other cases ${\mathbf{pnames}}\left[1\right]$ is not used.
${\mathbf{pnames}}\left[2\right]$
Contains the name of the RHS set.
${\mathbf{pnames}}\left[3\right]$
Contains the name of the RANGE.
${\mathbf{pnames}}\left[4\right]$
Contains the name of the BOUNDS.
18: $\mathbf{crname}\left[{\mathbf{n}}+{\mathbf{m}}\right]\left[9\right]$char Input
On entry: the names of all the variables and constraints in the problem in that order.
The names can be composed only from ‘printable’ characters and must be unique.
crname may be NULL in which case it will not be referenced and the names are automatically generated.
19: $\mathbf{h}\left[{\mathbf{nnzh}}\right]$const double Input
20: $\mathbf{irowh}\left[{\mathbf{nnzh}}\right]$const Integer Input
21: $\mathbf{iccolh}\left[\mathit{dim}\right]$const Integer Input
Note: the dimension, dim, of the array iccolh must be at least
• ${\mathbf{ncolh}}+1$ when ${\mathbf{ncolh}}>0$.
On entry: the nonzero elements of the Hessian matrix $H$ in compressed column storage (see Section 2.1.3 in the F11 Chapter Introduction). The Hessian matrix, $H$, is symmetric and its elements are stored in a lower triangular matrix.
Arrays irowh and h store the row indices and the values of the nonzero elements, respectively. The elements are sorted by columns and within each column in nondecreasing order. Duplicate entries are not allowed. iccolh contains the (one-based) indices to the beginning of each column in h and irowh.
If ${\mathbf{ncolh}}=0$, h is not referenced and may be NULL.
Constraints:
• $1\le {\mathbf{irowh}}\left[\mathit{i}-1\right]\le {\mathbf{ncolh}}$, for $\mathit{i}=1,2,\dots ,{\mathbf{nnzh}}$;
• ${\mathbf{iccolh}}\left[0\right]=1$;
• ${\mathbf{iccolh}}\left[\mathit{i}-1\right]\le {\mathbf{iccolh}}\left[\mathit{i}\right]$, for $\mathit{i}=1,2,\dots ,{\mathbf{ncolh}}$;
• ${\mathbf{iccolh}}\left[{\mathbf{ncolh}}\right]={\mathbf{nnzh}}+1$.
22: $\mathbf{minmax}$Integer Input
On entry: minmax defines the direction of optimization problem.
${\mathbf{minmax}}=-1$
Minimization.
${\mathbf{minmax}}=1$
Maximization.
Constraint: ${\mathbf{minmax}}=-1$ or $1$.
23: $\mathbf{intvar}\left[{\mathbf{lintvar}}\right]$const Integer Input
On entry: intvar contains the indices $k$ of variables ${x}_{k}$ which are defined as integers. Duplicate indices are not allowed.
If ${\mathbf{lintvar}}=0$, intvar is not referenced and may be NULL.
Constraint: $1\le {\mathbf{intvar}}\left[\mathit{j}-1\right]\le {\mathbf{n}}$, for $\mathit{j}=1,2,\dots ,{\mathbf{lintvar}}$.
24: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
NE_ARRAY_INPUT
On entry, ${\mathbf{iccola}}\left[0\right]=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{iccola}}\left[0\right]=1$.
On entry, ${\mathbf{iccola}}\left[{\mathbf{n}}\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{nnza}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{iccola}}\left[{\mathbf{n}}\right]={\mathbf{nnza}}+1$.
On entry, ${\mathbf{iccolh}}\left[0\right]=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{iccolh}}\left[0\right]=1$.
On entry, ${\mathbf{iccolh}}\left[{\mathbf{ncolh}}\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{nnzh}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{iccolh}}\left[{\mathbf{ncolh}}\right]={\mathbf{nnzh}}+1$.
On entry, ${\mathbf{intvar}}\left[⟨\mathit{\text{value}}⟩\right]={\mathbf{intvar}}\left[⟨\mathit{\text{value}}⟩\right]=$ $⟨\mathit{\text{value}}⟩$.
Constraint: all entries in intvar must be unique.
On entry, argument $⟨\mathit{\text{value}}⟩$ had an illegal value.
On entry, ${\mathbf{minmax}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{minmax}}=-1$ or $1$.
NE_BOUND
On entry, $j=⟨\mathit{\text{value}}⟩$ and ${\mathbf{bl}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$, ${\mathbf{bl}}\left[\mathit{j}-1\right]$ is incorrect.
Constraint: ${\mathbf{bl}}\left[\mathit{j}-1\right]<\text{1e+20}$.
On entry, $j=⟨\mathit{\text{value}}⟩$, ${\mathbf{bl}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{bu}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ are incorrect.
Constraint: ${\mathbf{bl}}\left[\mathit{j}-1\right]\le {\mathbf{bu}}\left[\mathit{j}-1\right]$.
On entry, $\mathit{j}=⟨\mathit{\text{value}}⟩$, ${\mathbf{bl}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{bu}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$, the integer variable $\mathit{j}$ requires at least one bound finite.
Constraint: at least one of the following conditions must be met for integer variable j: ${\mathbf{bl}}\left[\mathit{j}-1\right]>\text{−1e+20}$, ${\mathbf{bu}}\left[\mathit{j}-1\right]<\text{1e+20}$.
On entry, $j=⟨\mathit{\text{value}}⟩$ and ${\mathbf{bu}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$, ${\mathbf{bu}}\left[\mathit{j}-1\right]$ is incorrect.
Constraint: ${\mathbf{bu}}\left[\mathit{j}-1\right]>-\text{1e+20}$.
NE_FILEID
On entry, ${\mathbf{fileid}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{fileid}}\ge 0$.
NE_INT
On entry, ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{m}}\ge 0$.
On entry, ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{n}}\ge 1$.
NE_INT_2
On entry, ${\mathbf{lintvar}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{lintvar}}\ge 0$.
On entry, ${\mathbf{nnza}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{nnza}}\ge 0$.
On entry, ${\mathbf{nnzc}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{nnzc}}\ge 0$.
NE_INT_3
On entry, ${\mathbf{ncolh}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: $0\le {\mathbf{ncolh}}\le {\mathbf{n}}$.
On entry, ${\mathbf{ncolh}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{nnzh}}=⟨\mathit{\text{value}}⟩$.
Constraint: if ${\mathbf{ncolh}}=0$, ${\mathbf{nnzh}}=0$.
On entry, ${\mathbf{ncolh}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{nnzh}}=⟨\mathit{\text{value}}⟩$.
Constraint: if ${\mathbf{ncolh}}>0$, ${\mathbf{nnzh}}>0$.
NE_INT_4
On entry, ${\mathbf{iobj}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: $0\le {\mathbf{iobj}}\le {\mathbf{m}}$.
On entry, ${\mathbf{iobj}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{nnzc}}=⟨\mathit{\text{value}}⟩$.
Constraint: at most one of iobj or nnzc may be nonzero.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_INVALID_CS
On entry, $i=⟨\mathit{\text{value}}⟩$, ${\mathbf{irowa}}\left[\mathit{i}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{m}}=⟨\mathit{\text{value}}⟩$.
Constraint: $1\le {\mathbf{irowa}}\left[\mathit{i}-1\right]\le {\mathbf{m}}$.
On entry, $j=⟨\mathit{\text{value}}⟩$, $i=⟨\mathit{\text{value}}⟩$, ${\mathbf{ncolh}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{irowh}}\left[i-1\right]=⟨\mathit{\text{value}}⟩$
Constraint: $j\le {\mathbf{irowh}}\left[\mathit{i}-1\right]\le {\mathbf{ncolh}}$ (within the lower triangle).
On entry, more than one element of a has row index $⟨\mathit{\text{value}}⟩$ and column index $⟨\mathit{\text{value}}⟩$.
Constraint: each element of a must have a unique row and column index.
On entry, more than one element of h has row index $⟨\mathit{\text{value}}⟩$ and column index $⟨\mathit{\text{value}}⟩$.
Constraint: each element of h must have a unique row and column index.
NE_MPS_ILLEGAL_NAME
On entry, ${\mathbf{crname}}\left[\mathit{j}-1\right]$ for $j=⟨\mathit{\text{value}}⟩$ has been already used.
Constraint: the names in crname must be unique.
The name specified in ${\mathbf{pnames}}\left[1\right]$ is empty or has been already used among row names.
Constraint: the names in ${\mathbf{pnames}}\left[1\right]$ must be unique and nonempty if crname is provided and ${\mathbf{nnzc}}>0$.
NE_MPS_PRINTABLE
On entry, ${\mathbf{crname}}\left[\mathit{j}-1\right]$ for $j=⟨\mathit{\text{value}}⟩$ is incorrect.
Constraint: the names in crname must consist only of printable characters.
On entry, ${\mathbf{pnames}}\left[\mathit{j}-1\right]$ for $j=⟨\mathit{\text{value}}⟩$ is incorrect.
Constraint: the names in pnames must consist only of printable characters.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_NOT_INCREASING
On entry, $j=⟨\mathit{\text{value}}⟩$, ${\mathbf{iccola}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{iccola}}\left[j\right]=⟨\mathit{\text{value}}⟩$, the values of iccola must be nondecreasing.
Constraint: ${\mathbf{iccola}}\left[\mathit{j}-1\right]\le {\mathbf{iccola}}\left[j\right]$.
On entry, $j=⟨\mathit{\text{value}}⟩$, ${\mathbf{iccolh}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{iccolh}}\left[j\right]=⟨\mathit{\text{value}}⟩$, the values of iccolh must be nondecreasing.
Constraint: ${\mathbf{iccolh}}\left[\mathit{j}-1\right]\le {\mathbf{iccolh}}\left[j\right]$.
NE_NOT_STRICTLY_INCREASING
On entry, $j=⟨\mathit{\text{value}}⟩$, ${\mathbf{idxc}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{idxc}}\left[j\right]=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{idxc}}\left[j-1\right]<{\mathbf{idxc}}\left[j\right]$.
NE_OBJ_BOUND
On entry, ${\mathbf{iobj}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{bl}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{bu}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$, if ${\mathbf{iobj}}>0$ the bounds must be infinite.
Constraints: ${\mathbf{bl}}\left[\mathit{j}-1\right]\le -\text{1e+20}$, ${\mathbf{bu}}\left[\mathit{j}-1\right]\ge \text{1e+20}$.
NE_STATE_VAL
On entry, $j=⟨\mathit{\text{value}}⟩$, ${\mathbf{idxc}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{n}}=⟨\mathit{\text{value}}⟩$.
Constraint: $1\le {\mathbf{idxc}}\left[\mathit{j}-1\right]\le {\mathbf{n}}$.
On entry, $j=⟨\mathit{\text{value}}⟩$, ${\mathbf{intvar}}\left[\mathit{j}-1\right]=⟨\mathit{\text{value}}⟩$ and ${\mathbf{lintvar}}=⟨\mathit{\text{value}}⟩$.
Constraint: $1\le {\mathbf{intvar}}\left[\mathit{j}-1\right]\le {\mathbf{lintvar}}$.
NE_WRITE_ERROR
An error occurred when writing to file.

Not applicable.

## 8Parallelism and Performance

e04mwc is not threaded in any implementation.

None.

## 10Example

This example shows how to store an optimization problem to a file in MPS format after it has been solved by e04nqc. The problem is a minimization of the quadratic function $f\left(x\right)={c}^{\mathrm{T}}x+\frac{1}{2}{x}^{\mathrm{T}}Hx$, where
 $c=(-200.0,-2000.0,-2000.0,-2000.0,-2000.0,400.0,400.0)T$
 $H= ( 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 2 2 0 0 0 0 0 2 2 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 2 2 0 0 0 0 0 2 2 )$
subject to the bounds
 $000≤x1≤0200 000≤x2≤2500 400≤x3≤0800 100≤x4≤0700 000≤x5≤1500 000≤x6≤1500 000≤x7≤1500$
and to the linear constraints
 $x1 + x2 + x3 + x4 + x5 + x6 + x7 = 2000 0.15x1 + 0.04x2 + 0.02x3 + 0.04x4 + 0.02x5 + 0.01x6 + 0.03x7 ≤ 60 0.03x1 + 0.05x2 + 0.08x3 + 0.02x4 + 0.06x5 + 0.01x6 ≤ 100 0.02x1 + 0.04x2 + 0.01x3 + 0.02x4 + 0.02x5 ≤ 40 0.02x1 + 0.03x2 + 0.01x5 ≤ 30 1500 ≤ 0.70x1 + 0.75x2 + 0.80x3 + 0.75x4 + 0.80x5 + 0.97x6 250 ≤ 0.02x1 + 0.06x2 + 0.08x3 + 0.12x4 + 0.02x5 + 0.01x6 + 0.97x7 ≤ 300.$
The initial point, which is infeasible, is
 $x0=(0.0,0.0,0.0,0.0,0.0,0.0,0.0)T.$
The optimal solution (to five figures) is
 $x*=(0.0,349.40,648.85,172.85,407.52,271.36,150.02)T.$
The generated file is called e04mwce.mps.

### 10.1Program Text

Program Text (e04mwce.c)

### 10.2Program Data

Program Data (e04mwce.d)

### 10.3Program Results

Program Results (e04mwce.r)