The routine may be called by the names e04ref or nagf_opt_handle_set_linobj.
After the handle has been initialized (e.g., e04raf has been called),
e04ref may be used to define the objective function of the problem as a linear function using a dense vector . If the objective function has already been defined, it will be overwritten. If ,
any existing objective function is removed, no new one is added and the problem will be solved as a feasible point problem.
It is recommended to use e04rff if the vector is sparse. e04tef may be used to set individual elements of the linear objective.
This will typically be used for Linear Programming (LP)
Second-order Cone Programming (SOCP)
linear Semidefinite Programming problems (SDP)
or SDP with bilinear matrix inequalities (BMI-SDP) where the objective function has only linear terms. 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: – IntegerInput
On entry: , the current number of decision variables in the model.
3: – Real (Kind=nag_wp) arrayInput
On entry: the dense vector of the objective function.
4: – 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, , expected .
Constraint: nvar must match the current number of variables of the model in the handle.
An unexpected error has been triggered by this routine. Please
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.
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
e04ref is not threaded in any implementation.
Internal changes have been made to this routine as follows:
At Mark 27.1: Previously, it was not possible to modify the objective function once it was set or to edit the model once a solver had been called. These limitations have been removed and the associated error codes were removed.
For details of all known issues which have been reported for the NAG Library please refer to the Known Issues.
See e04raf for links to all the examples in the suite.