arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1805.03380cs.MS
收藏

C++中的一个User-Friendly混合稀疏矩阵类

A User-Friendly Hybrid Sparse Matrix Class in C++

Conrad Sanderson, Ryan Curtin

摘要:

当实现需要稀疏矩阵的功能时,有许多存储格式可供选择,每种格式都有优点和缺点。为了获得良好的性能,可能需要在一个程序中使用几种格式,这需要在格式之间进行显式选择和转换。这可能既乏味又容易出错,特别是对于非专业用户。出于这个问题,我们提出了一个用户友好的稀疏矩阵类的C++语言,具有高层次的应用程序编程接口故意类似于广泛使用的MATLAB语言。该类内部使用两种主要方法来实现高效执行:(i)混合存储框架,根据最适合特定操作的格式,在三种底层存储格式(压缩稀疏列,坐标列表,红黑树)之间自动无缝切换,以及(ii)基于模板的元编程,以自动检测和优化常见表达式模式的执行。为了便于将研究代码相对快速地转换到生产环境中,类及其相关函数提供了一套基本的稀疏线性代数功能(例如,算术运算、子矩阵操作)以及用于稀疏特征分解和线性方程求解器的高级功能。后者通过提供底层ARPACK和SuperLU库的易于使用的抽象来实现。源代码是开放的,并在许可的Apache 2.0许可证下提供,允许在商业产品中不受限制地使用。

英文摘要:

When implementing functionality which requires sparse matrices, there are numerous storage formats to choose from, each with advantages and disadvantages. To achieve good performance, several formats may need to be used in one program, requiring explicit selection and conversion between the formats. This can be both tedious and error-prone, especially for non-expert users. Motivated by this issue, we present a user-friendly sparse matrix class for the C++ language, with a high-level application programming interface deliberately similar to the widely used MATLAB language. The class internally uses two main approaches to achieve efficient execution: (i) a hybrid storage framework, which automatically and seamlessly switches between three underlying storage formats (compressed sparse column, coordinate list, Red-Black tree) depending on which format is best suited for specific operations, and (ii) template-based meta-programming to automatically detect and optimise execution of common expression patterns. To facilitate relatively quick conversion of research code into production environments, the class and its associated functions provide a suite of essential sparse linear algebra functionality (eg., arithmetic operations, submatrix manipulation) as well as high-level functions for sparse eigendecompositions and linear equation solvers. The latter are achieved by providing easy-to-use abstractions of the low-level ARPACK and SuperLU libraries. The source code is open and provided under the permissive Apache 2.0 license, allowing unencumbered use in commercial products.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑