×

LinearOperator – a generic, high-level expression syntax for linear algebra. (English) Zbl 1443.65003

Summary: We introduce an expression syntax for the evaluation of matrix-matrix, matrix-vector and vector-vector operations. The implementation is similar to the well-known general concept of expression templates as used, for example, in the C++ linear-algebra libraries Eigen and Blaze. The novelty of the approach that is discussed here lies in the use of new C++11 features like lambda expressions and std::function objects that avoid the majority of the implementational complexity that usually comes with a pure template solution.
A concrete implementation of the expression syntax has been developed within the framework of the finite-element library deal.II, but it is fairly generic: the LinearOperator implementation only requires a minimal vector and matrix interface, that all of deal.II’s concrete vector and matrix types adhere to. This makes the interface fully transparent with respect to the concrete implementation, in particular to the storage strategy (full matrix, sparse structure), and memory strategy (local, shared, distributed). The paper concludes with a number of performance comparisons and examples that demonstrate that the framework results in efficient, short and concise code. The performance comparisons show that the overhead introduced by std::function objects is negligible for moderately sized matrices, even when compared to native expression-template implementations.

MSC:

65-04 Software, source code, etc. for problems pertaining to numerical analysis
65Fxx Numerical linear algebra

Software:

deal.ii
Full Text: DOI

References:

[2] Veldhuizen, T., Expression templates, C++ Rep., 7, 5, 280-305 (1995)
[4] Iglberger, K.; Hager, G.; Treibig, J.; Rüde, U., Expression templates revisited: a performance analysis of current methodologies, SIAM J. Sci. Comput., 34, 2, C42-C69 (2012)
[5] Musser, D. R.; Stepanov, A. A., (Generic Programming. Generic Programming, Lecture Notes in Computer Science, vol. 358 (1989), Springer Berlin, Heidelberg), 13-25, Berlin, Heidelberg
[7] Bangerth, W.; Heister, T.; Heltai, L.; Kanschat, G.; Kronbichler, M.; Maier, M.; Turcksin, B., The library, version 8.3, Arch. Numer. Softw., 4, 100 (2016)
[8] Bangerth, W.; Heister, T.; Heltai, L.; Kanschat, G.; Kronbichler, M.; Maier, M.; Turcksin, B.; Young, T. D., The Library, Version 8.2, Arch. Numer. Softw., 3 (2015)
[10] Benzi, M.; Wathen, A. J., (Some Preconditioning Techniques for Saddle Point Problems. Some Preconditioning Techniques for Saddle Point Problems, Mathematics in Industry, vol. 13 (2008), Springer: Springer Berlin, Heidelberg), 195-211 · Zbl 1152.65425
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. In some cases that data have been complemented/enhanced by data from zbMATH Open. This attempts to reflect the references listed in the original paper as accurately as possible without claiming completeness or a perfect matching.