scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
fiedler_companion(a)

Given a polynomial coefficient array a , this function forms a pentadiagonal matrix with a special structure whose eigenvalues coincides with the roots of a .

Notes

Similar to companion the leading coefficient should be nonzero. In the case the leading coefficient is not 1, other coefficients are rescaled before the array generation. To avoid numerical issues, it is best to provide a monic polynomial.

versionadded

Parameters

a : (N,) array_like

1-D array of polynomial coefficients in descending order with a nonzero leading coefficient. For N < 2 , an empty array is returned.

Returns

c : (N-1, N-1) ndarray

Resulting companion matrix

Returns a Fiedler companion matrix

See Also

companion

Examples

>>> from scipy.linalg import fiedler_companion, eigvals
... p = np.poly(np.arange(1, 9, 2)) # [1., -16., 86., -176., 105.]
... fc = fiedler_companion(p)
... fc array([[ 16., -86., 1., 0.], [ 1., 0., 0., 0.], [ 0., 176., 0., -105.], [ 0., 1., 0., 0.]])
>>> eigvals(fc)
array([7.+0.j, 5.+0.j, 3.+0.j, 1.+0.j])
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.linalg._special_matrices.fiedler_companion

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/linalg/_special_matrices.py#1118
type: <class 'function'>
Commit: