P1635R0 : A Design for an Inter-Operable and Customizable Linear Algebra Library

semanticscholar(2019)

引用 0|浏览0
暂无评分
摘要
In the past few years, there has been an effort to add a linear algebra library to the standard library. The motivations for the effort can be found in [2]. There are already quite a few papers in flight concerning the design, with the primary one being [1]. The primary idea behind the design in the paper is to provide a collection of standard linear algebra types and functions with facilities for customization for special purposes. There is another approach which one can pursue, wherein, we ask the types implemented by the standard library and the user alike to satisfy certain requirements and then write generic code for those types. This is the idea which is primarily employed by the standard template library. In this paper, we take the second approach to the design of a linear algebra library. Now, while the two approach do look different in principle, the practical considerations involved and the resulting design from the two approaches might end up being very similar. For example, in absence of well-designed types and functions in the standard library, the approach in this paper has a potential to create disparate and fragmented types and engines with possibly sub-par implementations. A welldesigned standard library types in the spirit of [1] will go a long way towards acting as a deterrent to such implementations. This reasoning is not very different from the reasoning today wherein we can confidently refer people to use std::vector for most purposes even though, technically, anyone can write their own vector implementation and it will work with other parts of standard library just fine. For named functions, there is not anything significantly different about linear algebra types as to require a special attention in contrast with standard library types. The situation however changes when one begins talking about operators. Operators make the code quite readable and hence are considered quite desirable in the linear algebra community, however, this also means that specifying customization at the operator level in generic code can become quite cumbersome. For this reason, in this paper, we only devote our attention to the operator algebra between linear algebraic types. As a matter of exposition, we currently limit ourselves to only one operator, the operator+ between vectors, but one can see that the design can very well extend to other operators as well. In the next versions of this paper, we plan to include more operators in the exposition. The central idea of the paper is to use a configurable template parameter named as engine and then use that as a customization point to select correct algorithms. This also implies that instead of writing operators for specific types, we write operators for types with the corresponding engine parameter. This allows us
更多
查看译文
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要