Einstein summation for multidimensional arrays

被引:18
作者
Åhlander, K [1 ]
机构
[1] Uppsala Univ, Dept Informat Technol, S-75105 Uppsala, Sweden
关键词
index notation; mathematical software; domain specific language; tensor calculus;
D O I
10.1016/S0898-1221(02)00210-9
中图分类号
O29 [应用数学];
学科分类号
070104 ;
摘要
One of the most common data structures, at least in scientific computing, is the multidimensional array. Some numerical algorithms may conveniently be expressed as a generalized matrix multiplication, which computes a multidimensional array from two other multidimensional arrays. By adopting index notation with the Einstein summation convention, an elegant tool for expressing generalized matrix multiplications is obtained. Index notation is the succinct and compact notation primarily used in tensor calculus. In this paper, we develop computer support for index notation as a domain specific language. Grammar and semantics are proposed, yielding an unambiguous interpretation algorithm. An object-oriented implementation of a C++ library that supports index notation is described. A key advantage with computer support of index notation is that the notational gap between a mathematical index notation algorithm and its implementation in a computer language is avoided. This facilitates program construction as well as program understanding. Program examples that demonstrate the close resemblance between code and the original mathematical formulation are presented. (C) 2002 Elsevier Science Ltd. All rights reserved.
引用
收藏
页码:1007 / 1017
页数:11
相关论文
共 17 条
[1]  
Abraham R., 1988, APPL MATH SCI, V75
[2]  
Åhlander K, 2001, INT FED INFO PROC, V60, P145
[3]  
AHLANDER K, IN PRESS COMPUTERS M
[4]  
AHLANDER K, UNPUB INDEX NOTATION
[5]  
[Anonymous], Encyclopaedia of Mathematics
[6]  
ARGE E, 1997, NUMERICAL METHODS SO, P93
[7]  
BARR A, 2001, EINSTEIN SUMMATION N
[8]   A SIMPLE NOTATION FOR DIFFERENTIAL VECTOR EXPRESSIONS IN ORTHOGONAL CURVILINEAR COORDINATES [J].
BOLTON, EW .
GEOPHYSICAL JOURNAL INTERNATIONAL, 1993, 115 (03) :654-666
[9]  
Gamma E., 1995, Design Patterns: Elements of Reusable Object-Oriented Software, V206, P395, DOI 10.1093/carcin/bgs084
[10]  
LEMKE M, 1993, SIGPLAN NOTICES, V28, P21, DOI 10.1145/156668.159163