
Greetings, I have developed a C++ tensor library using template expressions which allows Einstein summation convention to be used to describe mathematical operations on tensors in C++. This allows a great simplification in syntax, while retaining execution speeds identical to hand optimized C code in most cases. An example of the syntax is: // Declare three rank 2 tensors (rank = # of dimensions) of doubles with sizes of // 6 x 5, 6 x 10, and 10 x 5 respectively tensor<double, 2> A(6, 5); tensor<double, 2> B(6, 10); tensor<double, 2> C(10, 5); // Name three index variable to be used in what follows index_variable<0> i; index_variable<1> j; index_variable<2> k; A[i][j] = 1.0; // Initialize A to all 1's B[i][j] = 4.5; // Initalize B to all 4.5 boost::mt19937 rng; C[i][j] = trand(rng); // Initalize C to uniform random numbers 0-1 C[i][2] = 2.1; // Set row 2 to 2.1 C[2][i] = 5.5; // Set col 2 to 5.5 C[2][2] = 0.0; // Zero out 2,2 A[i][j] = B[i][k] * C[k][j]; // Perform a matrix multiply /* The above line translates roughly as: for(size_t i = 0; i < A.size<0>(); i++) { for(size_t j = 0; j < A.size<1>(); j++) { double total = 0.0; for(size_t k = 0; k < B.size<1>(); k++) total += B[i][k] * C[k][j]; A[i][j] = total; } } */ An unlimited number of dimensions are supported, arbitrary operations are allowed, and for cases where you wish to perform other types of cumulative functions, such as finding the maximum element, a syntax such as: A[i] = max(j, B[i][j]); is allowed. There are lots of other interesting features but I don't wish to make this email too long. As far as efficency, Intel's compiler builds every example I've tried so far into code as good as doing the work by hand. GCC does so for expressions of reasonably complexity, and MSVC's optimizer does alright, but not nearly as well as the others. I was interested in knowing what the interest level of providing such a library as part of boost would be. I've tried to adhere to the boost coding guidelines during the construction. I've been using this library for over 6 months myself for scientific computing. However, I've so far avoiding sending a query to the boost mailing lists as the procedures for submission and review seem quite daunting. I'm usually crushingly busy, and I'm also especially bad at documentation. Still, I thought I would float the idea to guage interest, and also ask if anyone would be interested in helping me through the process somewhat. Thank you for you time. -Jeremy Bruestle