# NAG FL Interfacee04tbf (handle_​enable)

## ▸▿ Contents

Settings help

FL Name Style:

FL Specification Language:

## 1Purpose

e04tbf is a part of the NAG optimization modelling suite and allows you to enable various components of the existing model which were previously disabled by e04tcf.

## 2Specification

Fortran Interface
 Subroutine e04tbf ( comp, lidx, idx,
 Integer, Intent (In) :: lidx, idx(lidx) Integer, Intent (Inout) :: ifail Character (*), Intent (In) :: comp Type (c_ptr), Intent (In) :: handle
#include <nag.h>
 void e04tbf_ (void **handle, const char *comp, const Integer *lidx, const Integer idx[], Integer *ifail, const Charlen length_comp)
The routine may be called by the names e04tbf or nagf_opt_handle_enable.

## 3Description

e04tcf and e04tbf form a pair of routines which allow you to temporarily disable and then re-enable parts of a model. This is particularly useful when a sequence of similar problems needs to be solved, to identify how a particular constraint or variable affects the solution, or to switch between previously defined constraints which are somewhat related to each other.
e04tbf may be used to re-enable a component of the model previously disabled by a call to e04tcf. The components to be re-enabled are identified by supplying the same value of comp and idx as used in the call to e04tcf when they were disabled. All newly created components of the model are enabled. Calling this routine on enabled components is not an error but has no effect.
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 to be enabled. comp is case insensitive.
${\mathbf{comp}}=\text{'X'}$, $\text{'VAR'}$ or $\text{'VARIABLE'}$
Decision variables $x$.
${\mathbf{comp}}=\text{'LC'}$ or $\text{'LINEAR CONSTRAINT'}$
Linear constraints (see e04rjf).
${\mathbf{comp}}=\text{'QC'}$ or $\text{'QUADRATIC CONSTRAINT'}$
Quadratic constraints (see e04rsf and e04rtf).
${\mathbf{comp}}=\text{'NLC'}$ or $\text{'NONLINEAR CONSTRAINT'}$
Nonlinear constraints (see e04rkf).
${\mathbf{comp}}=\text{'CN'}$ or $\text{'CONE'}$
${\mathbf{comp}}=\text{'MI'}$ or $\text{'MATRIX INEQUALITY'}$
Matrix inequality constraints (see e04rnf).
${\mathbf{comp}}=\text{'NLS'}$ or $\text{'RESIDUAL'}$
Nonlinear residuals ${r}_{j}\left(x\right)$ in the nonlinear least squares objective function (see e04rmf).
Constraint: ${\mathbf{comp}}=\text{'X'}$, $\text{'VAR'}$, $\text{'VARIABLE'}$, $\text{'LC'}$, $\text{'LINEAR CONSTRAINT'}$, $\text{'QC'}$, $\text{'QUADRATIC CONSTRAINT'}$, $\text{'NLC'}$, $\text{'NONLINEAR CONSTRAINT'}$, $\text{'CN'}$, $\text{'CONE'}$, $\text{'MI'}$, $\text{'MATRIX INEQUALITY'}$, $\text{'NLS'}$ or $\text{'RESIDUAL'}$.
3: $\mathbf{lidx}$Integer Input
On entry: the number of elements in the index set.
Constraint: ${\mathbf{lidx}}\ge 1$.
4: $\mathbf{idx}\left({\mathbf{lidx}}\right)$Integer array Input
On entry: the index set of components comp to be enabled. The elements may be supplied in any order.
Constraint: $1\le {\mathbf{idx}}\left(\mathit{i}\right)\le M$, for $\mathit{i}=1,2,\dots ,{\mathbf{lidx}}$, where $M$ is the total number of the given components (e.g., decision variables) in the model.
5: $\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}}=5$
On entry, ${\mathbf{lidx}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{lidx}}\ge 1$.
${\mathbf{ifail}}=6$
On entry, ${\mathbf{comp}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{comp}}=\text{'X'}$, $\text{'LC'}$, $\text{'QC'}$, $\text{'NLC'}$, $\text{'CN'}$, $\text{'MI'}$ or $\text{'NLS'}$.
${\mathbf{ifail}}=8$
On entry, ${\mathbf{comp}}=⟨\mathit{\text{value}}⟩$, $i=⟨\mathit{\text{value}}⟩$, ${\mathbf{idx}}\left(i\right)=⟨\mathit{\text{value}}⟩$ and $M=⟨\mathit{\text{value}}⟩$.
Constraint: $1\le {\mathbf{idx}}\left(i\right)\le M$.
${\mathbf{ifail}}=9$
On entry, ${\mathbf{comp}}=⟨\mathit{\text{value}}⟩$ and ${\mathbf{idx}}\left(i\right)=⟨\mathit{\text{value}}⟩$.
This component has been deleted.
This error can only occur when trying to enable a cone constraint that has been deleted by setting its size to $0$ with e04rbf.
${\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.