NAG Library Routine Document

e04ref (handle_set_linobj)


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


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 <nagmk26.h>
void  e04ref_ (void **handle, const Integer *nvar, const double cvec[], Integer *ifail)


After the initialization routine 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 unless the objective function has already been defined by another routine in the suite. This will typically be used for 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) (1)
or SDP with bilinear matrix inequalities (BMI-SDP) where the objective function has only linear terms. It is recommended to use e04rff if the vector c is sparse. See e04raf for more details.




1:     handle – Type (c_ptr)Input
On entry: the handle to the problem. It needs to be initialized by e04raf and must not be changed.
2:     nvar – IntegerInput
On entry: n, the number of decision variables x in the problem. It must be unchanged from the value set during the initialization of the handle by e04raf.
3:     cvecnvar – Real (Kind=nag_wp) arrayInput
On entry: the dense vector c of the objective function.
4:     ifail – IntegerInput/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1 or 1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, the recommended value is -1. 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).

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:
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been initialized by e04raf or it has been corrupted.
The problem cannot be modified in this phase any more, the solver has already been called.
The objective function has already been defined.
On entry, nvar=value, expected value=value.
Constraint: nvar must match the value given during initialization of handle.
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.


Not applicable.

Parallelism and Performance

e04ref is not threaded in any implementation.

Further Comments



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