用于稀疏酉矩阵的最佳C ++矩阵库 [英] Best C++ Matrix Library for sparse unitary matrices
问题描述
我在寻找一个好的(在最好的情况下积极维护)C ++矩阵库。因此,它应该模板化,因为我想使用一个复杂的理性作为数字类型。我处理的矩阵主要是稀疏和单一的。
你能建议图书馆,并给一个小解释为什么使用它们,因为我知道如何找到他们,但我不能真正决定什么是适合我,因为我缺少与他们的经验。
编辑:
我要处理的主要操作是矩阵乘法,与向量和 kronecker乘积的标量乘法。矩阵的大小是指数的,我想至少能处理高达1024x1024个条目的矩阵。
做严重的矩阵素材,依靠 BLAS ,添加 LAPACK / ATLAS (正则矩阵)或 UMFPACK (稀疏矩阵)以获得更高级的数学。原因是这个代码经过了良好的测试,稳定,可靠,并且相当快。此外,您可以直接从供应商处购买(例如 Intel MKL )对你的建筑,而且也免费获得他们。 uBLAS 在 Manuel的回答可能是标准的C ++ BLAS实现。如果您稍后需要类似LAPACK的软件,则可以绑定执行此操作。然而,这些标准库(BLAS / LAPACK / ATLAS或uBLAS +绑定+ LAPACK / ATLAS)没有一个打勾,因为它们是模板化的并且易于使用(除非uBLAS是全部你会需要)。实际上,我必须承认,当我使用BLAS / LAPACK实现时,我倾向于直接调用C / Fortran接口,因为我经常在uBLAS +绑定组合中看不到额外的优势。
如果我需要一个简单易用的通用C ++矩阵库,我倾向于使用 Eigen (我以前使用 NewMat 过去)。优点:
- 在英特尔架构上相当快,可能是最小的矩阵
- nice interface
- 几乎可以从矩阵库中获得所有预期
- ,您可以轻松地添加新类型
缺点(IMO):
- 单一处理器[编辑:部分固定在 Eigen 3.0 ]
- 较大的矩阵和一些高级数学比ATLAS或Intel MKL Edit:在Eigen 3.0中也有所改善]
- 只有稀疏矩阵的实验性支持[ Edit: / li>
编辑:即将推出的Eigen 3.1允许一些功能使用英特尔MKL(或任何其他BLAS / LAPACK实施)。
I am looking for a good (in the best case actively maintained) C++ matrix library. Thereby it should be templated, because I want to use a complex of rationals as numerical type. The matrices what I am dealing with are mainly sparse and unitary.
Can you please suggest libraries and also give a small explaination why to use them, because I know how to find them, but I cannot really decide what is suitable for me because I am missing the experience with them.
EDIT:
The main operations I am dealing with are matrix multiplication, scalar multiplication with a vector and kronecker product. The size of the matrices is exponential and I wanna at least be able to deal with matrices up to 1024x1024 entries.
Many people doing "serious" matrix stuff, rely on BLAS, adding LAPACK / ATLAS (normal matrices) or UMFPACK (sparse matrices) for more advanced math. The reason is that this code is well-tested, stable, reliable, and quite fast. Furthermore, you can buy them directly from a vendor (e.g. Intel MKL) tuned towards your architecture, but also get them for free. uBLAS mentioned in Manuel's answer is probably the standard C++ BLAS implementation. And if you need something like LAPACK later on, there are bindings to do so.
However, none of these standard libraries (BLAS / LAPACK / ATLAS or uBLAS + bindings + LAPACK / ATLAS) ticks your box for being templated and easy to use (unless uBLAS is all you'll ever need). Actually, I must admit, that I tend to call the C / Fortran interface directly when I use a BLAS / LAPACK implementation, since I often don't see much additional advantage in the uBLAS + bindings combination.
If I a need a simple-to-use, general-purpose C++ matrix library, I tend to use Eigen (I used to use NewMat in the past). Advantages:
- quite fast on Intel architecture, probably the fastest for smaller matrices
- nice interface
- almost everything you expect from a matrix library
- you can easily add new types
Disadvantages (IMO):
- single-processor [Edit: partly fixed in Eigen 3.0]
- slower for larger matrices and some advanced math than ATLAS or Intel MKL (e.g. LU decomposition) [Edit: also improved in Eigen 3.0]
- only experimental support for sparse matrices [Edit: improved in upcoming version 3.1].
Edit: The upcoming Eigen 3.1 allows some functions to use the Intel MKL (or any other BLAS / LAPACK implementation).
这篇关于用于稀疏酉矩阵的最佳C ++矩阵库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!