TTL

The Tensor Library

Documentation | Download | Example | License

Writing tensor expressions natively in C++

The purpose of this library is to facilitate the translation of tensor expressions into C++ without compromizing speed. A tensor here is a vector, matrix or any multidimensional data array. Especially expressions including several indices can be taken as written into C++ removing the need for explicit loops. Expression templates and similar techniques are being used to achive this goal.

This software has a free license . If you have suggestions or find bugs, if you like it (or don't like it), please mail me.

Features

What are index expressions?

Expressions like
can be taken into the sourcecode like this:

...
Index1 m;
Index2 n;
Index3 k;
complex<double> iu( 0.0, 1.0 );
a[m] = norm( tsum( tsum( c( m, n ) * exp( iu * w[ k+1 ] * t( n, k ) ) ) ) );

No explicit loops are necessary here, the loops over the three indices m, n and k are performed implicitely.

Installation

Thomas Kunert
Thu Jun 6 10:47:47 CEST 2002