This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / polynomial / polynomial / polycompanion

function

numpy.polynomial.polynomial:polycompanion

source: build-install/usr/lib/python3.14/site-packages/numpy/polynomial/polynomial.py :1448

Signature

def   polycompanion ( c )

Summary

Return the companion matrix of c.

Extended Summary

The companion matrix for power series cannot be made symmetric by scaling the basis, so this function differs from those for the orthogonal polynomials.

Parameters

c : array_like

1-D array of polynomial coefficients ordered from low to high degree.

Returns

mat : ndarray

Companion matrix of dimensions (deg, deg).

Examples

from numpy.polynomial import polynomial as P
c = (1, 2, 3)
P.polycompanion(c)

Aliases

  • numpy.polynomial.polynomial.polycompanion