NAG C 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

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

2
Specification

#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)

3
Description

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.

4
References

None.

5
Arguments

1:     handle void *Input
On entry: the G22 handle which must have been initialized by one of Chapter g22's initialization functions.
2:     optstr const char *Input
On entry: a string identifying the option and, where required, the instance identifier.
identify
Returns a string description of the G22 handle supplied in handle. See Section 9 for more details.
option
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 optional parameter and ivalue holds its current value.
4:     rvalue double *Output
On exit: if optype=Nag_Real, option identifies a real-valued optional 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 optional 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.
optype=Nag_Integer
option is an integer-valued optional parameter; its current value has been returned in ivalue.
optype=Nag_Real
option is a real-valued optional parameter; its current value has been returned in rvalue.
optype=Nag_Character
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).

6
Error 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.
NE_BAD_PARAM
On entry, argument 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, optstr=value.
Numeric instance identifier is out of range.
On entry, instance identifier=value.
Constraint: valueinstance identifier and instance identifiervalue.
NE_INT
On entry, lcvalue=value.
Constraint: 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.
See Section 2.7.6 in How to Use the NAG Library and its Documentation for further information.
NE_INVALID_OPTION
On entry, option is not readable: optstr=value.
On entry, option was not recognized: optstr=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.
NW_INSTANCE
On entry, option cannot have an associated instance identifier. The supplied instance identifier was ignored.
optstr=value.
option has multiple instances. Information from the first instance has been returned.
NW_TRUNCATED
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.

7
Accuracy

Not applicable.

8
Parallelism and Performance

nag_blgm_optget (g22znc) is not threaded in any implementation.

9
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.

10
Example

See the example for nag_blgm_lm_formula (g22yac).