NAG Library Function Document

nag_blgm_optget (g22znc)

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.


    1  Purpose
    7  Accuracy
    10  Example


nag_blgm_optget (g22znc) is a general option getting function for Chapter g22. It is used to query the value of optional parameters.


#include <nag.h>
#include <nagg22.h>
void  nag_blgm_optget (void *handle, const char *optstr, Integer *ivalue, double *rvalue, char *cvalue, Integer lcvalue, Nag_VariableType *optype, NagError *fail)


nag_blgm_optget (g22znc) can only be called on G22 handles. It can be used to query the current values of optional parameters and will return either an integer, real or character value dependent upon the type associated with the optional parameter being queried.
The optional parameter of interest is presented as a character string of the form ‘option
In cases where an optional parameter may have multiple instances in a particular G22 handle an instance identifier can be specified. This is presented using the form ‘option:instance identifier’. In such cases, if the instance identifier is omitted, the value of the first instance is returned. If the value of optional parameter is not the same for all instances and an instance identifier is omitted, a warning is raised.
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.




1:     handle void *Input
On entry: the G22 handle which must have been initialized by one of Chapter g22 initialization functions.
2:     optstr const char *Input
On entry: a string identifying the option and, where required, the instance identifier.
Returns a string description of the G22 handle supplied in handle. See Section 9 for more details.
Returns the value of option. If there are multiple instances of option, the value of the first is returned. If not all instances of option have the same value, fail.code= NW_INSTANCE is returned.
option:instance identifier
Returns the value of a single instance of option.
optstr is case insensitive and option and instance identifier may consist of one or more tokens separated by white space.
See the documentation of the individual Chapter g22 functions for details of valid values for option and instance identifier.
3:     ivalue Integer *Output
On exit: if optype=Nag_Integer, option identifies an integer-valued parameter and ivalue holds its current value.
4:     rvalue double *Output
On exit: if optype=Nag_Real, option identifies a real-valued parameter and rvalue holds its current value.
5:     cvalue char *Output
Note: the string returned in cvalue will never exceed minlcvalue,41 characters in length, including the terminating null character.
On exit: if optype=Nag_Character, option identifies a character-valued parameter and cvalue holds its current value.
6:     lcvalue IntegerInput
On entry: length of the string cvalue. At most lcvalue-1 non-null characters will be written into cvalue.
Constraint: lcvalue>1.
7:     optype Nag_VariableType *Output
On exit: indicates whether option is an integer, real or character-valued optional parameter and hence which of ivalue, rvalue or cvalue holds the current value.
option is an integer-valued optional parameter; its current value has been returned in ivalue.
option is a real-valued optional parameter; its current value has been returned in rvalue.
option is a character-valued optional parameter; its current value has been returned in cvalue.
8:     fail NagError *Input/Output
The NAG error argument (see Section 3.7 in How to Use the NAG Library and its Documentation).

Error Indicators and Warnings

Dynamic memory allocation failed.
See Section in How to Use the NAG Library and its Documentation for further information.
On entry, argument value had an illegal value.
handle has not been initialized or is corrupt.
handle is not a G22 handle.
Invalid instance identifier for option.
On entry, optstr=value.
Numeric instance identifier is out of range.
On entry, instance identifier=value
Constraint: valueinstance identifier and instance identifiervalue.
On entry, lcvalue=value.
Constraint: lcvalue>1.
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.
On entry, option is not readable: optstr=value.
On entry, option was not recognized: optstr=value.
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.
On entry, option cannot have an associated instance identifier. The supplied instance identifier was ignored.
option has multiple instances. Information from the first instance has been returned.
On entry, option is a character optional parameter, but cvalue is too short to hold the stored value. The minimum number of characters to store the value is returned in ivalue. The value returned in cvalue will be truncated.


Not applicable.

Parallelism and Performance

nag_blgm_optget (g22znc) is not threaded in any implementation.

Further Comments

When optstr is set to identify, the following return values are possible:
Model Formula
G22 handle was returned by nag_blgm_lm_formula (g22yac) in hform.
Data Matrix Description
G22 handle was returned by nag_blgm_lm_describe_data (g22ybc) in hddesc.
Design Matrix Description
G22 handle was returned by nag_blgm_lm_design_matrix (g22ycc) in hxdesc.


See the example for nag_blgm_lm_formula (g22yac).
© The Numerical Algorithms Group Ltd, Oxford, UK. 2017