{ } Raw JSON

bundles / scipy latest / scipy / optimize / _optimize / _line_for_search

function

scipy.optimize._optimize:_line_for_search

source: /scipy/optimize/_optimize.py :3151

Signature

def   _line_for_search ( x0 alpha lower_bound upper_bound )

Summary

Given a parameter vector x0 with length n and a direction vector alpha with length n, and lower and upper bounds on each of the n parameters, what are the bounds on a scalar l such that lower_bound <= x0 + alpha * l <= upper_bound.

Parameters

x0 : np.array.

The vector representing the current location. Note np.shape(x0) == (n,).

alpha : np.array.

The vector representing the direction. Note np.shape(alpha) == (n,).

lower_bound : np.array.

The lower bounds for each parameter in x0. If the i``th parameter in ``x0 is unbounded below, then lower_bound[i] should be -np.inf. Note np.shape(lower_bound) == (n,).

upper_bound : np.array.

The upper bounds for each parameter in x0. If the i``th parameter in ``x0 is unbounded above, then upper_bound[i] should be np.inf. Note np.shape(upper_bound) == (n,).

Returns

res : tuple ``(lmin, lmax)``

Aliases

  • scipy.optimize._optimize._line_for_search