handle_set_group 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.
template <typename COMM, typename GROUP>
void function handle_set_group(COMM &comm, const string gtype, const GROUP &group, types::f77_integer &idgroup, OptionalE04RBopt)
template <typename COMM, typename GROUP>
void function handle_set_group(COMM &comm, const string gtype, const GROUP &group, types::f77_integer &idgroup)
3Description
After the initialization function handle_init has been called, handle_set_group 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:
(1)
•Rotated quadratic cone:
(2)
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 function will be used to build second-order cone programming (SOCP) problems which might be formulated in the following way:
(3)
where is either quadratic cone or rotated quadratic cone of dimension .
handle_set_group 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.
Communication structure.
An object of either the derived class CommE04RA or its base class NoneCopyableComm can be supplied.
It is recommended that the derived class is used. If the base class is supplied it must
first be initialized via a call to opt::handle_init (e04ra).
2: – stringInput
On entry: the type of the cone constraint, case insensitive.
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.
, 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.
5: – OptionalE04RBInput/Output
Optional parameter container, derived from Optional.
5.1Additional Quantities
1:
, the number of the variables in the group.
6Exceptions and Warnings
Errors or warnings detected by the function:
All errors and warnings have an associated numeric error code field, errorid, stored either as a member of the thrown exception object (see errorid), or as a member of
opt.ifail, depending on how errors
and warnings are being handled (see Error Handling for more details).
comm::handle does not belong to the NAG optimization modelling suite, has not been initialized properly or is corrupted.
comm::handle has not been initialized properly or is 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 function. 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, . Constraint: .
On entry, and . Constraint: if , or .
On entry, and . Constraint: if , or .
On entry, . Constraint: .
On entry, . Constraint: .
On entry, , and . Constraint: .
On entry, for and . Constraint: elements in group cannot repeat.
On entry, argument must be a vector of size array. Supplied argument has dimensions.
On entry, argument must be a vector of size array. Supplied argument was a vector of size .
On entry, argument must be a vector of size array. The size for the supplied array could not be ascertained.
On entry, the raw data component of is null.
On entry, unable to ascertain a value for .
On entry, the communication class has not been initialized correctly.
An unexpected error has been triggered by this routine.
Your licence key may have expired or may not have been installed correctly.
Dynamic memory allocation failed.
7Accuracy
Not applicable.
8Parallelism and Performance
Please see the description for the underlying computational routine in this section of the
FL Interface documentation.
9Further Comments
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 , .
10Example
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