naginterfaces.library.opt.handle_​set_​bound

naginterfaces.library.opt.handle_set_bound(handle, comp, idx, bli, bui)[source]

handle_set_bound 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.

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

https://www.nag.com/numeric/nl/nagdoc_29.3/flhtml/e04/e04tdf.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 whose bounds will be modified. is case insensitive.

, or

Simple bounds of a decision variable (see handle_set_simplebounds()).

or

Linear constraint (see handle_set_linconstr()).

or

Nonlinear constraint (see handle_set_nlnconstr()).

idxint

, the index of the component whose bounds will be changed.

blifloat

defines the new lower bound

buifloat

defines the new upper bound

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: , or .

(errno )

On entry, , and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

(errno )

On entry, and .

Constraint: .

Notes

After the model has been fully or partially built by calling functions of the NAG optimization modelling suite, handle_set_bound may be used to define a new lower bound, , and an upper bound , of a single constraint identified by the component type together with the appropriate component index given in . 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 (e.g., to fix a variable). If certain bounds are not present, the associated value or may be set to special values that are treated as or . See the description of the option ‘Infinite Bound Size’ which is common among all solvers in the suite. Its value is denoted as 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 ‘Infinite Bound Size’ will not affect these constraints.

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