The routine may be called by the names e04rsf or nagf_opt_handle_set_qconstr.
After the handle has been initialized (e.g., e04raf has been called),
e04rsf may be used to edit a model by adding or replacing a quadratic objective function or constraint of the form
respectively. If a factor of such that is available, e04rtf should be called instead.
The matrix is a sparse symmetric matrix. Typically e04rsf would be used together with Second-order Cone Programming (SOCP) solver e04ptf if is positive semidefinite which implies the problem is convex. Otherwise, if the problem is nonconvex, a general nonlinear optimization solver (such as e04stf) may be used. It is also acceptable if is a zero matrix, in which case the corresponding objective function or constraint becomes linear. 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: the number of nonzero elements in the upper triangle of the matrix .
If , the matrix is considered to be zero, the objective function or constraint is linear and irowq, icolq and q will not be referenced.
7: – Integer arrayInput
8: – Integer arrayInput
9: – Real (Kind=nag_wp) arrayInput
On entry: arrays irowq, icolq and q store the nonzeros of the upper triangle of the matrix in coordinate storage (CS) format (see Section 2.1.1 in the F11 Chapter Introduction). irowq specifies one-based row indices, icolq specifies one-based column indices and q 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 .
10: – 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.
11: – 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.