469,308 Members | 2,707 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,308 developers. It's quick & easy.

Multiplication of matrices consisting of arrays

Hello,

I am wondering if there is an efficient way (other than for cycle) of solving following task:

I need to multiply e.g. two matrices and at every point in the matrix there is an array. The two matrices shall be multiplied using matrix multiplication and when the elements of these matrices are multiplied, this shall be done elementwise. So lets say such multiplication:

[[[1,1,1],[2,2,2]],
[[3,3,3],[4,4,4]]]
x
[[[1,1,1],[2,2,2]],
[[3,3,3],[4,4,4]]]
=
[[[1,1,1]*[1,1,1]+[2,2,2]*[3,3,3],[1,1,1]*[2,2,2]+[2,2,2]*[4,4,4]],
[[3,3,3]*[1,1,1]+[4,4,4]*[3,3,3]],[[3,3,3]*[2,2,2]+[4,4,4]*[4,4,4]]]

The multiplication * denotes elementwise multiplication and x denotes matrix multiplication

Thank anybody for an idea, how to do it.
Jun 25 '11 #1
0 1225

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

11 posts views Thread by Michael Bader | last post: by
11 posts views Thread by Soeren Sonnenburg | last post: by
2 posts views Thread by Morgan | last post: by
14 posts views Thread by amitnanda | last post: by
1 post views Thread by conor.robinson | last post: by
1 post views Thread by mclaugb | last post: by
1 post views Thread by glitchized | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.