NAG CL Interface
e04rbc (handle_​set_​group)

Settings help

CL Name Style:


1 Purpose

e04rbc 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

#include <nag.h>
void  e04rbc (void *handle, const char *gtype, Integer lgroup, const Integer group[], Integer *idgroup, NagError *fail)
The function may be called by the names: e04rbc or nag_opt_handle_set_group.

3 Description

After the handle has been initialized (e.g., e04rac has been called), e04rbc may be used to edit a model by adding, replacing, or deleting a cone constraint i of dimension mi. The supported cones are quadratic cone and rotated quadratic cone, also known as second-order cones, which are defined as follows:
The cone constraint is defined by its type and a subset (group) of variables. Let index set Gi{1,2,,n} denote variable indices, then xGi will denote the subvector of variables xn.
For example, if mi=3 and Gi={4,1,2}, then a quadratic cone constraint
xGi = (x4,x1,x2) Kq3  
implies the inequality constraints
x42 x12 + x22 ,   x4 0 .  
Typically, this function will be used to build Second-order Cone Programming (SOCP) problems which might be formulated in the following way:
minimize xn cTx   (a) subject to lBBxuB,   (b) lxxux ,   (c) xGiKmi,i=1,,r,   (d) (3)
where Kmi is either a quadratic cone or a rotated quadratic cone of dimension mi.
e04rbc 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 e04tcc and e04tbc, respectively. See Section 4.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

4 References

None.

5 Arguments

1: handle void * Input
On entry: the handle to the problem. It needs to be initialized (e.g., by e04rac) and must not be changed between calls to the NAG optimization modelling suite.
2: gtype const char * Input
On entry: the type of the cone constraint. gtype is case insensitive.
gtype=QUAD or Q
The group defines a quadratic cone.
gtype=RQUAD or R
The group defines a rotated quadratic cone.
Constraint: gtype=QUAD, Q, RQUAD or R.
3: lgroup Integer Input
On entry: mi, the number of variables in the group.
If lgroup=0, gtype and group will not be referenced and may be NULL, and the constraint with ID number idgroup will be deleted from the model.
Constraints:
  • if gtype=QUAD or Q, lgroup=0 or lgroup2;
  • if gtype=RQUAD or R, lgroup=0 or lgroup3.
4: group[lgroup] const Integer Input
On entry: Gi, the indices of the variables in the constraint. If lgroup=0, group is not referenced and may be NULL.
Constraint: 1group[k-1]n, for k=1,2,,lgroup , where n is the number of decision variables in the problem. The elements must not repeat.
5: idgroup Integer * Input/Output
On entry:
idgroup=0
A new cone constraint is created.
idgroup>0
i, the ID number of the existing constraint to be deleted or replaced.
Constraint: idgroup0.
On exit: if idgroup=0 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.
6: fail NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

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_BAD_PARAM
On entry, argument value had an illegal value.
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 properly initialized or it has been corrupted.
NE_INDICES
On entry, k=value, group[k-1]=value and n=value.
Constraint: 1group[k-1]n.
NE_INT
On entry, idgroup=value.
Constraint: idgroup0.
On entry, lgroup=value.
Constraint: lgroup0.
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_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_PHASE
The problem cannot be modified right now, the solver is running.
NE_REF_MATCH
On entry, idgroup=value.
The given idgroup does not match with any cone constraint already defined.
NE_REPEAT_CONEVAR_SM
On entry, group[i-1]=group[j-1]=value for i=value and j=value.
Constraint: elements in group cannot repeat.
NE_STANDARD_ERRORS
On entry, gtype=value and lgroup=value.
Constraint: if gtype=QUAD or Q, lgroup=0 or lgroup2.
On entry, gtype=value and lgroup=value.
Constraint: if gtype=RQUAD or R, lgroup=0 or lgroup3.
NE_STR_UNKNOWN
On entry, gtype=value.
Constraint: gtype=QUAD, Q, RQUAD or R.

7 Accuracy

Not applicable.

8 Parallelism and Performance

e04rbc is not threaded in any implementation.

9 Further Comments

9.1 Internal Changes

Internal changes have been made to this function as follows:
For details of all known issues which have been reported for the NAG Library please refer to the Known Issues.

10 Example

See e04ptc.