
Hi. I am working on a tensor library (in the spirit of FTensor). Perhaps you are interested as well? http://code.google.com/p/asadchev/source/browse/#svn%2Ftrunk%2Fprojects%2Fbo... example: tensor::tensor<3> A(10,10,10); size_t size[] = { 10, 10, 10, 10 }; tensor::tensor<4> B(size), C(size); tensor::index<'a'> a; tensor::index<'b'> b; tensor::index<'c'> c; tensor::index<'d'> d; tensor::index<'e'> e; // using dgemm underneath contract(1, B(b,0,a,0), C(a,c,d,0), 0, A(b,c,d)); A(b,c,d) = contract(B(b,0,a,0), C(a,c,d,0)); A(b,c,d) = 5.0*contract(B(b,0,a,0), C(a,c,d,0)); A(b,c,d) -= 5*contract(B(b,0,a,0), C(a,c,d,0)); A(b,c,d) += 4*contract(B(b,0,a,0), C(a,c,d,0)); int i = 9; // arbitrary tensor ops using templates A(c,d,i) = C(b,c,a,i)*A(a,b,i); A(i,i,i) = C(b,c,a,i)*(A(a,b,c) + B(a,b,i,c));