我可以使用 Lapack 计算大型稀疏矩阵的特征值和特征向量吗?

发布于 2024-09-10 19:56:16 字数 224 浏览 6 评论 0原文

如果我有一个 1,000 x 1,000 的方阵,Lapack 可以计算该矩阵的特征向量和特征值吗?如果可以的话需要多长时间?另外,对于 10,000 x 10,000 矩阵甚至 1,000,000 x 1,000,000 矩阵呢?

请注意,这些将是主要由 0 填充的稀疏矩阵(这些矩阵将是代表社交网络的图表)。 Lapack 中有处理稀疏矩阵的特殊程序吗?我看到了 Arpack 的推荐。但这可以计算非常大的矩阵吗?

If I had a square matrix that is 1,000 by 1,000 could Lapack calculate the eigenvectors and eigenvalues for this matrix? And if it can how long would it take? Also what about for a 10,000 by 10,000 matrix or even a 1,000,000 by 1,000,000 matrix?

Please note these are going to be sparse matrices primarily populated by 0s (the matrices will be graphs representing social networks). Are there any special procedures in Lapack for dealing with sparse matrices? I see the Arpack recommendation. But would this allow for calculating very large matrices?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

爱的故事 2024-09-17 19:56:18

如果您的矩阵是稀疏的,那么您最好使用 稀疏矩阵 包。有关更多信息,请参阅这篇 StackOverflow 文章信息。

使用 lapack,您可以在几秒钟内完成 1000 x 1000(取决于您的机器)。 10000 x 10000 会花费 1000 倍的时间,因为所有算法都趋向于 O(n^3)。

If your matrices are sparse, you are probably better off using a sparse matrix package. See this StackOverflow article for more info.

Using lapack you could do a 1000 x 1000 in a couple of seconds (depending on your machine). A 10000 x 10000 would take 1000 times longer, as the algorithms all tend to be O(n^3).

各自安好 2024-09-17 19:56:18

Lapack 仅支持稠密和带状矩阵(不支持一般稀疏矩阵)。因此,除非你的稀疏矩阵是带状的(从你的描述来看,它听起来像是一个通用的稀疏矩阵,通常存储在压缩行存储方案中),那么 lapack 不是你想要使用的。

对于大型稀疏矩阵,Arpack 将是一个很好的起点。

Lapack only has support for dense and banded matrices (no support for general sparse matrices). So unless your sparse matrix is banded (from your description it sounds like it would be a general sparse matrix, usually stored in a compressed row storage scheme), then lapack is not what you want to use.

For large sparse matrices, Arpack would be a good place to start.

谁的年少不轻狂 2024-09-17 19:56:17

LAPACK 没有内置对稀疏矩阵的特殊支持,但 ARPACK 有。根据您计划运行此程序的计算机,这可能会排除使用 LAPACK,因为对于非常大的矩阵,您可能会耗尽内存。请参阅 http://www.netlib.org/utk/people/JackDongarra/ la-sw.html 各种线性代数库的摘要。

如果没有您期望的矩阵(对称矩阵会快很多倍)、您计划在什么处理器上运行、您有多少可用内存、等等。

根据您的其他问题,我建议坚持使用 MATLAB。它具有稀疏矩阵支持,一般适用于线性代数。

LAPACK does not have special support built in for sparse matrices, but ARPACK does. Depending on the machine you plan to run this on, this could rule out use of LAPACK, as you may run out of memory for very large matrices. See http://www.netlib.org/utk/people/JackDongarra/la-sw.html for a summary of various linear algebra libraries.

There is no way to give you a meaningful estimate for how long these computations would take without details of what matrices you expect (symmetric ones will be many times faster), what processor you plan to run this on, how much memory you have available, etc.

Based on your other questions, I would recommend sticking with MATLAB. It has sparse matrix support and is good for linear algebra in general.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文