LAPACKE_chbevd 的错误答案

问题描述 投票:0回答:1

我在基于arm的嵌入式设备AGX Orin上使用

LAPACKE_chbevd
来计算矩阵的特征值和特征向量,但结果不正确。

来自

LAPACKE_chbevd
(ARM 性能库):

-11919.6、-8524.17、-6111.67、-2497.23、2114.36、3121.9、9681.48、14156.4

正确的特征值应该约为:

-0.0141504、-0.00595834、-0.0012536、0.000805093、0.00987138、204.135、7947.25、24044.7。

根据用户手册,我不认为我以错误的方式调用了

LAPACKE_chbevd

LAPACKE_chbevd

#define N 8

lapack_complex_float h_cov_arm[N * N] = {
    {4140.65f, -2.24197e-06f}, {137.897f, 3938.01f}, {-158.647f, -1241.86f}, {-1936.52f, 2616.06f},
    {-743.871f, 2664.88f}, {623.323f, -4050.98f}, {-1115.17f, 1268.56f}, {-1067.13f, 133.398f},
    {137.897f, -3938.01f}, {4154.02f, 3.32665e-06f}, {-1563.14f, -967.872f}, {2961.04f, 2489.75f},
    {3325.31f, 1229.58f}, {-3941.03f, -737.05f}, {1463.98f, 2163.99f}, {-995.137f, 1257.28f},
    {-158.647f, 1241.86f}, {-1563.14f, 967.872f}, {3843.31f, -2.39818e-07f}, {-2763.36f, 255.503f},
    {-2805.64f, 1415.83f}, {1326.26f, 228.303f}, {-3621.11f, -722.38f}, {584.441f, -3733.83f},
    {-1936.52f, -2616.06f}, {2961.04f, -2489.75f}, {-2763.36f, -255.503f}, {4067.95f, -3.1887e-06f},
    {3742.5f, -1311.93f}, {-2992.45f, 1599.3f}, {3214.86f, 1165.23f}, {-611.432f, 2481.71f},
    {-743.871f, -2664.88f}, {3325.31f, -1229.58f}, {-2805.64f, -1415.83f}, {3742.5f, 1311.94f},
    {4021.9f, -3.66673e-06f}, {-2973.91f, 342.678f}, {2854.54f, 2360.54f}, {-1725.97f, 2476.39f},
    {623.323f, 4050.98f}, {-3941.03f, 737.05f}, {1326.26f, -228.303f}, {-2992.45f, -1599.3f},
    {-2973.91f, -342.678f}, {4204.25f, 3.96076e-06f}, {-1613.83f, -1059.15f}, {-198.559f, -1266.46f},
    {-1115.17f, -1268.56f}, {1463.98f, -2163.99f}, {-3621.11f, 722.38f}, {3214.86f, -1165.23f},
    {2854.54f, -2360.54f}, {-1613.83f, 1059.15f}, {3900.07f, -1.04732e-06f}, {171.296f, 3648.69f},
    {-1067.13f, -133.398f}, {-995.137f, -1257.28f}, {584.441f, 3733.84f}, {-611.432f, -2481.71f},
    {-1725.97f, -2476.39f}, {-198.559f, 1266.46f}, {171.296f, -3648.69f}, {3863.89f, -2.28193e-06f}
};

void ver_armpl(lapack_complex_float *cov_arm) {
    float w[N];
    lapack_complex_float z[N*N];
    armpl_int_t stat = LAPACKE_chbevd(LAPACK_ROW_MAJOR, 'V', 'U', N, N-1, cov_arm, N, w, z, N);
    std::cout << stat << std::endl;

    std::cout<<"LAPACK:"<<std::endl;
    for (int i=0;i<N;++i) {
        std::cout<<w[i]<<std::endl;
    }
}
c++ arm lapack
1个回答
0
投票

如果使用

LAPACKE_cheev
LAPACKE_zheev
,答案就是正确的。

还是不知道为什么在这种情况下不能使用

LAPACKE_chbevd

© www.soinside.com 2019 - 2024. All rights reserved.