Current File : //proc/self/root/proc/self/root/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyo
�
E�`Qc@sMdZddlZdgZdefd��YZddd�Zd�ZdS(s�
Utilities that manipulate strides to achieve desirable effects.

An explanation of strides can be found in the "ndarray.rst" file in the
NumPy reference guide.

i����Ntbroadcast_arrayst
DummyArraycBseZdZdd�ZRS(s� Dummy object that just exists to hang __array_interface__ dictionaries
    and possibly keep alive a reference to a base array.
    cCs||_||_dS(N(t__array_interface__tbase(tselft	interfaceR((s=/usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt__init__s	N(t__name__t
__module__t__doc__tNoneR(((s=/usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyRscCsft|j�}|dk	r.t|�|d<n|dk	rMt|�|d<ntjt|d|��S(sL Make an ndarray from the given array with the given shape and strides.
    tshapetstridesRN(tdictRR
ttupletnptasarrayR(txRRR((s=/usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt
as_stridedscGssttj|�}g|D]}|j^q}tt|��dkrJ|Sg|D]}t|�^qQ}g|D]}t|j�^qp}g|D]}t|�^q�}t|�}xit	t|��D]U}|||}|dkr�dg|||||<dg|||||<q�q�Wg}	xt	|�D]�}
g|D]}||
^qB}t|dg�}t|�dkr�t
d|
f��q5t|�dkr|jd�|j�}
|	j
|
�x]t	t|��D]9}|||
dkr�|
|||
<d|||
<q�q�Wq5|	j
d�q5Wgt|||�D]'\}}}t|d|d|�^qB}|S(s�
    Broadcast any number of arrays against each other.

    Parameters
    ----------
    `*args` : array_likes
        The arrays to broadcast.

    Returns
    -------
    broadcasted : list of arrays
        These arrays are views on the original arrays.  They are typically
        not contiguous.  Furthermore, more than one element of a
        broadcasted array may refer to a single memory location.  If you
        need to write to the arrays, make copies first.

    Examples
    --------
    >>> x = np.array([[1,2,3]])
    >>> y = np.array([[1],[2],[3]])
    >>> np.broadcast_arrays(x, y)
    [array([[1, 2, 3],
           [1, 2, 3],
           [1, 2, 3]]), array([[1, 1, 1],
           [2, 2, 2],
           [3, 3, 3]])]

    Here is a useful idiom for getting contiguous copies instead of
    non-contiguous views.

    >>> map(np.array, np.broadcast_arrays(x, y))
    [array([[1, 2, 3],
           [1, 2, 3],
           [1, 2, 3]]), array([[1, 1, 1],
           [2, 2, 2],
           [3, 3, 3]])]

    iiisKshape mismatch: two or more arrays have incompatible dimensions on axis %r.RR(tmapRRRtlentsettlistRtmaxtranget
ValueErrortremovetpoptappendtzipR(targsRtshapestsRtndstbiggesttitdifftcommon_shapetaxistlengthstuniquet
new_lengthtshtsttbroadcasted((s=/usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyRs@'" 

=(	R	tnumpyRt__all__tobjectRR
RR(((s=/usr/lib64/python2.7/site-packages/numpy/lib/stride_tricks.pyt<module>s