The routine may be called by the names e04rnf or nagf_opt_handle_set_linmatineq.
3Description
After the initialization routine e04raf has been called, e04rnf 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)
e04rnf can be called repeatedly to accumulate more matrix inequalities. See Section 3.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 routine. 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 routine 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 e04rdf 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 e04rnf 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 e04rnf. 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 e04rdf.
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)
e04rnf is designed to be used together with e04rpf to define bilinear matrix inequalities (3)(b). e04rnf sets the linear part of the constraint and e04rpf expands it by higher order terms. To distinquish which linear matrix inequality (or more precisely, which block) is to be expanded, e04rpf 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 routine 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 e04rnf for the very first time with , it adds inequalities with idblk from to and the routine 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: – Type (c_ptr)Input
On entry: the handle to the problem. It needs to be initialized (e.g., by e04raf) 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: – Integer arrayInput
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: – Integer arrayInput
7: – Integer arrayInput
8: – Real (Kind=nag_wp) arrayInput
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: – IntegerInput/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. 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).
6Error 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 properly initialized or it has been corrupted.
The problem cannot be modified right now, the solver is running.
On entry, . Constraint: .
On entry, , expected .
Constraint: nvar must match the current number of variables of the model in the handle.
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, .
Constraint: .
On entry, and .
Constraint: .
On entry, and .
Constraint: .
On entry, .
Constraint: .
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.
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.
7Accuracy
Not applicable.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
e04rnf 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 e04rnf, 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 routine. 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: