# NAG Library Function Document

## nag_blgm_optset (g22zmc)

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

## 1Purpose

nag_blgm_optset (g22zmc) is a general option setting function for functions in Chapter g22. It can set a single optional parameter or reset all of them to their default.

## 2Specification

 #include #include
 void nag_blgm_optset (void *handle, const char *optstr, NagError *fail)

## 3Description

nag_blgm_optset (g22zmc) 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 function documents.

None.

## 5Arguments

1:    $\mathbf{handle}$void *Input
On entry: the G22 handle which must have been initialized by one of Chapter g22s initialization functions.
2:    $\mathbf{optstr}$const char *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 option to optval.
$\mathit{option}:\mathit{instance identifier}=\mathit{optval}$
Sets a single instance of option to optval.
$\mathit{option}=\mathbf{default}$
Resets (all instances) of option to their default value.
$\mathit{option}:\mathit{instance identifier}=\mathbf{default}$
Resets a single instance of option to its default value.
optstr is case insensitive and option, instance identifier and optval may consist of one or more tokens separated by white space.
See the documentation of the individual functions in the g22 Chapter Introduction for details of valid values for option, instance identifier and optval.
3:    $\mathbf{fail}$NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 2.3.1.2 in How to Use the NAG Library and its Documentation for further information.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_HANDLE
handle has not been initialized or is corrupt.
handle is not a G22 handle.
NE_INSTANCE
Invalid instance identifier for option.
On entry, ${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
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}}〉$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_INVALID_FORMAT
On entry, could not convert optval to an integer.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
On entry, could not convert optval to a real.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
On entry, the expected delimiter ‘$=$’ was not found.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
NE_INVALID_OPTION
On entry, option was not recognized.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
NE_INVALID_VALUE
On entry, optval is not a valid value for option.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 2.7.5 in How to Use the NAG Library and its Documentation for further information.
NE_WRITE_ERROR
On entry, option is read only.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.
NW_INSTANCE
On entry, option cannot have an associated instance identifier. The supplied instance identifier was ignored.
${\mathbf{optstr}}=〈\mathit{\text{value}}〉$.

Not applicable.

## 8Parallelism and Performance

nag_blgm_optset (g22zmc) is not threaded in any implementation.