g02 Chapter Contents
g02 Chapter Introduction
NAG C Library Manual

# NAG Library Function Documentnag_g02_opt_get (g02zlc)

## 1  Purpose

nag_g02_opt_get (g02zlc) is used to query the value of optional arguments available to supported problem solving functions in Chapter g02. Currently, only nag_regsn_quant_linear (g02qgc) is supported.

## 2  Specification

 #include #include
 void nag_g02_opt_get (const char *optstr, Integer *ivalue, double *rvalue, char *cvalue, Integer lcvalue, Nag_VariableType *optype, const Integer iopts[], const double opts[], NagError *fail)

## 3  Description

nag_g02_opt_get (g02zlc) is used to query the current values of options. It is necessary to initalize optional argument arrays using nag_g02_opt_set (g02zkc) before any options are queried.
nag_g02_opt_get (g02zlc) will normally return either an integer, real or character value dependent upon the type associated with the optional argument being queried. Whether the option queried is of integer, real or character type is indicated by the returned value of optype.
Information on optional argument names and whether these options are real, integer or character can be found in Section 11 in nag_regsn_quant_linear (g02qgc).

None.

## 5  Arguments

1:     optstrconst char *Input
On entry: a string identifying the option whose current value is required. See Section 11 in nag_regsn_quant_linear (g02qgc) for information on valid options. In addition, the following is a valid option:
$\mathbf{Identify}$
nag_g02_opt_get (g02zlc) returns in cvalue the function name supplied to nag_g02_opt_set (g02zkc) when the optional argument arrays iopts and opts were initialized.
2:     ivalueInteger *Output
On exit: if the optional argument supplied in optstr is an integer valued argument, ivalue will hold its current value.
3:     rvaluedouble *Output
On exit: if the optional argument supplied in optstr is a real valued argument, rvalue will hold its current value.
4:     cvaluechar *Output
Note: the string returned in cvalue will never exceed $\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{lcvalue}},40\right)$ characters in length.
On exit: if the optional argument supplied in optstr is a character valued argument, cvalue will hold its current value, unless Identify is specified, see optstr.
5:     lcvalueIntegerInput
On entry: length of the string cvalue. At most $\mathrm{min}\phantom{\rule{0.125em}{0ex}}\left({\mathbf{lcvalue}},40\right)$ non-null characters will be written into cvalue.
Constraint: ${\mathbf{lcvalue}}>1$.
6:     optypeNag_VariableType*Output
On exit: indicates whether the optional argument supplied in optstr is an integer, real or character valued argument and hence which of ivalue, rvalue or cvalue holds the current value.
${\mathbf{optype}}=\mathrm{Nag_Integer}$
optstr is an integer valued optional argument, its current value has been returned in ivalue.
${\mathbf{optype}}=\mathrm{Nag_Real}$
optstr is a real valued optional argument, its current value has been returned in rvalue.
${\mathbf{optype}}=\mathrm{Nag_Character}$
optstr is a character valued optional argument, its current value has been returned in cvalue.
7:     iopts[$\mathit{dim}$]const IntegerCommunication Array
Note: the dimension, dim, of the array iopts must be at least ${\mathbf{liopts}}$ (see nag_g02_opt_set (g02zkc)).
On entry: the contents of iopts MUST NOT have been altered between calls to nag_g02_opt_set (g02zkc), nag_g02_opt_get (g02zlc) and the selected problem solving function.
8:     opts[$\mathit{dim}$]const doubleCommunication Array
Note: the dimension, dim, of the array iopts must be at least ${\mathbf{lopts}}$ (see nag_g02_opt_set (g02zkc)).
On entry: the contents of opts MUST NOT have been altered between calls to nag_g02_opt_set (g02zkc), nag_g02_opt_get (g02zlc) and the selected problem solving function.
9:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INT
On entry, ${\mathbf{lcvalue}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{lcvalue}}>1$.
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.
NE_INVALID_OPTION
On entry, either the option arrays have not been initialized or they have been corrupted.
On entry, the option in optstr was not recognized: ${\mathbf{optstr}}="〈\mathit{\text{value}}〉"$.
NW_TRUNCATED
On entry, optstr indicates a character optional argument, but cvalue is too short to hold the stored value. The returned value will be truncated.

Not applicable.