bundles / scipy latest / scipy / optimize / _spectral / _wrap_func
function
scipy.optimize._spectral:_wrap_func
Signature
def _wrap_func ( func , x0 , fmerit , nfev_list , maxfev , args = () ) Summary
Wrap a function and an initial value so that (i) complex values are wrapped to reals, and (ii) value for a merit function fmerit(x, f) is computed at the same time, (iii) iteration count is maintained and an exception is raised if it is exceeded.
Parameters
func: callableFunction to wrap
x0: ndarrayInitial value
fmerit: callableMerit function fmerit(f) for computing merit value from residual.
nfev_list: listList to store number of evaluations in. Should be [0] in the beginning.
maxfev: intMaximum number of evaluations before _NoConvergence is raised.
args: tupleExtra arguments to func
Returns
wrap_func: callableWrapped function, to be called as
F, fp = wrap_func(x0)x0_wrap: ndarray of floatWrapped initial value; raveled to 1-D and complex values mapped to reals.
x0_shape: tupleShape of the initial value array
f: floatMerit function at F
F: ndarray of floatResidual at x0_wrap
is_complex: boolWhether complex values were mapped to reals
Aliases
-
scipy.optimize._spectral._wrap_func