The function may be called by the names: e04rnc or nag_opt_handle_set_linmatineq.
3Description
After the initialization function e04rac has been called, e04rnc may be used to add one or more linear matrix inequalities
(1)
to the problem definition. Here are symmetric matrices. The expression stands for a constraint on eigenvalues of a symmetric matrix , namely, all the eigenvalues should be non-negative, i.e., the matrix should be positive semidefinite.
Typically, this will be used in linear semidefinite programming problems (SDP)
(2)
or to define the linear part of bilinear matrix inequalities (3)(b) in (BMI-SDP)
(3)
e04rnc can be called repeatedly to accumulate more matrix inequalities. See Section 4.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.
3.1Input data organization
All the matrices , for , are symmetric and thus only their upper triangles are passed to the function. They are stored in sparse coordinate storage format (see Section 2.1.1 in the F11 Chapter Introduction), i.e., every nonzero from the upper triangles is coded as a triplet of row index, column index and the numeric value. These triplets of all (upper triangle) nonzeros from all matrices are passed to the function in three arrays: irowa for row indices, icola for column indices and a for the values. No particular order of nonzeros within one matrix is enforced but all nonzeros from must be stored first, followed by all nonzero from , followed by , etc.
The number of stored nonzeros from each matrix is given in , thus this array indicates which section of arrays irowa, icola and a belongs to which matrix. See Table 1 and the example in Section 9. See also e04rdc which uses the same data organization.
Table 1
Coordinate storage format of matrices in input arrays
There are two possibilities for defining more matrix inequality constraints
(4)
to the problem. The first is to call e04rnc times and define a single matrix inequality at a time. This might be more straightforward and, therefore, it is recommended. Alternatively, it is possible to merge all constraints into one inequality and pass them in a single call to e04rnc. It is easy to see that (4) can be equivalently expressed as one bigger matrix inequality with the following block diagonal structure
If denotes the dimension of inequality , the new merged inequality has dimension and each of the matrices is formed by stored as diagonal blocks. In such a case, nblk is set to and to , the size of the th diagonal blocks. This might be useful in connection with e04rdc.
On the other hand, if there is no block structure and just one matrix inequality is provided, nblk should be set to and blksizea is not referenced.
3.2Definition of Bilinear Matrix Inequalities (BMI)
e04rnc is designed to be used together with e04rpc to define bilinear matrix inequalities (3)(b). e04rnc sets the linear part of the constraint and e04rpc expands it by higher order terms. To distinquish which linear matrix inequality (or more precisely, which block) is to be expanded, e04rpc needs the number of the block, idblk. The blocks are numbered as they are added, starting from .
Whenever a matrix inequality (or a set of them expressed as diagonal blocks) is stored, the function returns idblk of the last inequality added. idblk is just the order of the inequality amongst all matrix inequalities accumulated through the calls. The first inequality has , the second one , etc. Therefore, if you call e04rnc for the very first time with , it adds inequalities with idblk from to and the function returns (the number of the last one). A subsequent call with would add only one inequality, this time with which would be returned.
4References
None.
5Arguments
1: – 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: – IntegerInput
On entry: , the current number of decision variables in the model.
3: – IntegerInput
On entry: , the dimension of the matrices
, for .
Constraint:
.
4: – const IntegerInput
On entry: , for , gives the number of nonzero elements in the upper triangle of matrix . To define as a zero matrix, set . However, there must be at least one matrix with at least one nonzero.
Constraints:
;
.
5: – IntegerInput
On entry: the dimension of the arrays irowa, icola and a, at least the total number of all nonzeros in all matrices .
Constraints:
;
.
6: – const IntegerInput
7: – const IntegerInput
8: – const doubleInput
On entry: nonzero elements in upper triangle of matrices stored in coordinate storage. The first elements belong to , the following elements belong to , etc. See explanation above.
On entry: if , new matrix inequalities are created. This is the only value allowed at the moment; nonzero values are reserved for future releases of the NAG Library.
Constraint:
.
On exit: the number of the last matrix inequality added. By definition, it is the number of matrix inequalities already defined plus nblk.
12: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error 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 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_INT
On entry, .
Constraint: .
On entry, .
Constraint: .
NE_INT_2
On entry, and .
Constraint: .
NE_INT_ARRAY_1
On entry, and .
Constraint: .
On entry, .
Constraint: .
NE_INT_ARRAY_2
On entry, and .
Constraint: .
NE_INTARR_INT
On entry, and .
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.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_INVALID_CS
An error occurred in matrix , .
On entry, , and .
Constraint: .
An error occurred in matrix , .
On entry, , and .
Constraint: .
An error occurred in matrix , .
On entry, , and .
Constraint: (elements within the upper triangle).
An error occurred in matrix , .
On entry, , and . Maximum column index in this row given by the block structure defined by blksizea is .
Constraint: all elements of must respect the block structure given by blksizea.
An error occurred in matrix , .
On entry, more than one element of has row index and column index .
Constraint: each element of 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 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, . Constraint: .
On entry, , expected .
Constraint: nvar must match the current number of variables of the model in the handle.
7Accuracy
Not applicable.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
e04rnc is not threaded in any implementation.
9Further Comments
The following example demonstrates how the elements of the matrices are organized within the input arrays. Let us assume that there are two blocks defined (). The first has dimension () and the second (). For simplicity, the number of variables is . Please note that the values were chosen to ease orientation rather than to define a valid problem.
Both inequalities will be passed in a single call to e04rnc, therefore, the matrices are merged into the following block diagonal form:
All matrices are symmetric and, therefore, only the upper triangles are passed to the function. The coordinate storage format is used. Note that elements within the same matrix do not need to be in any specific order. The table below shows one of the ways the arrays could be populated.
There are various problems which can be successfully reformulated and solved as an SDP problem. The following example shows how a maximization of the minimal eigenvalue of a matrix depending on certain parameters can be utilized in statistics.
Given a series of vectors of length , this example solves the SDP problem:
This formulation comes from an area of statistics called experimental design and corresponds to finding an approximate optimal design for a linear regression.
A linear regression model has the form:
where is a vector of observed values, is a design matrix of (known) independent variables and is a vector of errors. In experimental design it is assumed that each row of is chosen from a set of possible vectors, . The goal of experimental design is to choose the rows of so that the error covariance is ‘small’. For an optimal design this is defined as the that maximizes the minimum eigenvalue of .
In this example we construct the optimal design for a polynomial regression model of the form: