# encoding: utf-8
# module scipy.interpolate._bspl
# from C:\Programs\Python\Python313\Lib\site-packages\scipy\interpolate\_bspl.cp313-win_amd64.pyd
# by generator 1.147
""" Routines for evaluating and manipulating B-splines. """

# imports
import builtins as __builtins__ # <module 'builtins' (built-in)>
import numpy as np # C:\Programs\Python\Python313\Lib\site-packages\numpy\__init__.py

# functions

def evaluate_ndbspline(*args, **kwargs): # real signature unknown
    """
    Evaluate an N-dim tensor product spline or its derivative.
    
            Parameters
            ----------
            xi : ndarray, shape(npoints, ndim)
                ``npoints`` values to evaluate the spline at, each value is
                a point in an ``ndim``-dimensional space.
            t : ndarray, shape(ndim, max_len_t)
                Array of knots for each dimension.
                This array packs the tuple of knot arrays per dimension into a single
                2D array. The array is ragged (knot lengths may differ), hence
                the real knots in dimension ``d`` are ``t[d, :len_t[d]]``.
            len_t : ndarray, 1D, shape (ndim,)
                Lengths of the knot arrays, per dimension.
            k : tuple of ints, len(ndim)
                Spline degrees in each dimension.
            nu : ndarray of ints, shape(ndim,)
                Orders of derivatives to compute, per dimension.
            extrapolate : int
                Whether to extrapolate out of bounds or return nans.
            c1r: ndarray, one-dimensional
                Flattened array of coefficients.
                The original N-dimensional coefficient array ``c`` has shape
                ``(n1, ..., nd, ...)`` where each ``ni == len(t[d]) - k[d] - 1``,
                and the second "..." represents trailing dimensions of ``c``.
                In code, given the C-ordered array ``c``, ``c1r`` is
                ``c1 = c.reshape(c.shape[:ndim] + (-1,)); c1r = c1.ravel()``
            num_c_tr : int
                The number of elements of ``c1r``, which correspond to the trailing
                dimensions of ``c``. In code, this is
                ``c1 = c.reshape(c.shape[:ndim] + (-1,)); num_c_tr = c1.shape[-1]``.
            strides_c1 : ndarray, one-dimensional
                Pre-computed strides of the ``c1`` array.
                Note: These are *data* strides, not numpy-style byte strides.
                This array is equivalent to
                ``[stride // s1.dtype.itemsize for stride in s1.strides]``.
            indices_k1d : ndarray, shape((k+1)**ndim, ndim)
                Pre-computed mapping between indices for iterating over a flattened
                array of shape ``[k[d] + 1) for d in range(ndim)`` and
                ndim-dimensional indices of the ``(k+1,)*ndim`` dimensional array.
                This is essentially a transposed version of
                ``np.unravel_index(np.arange((k+1)**ndim), (k+1,)*ndim)``.
            out : ndarray, shape (npoints, num_c_tr)
                Output values of the b-spline at given ``xi`` points.
    
            Notes
            -----
    
            This function is essentially equivalent to the following: given an
            N-dimensional vector ``x = (x1, x2, ..., xN)``, iterate over the
            dimensions, form linear combinations of products,
            B(x1) * B(x2) * ... B(xN) of (k+1)**N b-splines which are non-zero
            at ``x``.
    
            Since b-splines are localized, the sum has (k+1)**N non-zero elements.
    
            If ``i = (i1, i2, ..., iN)`` is a vector if intervals of the knot
            vectors, ``t[d, id] <= xd < t[d, id+1]``, for ``d=1, 2, ..., N``, then
            the core loop of this function is nothing but
    
            ```
            result = 0
            iters = [range(i[d] - self.k[d], i[d] + 1) for d in range(ndim)]
            for idx in itertools.product(*iters):
                term = self.c[idx] * np.prod([B(x[d], self.k[d], idx[d], self.t[d])
                                              for d in range(ndim)])
                result += term
            ```
    
            For efficiency reasons, we iterate over the flattened versions of the
            arrays.
    """
    pass

def _colloc_nd(*args, **kwargs): # real signature unknown
    """
    Construct the N-D tensor product collocation matrix as a CSR array.
    
        In the dense representation, each row of the collocation matrix corresponds
        to a data point and contains non-zero b-spline basis functions which are
        non-zero at this data point.
    
        Parameters
        ----------
        xvals : ndarray, shape(size, ndim)
            Data points. ``xvals[j, :]`` gives the ``j``-th data point as an
            ``ndim``-dimensional array.
        t : tuple of 1D arrays, length-ndim
            Tuple of knot vectors
        k : ndarray, shape (ndim,)
            Spline degrees
    
        Returns
        -------
        csr_data, csr_indices, csr_indptr
            The collocation matrix in the CSR array format.
    
        Notes
        -----
        Algorithm: given `xvals` and the tuple of knots `t`, we construct a tensor
        product spline, i.e. a linear combination of
    
           B(x1; i1, t1) * B(x2; i2, t2) * ... * B(xN; iN, tN)
    
    
        Here ``B(x; i, t)`` is the ``i``-th b-spline defined by the knot vector
        ``t`` evaluated at ``x``.
    
        Since ``B`` functions are localized, for each point `(x1, ..., xN)` we
        loop over the dimensions, and
        - find the location in the knot array, `t[i] <= x < t[i+1]`,
        - compute all non-zero `B` values
        - place these values into the relevant row
    
        In the dense representation, the collocation matrix would have had a row per
        data point, and each row has the values of the basis elements (i.e., tensor
        products of B-splines) evaluated at this data point. Since the matrix is very
        sparse (has size = len(x)**ndim, with only (k+1)**ndim non-zero elements per
        row), we construct it in the CSR format.
    """
    pass

def __pyx_unpickle_Enum(*args, **kwargs): # real signature unknown
    pass

# no classes
# variables with complex values

__loader__ = None # (!) real value is '<_frozen_importlib_external.ExtensionFileLoader object at 0x0000019A25742870>'

__spec__ = None # (!) real value is "ModuleSpec(name='scipy.interpolate._bspl', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x0000019A25742870>, origin='C:\\\\Programs\\\\Python\\\\Python313\\\\Lib\\\\site-packages\\\\scipy\\\\interpolate\\\\_bspl.cp313-win_amd64.pyd')"

__test__ = {}

