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 handle has been initialized (e.g., 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 a quadratic cone or a rotated quadratic cone of dimension .
handle_set_group can be called repeatedly to add, replace or delete one cone constraint at a time. Note that it is also possible to temporarily disable and enable individual cone constraints in the model by calling e04tcf (no CPP interface) and e04tbf (no CPP interface), respectively. 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. gtype is case insensitive.
, 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 cone constraints already defined plus one. Otherwise, idgroup remains unchanged.
5: – OptionalE04RBInput/Output
Optional parameter container, derived from Optional.
5.1Additional Quantities
1:
, the number of 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).