NAG CPP Interface
nagcpp::opt::handle_opt_set (e04zm)
1
Purpose
handle_opt_set is an option setting function for all solvers from the NAG optimization modelling suite. It can set a single optional parameter or reset all of them to their default.
2
Specification
#include "e04/nagcpp_e04zm.hpp"
#include "e04/nagcpp_class_CommE04RA.hpp"
template <typename COMM>
void function handle_opt_set(COMM &comm, const string optstr, OptionalE04ZM opt)
template <typename COMM>
void function handle_opt_set(COMM &comm, const string optstr)
3
Description
handle_opt_set can only be called on handles which have been correctly initialized (e.g., by
handle_init) and not during the call to the solver. It has two purposes: to reset all optional parameters to their default values; or to set a single optional parameter to a user-supplied value.
Optional parameters and their values are, in general, presented as a character string,
optstr, of the form ‘
’; alphabetic characters can be supplied in either upper or lower case. Both
and
may consist of one or more tokens separated by white space. The tokens that comprise
will normally be either an integer, real or character value as defined in the description of the specific optional parameter. In addition all optional parameters can take an
DEFAULT which resets the optional parameter to its default value.
Information relating to available option names and their corresponding valid values is given in the documentation of the particular solver. See also
Section 3.1 in the
E04 Chapter Introduction for more details about the
NAG optimization modelling suite.
4
References
None.
5
Arguments
-
1:
– CommE04RA
Input/Output
-
Communication structure.
An object of either the derived class
CommE04RA or its base class
NoneCopyableComm can be supplied.
It is recommended that the derived class is used. If the base class is supplied it must
first be initialized via a call to
opt::handle_init (e04ra).
-
2:
– string
Input
-
On entry: a string identifying the optional parameter and its value to be set.
- Resets all options to their default values.
- See the documentation of the particular solver for details of valid values for and . The equals sign () delimiter must be used to separate the from its value.
- Resets the given optional parameter back to its default value.
optstr is case insensitive. Each token in the
and
component must be separated by at least one space.
-
3:
– OptionalE04ZM
Input/Output
-
Optional parameter container, derived from
Optional.
6
Exceptions and Warnings
Errors or warnings detected by the function:
All errors and warnings have an associated numeric error code field,
errorid, stored either as a member of the thrown exception object (see
errorid), or as a member of
opt.
ifail, depending on how errors
and warnings are being handled (see
Error Handling for more details).
- Raises: ErrorException
-
- comm::handle has not been initialized.
- comm::handle does not belong to the NAG optimization modelling suite,
has not been initialized properly or is corrupted.
- comm::handle has not been initialized properly or is corrupted.
- The options cannot be modified while solver is running.
- On entry, the supplied in optstr was not recognized:
.
- On entry, the expected delimiter ‘’ was not found in optstr:
.
- On entry, could not convert the specified to an integer:
.
- On entry, could not convert the specified to a real:
.
- On entry, the supplied for the integer option is not
valid.
,
.
Constraint: .
- On entry, the supplied for the integer option is not
valid.
,
.
Constraint: .
- On entry, the supplied for the integer option is not
valid.
,
.
Constraint: .
- On entry, the supplied for the integer option is not
valid.
,
.
Constraint: .
- On entry, the supplied for the real option is not valid.
,
.
Constraint: .
- On entry, the supplied for the real option is not valid.
,
.
Constraint: .
- On entry, the supplied for the real option is not valid.
,
.
Constraint: .
- On entry, the supplied for the real option is not valid.
,
.
Constraint: .
- On entry, the supplied for the character option is not
valid.
,
.
- On entry, the communication class has not been initialized correctly.
- An exception was thrown during IO (writing).
- An unexpected error has been triggered by this routine.
- Your licence key may have expired or may not have been installed correctly.
- Dynamic memory allocation failed.
7
Accuracy
Not applicable.
8
Parallelism and Performance
None.
10
Example
Examples for the NAG CPP Interface are not currently available.