This is a pre-release version (latest).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy latest / scipy / optimize / _lsq / common / step_size_to_bound

function

scipy.optimize._lsq.common:step_size_to_bound

source: build-install/usr/lib/python3.14/site-packages/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