e04rtf is a part of the NAG optimization modelling suite and defines a new, or edits an existing, quadratic objective function or constraint of the problem using a factor of the quadratic coefficient matrix.
The routine may be called by the names e04rtf or nagf_opt_handle_set_qconstr_fac.
After the handle has been initialized (e.g., e04raf has been called),
e04rtf may be used to edit a model by adding or replacing a quadratic objective function or constraint of the form
The matrix is a sparse matrix. It can be viewed as the factor of the symmetric matrix in a general quadratic function
It is also acceptable if is a zero matrix, in which case the corresponding objective function or constraint becomes linear. If you have the full matrix as input data, please call routine e04rsf instead. Note that it is possible to temporarily disable and enable individual constraints in the model by e04tcfande04tbf, respectively. See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.
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: – Real (Kind=nag_wp)Input
On entry: the constant term in quadratic constraint.
On entry: the number of nonzero elements in the sparse vector .
If , is considered to be zero and the arrays idxr and r will not be referenced.
4: – Integer arrayInput
5: – Real (Kind=nag_wp) arrayInput
On entry: the nonzero elements of the sparse vector . must contain the index of
in the vector, for . No particular order is expected, but elements should not repeat. Note that is the current number of variables in the problem.
, for .
6: – IntegerInput
On entry: , row dimension of matrix .
7: – IntegerInput
On entry: the number of nonzero elements in the matrix .
If , the matrix is considered to be zero, the objective function or constraint is linear and mf, irowf, icolf and f will not be referenced.
8: – Integer arrayInput
9: – Integer arrayInput
10: – Real (Kind=nag_wp) arrayInput
On entry: arrays irowf, icolf and f store the nonzeros of the matrix in coordinate storage (CS) format (see Section 2.1.1 in the F11 Chapter Introduction). irowf specifies one-based row indices, icolf specifies one-based column indices and f specifies the values of the nonzero elements in such a way that where ,
, for . No particular order is expected, but elements should not repeat.
, for .
11: – IntegerInput/Output
A new quadratic constraint is created.
Specifies the index of an existing constraint to be replaced. i.e., replaces the idqcth constraint.
A new quadratic objective is created and will replace any previously defined objective function.
On exit: if on entry, then idqc is overwritten with the index of the new quadratic constraint. By definition, this is the number of quadratic constraints already defined plus one. Otherwise, idqc stays unchanged.
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, . The given idqc does not match with any quadratic constraint already defined.