Blitz logo

Blitz Support :

From: Jonathan Stickel (jjstickel_at_[hidden])
Date: 2003-12-15 12:21:07


Please read the documentation about tensor notation and partial
reductions (http://www.oonumerics.org/blitz/manual/blitz03.html#l75).
Here is a quick example of how to use these features to do matrix
multiplication:

   Array<double,2> A(m,p), B(p,n), C(m,n); //m,n,p are integer values

   firstIndex i; //for blitz tensor notation
   secondIndex j;
   thirdIndex k;

   A = [assignment];

   B = [assignment];

   C = sum(A(i,k)*B(k,j),k); // matrix multiply C(m,n)=A(m,p)*B(p,n)

HTH,
Jonathan

Thomas Wharton wrote:
> Greetings,
>
> I recently came across your Blitz++ lib and I am very impressed! However, I
> cant seem to find any function that matrix multiples two (2D/3D) matrices
> (though the element wise multiply via the '*' operator works great) Does
> your library contain such a function?
>
> Many Thanks,
> Thomas Wharton
> Software Engineer
> Raytheon Co.
>
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>