{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _lsq / common / step_size_to_bound

function

scipy.optimize._lsq.common:step_size_to_bound

source: /scipy/optimize/_lsq/common.py :372

Signature

def   step_size_to_bound ( x s lb ub )

Summary

Compute a min_step size required to reach a bound.

Extended Summary

The function computes a positive scalar t, such that x + s * t is on the bound.

Returns

step : float

Computed step. Non-negative value.

hits : ndarray of int with shape of x

Each element indicates whether a corresponding variable reaches the bound:

  • 0 - the bound was not hit.

  • -1 - the lower bound was hit.

  • 1 - the upper bound was hit.

Aliases

  • scipy.optimize._lsq.common.step_size_to_bound