# NAG FL Interfacee04tdf (handle_​set_​bound)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

e04tdf is a part of the NAG optimization modelling suite and sets or modifies the bounds of a single constraint, either the simple variable bounds, linear constraint or nonlinear constraint of the problem. It can be also used to fix any given variable.

## 2Specification

Fortran Interface
 Subroutine e04tdf ( comp, idx, bli, bui,
 Integer, Intent (In) :: idx Integer, Intent (Inout) :: ifail Real (Kind=nag_wp), Intent (In) :: bli, bui Character (*), Intent (In) :: comp Type (c_ptr), Intent (In) :: handle
#include <nag.h>
 void e04tdf_ (void **handle, const char *comp, const Integer *idx, const double *bli, const double *bui, Integer *ifail, const Charlen length_comp)
The routine may be called by the names e04tdf or nagf_opt_handle_set_bound.

## 3Description

After the model has been fully or partially built by calling routines of the NAG optimization modelling suite, e04tdf may be used to define a new lower bound, ${l}_{i}$, and an upper bound ${u}_{i}$, of a single constraint identified by the component type comp together with the appropriate component index $i$ given in idx. Note that both upper and lower bounds need to be specified. This form allows full generality in specifying various types of constraint. In particular, the model component may be set as an equality by setting ${l}_{i}={u}_{i}$ (e.g., to fix a variable). If certain bounds are not present, the associated value ${l}_{i}$ or ${u}_{i}$ may be set to special values that are treated as $-\infty$ or $+\infty$. See the description of the optional parameter Infinite Bound Size which is common among all solvers in the suite. Its value is denoted as $\mathit{bigbnd}$ further in this text. Note that the bounds are interpreted based on its value at the time of calling this routine and any later alterations to Infinite Bound Size will not affect these constraints.
See Section 3.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

None.

## 5Arguments

1: $\mathbf{handle}$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: $\mathbf{comp}$Character(*) Input
On entry: the type of the component of the model whose bounds will be modified. comp is case insensitive.
${\mathbf{comp}}=\text{'X'}$, $\text{'VAR'}$ or $\text{'VARIABLE'}$
Simple bounds of a decision variable ${x}_{i}$ (see e04rhf).
${\mathbf{comp}}=\text{'LC'}$ or $\text{'LINEAR CONSTRAINT'}$
Linear constraint (see e04rjf).
${\mathbf{comp}}=\text{'NLC'}$ or $\text{'NONLINEAR CONSTRAINT'}$
Nonlinear constraint (see e04rkf).
Constraint: ${\mathbf{comp}}=\text{'X'}$, $\text{'VAR'}$, $\text{'VARIABLE'}$, $\text{'LC'}$, $\text{'LINEAR CONSTRAINT'}$, $\text{'NLC'}$ or $\text{'NONLINEAR CONSTRAINT'}$.
3: $\mathbf{idx}$Integer Input
On entry: $i$, the index of the component comp whose bounds will be changed.
Constraint: $1\le {\mathbf{idx}}\le M$, where $M$ is the total number of the given components (e.g., decision variables) in the problem.
4: $\mathbf{bli}$Real (Kind=nag_wp) Input
5: $\mathbf{bui}$Real (Kind=nag_wp) Input
On entry: ${l}_{i}$, bli and ${u}_{i}$, bui define the new lower and upper bounds on the $i$th component identified by idx and comp, respectively. To create an equality, set ${\mathbf{bli}}={\mathbf{bui}}=\beta$, where $|\beta |<\mathit{bigbnd}$. To specify a nonexistent lower bound (i.e., ${l}_{i}=-\infty$), set ${\mathbf{bli}}\le -\mathit{bigbnd}$; to specify a nonexistent upper bound (i.e., ${u}_{i}=\infty$), set ${\mathbf{bui}}\ge \mathit{bigbnd}$.
Constraints:
• ${\mathbf{bli}}\le {\mathbf{bui}}$;
• ${\mathbf{bli}}<\mathit{bigbnd}$;
• ${\mathbf{bui}}>-\mathit{bigbnd}$.
6: $\mathbf{ifail}$Integer Input/Output
On entry: ifail must be set to $0$, $-1$ or $1$ to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of $0$ causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of $-1$ means that an error message is printed while a value of $1$ means that it is not.
If halting is not appropriate, the value $-1$ or $1$ is recommended. If message printing is undesirable, then the value $1$ is recommended. Otherwise, the value $-1$ is recommended. When the value $-\mathbf{1}$ or $\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit: ${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see Section 6).

## 6Error Indicators and Warnings

If on entry ${\mathbf{ifail}}=0$ or $-1$, explanatory error messages are output on the current error message unit (as defined by x04aaf).
Errors or warnings detected by the routine:
${\mathbf{ifail}}=1$
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.
${\mathbf{ifail}}=2$
The problem cannot be modified right now, the solver is running.
${\mathbf{ifail}}=6$
On entry, ${\mathbf{comp}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{comp}}=\text{'X'}$, $\text{'LC'}$ or $\text{'NLC'}$.
${\mathbf{ifail}}=8$
On entry, ${\mathbf{comp}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{idx}}=⟨\mathit{\text{value}}⟩$ and $M=⟨\mathit{\text{value}}⟩$.
Constraint: $1\le {\mathbf{idx}}\le M$.
${\mathbf{ifail}}=10$
On entry, ${\mathbf{bli}}=⟨\mathit{\text{value}}⟩$ and $\mathit{bigbnd}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{bli}}<\mathit{bigbnd}$.
On entry, ${\mathbf{bli}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{bui}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{bli}}\le {\mathbf{bui}}$.
On entry, ${\mathbf{bui}}=⟨\mathit{\text{value}}⟩$ and $\mathit{bigbnd}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{bui}}>-\mathit{bigbnd}$.
${\mathbf{ifail}}=-99$
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
${\mathbf{ifail}}=-399$
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.
${\mathbf{ifail}}=-999$
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface for further information.

Not applicable.