NAG Library Routine Document

e04zpf  (handle_opt_set_file)

 Contents

    1  Purpose
    7  Accuracy
    10  Example

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 nagmk26.h
void  e04zpf_ ( void **handle, const Integer *infile, Integer *ifail)

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 initialized 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

4
References

None.

5
Arguments

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:     infile – IntegerInput
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 – 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, if you are not familiar with this argument, the recommended value is 0. 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 initialized by e04raf or it has been corrupted.
ifail=2
The options cannot be modified in this phase.
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 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
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.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation 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 Section 10 in e04raf for links to all the examples in the suite.
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017