NAG FL Interface
e04raf (handle_​init)

1 Purpose

e04raf initializes a data structure for the NAG optimization modelling suite for problems such as, linear programming (LP), quadratic programming (QP), nonlinear programming (NLP), least squares (LSQ) problems, second-order cone programming (SOCP), linear semidefinite programming (SDP) and semidefinite programming with bilinear matrix inequalities (BMI-SDP).

2 Specification

Fortran Interface
Subroutine e04raf ( handle, nvar, ifail)
Integer, Intent (In) :: nvar
Integer, Intent (Inout) :: ifail
Type (c_ptr), Intent (Out) :: handle
C Header Interface
#include <nag.h>
void  e04raf_ (void **handle, const Integer *nvar, Integer *ifail)
The routine may be called by the names e04raf or nagf_opt_handle_init.

3 Description

e04raf initializes an empty problem with n decision variables, x, and returns a handle to the data structure. This handle may then be passed to some of the routines e04rbf, e04ref, e04rff, e04rgf, e04rhf, e04rjf, e04rkf, e04rlf, e04rmf, e04rnf and e04rpf to formulate the problem (define the objective function and constraints) and to a compatible solver, e04fff, e04fgf, e04jdf, e04jef, e04kff, e04mtf, e04ptf, e04stf or e04svf, to solve it. The handle must not be changed between calls. When the handle is no longer needed, e04rzf must be called to destroy it and deallocate all the allocated memory and data within. See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

4 References


5 Arguments

1: handle Type (c_ptr) Output
Note: handle does not need to be set on input.
On exit: holds a handle to the internal data structure where an empty problem with nvar variables is defined.
2: nvar Integer Input
On entry: n, the number of decision variables in the problem.
Constraint: nvar>0.
3: 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 0 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:
On entry, nvar=value.
Constraint: nvar>0.
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.
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.

7 Accuracy

Not applicable.

8 Parallelism and Performance

e04raf is not threaded in any implementation.

9 Further Comments


10 Example

See examples associated with other routines in the suite, such as: