NAG FL Interface
e04ref (handle_​set_​linobj)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

e04ref is a part of the NAG optimization modelling suite and defines or redefines the objective function of the problem to be linear.

2 Specification

Fortran Interface
Subroutine e04ref ( handle, nvar, cvec, ifail)
Integer, Intent (In) :: nvar
Integer, Intent (Inout) :: ifail
Real (Kind=nag_wp), Intent (In) :: cvec(nvar)
Type (c_ptr), Intent (In) :: handle
C Header Interface
#include <nag.h>
void  e04ref_ (void **handle, const Integer *nvar, const double cvec[], Integer *ifail)
The routine may be called by the names e04ref or nagf_opt_handle_set_linobj.

3 Description

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 cTx using a dense vector c. If the objective function has already been defined, it will be overwritten. If c=0, 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 c is sparse. e04tef may be used to set individual elements ci of the linear objective.
This will typically be used for Linear Programming (LP)
minimize xn cTx   (a) subject to   lBBxuB,   (b) lxxux ,   (c) (1)
Second-order Cone Programming (SOCP)
minimize xn cTx   (a) subject to lBBxuB,   (b) lxxux ,   (c) xGiKmi,i=1,,r,   (d) (2)
linear Semidefinite Programming problems (SDP)
minimize xn cTx   (a) subject to   i=1 n xi Aik - A0k 0 ,  k=1,,mA ,   (b) lBBxuB ,   (c) lxxux ,   (d) (3)
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.

4 References

None.

5 Arguments

1: handle 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: nvar Integer Input
On entry: n, the current number of decision variables x in the model.
3: cvec(nvar) Real (Kind=nag_wp) array Input
On entry: the dense vector c of the objective function.
4: ifail Integer Input/Output
On entry: ifail must be set to 0, -1 or 1 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value -1 is recommended. When the value -1 or 1 is used it is essential to test the value of ifail on exit.
On exit: ifail=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6 Error Indicators and Warnings

If on entry ifail=0 or -1, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
ifail=1
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.
ifail=2
The problem cannot be modified right now, the solver is running.
ifail=4
On entry, nvar=value, expected value=value.
Constraint: nvar must match the current number of variables of the model in the handle.
ifail=-99
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.
ifail=-399
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.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

7 Accuracy

Not applicable.

8 Parallelism and Performance

e04ref is not threaded in any implementation.

9 Further Comments

9.1 Internal Changes

Internal changes have been made to this routine as follows:
For details of all known issues which have been reported for the NAG Library please refer to the Known Issues.

10 Example

See e04raf for links to all the examples in the suite.