|
31 | 31 | import inspect
|
32 | 32 | from numpy import eye, argmin, zeros, shape, asarray, sqrt
|
33 | 33 | import numpy as np
|
| 34 | +from scipy._lib._util import OptimizeResult |
34 | 35 | from scipy.linalg import cholesky, issymmetric, LinAlgError
|
35 | 36 | from scipy.sparse.linalg import LinearOperator
|
36 | 37 | from ._linesearch import (line_search_wolfe1, line_search_wolfe2,
|
37 | 38 | line_search_wolfe2 as line_search,
|
38 | 39 | LineSearchWarning)
|
39 | 40 | from ._numdiff import approx_derivative
|
40 | 41 | from scipy._lib._util import getfullargspec_no_self as _getfullargspec
|
41 |
| -from scipy._lib._util import (MapWrapper, check_random_state, _RichResult, |
42 |
| - _call_callback_maybe_halt, _transition_to_rng) |
| 42 | +from scipy._lib._util import (MapWrapper, check_random_state, _call_callback_maybe_halt, _transition_to_rng) |
43 | 43 | from scipy.optimize._differentiable_functions import ScalarFunction, FD_METHODS
|
44 | 44 | from scipy._lib._array_api import array_namespace, xp_capabilities
|
45 | 45 | from scipy._lib import array_api_extra as xpx
|
@@ -109,51 +109,6 @@ def wrapped_callback(res):
|
109 | 109 | return wrapped_callback
|
110 | 110 |
|
111 | 111 |
|
112 |
| -class OptimizeResult(_RichResult): |
113 |
| - """ |
114 |
| - Represents the optimization result. |
115 |
| -
|
116 |
| - Attributes |
117 |
| - ---------- |
118 |
| - x : ndarray |
119 |
| - The solution of the optimization. |
120 |
| - success : bool |
121 |
| - Whether or not the optimizer exited successfully. |
122 |
| - status : int |
123 |
| - Termination status of the optimizer. Its value depends on the |
124 |
| - underlying solver. Refer to `message` for details. |
125 |
| - message : str |
126 |
| - Description of the cause of the termination. |
127 |
| - fun : float |
128 |
| - Value of objective function at `x`. |
129 |
| - jac, hess : ndarray |
130 |
| - Values of objective function's Jacobian and its Hessian at `x` (if |
131 |
| - available). The Hessian may be an approximation, see the documentation |
132 |
| - of the function in question. |
133 |
| - hess_inv : object |
134 |
| - Inverse of the objective function's Hessian; may be an approximation. |
135 |
| - Not available for all solvers. The type of this attribute may be |
136 |
| - either np.ndarray or scipy.sparse.linalg.LinearOperator. |
137 |
| - nfev, njev, nhev : int |
138 |
| - Number of evaluations of the objective functions and of its |
139 |
| - Jacobian and Hessian. |
140 |
| - nit : int |
141 |
| - Number of iterations performed by the optimizer. |
142 |
| - maxcv : float |
143 |
| - The maximum constraint violation. |
144 |
| -
|
145 |
| - Notes |
146 |
| - ----- |
147 |
| - Depending on the specific solver being used, `OptimizeResult` may |
148 |
| - not have all attributes listed here, and they may have additional |
149 |
| - attributes not listed here. Since this class is essentially a |
150 |
| - subclass of dict with attribute accessors, one can see which |
151 |
| - attributes are available using the `OptimizeResult.keys` method. |
152 |
| -
|
153 |
| - """ |
154 |
| - pass |
155 |
| - |
156 |
| - |
157 | 112 | class OptimizeWarning(UserWarning):
|
158 | 113 | """General warning for :mod:`scipy.optimize`."""
|
159 | 114 | pass
|
|
0 commit comments