Module ImportFrom alias alias alias Import alias Import alias identifier ImportFrom alias ImportFrom alias Assign NameStore ListLoad Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad Num NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad If Call NameLoad NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad UnaryOpUSub NameLoad If CompareIs NameLoad NameLoad body Return NameLoad orelse Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num keyword NameLoad keyword AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult BinOpSub Num Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpSub NameLoad Num AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad NameLoad Slice Num Num Num NameLoad Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Call NameLoad NameLoad Slice BinOpSub Call NameLoad NameLoad Num Num Num Assign NameStore BinOpAdd NameLoad NameLoad Return SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Call NameLoad NameLoad Slice Num UnaryOpUSub Call NameLoad NameLoad Num Assign NameStore BinOpAdd NameLoad NameLoad Return SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad orelse Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad SubscriptLoad NameLoad Slice Num Assign TupleStore NameStore NameStore SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Num Call NameLoad NameLoad Slice Num Call NameLoad NameLoad Assign NameStore BinOpAdd NameLoad NameLoad Return SubscriptLoad NameLoad Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareLt NameLoad Num body Assign NameStore Num orelse Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num If CompareNotEq BinOpPow Num NameLoad NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad ListLoad Num keyword NameLoad For NameStore Call NameLoad Num NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr TupleLoad NameLoad UnaryOpUSub NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareNotEq AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str Assign NameStore BinOpAdd SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index TupleLoad Call NameLoad Call NameLoad Num NameLoad Call NameLoad Call NameLoad Num BinOpSub NameLoad Num NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If UnaryOpNot SubscriptLoad AttributeLoad NameLoad attr Index Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr If UnaryOpNot SubscriptLoad AttributeLoad NameLoad attr Index Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword Num decorator_list FunctionDef arguments args defaults vararg body Expr Str If CompareEq NameLoad TupleLoad body Assign NameStore TupleLoad ListLoad Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore NameLoad Assign NameStore ListComp NameLoad comprehension NameStore Call NameLoad Call NameLoad NameLoad CompareGt AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Num If NameLoad body Raise Call NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp IfExp CompareGt AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr ListLoad Num Num comprehension NameStore NameLoad Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad ListLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad keyword Num keyword NameLoad Assign TupleStore NameStore NameStore TupleLoad Num Num For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad NameLoad body Assign SubscriptStore NameLoad ExtSlice Slice NameLoad BinOpAdd NameLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad SubscriptLoad NameLoad Index NameLoad AugAssignAdd NameStore NameLoad AugAssignAdd NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareNotEq AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareLt AttributeLoad NameLoad attr Num body Raise Call NameLoad Str If CompareEq SubscriptLoad NameLoad Index Num Num body Raise Call NameLoad Str Assign NameStore BinOpDiv UnaryOpUSub SubscriptLoad NameLoad Slice Num BinOpMult Num SubscriptLoad NameLoad Index Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad BinOpSub NameLoad Num BinOpSub NameLoad Num keyword AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Num NameLoad Assign SubscriptStore NameLoad Index TupleLoad Call NameLoad Call NameLoad Num BinOpSub NameLoad Num Call NameLoad Call NameLoad Num BinOpSub NameLoad Num Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore BinOpSub Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpMult Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr Num BinOpAdd NameLoad Num Assign SubscriptStore NameLoad Index Num Num Assign SubscriptStore NameLoad Index Num NameLoad Assign NameStore BinOpDiv NameLoad SubscriptLoad Call AttributeLoad NameLoad attr NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr If NameLoad body Return NameLoad orelse Return SubscriptLoad NameLoad Slice Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpDiv Num BinOpAdd Num Call AttributeLoad NameLoad attr BinOpSub BinOpMult Num NameLoad Num Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice NameLoad keyword SubscriptLoad NameLoad Slice BinOpSub NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str ImportFrom alias If NameLoad body If CompareGt NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword NameLoad For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad Num BinOpAdd NameLoad Num body Assign NameStore BinOpAdd NameLoad NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult BinOpMult BinOpMult BinOpMult BinOpPow Num NameLoad BinOpAdd NameLoad Num Call NameLoad BinOpAdd NameLoad NameLoad BinOpSub BinOpSub NameLoad NameLoad Num NameLoad Call NameLoad BinOpAdd NameLoad NameLoad BinOpSub BinOpSub NameLoad NameLoad Num NameLoad BinOpPow Call NameLoad NameLoad NameLoad NameLoad Num If CompareNotEq NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str NameLoad body Expr Str ImportFrom alias If CompareNotIn NameLoad ListLoad Str Str Str body Raise Call NameLoad Str If NameLoad body If CompareGtE NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Num orelse Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword AttributeLoad NameLoad attr For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad BinOpAdd NameLoad Num body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad Call NameLoad NameLoad NameLoad keyword NameLoad orelse Assign NameStore Call NameLoad SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice NameLoad Slice NameLoad If CompareIs NameLoad Str body Assign NameStore NameLoad orelse If CompareIs NameLoad Str body Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str NameLoad body Expr Str ImportFrom alias If CompareNotIn NameLoad ListLoad Str Str Str body Raise Call NameLoad Str If CompareEq NameLoad Str body If NameLoad body If CompareGt NameLoad Num body Assign NameStore NameLoad orelse Assign NameStore AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad keyword NameLoad For NameStore Call NameLoad NameLoad body For NameStore Call NameLoad Num BinOpAdd NameLoad Num body Assign NameStore Num For NameStore Call NameLoad BinOpSub NameLoad NameLoad body AugAssignAdd NameStore BinOpMult Call NameLoad BinOpAdd NameLoad NameLoad NameLoad keyword NameLoad Call NameLoad BinOpAdd NameLoad NameLoad BinOpSub BinOpAdd NameLoad NameLoad NameLoad keyword NameLoad Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad BinOpMult BinOpPow Num BinOpSub NameLoad NameLoad NameLoad If CompareNotEq NameLoad NameLoad body Assign SubscriptStore NameLoad Index TupleLoad NameLoad NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad orelse Assign NameStore Call NameLoad NameLoad keyword NameLoad keyword NameLoad If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AugAssignMult NameStore Call AttributeLoad Call NameLoad BinOpPow Num Call AttributeLoad NameLoad attr NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareNotIn NameLoad ListLoad NameLoad Str Str body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr BinOpDiv BinOpMult BinOpMult Num AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad attr Num Num Assign NameStore BinOpPow NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Str body AugAssignDiv NameStore Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq NameLoad Str body AugAssignDiv NameStore NameLoad Return NameLoad decorator_list
N/A __future__ division print_function absolute_import N/A math N/A numpy np scipy._lib.six xrange scipy._lib.six string_types N/A __all__ N/A tri tril triu toeplitz circulant hankel hadamard leslie kron block_diag companion helmert hilbert invhilbert pascal invpascal dft tri N/A N/A N M k dtype N/A None 0 None N/A N/A 
    Construct (N, M) matrix filled with ones at and below the k-th diagonal.

    The matrix has A[i,j] == 1 for i <= j + k

    Parameters
    ----------
    N : int
        The size of the first dimension of the matrix.
    M : int or None, optional
        The size of the second dimension of the matrix. If `M` is None,
        `M = N` is assumed.
    k : int, optional
        Number of subdiagonal below which matrix is filled with ones.
        `k` = 0 is the main diagonal, `k` < 0 subdiagonal and `k` > 0
        superdiagonal.
    dtype : dtype, optional
        Data type of the matrix.

    Returns
    -------
    tri : (N, M) ndarray
        Tri matrix.

    Examples
    --------
    >>> from scipy.linalg import tri
    >>> tri(3, 5, 2, dtype=int)
    array([[1, 1, 1, 0, 0],
           [1, 1, 1, 1, 0],
           [1, 1, 1, 1, 1]])
    >>> tri(3, 5, -1, dtype=int)
    array([[0, 0, 0, 0, 0],
           [1, 0, 0, 0, 0],
           [1, 1, 0, 0, 0]])

     N/A N/A M None N/A N/A M N N/A N/A isinstance M string_types N/A N/A dtype M N/A M N N/A m N/A N/A np greater_equal N/A N/A N/A np subtract outer N/A N/A np arange N N/A N/A np arange M N/A k N/A N/A dtype None N/A N/A m N/A N/A N/A N/A m astype dtype N/A tril N/A N/A m k N/A 0 N/A N/A 
    Make a copy of a matrix with elements above the k-th diagonal zeroed.

    Parameters
    ----------
    m : array_like
        Matrix whose elements to return
    k : int, optional
        Diagonal above which to zero elements.
        `k` == 0 is the main diagonal, `k` < 0 subdiagonal and
        `k` > 0 superdiagonal.

    Returns
    -------
    tril : ndarray
        Return is the same shape and type as `m`.

    Examples
    --------
    >>> from scipy.linalg import tril
    >>> tril([[1,2,3],[4,5,6],[7,8,9],[10,11,12]], -1)
    array([[ 0,  0,  0],
           [ 4,  0,  0],
           [ 7,  8,  0],
           [10, 11, 12]])

     N/A m N/A N/A np asarray m N/A out N/A N/A tri N/A N/A m shape N/A 0 N/A N/A m shape N/A 1 k k dtype N/A N/A m dtype char m N/A out N/A triu N/A N/A m k N/A 0 N/A N/A 
    Make a copy of a matrix with elements below the k-th diagonal zeroed.

    Parameters
    ----------
    m : array_like
        Matrix whose elements to return
    k : int, optional
        Diagonal below which to zero elements.
        `k` == 0 is the main diagonal, `k` < 0 subdiagonal and
        `k` > 0 superdiagonal.

    Returns
    -------
    triu : ndarray
        Return matrix with zeroed elements below the k-th diagonal and has
        same shape and type as `m`.

    Examples
    --------
    >>> from scipy.linalg import triu
    >>> triu([[1,2,3],[4,5,6],[7,8,9],[10,11,12]], -1)
    array([[ 1,  2,  3],
           [ 4,  5,  6],
           [ 0,  8,  9],
           [ 0,  0, 12]])

     N/A m N/A N/A np asarray m N/A out N/A N/A 1 N/A tri N/A N/A m shape N/A 0 N/A N/A m shape N/A 1 N/A k 1 N/A N/A m dtype char m N/A out N/A toeplitz N/A N/A c r N/A None N/A N/A 
    Construct a Toeplitz matrix.

    The Toeplitz matrix has constant diagonals, with c as its first column
    and r as its first row.  If r is not given, ``r == conjugate(c)`` is
    assumed.

    Parameters
    ----------
    c : array_like
        First column of the matrix.  Whatever the actual shape of `c`, it
        will be converted to a 1-D array.
    r : array_like, optional
        First row of the matrix. If None, ``r = conjugate(c)`` is assumed;
        in this case, if c[0] is real, the result is a Hermitian matrix.
        r[0] is ignored; the first row of the returned matrix is
        ``[c[0], r[1:]]``.  Whatever the actual shape of `r`, it will be
        converted to a 1-D array.

    Returns
    -------
    A : (len(c), len(r)) ndarray
        The Toeplitz matrix. Dtype is the same as ``(c[0] + r[0]).dtype``.

    See also
    --------
    circulant : circulant matrix
    hankel : Hankel matrix

    Notes
    -----
    The behavior when `c` or `r` is a scalar, or when `c` is complex and
    `r` is None, was changed in version 0.8.0.  The behavior in previous
    versions was undocumented and is no longer supported.

    Examples
    --------
    >>> from scipy.linalg import toeplitz
    >>> toeplitz([1,2,3], [1,4,5,6])
    array([[1, 4, 5, 6],
           [2, 1, 4, 5],
           [3, 2, 1, 4]])
    >>> toeplitz([1.0, 2+3j, 4-1j])
    array([[ 1.+0.j,  2.-3.j,  4.+1.j],
           [ 2.+3.j,  1.+0.j,  2.-3.j],
           [ 4.-1.j,  2.+3.j,  1.+0.j]])

     N/A c N/A N/A N/A N/A np asarray c ravel N/A N/A r None N/A N/A r N/A N/A c conjugate N/A N/A r N/A N/A N/A N/A np asarray r ravel N/A vals N/A N/A np concatenate N/A N/A r N/A -1 0 -1 c N/A N/A a b N/A N/A np ogrid N/A N/A 0 N/A len c N/A N/A N/A len r 1 -1 -1 N/A indx N/A a b N/A N/A vals N/A indx N/A circulant N/A N/A c N/A N/A N/A 
    Construct a circulant matrix.

    Parameters
    ----------
    c : (N,) array_like
        1-D array, the first column of the matrix.

    Returns
    -------
    A : (N, N) ndarray
        A circulant matrix whose first column is `c`.

    See also
    --------
    toeplitz : Toeplitz matrix
    hankel : Hankel matrix

    Notes
    -----
    .. versionadded:: 0.8.0

    Examples
    --------
    >>> from scipy.linalg import circulant
    >>> circulant([1, 2, 3])
    array([[1, 3, 2],
           [2, 1, 3],
           [3, 2, 1]])

     N/A c N/A N/A N/A N/A np asarray c ravel N/A N/A a b N/A N/A np ogrid N/A N/A 0 N/A len c N/A 0 N/A N/A len c -1 N/A indx N/A a b N/A N/A c N/A indx N/A hankel N/A N/A c r N/A None N/A N/A 
    Construct a Hankel matrix.

    The Hankel matrix has constant anti-diagonals, with `c` as its
    first column and `r` as its last row.  If `r` is not given, then
    `r = zeros_like(c)` is assumed.

    Parameters
    ----------
    c : array_like
        First column of the matrix.  Whatever the actual shape of `c`, it
        will be converted to a 1-D array.
    r : array_like, optional
        Last row of the matrix. If None, ``r = zeros_like(c)`` is assumed.
        r[0] is ignored; the last row of the returned matrix is
        ``[c[-1], r[1:]]``.  Whatever the actual shape of `r`, it will be
        converted to a 1-D array.

    Returns
    -------
    A : (len(c), len(r)) ndarray
        The Hankel matrix. Dtype is the same as ``(c[0] + r[0]).dtype``.

    See also
    --------
    toeplitz : Toeplitz matrix
    circulant : circulant matrix

    Examples
    --------
    >>> from scipy.linalg import hankel
    >>> hankel([1, 17, 99])
    array([[ 1, 17, 99],
           [17, 99,  0],
           [99,  0,  0]])
    >>> hankel([1,2,3,4], [4,7,7,8,9])
    array([[1, 2, 3, 4, 7],
           [2, 3, 4, 7, 7],
           [3, 4, 7, 7, 8],
           [4, 7, 7, 8, 9]])

     N/A c N/A N/A N/A N/A np asarray c ravel N/A N/A r None N/A N/A r N/A N/A np zeros_like c N/A N/A r N/A N/A N/A N/A np asarray r ravel N/A vals N/A N/A np concatenate N/A c N/A r N/A 1 N/A N/A a b N/A N/A np ogrid N/A N/A 0 N/A len c N/A 0 N/A len r N/A indx N/A a b N/A N/A vals N/A indx N/A hadamard N/A N/A n dtype N/A int N/A N/A 
    Construct a Hadamard matrix.

    Constructs an n-by-n Hadamard matrix, using Sylvester's
    construction.  `n` must be a power of 2.

    Parameters
    ----------
    n : int
        The order of the matrix.  `n` must be a power of 2.
    dtype : dtype, optional
        The data type of the array to be constructed.

    Returns
    -------
    H : (n, n) ndarray
        The Hadamard matrix.

    Notes
    -----
    .. versionadded:: 0.8.0

    Examples
    --------
    >>> from scipy.linalg import hadamard
    >>> hadamard(2, dtype=complex)
    array([[ 1.+0.j,  1.+0.j],
           [ 1.+0.j, -1.-0.j]])
    >>> hadamard(4)
    array([[ 1,  1,  1,  1],
           [ 1, -1,  1, -1],
           [ 1,  1, -1, -1],
           [ 1, -1, -1,  1]])

     N/A N/A n 1 N/A N/A lg2 0 N/A N/A lg2 N/A int N/A N/A math log n 2 N/A N/A N/A 2 lg2 n N/A N/A N/A ValueError n must be an positive integer, and n must be a power of 2 N/A H N/A N/A np array N/A N/A 1 dtype dtype N/A i N/A range 0 lg2 N/A N/A H N/A N/A np vstack N/A N/A N/A np hstack N/A H H N/A N/A np hstack N/A H N/A H N/A H N/A leslie N/A N/A f s N/A N/A N/A 
    Create a Leslie matrix.

    Given the length n array of fecundity coefficients `f` and the length
    n-1 array of survival coefficents `s`, return the associated Leslie matrix.

    Parameters
    ----------
    f : (N,) array_like
        The "fecundity" coefficients.
    s : (N-1,) array_like
        The "survival" coefficients, has to be 1-D.  The length of `s`
        must be one less than the length of `f`, and it must be at least 1.

    Returns
    -------
    L : (N, N) ndarray
        The array is zero except for the first row,
        which is `f`, and the first sub-diagonal, which is `s`.
        The data-type of the array will be the data-type of ``f[0]+s[0]``.

    Notes
    -----
    .. versionadded:: 0.8.0

    The Leslie matrix is used to model discrete-time, age-structured
    population growth [1]_ [2]_. In a population with `n` age classes, two sets
    of parameters define a Leslie matrix: the `n` "fecundity coefficients",
    which give the number of offspring per-capita produced by each age
    class, and the `n` - 1 "survival coefficients", which give the
    per-capita survival rate of each age class.

    References
    ----------
    .. [1] P. H. Leslie, On the use of matrices in certain population
           mathematics, Biometrika, Vol. 33, No. 3, 183--212 (Nov. 1945)
    .. [2] P. H. Leslie, Some further notes on the use of matrices in
           population mathematics, Biometrika, Vol. 35, No. 3/4, 213--245
           (Dec. 1948)

    Examples
    --------
    >>> from scipy.linalg import leslie
    >>> leslie([0.1, 2.0, 1.0, 0.1], [0.2, 0.8, 0.7])
    array([[ 0.1,  2. ,  1. ,  0.1],
           [ 0.2,  0. ,  0. ,  0. ],
           [ 0. ,  0.8,  0. ,  0. ],
           [ 0. ,  0. ,  0.7,  0. ]])

     N/A f N/A N/A np atleast_1d f N/A s N/A N/A np atleast_1d s N/A N/A N/A f ndim 1 N/A N/A N/A ValueError Incorrect shape for f.  f must be one-dimensional N/A N/A N/A s ndim 1 N/A N/A N/A ValueError Incorrect shape for s.  s must be one-dimensional N/A N/A N/A f size N/A N/A s size 1 N/A N/A N/A ValueError Incorrect lengths for f and s.  The length of s must be one less than the length of f. N/A N/A N/A s size 0 N/A N/A N/A ValueError The length of s must be at least 1. N/A tmp N/A N/A f N/A 0 N/A s N/A 0 N/A n N/A f size N/A a N/A N/A np zeros N/A n n dtype N/A tmp dtype N/A N/A a N/A 0 f N/A N/A a N/A N/A N/A list N/A range 1 n N/A list N/A range 0 N/A n 1 s N/A a N/A kron N/A N/A a b N/A N/A N/A 
    Kronecker product.

    The result is the block matrix::

        a[0,0]*b    a[0,1]*b  ... a[0,-1]*b
        a[1,0]*b    a[1,1]*b  ... a[1,-1]*b
        ...
        a[-1,0]*b   a[-1,1]*b ... a[-1,-1]*b

    Parameters
    ----------
    a : (M, N) ndarray
        Input array
    b : (P, Q) ndarray
        Input array

    Returns
    -------
    A : (M*P, N*Q) ndarray
        Kronecker product of `a` and `b`.

    Examples
    --------
    >>> from numpy import array
    >>> from scipy.linalg import kron
    >>> kron(array([[1,2],[3,4]]), array([[1,1,1]]))
    array([[1, 1, 1, 2, 2, 2],
           [3, 3, 3, 4, 4, 4]])

     N/A N/A N/A N/A a flags N/A CONTIGUOUS N/A N/A a N/A N/A np reshape a N/A a shape N/A N/A N/A N/A b flags N/A CONTIGUOUS N/A N/A b N/A N/A np reshape b N/A b shape N/A o N/A N/A np outer a b N/A o N/A N/A o reshape N/A N/A a shape N/A b shape N/A N/A N/A np concatenate N/A N/A np concatenate o axis 1 axis 1 N/A block_diag N/A N/A N/A arrs N/A N/A 
    Create a block diagonal matrix from provided arrays.

    Given the inputs `A`, `B` and `C`, the output will have these
    arrays arranged on the diagonal::

        [[A, 0, 0],
         [0, B, 0],
         [0, 0, C]]

    Parameters
    ----------
    A, B, C, ... : array_like, up to 2-D
        Input arrays.  A 1-D array or array_like sequence of length `n` is
        treated as a 2-D array with shape ``(1,n)``.

    Returns
    -------
    D : ndarray
        Array with `A`, `B`, `C`, ... on the diagonal.  `D` has the
        same dtype as `A`.

    Notes
    -----
    If all the input arrays are square, the output is known as a
    block diagonal matrix.

    Empty sequences (i.e., array-likes of zero size) are ignored.

    Examples
    --------
    >>> from scipy.linalg import block_diag
    >>> A = [[1, 0],
    ...      [0, 1]]
    >>> B = [[3, 4, 5],
    ...      [6, 7, 8]]
    >>> C = [[7]]
    >>> block_diag(A, B, C)
    array([[1, 0, 0, 0, 0, 0],
           [0, 1, 0, 0, 0, 0],
           [0, 0, 3, 4, 5, 0],
           [0, 0, 6, 7, 8, 0],
           [0, 0, 0, 0, 0, 7]])
    >>> block_diag(1.0, [2, 3], [[4, 5], [6, 7]])
    array([[ 1.,  0.,  0.,  0.,  0.],
           [ 0.,  2.,  3.,  0.,  0.],
           [ 0.,  0.,  0.,  4.,  5.],
           [ 0.,  0.,  0.,  6.,  7.]])

     N/A N/A arrs N/A N/A N/A arrs N/A N/A N/A arrs N/A N/A N/A np atleast_2d a N/A a arrs N/A bad_args N/A k N/A k N/A range N/A len arrs N/A N/A N/A arrs N/A k ndim 2 N/A bad_args N/A N/A N/A ValueError N/A arguments in the following positions have dimension greater than 2: %s bad_args N/A shapes N/A N/A np array N/A N/A N/A N/A a size 0 N/A a shape N/A 0 0 N/A a arrs N/A out_dtype N/A N/A np find_common_type N/A N/A arr dtype N/A arr arrs N/A N/A out N/A N/A np zeros N/A N/A np sum shapes axis 0 dtype out_dtype N/A N/A r c N/A 0 0 N/A N/A i N/A rr cc N/A enumerate shapes N/A N/A N/A out N/A N/A r N/A r rr N/A c N/A c cc N/A arrs N/A i N/A r rr N/A c cc N/A out N/A companion N/A N/A a N/A N/A N/A 
    Create a companion matrix.

    Create the companion matrix [1]_ associated with the polynomial whose
    coefficients are given in `a`.

    Parameters
    ----------
    a : (N,) array_like
        1-D array of polynomial coefficients.  The length of `a` must be
        at least two, and ``a[0]`` must not be zero.

    Returns
    -------
    c : (N-1, N-1) ndarray
        The first row of `c` is ``-a[1:]/a[0]``, and the first
        sub-diagonal is all ones.  The data-type of the array is the same
        as the data-type of ``1.0*a[0]``.

    Raises
    ------
    ValueError
        If any of the following are true: a) ``a.ndim != 1``;
        b) ``a.size < 2``; c) ``a[0] == 0``.

    Notes
    -----
    .. versionadded:: 0.8.0

    References
    ----------
    .. [1] R. A. Horn & C. R. Johnson, *Matrix Analysis*.  Cambridge, UK:
        Cambridge University Press, 1999, pp. 146-7.

    Examples
    --------
    >>> from scipy.linalg import companion
    >>> companion([1, -10, 31, -30])
    array([[ 10., -31.,  30.],
           [  1.,   0.,   0.],
           [  0.,   1.,   0.]])

     N/A a N/A N/A np atleast_1d a N/A N/A N/A a ndim 1 N/A N/A N/A ValueError Incorrect shape for `a`.  `a` must be one-dimensional. N/A N/A N/A a size 2 N/A N/A N/A ValueError The length of `a` must be at least 2. N/A N/A N/A a N/A 0 0 N/A N/A N/A ValueError The first coefficient in `a` must not be zero. N/A first_row N/A N/A N/A a N/A 1 N/A 1.0 N/A a N/A 0 N/A n N/A a size N/A c N/A N/A np zeros N/A N/A n 1 N/A n 1 dtype N/A first_row dtype N/A N/A c N/A 0 first_row N/A N/A c N/A N/A N/A list N/A range 1 N/A n 1 N/A list N/A range 0 N/A n 2 1 N/A c N/A helmert N/A N/A n full N/A False N/A N/A 
    Create a Helmert matrix of order `n`.

    This has applications in statistics, compositional or simplicial analysis,
    and in Aitchison geometry.

    Parameters
    ----------
    n : int
        The size of the array to create.
    full : bool, optional
        If True the (n, n) ndarray will be returned.
        Otherwise the submatrix that does not include the first
        row will be returned.
        Default: False.

    Returns
    -------
    M : ndarray
        The Helmert matrix.
        The shape is (n, n) or (n-1, n) depending on the `full` argument.

    Examples
    --------
    >>> from scipy.linalg import helmert
    >>> helmert(5, full=True)
    array([[ 0.4472136 ,  0.4472136 ,  0.4472136 ,  0.4472136 ,  0.4472136 ],
           [ 0.70710678, -0.70710678,  0.        ,  0.        ,  0.        ],
           [ 0.40824829,  0.40824829, -0.81649658,  0.        ,  0.        ],
           [ 0.28867513,  0.28867513,  0.28867513, -0.8660254 ,  0.        ],
           [ 0.2236068 ,  0.2236068 ,  0.2236068 ,  0.2236068 , -0.89442719]])

     N/A H N/A N/A N/A np tril N/A N/A np ones N/A n n -1 N/A N/A np diag N/A N/A np arange n N/A d N/A N/A N/A np arange n N/A N/A np arange 1 N/A n 1 N/A N/A H N/A 0 1 N/A N/A d N/A 0 n N/A H_full N/A H N/A N/A N/A np sqrt d N/A N/A N/A N/A np newaxis N/A full N/A N/A H_full N/A N/A N/A H_full N/A 1 N/A hilbert N/A N/A n N/A N/A N/A 
    Create a Hilbert matrix of order `n`.

    Returns the `n` by `n` array with entries `h[i,j] = 1 / (i + j + 1)`.

    Parameters
    ----------
    n : int
        The size of the array to create.

    Returns
    -------
    h : (n, n) ndarray
        The Hilbert matrix.

    See Also
    --------
    invhilbert : Compute the inverse of a Hilbert matrix.

    Notes
    -----
    .. versionadded:: 0.10.0

    Examples
    --------
    >>> from scipy.linalg import hilbert
    >>> hilbert(3)
    array([[ 1.        ,  0.5       ,  0.33333333],
           [ 0.5       ,  0.33333333,  0.25      ],
           [ 0.33333333,  0.25      ,  0.2       ]])

     N/A values N/A 1.0 N/A 1.0 N/A N/A np arange N/A N/A 2 n 1 N/A h N/A hankel N/A values N/A n r N/A values N/A N/A n 1 N/A h N/A invhilbert N/A N/A n exact N/A False N/A N/A 
    Compute the inverse of the Hilbert matrix of order `n`.

    The entries in the inverse of a Hilbert matrix are integers.  When `n`
    is greater than 14, some entries in the inverse exceed the upper limit
    of 64 bit integers.  The `exact` argument provides two options for
    dealing with these large integers.

    Parameters
    ----------
    n : int
        The order of the Hilbert matrix.
    exact : bool, optional
        If False, the data type of the array that is returned is np.float64,
        and the array is an approximation of the inverse.
        If True, the array is the exact integer inverse array.  To represent
        the exact inverse when n > 14, the returned array is an object array
        of long integers.  For n <= 14, the exact inverse is returned as an
        array with data type np.int64.

    Returns
    -------
    invh : (n, n) ndarray
        The data type of the array is np.float64 if `exact` is False.
        If `exact` is True, the data type is either np.int64 (for n <= 14)
        or object (for n > 14).  In the latter case, the objects in the
        array will be long integers.

    See Also
    --------
    hilbert : Create a Hilbert matrix.

    Notes
    -----
    .. versionadded:: 0.10.0

    Examples
    --------
    >>> from scipy.linalg import invhilbert
    >>> invhilbert(4)
    array([[   16.,  -120.,   240.,  -140.],
           [ -120.,  1200., -2700.,  1680.],
           [  240., -2700.,  6480., -4200.],
           [ -140.,  1680., -4200.,  2800.]])
    >>> invhilbert(4, exact=True)
    array([[   16,  -120,   240,  -140],
           [ -120,  1200, -2700,  1680],
           [  240, -2700,  6480, -4200],
           [ -140,  1680, -4200,  2800]], dtype=int64)
    >>> invhilbert(16)[7,7]
    4.2475099528537506e+19
    >>> invhilbert(16, exact=True)[7,7]
    42475099528537378560L

     scipy.special comb N/A exact N/A N/A N/A n 14 N/A N/A dtype object N/A N/A dtype N/A np int64 N/A N/A dtype N/A np float64 N/A invh N/A N/A np empty N/A n n dtype dtype N/A i N/A xrange n N/A N/A j N/A xrange 0 N/A i 1 N/A N/A s N/A i j N/A N/A invh N/A N/A i j N/A N/A N/A N/A N/A -1 s N/A s 1 N/A comb N/A n i N/A N/A n j 1 exact N/A comb N/A n j N/A N/A n i 1 exact N/A N/A comb s i exact 2 N/A N/A i j N/A N/A N/A invh N/A N/A j i N/A invh N/A N/A i j N/A invh N/A pascal N/A N/A n kind exact N/A symmetric True N/A N/A 
    Returns the n x n Pascal matrix.

    The Pascal matrix is a matrix containing the binomial coefficients as
    its elements.

    Parameters
    ----------
    n : int
        The size of the matrix to create; that is, the result is an n x n
        matrix.
    kind : str, optional
        Must be one of 'symmetric', 'lower', or 'upper'.
        Default is 'symmetric'.
    exact : bool, optional
        If `exact` is True, the result is either an array of type
        numpy.uint64 (if n < 35) or an object array of Python long integers.
        If `exact` is False, the coefficients in the matrix are computed using
        `scipy.special.comb` with `exact=False`.  The result will be a floating
        point array, and the values in the array will not be the exact
        coefficients, but this version is much faster than `exact=True`.

    Returns
    -------
    p : (n, n) ndarray
        The Pascal matrix.

    See Also
    --------
    invpascal

    Notes
    -----
    See http://en.wikipedia.org/wiki/Pascal_matrix for more information
    about Pascal matrices.

    .. versionadded:: 0.11.0

    Examples
    --------
    >>> from scipy.linalg import pascal
    >>> pascal(4)
    array([[ 1,  1,  1,  1],
           [ 1,  2,  3,  4],
           [ 1,  3,  6, 10],
           [ 1,  4, 10, 20]], dtype=uint64)
    >>> pascal(4, kind='lower')
    array([[1, 0, 0, 0],
           [1, 1, 0, 0],
           [1, 2, 1, 0],
           [1, 3, 3, 1]], dtype=uint64)
    >>> pascal(50)[-1, -1]
    25477612258980856902730428600L
    >>> from scipy.special import comb
    >>> comb(98, 49, exact=True)
    25477612258980856902730428600L

     scipy.special comb N/A N/A kind N/A symmetric lower upper N/A N/A N/A ValueError kind must be 'symmetric', 'lower', or 'upper' N/A exact N/A N/A N/A n 35 N/A N/A L_n N/A N/A np empty N/A n n dtype object N/A N/A N/A L_n fill 0 N/A N/A L_n N/A N/A np zeros N/A n n dtype N/A np uint64 N/A i N/A range n N/A N/A j N/A range N/A i 1 N/A N/A N/A L_n N/A N/A i j N/A comb i j exact True N/A N/A L_n N/A comb N/A N/A np ogrid N/A N/A n N/A n N/A N/A kind lower N/A N/A p L_n N/A N/A N/A kind upper N/A N/A p N/A L_n T N/A N/A p N/A N/A np dot L_n N/A L_n T N/A p N/A invpascal N/A N/A n kind exact N/A symmetric True N/A N/A 
    Returns the inverse of the n x n Pascal matrix.

    The Pascal matrix is a matrix containing the binomial coefficients as
    its elements.

    Parameters
    ----------
    n : int
        The size of the matrix to create; that is, the result is an n x n
        matrix.
    kind : str, optional
        Must be one of 'symmetric', 'lower', or 'upper'.
        Default is 'symmetric'.
    exact : bool, optional
        If `exact` is True, the result is either an array of type
        `numpy.int64` (if `n` <= 35) or an object array of Python integers.
        If `exact` is False, the coefficients in the matrix are computed using
        `scipy.special.comb` with `exact=False`.  The result will be a floating
        point array, and for large `n`, the values in the array will not be the
        exact coefficients.

    Returns
    -------
    invp : (n, n) ndarray
        The inverse of the Pascal matrix.

    See Also
    --------
    pascal

    Notes
    -----

    .. versionadded:: 0.16.0

    References
    ----------
    .. [1] "Pascal matrix",  http://en.wikipedia.org/wiki/Pascal_matrix
    .. [2] Cohen, A. M., "The inverse of a Pascal matrix", Mathematical
           Gazette, 59(408), pp. 111-112, 1975.

    Examples
    --------
    >>> from scipy.linalg import invpascal, pascal
    >>> invp = invpascal(5)
    >>> invp
    array([[  5, -10,  10,  -5,   1],
           [-10,  30, -35,  19,  -4],
           [ 10, -35,  46, -27,   6],
           [ -5,  19, -27,  17,  -4],
           [  1,  -4,   6,  -4,   1]])

    >>> p = pascal(5)
    >>> p.dot(invp)
    array([[ 1.,  0.,  0.,  0.,  0.],
           [ 0.,  1.,  0.,  0.,  0.],
           [ 0.,  0.,  1.,  0.,  0.],
           [ 0.,  0.,  0.,  1.,  0.],
           [ 0.,  0.,  0.,  0.,  1.]])

    An example of the use of `kind` and `exact`:

    >>> invpascal(5, kind='lower', exact=False)
    array([[ 1., -0.,  0., -0.,  0.],
           [-1.,  1., -0.,  0., -0.],
           [ 1., -2.,  1., -0.,  0.],
           [-1.,  3., -3.,  1., -0.],
           [ 1., -4.,  6., -4.,  1.]])

     scipy.special comb N/A N/A kind N/A symmetric lower upper N/A N/A N/A ValueError 'kind' must be 'symmetric', 'lower' or 'upper'. N/A N/A kind symmetric N/A N/A exact N/A N/A N/A n 34 N/A N/A dt object N/A N/A dt N/A np int64 N/A N/A dt N/A np float64 N/A invp N/A N/A np empty N/A n n dtype dt N/A i N/A range n N/A N/A j N/A range 0 N/A i 1 N/A N/A v 0 N/A k N/A range N/A n i N/A N/A v N/A N/A comb N/A i k k exact exact N/A comb N/A i k N/A N/A i k j exact exact N/A N/A invp N/A N/A i j N/A N/A -1 N/A i j v N/A N/A i j N/A N/A N/A invp N/A N/A j i N/A invp N/A N/A i j N/A N/A invp N/A pascal n kind kind exact exact N/A N/A N/A invp dtype N/A np uint64 N/A N/A invp N/A N/A invp view N/A np int64 N/A invp N/A N/A N/A toeplitz N/A -1 N/A N/A np arange n astype N/A invp dtype N/A invp N/A dft N/A N/A n scale N/A None N/A N/A 
    Discrete Fourier transform matrix.

    Create the matrix that computes the discrete Fourier transform of a
    sequence [1]_.  The n-th primitive root of unity used to generate the
    matrix is exp(-2*pi*i/n), where i = sqrt(-1).

    Parameters
    ----------
    n : int
        Size the matrix to create.
    scale : str, optional
        Must be None, 'sqrtn', or 'n'.
        If `scale` is 'sqrtn', the matrix is divided by `sqrt(n)`.
        If `scale` is 'n', the matrix is divided by `n`.
        If `scale` is None (the default), the matrix is not normalized, and the
        return value is simply the Vandermonde matrix of the roots of unity.

    Returns
    -------
    m : (n, n) ndarray
        The DFT matrix.

    Notes
    -----
    When `scale` is None, multiplying a vector by the matrix returned by
    `dft` is mathematically equivalent to (but much less efficient than)
    the calculation performed by `scipy.fftpack.fft`.

    .. versionadded:: 0.14.0

    References
    ----------
    .. [1] "DFT matrix", http://en.wikipedia.org/wiki/DFT_matrix

    Examples
    --------
    >>> from scipy.linalg import dft
    >>> np.set_printoptions(precision=5, suppress=True)
    >>> x = np.array([1, 2, 3, 0, 3, 2, 1, 0])
    >>> m = dft(8)
    >>> m.dot(x)   # Compute the DFT of x
    array([ 12.+0.j,  -2.-2.j,   0.-4.j,  -2.+2.j,   4.+0.j,  -2.-2.j,
            -0.+4.j,  -2.+2.j])

    Verify that ``m.dot(x)`` is the same as ``fft(x)``.

    >>> from scipy.fftpack import fft
    >>> fft(x)     # Same result as m.dot(x)
    array([ 12.+0.j,  -2.-2.j,   0.-4.j,  -2.+2.j,   4.+0.j,  -2.-2.j,
             0.+4.j,  -2.+2.j])
     N/A N/A scale N/A None sqrtn n N/A N/A N/A ValueError N/A scale must be None, 'sqrtn', or 'n'; %r is not valid. N/A scale N/A omegas N/A N/A N/A N/A np exp N/A N/A N/A -2j N/A np pi N/A N/A np arange n n reshape -1 1 N/A m N/A omegas N/A N/A np arange n N/A N/A scale sqrtn N/A N/A m N/A N/A math sqrt n N/A N/A N/A scale n N/A N/A m n N/A m N/A