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
Where
is the number of variables,
is the number of general linear constraints,
is the linear constraint matrix with dimension
, the vectors
and
are the lower and upper bounds, respectively.
is the Hessian matrix with dimension
, 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
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
, whereas if
iobj is supplied (
), row
iobj of matrix
is a free row storing the nonzero elements of
.
Note: that this function uses fixed MPS format, see
IBM (1971).
- 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, .
Constraint: .
On entry, and .
Constraint: .
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry,
.
Constraint: all entries in
intvar must be unique.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
On entry, .
Constraint: or .
- NE_BOUND
-
On entry, and , is incorrect.
Constraint: .
On entry, , and are incorrect.
Constraint: .
On entry, , and , the integer variable requires at least one bound finite.
Constraint: at least one of the following conditions must be met for integer variable j: , .
On entry, and , is incorrect.
Constraint: .
- NE_FILEID
-
On entry, .
Constraint: .
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_2
-
On entry, .
Constraint: .
On entry, .
Constraint: .
On entry, .
Constraint: .
- NE_INT_3
-
On entry, and .
Constraint: .
On entry, and .
Constraint: if , .
On entry, and .
Constraint: if , .
- NE_INT_4
-
On entry, and .
Constraint: .
On entry,
and
.
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, , and .
Constraint: .
On entry, , , and
Constraint: (within the lower triangle).
On entry, more than one element of
a has row index
and column index
.
Constraint: each element of
a must have a unique row and column index.
On entry, more than one element of
h has row index
and column index
.
Constraint: each element of
h must have a unique row and column index.
- NE_MPS_ILLEGAL_NAME
-
On entry,
for
has been already used.
Constraint: the names in
crname must be unique.
The name specified in
is empty or has been already used among row names.
Constraint: the names in
must be unique and nonempty if
crname is provided and
.
- NE_MPS_PRINTABLE
-
On entry,
for
is incorrect.
Constraint: the names in
crname must consist only of printable characters.
On entry,
for
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,
,
and
, the values of
iccola must be nondecreasing.
Constraint:
.
On entry,
,
and
, the values of
iccolh must be nondecreasing.
Constraint:
.
- NE_NOT_STRICTLY_INCREASING
-
On entry, , and .
Constraint: .
- NE_OBJ_BOUND
-
On entry, , and , if the bounds must be infinite.
Constraints: , .
- NE_STATE_VAL
-
On entry, , and .
Constraint: .
On entry, , and .
Constraint: .
- NE_WRITE_ERROR
-
An error occurred when writing to file.
Not applicable.
Background information to multithreading can be found in the
Multithreading documentation.
None.
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
, where
subject to the bounds
and to the linear constraints
The initial point, which is infeasible, is
The optimal solution (to five figures) is
The generated file is called e04mwce.mps.