# naginterfaces.library.opt.handle_​enable¶

naginterfaces.library.opt.handle_enable(handle, comp, idx)[source]

handle_enable 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 handle_disable().

For full information please refer to the NAG Library document for e04tb

https://www.nag.com/numeric/nl/nagdoc_28.6/flhtml/e04/e04tbf.html

Parameters
handleHandle

The handle to the problem. It needs to be initialized (e.g., by handle_init()) and must not be changed between calls to the NAG optimization modelling suite.

compstr

The type of the component of the model to be enabled. is case insensitive.

, or

Decision variables .

or

Linear constraints (see handle_set_linconstr()).

or

or

Nonlinear constraints (see handle_set_nlnconstr()).

or

Quadratic or rotated quadratic cones (see handle_set_group()).

or

Matrix inequality constraints (see handle_set_linmatineq()).

or

Nonlinear residuals in the nonlinear least squares objective function (see handle_set_nlnls()).

idxint, array-like, shape

The index set of components to be enabled. The elements may be supplied in any order.

Raises
NagValueError
(errno )

has not been initialized.

(errno )

does not belong to the NAG optimization modelling suite, has not been initialized properly or is corrupted.

(errno )

has not been initialized properly or is corrupted.

(errno )

The problem cannot be modified right now, the solver is running.

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: , , , , , or .

(errno )

On entry, , , and .

Constraint: .

(errno )

On entry, and .

This component has been deleted.

Notes

handle_disable() and handle_enable form a pair of functions 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.

handle_enable may be used to re-enable a component of the model previously disabled by a call to handle_disable(). The components to be re-enabled are identified by supplying the same value of and as used in the call to handle_disable() when they were disabled. All newly created components of the model are enabled. Calling this function on enabled components is not an error but has no effect.

See the E04 Introduction for more details about the NAG optimization modelling suite.