# NAG CL Interfacee04tdc (handle_​set_​bound)

Settings help

CL Name Style:

## 1Purpose

e04tdc 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

 #include
 void e04tdc (void *handle, const char *comp, Integer idx, double bli, double bui, NagError *fail)
The function may be called by the names: e04tdc or nag_opt_handle_set_bound.

## 3Description

After the model has been fully or partially built by calling functions of the NAG optimization modelling suite, e04tdc 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 ${\mathbf{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 function and any later alterations to ${\mathbf{Infinite Bound Size}}$ will not affect these constraints.
See Section 4.1 in the E04 Chapter Introduction for more details about the NAG optimization modelling suite.

None.

## 5Arguments

1: $\mathbf{handle}$void * Input
On entry: the handle to the problem. It needs to be initialized (e.g., by e04rac) and must not be changed between calls to the NAG optimization modelling suite.
2: $\mathbf{comp}$const char * Input
On entry: the type of the component of the model whose bounds will be modified. comp is case insensitive.
${\mathbf{comp}}="X"$, $"VAR"$ or $"VARIABLE"$
Simple bounds of a decision variable ${x}_{i}$ (see e04rhc).
${\mathbf{comp}}="LC"$ or $"LINEAR CONSTRAINT"$
Linear constraint (see e04rjc).
${\mathbf{comp}}="NLC"$ or $"NONLINEAR CONSTRAINT"$
Nonlinear constraint (see e04rkc).
Constraint: ${\mathbf{comp}}="X"$, $"VAR"$, $"VARIABLE"$, $"LC"$, $"LINEAR CONSTRAINT"$, $"NLC"$ or $"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}$double Input
5: $\mathbf{bui}$double 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{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument $⟨\mathit{\text{value}}⟩$ had an illegal value.
NE_BOUND
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}$.
NE_HANDLE
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.
NE_INDICES
On entry, ${\mathbf{comp}}=⟨\mathit{\text{value}}⟩$, ${\mathbf{idx}}=⟨\mathit{\text{value}}⟩$ and $M=⟨\mathit{\text{value}}⟩$.
Constraint: $1\le {\mathbf{idx}}\le M$.
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.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
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.
NE_PHASE
The problem cannot be modified right now, the solver is running.
NE_STR_UNKNOWN
On entry, ${\mathbf{comp}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{comp}}="X"$, $"LC"$ or $"NLC"$.

Not applicable.