问题标签 [lapack++]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
3063 浏览

c++ - How to install lapack++ on linux

I'm making a script on c++ that requires the resolution of linear systems. I've looked around and found that the LAPACK++ gives me functions to achieve that end. However I've been having a lot of trouble just getting them installed.

I have the following files:

Those files were given to me to use with microsoft visual studio 2010 some time ago. From what I've read I need at least the lapack.lib and blas.lib libraries, however I have no idea where to put them, or what to install.

I've searched on the web, but all the information I've gathered only got me more confused. If someone could point me in the right direction I'd highly appreciate.

Thanks.

PS1: Take into consideration that I'm very new with Linux. PS2: Do I have to install LAPACK++ or will LAPACK do? Because there seems to be more information about the later than the first.

0 投票
2 回答
1233 浏览

c++ - 低 RAM 消耗 C++ 特征求解器

我是C++ 编程的新手,但我的任务是为非常大的大小矩阵计算对称矩阵(和厄米特矩阵)的特征值和特征向量(标准特征问题Ax=lx ):二项式(L,L/2)其中L大约是18-22。现在我在有大约 7.7 GB 内存的机器上对其进行测试,但最终我可以使用 64 GB 内存的 PC。

我从Lapack++开始。一开始我的项目假设只为对称实矩阵解决这个问题。

这个图书馆很棒。非常快速和小内存消耗。它可以选择计算特征向量并放入输入矩阵 A 以节省内存。有用!我认为Lapack++ eigensolver可以处理 Hermitian 矩阵,但由于未知原因它不能(也许我做错了什么)。我的项目已经发展,我应该也能够计算 Hermitian 矩阵的这个问题。

所以我试图将 library 更改为Armadillo library。它工作得很好,但它不如用 all替换的Lapack++好,但当然支持 Hermitian 矩阵。mat Aeigenvec

L=14 的一些统计数据

  • Lapack++ RAM 126MB 时间 7.9s 特征值 + 特征向量

  • 犰狳RAM 216MB 时间 12s 特征值

  • 犰狳RAM 396MB 时间 15s 特征值+特征向量

让我们做一些计算:double变量大约是8B。我的矩阵有大小 binomial(14,7) = 3432,所以在理想情况下它应该有3432^2*8/1024^2 = 89 MB

我的问题是:是否可以修改或强制犰狳做一个像Lapack++一样的好把戏?犰狳的用途LAPACKBLAS惯例。或者也许有人可以推荐使用另一个库来解决这个问题的另一种方法?

PS:我的矩阵真的很稀疏。它有大约2 * binomial(L,L/2)个非零元素。我尝试用SuperLUCSC 格式计算它,但它不是很有效,因为 L=14 -> RAM 185MB,但时间为 135 秒。