scijit.optimize.RootResults¶
- class scijit.optimize.RootResults(root, iterations, function_calls, converged, flag, method)¶
Bases:
OptimizeResult,RootResultsResult of a scalar root find.
Returned by bisect, brentq, brenth, ridder, toms748, newton and root_scalar.
- Attributes:
- rootfloat
The estimated root.
- iterationsint
Iterations taken.
- function_callsint
Evaluations of f.
- convergedbool
Truewhen the routine met its tolerance.- flagstr
'converged'or'convergence error'. See Notes.- methodstr
The routine that ran, by name.
Notes
The flag set is two strings,
'converged'and'convergence error'.scipy.optimize.RootResults’sflag_mapalso holds'sign error','value error'and'No error', and itsroot_scalarputs an exception message there on the NaN path.The CONTAINER is a namedtuple, where
scipy.optimize.RootResultssubclassesOptimizeResultand so is adict. Attribute access reads the same on both. Three things do not, all measured on the same root:isinstance(res, scipy.optimize.RootResults) False res[0] the root here, KeyError: 0 in scipy tuple(res) the six values here, the six field NAMES in scipy, which is a dict iterating its keys
The third is silent, since both sides return a 6-tuple.
The CONSTRUCTOR differs too. This takes the six attributes above;
scipy.optimize.RootResultstakes five,(root, iterations, function_calls, flag, method), with flag an integer code, and derives converged and the flag string from it.- __init__(*args, **kwargs)¶
Methods
__init__(*args, **kwargs)count(value, /)Return number of occurrences of value.
get(key[, default])index(value[, start, stop])Return first index of value.
items()keys()values()Attributes
convergedAlias for field number 3
flagAlias for field number 4
function_callsAlias for field number 2
iterationsAlias for field number 1
methodAlias for field number 5
rootAlias for field number 0