About: Partial template specialization is a research topic. Over the lifetime, 7 publications have been published within this topic receiving 568 citations.
TL;DR: In this paper, the authors describe C++ programming techniques that may help to accelerate linear solvers for large sparse saddle point systems, based on the policy-based design pattern and partial template specialization.
TL;DR: The C ++ programming techniques that can help in creating flexible and extensible programming interfaces for linear solvers are described and implemented in the open source AMGCL library.
Abstract: Ability to solve large sparse linear systems of equations is very important in modern numerical methods. Creating a solver with a user-friendly interface that can work in many specific scenarios is a challenging task. We describe the C ++ programming techniques that can help in creating flexible and extensible programming interfaces for linear solvers. The approach is based on policy-based design and partial template specialization, and is implemented in the open source AMGCL library. Convenience for the user and efficiency is demonstrated on the example of accelerating a large-scale Stokes problem solution with a Schur pressure correction preconditioner. The user may select algorithmic components of the solver by adjusting template parameters without any change to the codebase. It is also possible to switch to block values, or use mixed precision solution, which results in up to 4 times speedup, and reduces the memory footprint of the algorithm by about 50%.
TL;DR: A new fixed precision arithmetic package called RecInt, which uses a recursive double-size data-structure and is particularly well adapted to Newton-Raphson like iterations or Montgomery reduction, which is used for efficient exact linear algebra computations.
Abstract: We propose a new fixed precision arithmetic package called RecInt. It uses a recursive double-size data-structure. Contrary to arbitrary precision packages like GMP, that create vectors of words on the heap, RecInt large integers are created on the stack. The space allocated for these integers is a power of two and arithmetic is performed modulo that power. Operations are thus easily implemented recursively by a divide and conquer strategy. Among those, we show that this packages is particularly well adapted to Newton-Raphson like iterations or Montgomery reduction. Recursivity is implemented via doubling algorithms on templated data-types. The idea is to extend machine word functionality to any power of two and to use template partial specialization to adapt the implemented routines to some specific sizes and thresholds. The main target precision is for cryptographic sizes, that is up to several tens of machine words. Preliminary experiments show that good performance can be attained when comparing to the state of art GMP library: it can be several order of magnitude faster when used with very few machine words. This package is now integrated within the Givaro C++ library and has been used for efficient exact linear algebra computations.
TL;DR: C++ lets you to specify only some of the template arguments, leaving one or more template parameters in the header, but only for class templates, as this Exploration describes.
Abstract: Explicit specialization requires you to specify a template argument for every template parameter, leaving no template parameters in the template header Sometimes, however, you want to specify only some of the template arguments, leaving one or more template parameters in the header C++ lets you do just that and more, but only for class templates, as this Exploration describes
TL;DR: The design and implementation of a Templated C++ class for vectors is described, which is templated both for vector length and vector component type; the vector length is fixed at template instantiation time.
Abstract: We describe the design and implementation of a templated C++ class for vectors. The vector class is templated both for vector length and vector component type; the vector length is fixed at template instantiation time. The vector implementation is such that for a vector of N components of type T, the total number of bytes required by the vector is equal to N * size of (T), where size of is the built-in C operator. The property of having a size no bigger than that required by the components themselves is key in many numerical computing applications, where one may allocate very large arrays of small, fixed-length vectors. In addition to the design trade-offs motivating our fixed-length vector design choice, we review some of the C++ template features essential to an efficient, succinct implementation. In particular, we highlight some of the standard C++ features, such as partial template specialization, that are not supported by all compilers currently. This report provides an inventory listing the relevant support currently provided by some key compilers, as well as test code one can use to verify compiler capabilities.