The routine may be called by the names e04rcf or nagf_opt_handle_set_property.
After the model has been fully or partially built by calling routines of the NAG optimization modelling suite,
e04rcf may be used to change properties of a subset of the variables in the model. The property is given by ptype which
refers to the integrality of the variables (continuous, integer or binary) or their linearity (if the variables are linear or generic, see Section 3.1). Both classes of properties can be set independently, however, only one property per class of properties can be chosen (i.e., a variable can be linear and integer but it cannot be continuous and binary at the same time). The properties can be changed multiple times and the last setting is the one used. e04ryf may be used to display the properties and further details of the problem.
See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.
3.1Linearity of the Variables
It is sometimes useful in Nonlinear Programming (NLP) problems to distinguish between linear and nonlinear variables and thus give the solvers an extra piece of information to utilize. A variable is said to be linear if its involvement in the whole optimization model is linear, i.e., it appears only in linear expressions. All other variables, if used at all, are nonlinear.
Let's assume that we have a problem with seven variables with two nonlinear constraints declared by e04rkf and defined as follows:
and with a linear objective function, linear constraints. Variables and are not used at all in the definition of and, therefore, they are clearly linear which is automatically detected by the solver. Although and appear in the nonlinear constraints , they are involved only in linear expressions and, therefore, are also linear. These two cannot be detected by the solver because the solver can only see the sparsity pattern defined by e04rkf and a Black Box call-back. In this case, it might be beneficial to set their property as linear using this routine. If no property is set, it is assumed that the variables are generic, meaning that they have no special property, and their linearity is auto detected based on the constraints they appear in.
Solvers which can exploit this property will describe it in their documentation.
1: – Type (c_ptr)Input
On entry: the handle to the problem. It needs to be initialized (e.g., by e04raf) and must not be changed between calls to the NAG optimization modelling suite.
2: – Character(*)Input
On entry: indicates the property to set for the specified variables. ptype is case insensitive.
Class of properties referring to integrality:
The variables will be continuous (the default property).
The variables become integer.
The variables become binary so they will be able to hold only values 0 or 1. Note that any existing box bounds are preserved. For example, if variable has its bounds set as and becomes binary, its box bounds are not removed and, therefore, the only allowed value will be .
Class of properties referring to linearity.
The variables have no special property. If they appear in at least one nonlinear expression (constraints or the objective), they will be assumed to be nonlinear (the default property).
The variables will be assumed to be linear in all nonlinear constraints and the objective they might appear.
, , , , , , , , or .
3: – IntegerInput
On entry: the number of variables in the index set.
4: – Integer arrayInput
On entry: the index set of variables whose properties will be modified. The elements may be supplied in any order.
, for , where is the number of decision variables in the problem.
5: – IntegerInput/Output
On entry: ifail must be set to , or to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of means that an error message is printed while a value of means that it is not.
If halting is not appropriate, the value or is recommended. If message printing is undesirable, then the value is recommended. Otherwise, the value is recommended. When the value or is used it is essential to test the value of ifail on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6Error Indicators and Warnings
If on entry or , explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
The supplied handle does not define a valid handle to the data structure for the NAG optimization modelling suite. It has not been properly initialized or it has been corrupted.
The problem cannot be modified right now, the solver is running.
On entry, . Constraint: .
On entry, . Constraint: , , , or .
On entry, , and . Constraint: .
An unexpected error has been triggered by this routine. Please
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.
8Parallelism and Performance
e04rcf is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
Please consult the X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the Users' Note for your implementation for any additional implementation-specific information.