This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / linalg / _special_matrices / hankel

function

scipy.linalg._special_matrices:hankel

source: build-install/usr/lib/python3.14/site-packages/scipy/linalg/_special_matrices.py:161

Signature

def hankel(c, r = None)

Summary

Construct a Hankel matrix.

Extended Summary

The Hankel matrix has constant anti-diagonals, with c as its first column and r as its last row. If the first element of r differs from the last element of c, the first element of r is replaced by the last element of c to ensure that anti-diagonals remain constant. If r is not given, then r = zeros_like(c) is assumed.

The documentation is written assuming array arguments are of specified "core" shapes. However, array argument(s) of this function may have additional "batch" dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see linalg_batch for details. The NEP 5 signature of this function is (i),(j)->(i,j).

Parameters

c : array_like

First column of the matrix.

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:]].

Returns

A : (len(c), len(r)) ndarray

The Hankel matrix. Dtype is the same as (c[0] + r[0]).dtype.

Examples

from scipy.linalg import hankel
hankel([1, 17, 99])
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]])

See also

circulant

circulant matrix

toeplitz

Toeplitz matrix

Aliases

  • scipy.linalg.hankel

Referenced by