c中的奇异值分解简单代码
我正在寻找 C 语言的奇异值分解 (SVD) 代码,你能帮我吗?
我找到了很多来源,但我无法运行它们,我正在寻找一个为我提供 S、V 和 U 3 个矩阵的 SVD 代码版本。
I am looking for Singular Value Decomposition (SVD) code in C, would you please help me?
I found many sources but I cannot run them, I am looking for a version of SVD code that provide all 3 matrix of S, V and U for me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以使用数字食谱代码
svdcmp.c 参考。实际上,就我而言,我发现 openCV 更准确,但两者都工作正常。
You can use the Numerical recipies code for that
svdcmp.c reference. Actually in my case I found more accurate the openCV one, but both work fine.
使用 Wiki 页面上列出的库之一:线性代数库的比较。查看“SVD”列以确保支持算法(甚至绝大多数库都支持 SVD)。
Use one of the libraries listed at the Wiki page: comparison of linear algebra libraries. Look under the "SVD" column to make sure algorithm is supported (even vast majority of the libraries do support SVD).
不要自己编写,也不要试图构建别人的源代码。使用为您提供此功能的库。您的目标平台上可能已经有一个可用的。
具体来说,使用行业标准的 LAPACK 库或使用 GSL 或您想要的任何其他线性代数库。它们都有 SVD 实现。
Don't write it yourself, don't deal with trying to build someone else's source. Use a library that provides this function for you. There's probably already one available on your target platform.
Specifically, use the industry-standard LAPACK library or use the GSL or whatever other linear algebra library you want. They all have an SVD implementation.