nag_fit_opt_set (e02zkc) (PDF version)
e02 Chapter Contents
e02 Chapter Introduction
NAG Library Manual

NAG Library Function Document

nag_fit_opt_set (e02zkc)

+ Contents

    1  Purpose
    7  Accuracy
    10  Example

1  Purpose

nag_fit_opt_set (e02zkc) either initializes or resets the optional argument arrays or sets a single optional argument for supported problem solving functions in Chapter e02. Currently, only nag_2d_spline_fit_ts_scat (e02jdc) is supported.

2  Specification

#include <nag.h>
#include <nage02.h>
void  nag_fit_opt_set (const char *optstr, Integer iopts[], Integer liopts, double opts[], Integer lopts, NagError *fail)

3  Description

nag_fit_opt_set (e02zkc) has three purposes: to initialize optional argument arrays, to reset all optional arguments to their default values or to set a single optional argument to a user-supplied value.
Optional arguments and their values are, in general, presented as a character string, optstr, of the form ‘option =optval’; alphabetic characters can be supplied in either upper or lower case. Both option and optval may consist of one or more tokens separated by white space. The tokens that comprise optval will normally be either an integer, real or character value as defined in the description of the specific optional argument. In addition all optional arguments can take an optval DEFAULT which resets the optional argument to its default value.
It is imperative that optional argument arrays are initialized before any options are set, before the relevant problem solving function is called and before any options are queried using nag_fit_opt_get (e02zlc). To initialize the optional argument arrays iopts and opts for a specific problem solving function, the option Initialize is used with optval identifying the problem solving function to be called, via its short name. For example, to initialize optional argument arrays to be passed to nag_2d_spline_fit_ts_scat (e02jdc), nag_fit_opt_set (e02zkc) is called as follows:
nag_fit_opt_set("Initialize = e02jdc", iopts, liopts, opts, lopts, &fail);
Information relating to available option names and their corresponding valid values is given in Section 11 in nag_2d_spline_fit_ts_scat (e02jdc).

4  References

None.

5  Arguments

1:     optstrconst char *Input
On entry: a string identifying the option to be set.
Initialize=function name
Initialize the optional argument arrays iopts and opts for use with function function name, where function name is the short name of the problem solving function you wish to use.
Defaults
Resets all options to their default values.
option=optval
See Section 11 in nag_2d_spline_fit_ts_scat (e02jdc) for details of valid values for option and optval. The equals sign (=) delimiter must be used to separate the option from its optval.
The processing of optstr does not depend on its case. Each token in the option and optval component must be separated by at least one space.
2:     iopts[liopts]IntegerCommunication Array
On entry: optional argument array.
If optstr has the form Initialize=function name, the contents of iopts need not be set.
Otherwise, iopts MUST NOT have been altered since the last call to nag_fit_opt_set (e02zkc), nag_fit_opt_get (e02zlc) or the selected problem solving function or suite of functions.
On exit: dependent on the contents of optstr, either an initialized, reset or updated version of the optional argument array.
3:     lioptsIntegerInput
On entry: the length of the array iopts.
Constraint: unless otherwise stated in the documentation for a specific, supported, problem solving function, liopts100.
4:     opts[lopts]doubleCommunication Array
On entry: optional argument array.
If optstr has the form Initialize=function name, the contents of opts need not be set.
Otherwise, opts MUST NOT have been altered since the last call to nag_fit_opt_set (e02zkc), nag_fit_opt_get (e02zlc) or the selected problem solving function or suite of functions.
On exit: dependent on the contents of optstr, either an initialized, reset or updated version of the optional argument array.
5:     loptsIntegerInput
On entry: the length of the array opts.
Constraint: unless otherwise stated in the documentation for a specific, supported, problem solving function, lopts100.
6:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_INT
On entry, liopts=value.
Constraint: lioptsvalue.
On entry, lopts=value.
Constraint: loptsvalue.
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_FORMAT
On entry, could not convert the specified optval to an integer: optstr=value.
On entry, could not convert the specified optval to a real: optstr=value.
On entry, the expected delimiter ‘=’ was not found in optstr: optstr=value.
NE_INVALID_OPTION
On entry, either the option arrays have not been initialized or they have been corrupted.
On entry, the optional argument in optstr was not recognized: optstr=value.
NE_INVALID_VALUE
On entry, the optval supplied for the character optional argument is not valid.
optstr=value.
On entry, the optval supplied for the integer optional argument is not valid.
optstr=value.
On entry, the optval supplied for the real optional argument is not valid.
optstr=value.
NE_NOT_FUN_NAME
On entry, attempting to initialize the optional argument arrays but specified function name was not valid: name=value.

7  Accuracy

Not applicable.

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

See the example programs associated with the problem solving function you wish to use for a demonstration of how to use nag_fit_opt_set (e02zkc) to initialize option arrays and set options.

nag_fit_opt_set (e02zkc) (PDF version)
e02 Chapter Contents
e02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2014