对从 zgeev 获得的特征系统进行排序
我正在使用 Lapack 例程 zgeev 来获取(复)特征值和 Fortran 中非对称复矩阵的特征向量。得到的数组 特征向量的顺序是任意的。我想重新订购 特征值数组和特征向量矩阵中的相应列 使得特征值相对于实部按升序排列 每个特征值。我当然可以推出自己的排序程序,但我 想知道是否已经有一个 Fortran 例程可以做到这一点 我,甚至可能是 lapack 的一部分。
I'm using the Lapack routine zgeev to obtain the (complex) eigenvalues and
eigenvectors of a non-symmetric complex matrix in Fortran. The resulting array
of eigenvectors is in some arbitrary order. I would like to reorder both the
array of eigenvalues and the corresponding columns in the matrix of eigenvectors
so that the eigenvalues are in ascending order with respect to the real part of
each eigenvalue. I could of course roll my own sorting routine, but I was
wondering if there was already a Fortran routine somewhere that can do this for
me, maybe even as part of lapack.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以只查看 zsteqr.f(埃尔米特三角求解器)的末尾并进行概括。相关的代码是
所以我认为你只需要更改比较行(但未经测试)
Ian
You could just look at the end of zsteqr.f (the hermitian tridigaonal solver) and generalise that. The relevant bit of code is
So I think you just have to change the comparison line (but untested)
Ian
前几天写了一篇,不过是按照真实值排序的。这是快速排序的一个实现。确保输入要用作排序键的函数。
I wrote one a few days ago, but the sorting was done according to the real values. This is an implementation of Quicksort. Make sure you input the function you want to be used as the key for sorting.