{"title":"表达式定义精度","authors":"A. Pokorny, J. W. von Gudenberg","doi":"10.1109/SCAN.2006.17","DOIUrl":null,"url":null,"abstract":"In numerical computations the accuracy of the result quite often depends on a few expressions. In numerical linear algebra, e.g., summations or dot products should very often be computed with additional precision or accuracy. Corresponding algorithms have been developed for a long time and only recently revisited. The usage of these algorithms would be facilitated, if we had a means in a programming language to specify the accuracy requirements of an expression evaluation. In this paper we present a precision aware C+ + template library (PTL)for matrix / vector operations that provides several algorithms with different accuracy or precision characteristics for matrix multiplication and related operations. A matrix is a template parameterized with the number of rows and columns, the element type, a type representing the shape, and an evaluation strategy. Currently only two shapes are implemented, fixed or dynamically adaptable dense arrays. We distinguish between row and column vectors. The access to submatrices and -vectors is accomplished by an overloaded function template. It is possible to adapt the expression system to types declared in other libraries or declared by the user. The concept of expression templates is extended in a way that allows the user to specify rules for the evaluation strategy. The expression tree is constructed by overloading the operators for the expression type. In a second but still compile-time step the evaluation strategy is chosen and the trees are transformed and prepared for run-time execution. The strategy is determined by the tag type of the result, but it can be explicitly set using the index operator. The evaluation strategies can be combined with loop unrolling or loop fusion. Note that the latter not only increases the precision but also the accuracy of the result, since this strategy directly implements the dotprecision expression evaluation in the XSC languages. The library provides evaluation strategies for matrix and vector expressions with k-fold precision and with least bit accuracy. Efficiency and accuracy of the algorithms are tested vs. the Gnu multiple precision library GMP.","PeriodicalId":388600,"journal":{"name":"12th GAMM - IMACS International Symposium on Scientific Computing, Computer Arithmetic and Validated Numerics (SCAN 2006)","volume":"121 3 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2006-09-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Expression Defined Accuracy\",\"authors\":\"A. Pokorny, J. W. von Gudenberg\",\"doi\":\"10.1109/SCAN.2006.17\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"In numerical computations the accuracy of the result quite often depends on a few expressions. In numerical linear algebra, e.g., summations or dot products should very often be computed with additional precision or accuracy. Corresponding algorithms have been developed for a long time and only recently revisited. The usage of these algorithms would be facilitated, if we had a means in a programming language to specify the accuracy requirements of an expression evaluation. In this paper we present a precision aware C+ + template library (PTL)for matrix / vector operations that provides several algorithms with different accuracy or precision characteristics for matrix multiplication and related operations. A matrix is a template parameterized with the number of rows and columns, the element type, a type representing the shape, and an evaluation strategy. Currently only two shapes are implemented, fixed or dynamically adaptable dense arrays. We distinguish between row and column vectors. The access to submatrices and -vectors is accomplished by an overloaded function template. It is possible to adapt the expression system to types declared in other libraries or declared by the user. The concept of expression templates is extended in a way that allows the user to specify rules for the evaluation strategy. The expression tree is constructed by overloading the operators for the expression type. In a second but still compile-time step the evaluation strategy is chosen and the trees are transformed and prepared for run-time execution. The strategy is determined by the tag type of the result, but it can be explicitly set using the index operator. The evaluation strategies can be combined with loop unrolling or loop fusion. Note that the latter not only increases the precision but also the accuracy of the result, since this strategy directly implements the dotprecision expression evaluation in the XSC languages. The library provides evaluation strategies for matrix and vector expressions with k-fold precision and with least bit accuracy. Efficiency and accuracy of the algorithms are tested vs. the Gnu multiple precision library GMP.\",\"PeriodicalId\":388600,\"journal\":{\"name\":\"12th GAMM - IMACS International Symposium on Scientific Computing, Computer Arithmetic and Validated Numerics (SCAN 2006)\",\"volume\":\"121 3 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2006-09-26\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"12th GAMM - IMACS International Symposium on Scientific Computing, Computer Arithmetic and Validated Numerics (SCAN 2006)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/SCAN.2006.17\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"12th GAMM - IMACS International Symposium on Scientific Computing, Computer Arithmetic and Validated Numerics (SCAN 2006)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SCAN.2006.17","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

在数值计算中,结果的准确性往往取决于几个表达式。例如,在数值线性代数中,求和或点积的计算通常需要额外的精度或准确度。相应的算法已经开发了很长时间,只是最近才重新审视。如果我们在编程语言中有一种方法来指定表达式求值的精度要求,那么这些算法的使用将会很方便。在本文中,我们提出了一个精确感知的c++矩阵/向量运算模板库(PTL),它为矩阵乘法和相关运算提供了几种具有不同精度或精度特征的算法。矩阵是一个模板,参数化了行数和列数、元素类型、表示形状的类型和求值策略。目前只实现了两种形状,固定的或动态适应的密集数组。我们区分行向量和列向量。对子矩阵和向量的访问是通过重载函数模板完成的。可以使表达式系统适应在其他库中声明或由用户声明的类型。表达式模板的概念得到了扩展,允许用户为求值策略指定规则。表达式树是通过重载表达式类型的操作符来构造的。在第二步(仍然是编译时步骤)中,选择评估策略,转换树并为运行时执行做准备。该策略由结果的标记类型决定,但可以使用索引操作符显式设置。评估策略可以与循环展开或循环融合相结合。注意,后者不仅提高了精度,而且提高了结果的准确性,因为该策略直接实现了XSC语言中的dotprecision表达式求值。该库提供了具有k倍精度和最小位精度的矩阵和向量表达式的求值策略。用Gnu多精度库GMP对算法的效率和精度进行了测试。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
Expression Defined Accuracy
In numerical computations the accuracy of the result quite often depends on a few expressions. In numerical linear algebra, e.g., summations or dot products should very often be computed with additional precision or accuracy. Corresponding algorithms have been developed for a long time and only recently revisited. The usage of these algorithms would be facilitated, if we had a means in a programming language to specify the accuracy requirements of an expression evaluation. In this paper we present a precision aware C+ + template library (PTL)for matrix / vector operations that provides several algorithms with different accuracy or precision characteristics for matrix multiplication and related operations. A matrix is a template parameterized with the number of rows and columns, the element type, a type representing the shape, and an evaluation strategy. Currently only two shapes are implemented, fixed or dynamically adaptable dense arrays. We distinguish between row and column vectors. The access to submatrices and -vectors is accomplished by an overloaded function template. It is possible to adapt the expression system to types declared in other libraries or declared by the user. The concept of expression templates is extended in a way that allows the user to specify rules for the evaluation strategy. The expression tree is constructed by overloading the operators for the expression type. In a second but still compile-time step the evaluation strategy is chosen and the trees are transformed and prepared for run-time execution. The strategy is determined by the tag type of the result, but it can be explicitly set using the index operator. The evaluation strategies can be combined with loop unrolling or loop fusion. Note that the latter not only increases the precision but also the accuracy of the result, since this strategy directly implements the dotprecision expression evaluation in the XSC languages. The library provides evaluation strategies for matrix and vector expressions with k-fold precision and with least bit accuracy. Efficiency and accuracy of the algorithms are tested vs. the Gnu multiple precision library GMP.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
Validated computation for infinite dimensional eigenvalue problems VALENCIA-IVP: A Comparison with Other Initial Value Problem Solvers Fast and Accurate Multi-Argument Interval Evaluation of Polynomials Towards Combining Probabilistic, Interval, Fuzzy Uncertainty, and Constraints: An Example Using the Inverse Problem in Geophysics Computer-Assisted Proofs in Solving Linear Parametric Problems
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1