nag_opt_handle_set_linconstr (e04rjc) is a part of the NAG optimization modelling suite and defines the block of linear constraints of the problem.
After the initialization function
nag_opt_handle_init (e04rac) has been called, nag_opt_handle_set_linconstr (e04rjc) may be used to define the linear constraints
of the problem unless the linear constraints have already been defined. This will typically be used for problems, such as quadratic programming (QP)
nonlinear programming (NLP)
linear semidefinite programming (SDP)
or semidefinite programming with bilinear matrix inequalities (BMI-SDP)
where
is the number of decision variables,
is a general
rectangular matrix and
and
are
-dimensional vectors. Note that upper and lower bounds are specified for all the constraints. This form allows full generality in specifying various types of constraint. In particular, the
th constraint may be defined as an equality by setting
. If certain bounds are not present, the associated elements of
or
may be set to special values that are treated as
or
. See the description of the optional parameter
of the solvers in the suite,
nag_opt_handle_solve_ipopt (e04stc) and
nag_opt_handle_solve_pennon (e04svc). Its value is denoted as
further in this text. Note that the bounds are interpreted based on its value at the time of calling this function and any later alterations to
will not affect these constraints.
None.
- NE_ALLOC_FAIL
-
Dynamic memory allocation failed.
See
Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
- NE_ALREADY_DEFINED
-
A set of linear constraints has already been defined.
- NE_BAD_PARAM
-
On entry, argument had an illegal value.
- NE_BOUND
-
On entry, , , .
Constraint: .
On entry, , and .
Constraint: .
On entry, , , .
Constraint: .
- NE_HANDLE
-
The supplied
handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been initialized by
nag_opt_handle_init (e04rac) or it has been corrupted.
- NE_INT
-
On entry, .
Constraint: .
On entry, .
Constraint: .
- 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.
An unexpected error has been triggered by this function. Please contact
NAG.
See
Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
- NE_INVALID_CS
-
On entry, , and .
Constraint: .
On entry, , and .
Constraint: .
On entry, more than one element of
b has row index
and column index
.
Constraint: each element of
b must have a unique row and column index.
- NE_NO_LICENCE
-
Your licence key may have expired or may not have been installed correctly.
See
Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
- NE_PHASE
-
The problem cannot be modified in this phase any more, the solver has already been called.
- NE_REF_MATCH
-
On entry, .
Constraint: .
Not applicable.
nag_opt_handle_set_linconstr (e04rjc) is not threaded in any implementation.
None.
This example demonstrates how to use the MPS file reader
nag_opt_miqp_mps_read (e04mxc) and this suite of functions to define and solve a QP problem.
nag_opt_miqp_mps_read (e04mxc) uses a different output format to the one required by nag_opt_handle_set_linconstr (e04rjc), in particular, it uses the compressed column storage (CCS) (see
Section 2.1.3 in the f11 Chapter Introduction) instead of the coordinate storage and the linear objective vector is included in the system matrix. Therefore a simple transformation is needed before calling nag_opt_handle_set_linconstr (e04rjc) as demonstrated in the example program.
The data file stores the following problem:
where
The optimal solution (to five figures) is
See also
Section 10 in nag_opt_handle_init (e04rac) for links to further examples in this suite.