NAG FL Interface
e04rbf (handle_set_group)
1
Purpose
e04rbf is a part of the NAG optimization modelling suite and modifies a model by either adding a new, or replacing or deleting an existing, quadratic or rotated quadratic cone constraint.
2
Specification
Fortran Interface
Integer, Intent (In) |
:: |
lgroup, group(lgroup) |
Integer, Intent (Inout) |
:: |
idgroup, ifail |
Character (*), Intent (In) |
:: |
gtype |
Type (c_ptr), Intent (In) |
:: |
handle |
|
C++ Header Interface
#include <nag.h> extern "C" {
}
|
The routine may be called by the names e04rbf or nagf_opt_handle_set_group.
3
Description
After the initialization routine
e04raf has been called,
e04rbf may be used to edit a model by adding, replacing, or deleting a cone constraint
of dimension
. The supported cones are quadratic cone and rotated quadratic cone, also known as second-order cones, which are defined as follows:
-
•Quadratic cone:
-
•Rotated quadratic cone:
The cone constraint is defined by its type and a subset (group) of variables. Let index set denote variable indices, then will denote the subvector of variables .
For example, if
and
, then a quadratic cone constraint
implies the inequality constraints
Typically, this routine will be used to build second-order cone programming (SOCP) problems which might be formulated in the following way:
where
is either quadratic cone or rotated quadratic cone of dimension
.
e04rbf can be called repeatedly to add, replace or delete one cone constraint at a time. See
Section 3.1 in the
E04 Chapter Introduction for more details about the NAG optimization modelling suite.
4
References
None.
5
Arguments
-
1:
– Type (c_ptr)
Input
-
On entry: the handle to the problem. It needs to be initialized by
e04raf and
must not be changed before the call to
e04rbf.
-
2:
– Character(*)
Input
-
On entry: the type of the cone constraint, case insensitive.
- or
- The group defines a quadratic cone.
- or
- The group defines a rotated quadratic cone.
Constraint:
, , or .
-
3:
– Integer
Input
-
On entry:
, the number of the variables in the group.
If
,
gtype and
group will not be referenced, and the constraint with ID number
idgroup will be deleted from the model.
Constraints:
- if or , or ;
- if or , or .
-
4:
– Integer array
Input
-
On entry:
, the indices of the variables in the constraint. If
,
group is not referenced.
Constraint:
, for
, where
is the number of decision variables in the problem. The elements must not repeat and each variable can appear in one cone at most, see
Section 9.
-
5:
– Integer
Input/Output
-
On entry:
- A new cone constraint is created.
- , the ID number of the existing constraint to be deleted or replaced.
Constraint:
.
On exit: if
on entry, the ID number of the new cone constraint is returned. By definition, this is the number of the cone constraints already defined plus one. Otherwise,
idgroup stays unchanged.
-
6:
– Integer
Input/Output
-
On entry:
ifail must be set to
,
or
to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value
or
is recommended. If message printing is undesirable, then the value
is recommended. Otherwise, the value
is recommended since useful values can be provided in some output arguments even when
on exit.
When the value or is used it is essential to test the value of ifail on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6
Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Errors or warnings detected by the routine:
-
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
e04raf or it has been corrupted.
-
The problem cannot be modified in this phase any more, the solver has already been called.
-
On entry, variable with index has been defined in a cone in a previous call to this routine.
Constraint: each variable may be defined in one cone constraint at most.
-
On entry,
.
The given
idgroup does not match with any cone constraint already defined.
-
On entry, and .
Constraint: if or , or .
On entry, and .
Constraint: if or , or .
On entry, .
Constraint: .
-
On entry, .
Constraint: , , or .
-
On entry, .
Constraint: .
-
On entry, , and .
Constraint: .
-
On entry,
for
and
.
Constraint: elements in
group cannot repeat.
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.
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.
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
e04rbf is not threaded in any implementation.
Overlapping of cones is not supported, which means each variable may be defined in one cone at most. However by adding auxiliary variables, you can achieve the same effect. For example, if and , you can add one more variable and set , .
10
Example
This example solves the following SOCP problem
subject to the bounds
the general linear constraints
and the cone constraint
The optimal solution (to five significant figures) is
and the objective function value is
.
10.1
Program Text
10.2
Program Data
10.3
Program Results