
    -i                     N    S SK JrJr  S SKJr  S SKJr  SSKJr   " S S\5      r	g)	    )array_namespace	np_compat)cached_property)roots_legendre   )	FixedRulec                   2    \ rS rSrSrSS jr\S 5       rSrg)GaussLegendreQuadrature
   a  
Gauss-Legendre quadrature.

Parameters
----------
npoints : int
    Number of nodes for the higher-order rule.

xp : array_namespace, optional
    The namespace for the node and weight arrays. Default is None, where NumPy is
    used.

Examples
--------
Evaluate a 1D integral. Note in this example that ``f`` returns an array, so the
estimates will also be arrays.

>>> import numpy as np
>>> from scipy.integrate import cubature
>>> from scipy.integrate._rules import GaussLegendreQuadrature
>>> def f(x):
...     return np.cos(x)
>>> rule = GaussLegendreQuadrature(21) # Use 21-point GaussLegendre
>>> a, b = np.array([0]), np.array([1])
>>> rule.estimate(f, a, b) # True value sin(1), approximately 0.84147
 array([0.84147098])
>>> rule.estimate_error(f, a, b)
 array([1.11022302e-16])
Nc                     US:  a  [        S5      eXl        Uc  [        n[        UR	                  S5      5      U l        g )N   z5At least 2 nodes required for Gauss-Legendre cubaturer   )
ValueErrornpointsr   r   emptyxp)selfr   r   s      Y/var/www/html/venv/lib/python3.13/site-packages/scipy/integrate/_rules/_gauss_legendre.py__init__ GaussLegendreQuadrature.__init__)   s>    Q;G  :B!"((1+.    c                     [        U R                  5      u  pU R                  R                  XR                  R                  S9U R                  R                  X R                  R                  S94$ )N)dtype)r   r   r   asarrayfloat64)r   nodesweightss      r   nodes_and_weights)GaussLegendreQuadrature.nodes_and_weights6   sT     (5 GGOOEO9GGOOG77??O;
 	
r   )r   r   )N)	__name__
__module____qualname____firstlineno____doc__r   r   r   __static_attributes__ r   r   r
   r
   
   s     </ 
 
r   r
   N)
scipy._lib._array_apir   r   	functoolsr   scipy.specialr   _baser   r
   r%   r   r   <module>r*      s    < % ( 4
i 4
r   