← Back
Editing: _optimize.cpython-311.pyc
� d�c�! � �� � g d �Z dZddlZddlZddlmZmZmZmZm Z m Z mZmZm Z mZ ddlZddlmZ ddlmZmZmZmZ ddlmZ dd lmZ dd lmZ ddlmZmZ ddl m!Z!m"Z" d dddddd�Z# G d� d� � Z$d\d�Z%d� Z&d]d�Z' G d� de(� � Z) G d� de*� � Z+d� Z,d� Z- e ej. e/� � j0 � � Z1d^d �Z2 d_d"�Z3d#� Z4d$� Z5d%� Z6d&� Z7d'� Z8d(� Z9d)� Z: G d*� d+e;� � Z<d,� Z= d`d.�Z> dad0�Z?e1fd1�Z@e1d2dd3�d4�ZAd5� ZB G d6� d7e;� � ZCd8� ZDdd!d9e e1ddddddfd:�ZEd!ddd9e e1dd/d/ddfd;�ZFdd!d9e e1dddddf d<�ZGd!ddd9e e1dd/d/df d=�ZHddd!d9e1dddddf d>�ZId!ddddd9e1dd/d/f d?�ZJ dbdA�ZK dcdB�ZL G dC� dD� � ZMdddF�ZN dedG�ZOd!de1ddHfdI�ZPdd!e1dHdfdJ�ZQdfdO�ZRdP� ZS dgdR�ZT d`dS�ZU dhdT�ZVdU� ZWd!dVde>d/dfdW�ZX G dX� dY� � ZYdid[�ZZdS )j)�fmin�fmin_powell� fmin_bfgs�fmin_ncg�fmin_cg� fminbound�brent�golden�bracket�rosen� rosen_der� rosen_hess�rosen_hess_prod�brute� approx_fprime�line_search� check_grad�OptimizeResult�show_options�OptimizeWarningzrestructuredtext en� N) � atleast_1d�eye�argmin�zeros�shape�squeeze�asarray�sqrt�Inf�asfarray)�LinearOperator� )�line_search_wolfe1�line_search_wolfe2r$ �LineSearchWarning)�approx_derivative)�HessianUpdateStrategy)�getfullargspec_no_self)� MapWrapper�check_random_state)�ScalarFunction� FD_METHODSz%Optimization terminated successfully.z9Maximum number of function evaluations has been exceeded.z/Maximum number of iterations has been exceeded.z=Desired error not necessarily achieved due to precision loss.zNaN result encountered.z-The result is outside of the provided bounds.)�success�maxfev�maxiter�pr_loss�nan� out_of_boundsc �* � e Zd ZdZd� Zd� Zd� Zd� ZdS )� MemoizeJaczo Decorator that caches the return values of a function returning `(fun, grad)` each time it is called. c �>