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

bundles / scipy latest / scipy / optimize / _dcsrch / DCSRCH / _iterate

function

scipy.optimize._dcsrch:DCSRCH._iterate

source: build-install/usr/lib/python3.14/site-packages/scipy/optimize/_dcsrch.py:269

Signature

def _iterate(self, stp, f, g, task)

Parameters

stp : float

The current estimate of a satisfactory step. On initial entry, a positive initial estimate must be provided.

f : float

On first call f is the value of the function at 0. On subsequent entries f should be the value of the function at stp.

g : float

On initial entry g is the derivative of the function at 0. On subsequent entries g is the derivative of the function at stp.

task : bytes

On initial entry task must be set to 'START'.

On exit with convergence, a warning or an error, the

variable task contains additional information.

Returns

: stp, f, g, task: tuple

stp

the current estimate of a satisfactory step if task = 'FG'. If task = 'CONV' then stp satisfies the sufficient decrease and curvature condition.

f

the value of the function at stp.

g

the derivative of the function at stp.

task

On exit task indicates the required action:

If task(1:2) == b'FG' then evaluate the function and derivative at stp and call dcsrch again.

If task(1:4) == b'CONV' then the search is successful.

If task(1:4) == b'WARN' then the subroutine is not able to satisfy the convergence conditions. The exit value of stp contains the best point found during the search.

If task(1:5) == b'ERROR' then there is an error in the input arguments.

Aliases

  • scipy.optimize._dcsrch.DCSRCH._iterate