NAG CL Interface
g22znc (optget)

Note: please be advised that this function 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.
Settings help

CL Name Style:

1 Purpose

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>
void  g22znc (void *handle, const char *optstr, Integer *ivalue, double *rvalue, char *cvalue, Integer lcvalue, Nag_VariableType *optype, NagError *fail)
The function may be called by the names: g22znc or nag_blgm_optget.

3 Description

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


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.
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 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 min(lcvalue,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 Integer Input
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 7 in the Introduction to the NAG Library CL Interface).

6 Error Indicators and Warnings

Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface 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 7.5 in the Introduction to the NAG Library CL Interface 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 8 in the Introduction to the NAG Library CL Interface 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.

7 Accuracy

Not applicable.

8 Parallelism and Performance

Background information to multithreading can be found in the Multithreading documentation.
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 g22yac in hform.
Data Matrix Description
G22 handle was returned by g22ybc in hddesc.
Design Matrix Description
G22 handle was returned by g22ycc in hxdesc.

10 Example

See the example for g22yac.