# NAG FL Interfaceg22zmf (optset)

Note: please be advised that this routine is classed as ‘experimental’ and its interface may be developed further in the future. Please see Section 4 in How to Use the NAG Library for further information.

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

g22zmf is a general option setting routine for routines in Chapter G22. It can set a single optional parameter or reset all of them to their default.

## 2Specification

Fortran Interface
 Subroutine g22zmf (
 Integer, Intent (Inout) :: ifail Character (*), Intent (In) :: optstr Type (c_ptr), Intent (In) :: handle
#include <nag.h>
 void g22zmf_ (void **handle, const char *optstr, Integer *ifail, const Charlen length_optstr)
The routine may be called by the names g22zmf or nagf_blgm_optset.

## 3Description

g22zmf can only be called on G22 handles. Its purpose is to reset all optional parameters to their default values or set a single optional parameter to a user-supplied value.
Optional parameters and their values are, in general, presented as a character string of the form ‘$\mathit{option}=\mathit{optval}$’; alphabetic characters can be supplied in either upper or lower case. $\mathit{optval}$ will normally be either an integer, real or character value as defined in the description of the specific optional parameter. In addition, all optional parameters can take an $\mathit{optval}$ DEFAULT which resets the optional parameter to its default value.
In cases where an optional parameter may have multiple instances an instance identifier can be specified. This is presented using the form ‘$\mathit{option}:\mathit{instance identifier}=\mathit{optval}$’. In such cases, if the instance identifier is omitted, the value of all instances are changed.
Information relating to available option names, their corresponding valid values, whether the use of an instance identifier may be appropriate and what form it can take is given in the individual routine documents.

None.

## 5Arguments

1: $\mathbf{handle}$Type (c_ptr) Input
On entry: the G22 handle which must have been initialized by one of Chapter G22's initialization routines.
2: $\mathbf{optstr}$Character(*) Input
On entry: a string identifying the option, its value and, where required, the instance identifier.
$\mathbf{Defaults}$
Resets all options to their default values.
$\mathit{option}=\mathit{optval}$
Sets (all instances) of $\mathit{option}$ to $\mathit{optval}$.
$\mathit{option}:\mathit{instance identifier}=\mathit{optval}$
Sets a single instance of $\mathit{option}$ to $\mathit{optval}$.
$\mathit{option}=\mathbf{default}$
Resets (all instances) of $\mathit{option}$ to their default value.
$\mathit{option}:\mathit{instance identifier}=\mathbf{default}$
Resets a single instance of $\mathit{option}$ to its default value.
optstr is case insensitive and $\mathit{option}$, instance identifier and $\mathit{optval}$ may consist of one or more tokens separated by white space.
See the documentation of the individual routines in the G22 Chapter Introduction for details of valid values for $\mathit{option}$, instance identifier and $\mathit{optval}$.
3: $\mathbf{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 $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6Error Indicators and Warnings

If on entry ${\mathbf{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:
${\mathbf{ifail}}=11$
handle has not been initialized or is corrupt.
${\mathbf{ifail}}=12$
handle is not a G22 handle.
${\mathbf{ifail}}=21$
On entry, $\mathit{option}$ was not recognized.
${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=22$
On entry, the expected delimiter ‘$=$’ was not found.
${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=23$
On entry, $\mathit{option}$ is read only.
${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=24$
On entry, could not convert $\mathit{optval}$ to an integer.
${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=25$
On entry, could not convert $\mathit{optval}$ to a real.
${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=26$
On entry, $\mathit{optval}$ is not a valid value for $\mathit{option}$.
${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=121$
Invalid instance identifier for $\mathit{option}$.
On entry, ${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=122$
Numeric instance identifier is out of range.
On entry, $\mathit{instance identifier}=⟨\mathit{\text{value}}⟩$.
Constraint: $⟨\mathit{\text{value}}⟩\le \mathit{instance identifier}$ and $\mathit{instance identifier}\le ⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=123$
On entry, $\mathit{option}$ cannot have an associated instance identifier. The supplied instance identifier was ignored.
${\mathbf{optstr}}=⟨\mathit{\text{value}}⟩$.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{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.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

Not applicable.

## 8Parallelism and Performance

g22zmf is not threaded in any implementation.

None.

## 10Example

See the example for g22yaf.