gpt4 book ai didi

python - numpy.linalg.eig 如何决定返回特征值的顺序?

转载 作者:行者123 更新时间:2023-11-28 16:32:38 25 4
gpt4 key购买 nike

当我使用 numpy.linalg.eig

eValues, eVectors = numpy.linalg.eig(someMatrix)

返回的 eValues 几乎是按降序排列的。

numpy.linalg.eig 如何决定返回特征值的顺序?

最佳答案

Numpy 对此不作任何保证 -

来自 docstring :

Returns
-------
w : (..., M) array
The eigenvalues, each repeated according to its multiplicity.
The eigenvalues are not necessarily ordered. The resulting
array will be always be of complex type. When `a` is real
the resulting eigenvalues will be real (0 imaginary part) or
occur in conjugate pairs

Numpy 委托(delegate) LAPACK 进行此计算,因此如果有任何一致的顺序,您应该考虑它的实现细节而不是依赖它。

关于python - numpy.linalg.eig 如何决定返回特征值的顺序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30386437/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com