← Back
Editing: _slsqp_py.cpython-311.pyc
� d�cOI � � � d Z ddgZddlZddlmZ ddlmZmZmZm Z m Z mZmZm Z mZmZmZ ddlmZmZmZmZmZ dd lmZ dd lmZmZ dZ e ee� � j � � Zd� Z d dd dd dddd dddddedfd�Z!d ddd ddddeddfd�Z"d� Z#d� Z$dS )a This module implements the Sequential Least Squares Programming optimization algorithm (SLSQP), originally developed by Dieter Kraft. See http://www.netlib.org/toms/733 Functions --------- .. autosummary:: :toctree: generated/ approx_jacobian fmin_slsqp �approx_jacobian� fmin_slsqp� N)�slsqp)�zeros�array�linalg�append�asfarray�concatenate�finfo�sqrt�vstack�isfinite� atleast_1d� )�OptimizeResult�_check_unknown_options�_prepare_scalar_function�_clip_x_for_func� _check_clip_x)�approx_derivative)�old_bound_to_new�_arr_to_scalarzrestructuredtext enc �R � t || d||�� � }t j |� � S )a� Approximate the Jacobian matrix of a callable function. Parameters ---------- x : array_like The state vector at which to compute the Jacobian matrix. func : callable f(x,*args) The vector-valued function. epsilon : float The perturbation used to determine the partial derivatives. args : sequence Additional arguments passed to func. Returns ------- An array of dimensions ``(lenf, lenx)`` where ``lenf`` is the length of the outputs of `func`, and ``lenx`` is the number of elements in `x`. Notes ----- The approximation is done using forward differences. �2-point)�method�abs_step�args)r �np� atleast_2d)�x�func�epsilonr �jacs �:/usr/lib/python3/dist-packages/scipy/optimize/_slsqp_py.pyr r "