
On Tue, Feb 22, 2011 at 4:11 AM, Andrey Asadchev <asadchev@gmail.com> wrote:
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));
Hi, while not extending the Boost.uBLAS library? http://www.boost.org/doc/libs/1_45_0/libs/numeric/ublas/doc/index.htm It works very well with matrix and vector. It uses expression templates. It handles special matrices (like sparse matricies). It easly integrates with LAPACK/UBLAS thanks to Boost.Numeric-Bindings. Best, -- Marco