NAG FL Interface
e04zpf (handle_​opt_​set_​file)

Settings help

FL Name Style:


FL Specification Language:


1 Purpose

e04zpf is an option setting routine for all solvers from the NAG optimization modelling suite. It can set one or more optional parameters from an external file.

2 Specification

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

3 Description

e04zpf may be used to supply values for optional parameters to the solver from an external file. It can only be called on handles which have been correctly initialized (e.g., by e04raf) and before the call to the solver. e04zpf looks in the file for a specific section containing the optional parameters. The section must start with a line Begin and must finish with a line End. Anything outside the section is ignored. If there is more than one section like this, only the first one is processed. Any line within the section is either blank or a comment which is ignored or defines a single optional parameter as if it had been set by e04zmf. The implied data type (character, integer or real) of each value to be set must match that expected by the corresponding optional parameter. It is only necessary to supply values for those arguments whose values are to be different from their default values. A comment begins with an asterisk (*) and all subsequent characters to the end of the line are ignored. Comments can also be placed after the optional parameter. The file is case insensitive.
Note that the optional parameters printed by the solver or by e04ryf are in the compatible format. An example of a valid options file is:
Begin * Example options file
   Print Level = 3 
   Monitoring Level = 5 * output all details
   Monitoring File = 42 * to this file
End
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: infile Integer Input
On entry: the file identifier associated with the argument data file. Note:  that the file needs to be opened in read mode by x04acf with mode=0.
Constraint: infile0.
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:
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 options cannot be modified while solver is running.
ifail=3
On entry, infile=value.
Constraint: infile0.
ifail=4
BEGIN found, but end-of-file found before END. All optional parameters that were set from the file before this error was encountered will remain set on exit.
End-of-file or read error detected before BEGIN was found.
ifail=11
The option provided on line value was not recognized.
ifail=12
The expected delimiter ‘=’ was not found on line value.
ifail=13
The optval provided on line value could not be converted to the expected numerical type.
ifail=15
The optval provided on line value for the integer optional parameter is out of bounds.
ifail=16
The optval provided on line value for the real optional parameter is out of bounds.
ifail=17
The optval provided on line value for the character optional parameter is not valid.
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

e04zpf is not threaded in any implementation.

9 Further Comments

None.

10 Example

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