473,385 Members | 2,243 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1301

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

Similar topics

11
by: Michael Bader | last post by:
Hi, I'm currently working on a matrix multiplication code (matrix times matrix), and have come along some interesting/confusing results concerning the running time of the (apparently) same...
11
by: Soeren Sonnenburg | last post by:
Hi all, Just having started with python, I feel that simple array operations '*' and '+' don't do multiplication/addition but instead extend/join an array: a= >>> b= >>> a+b
2
by: Morgan | last post by:
Thanks to all of you because I solved the problem related with my previous post. I simply made confusion with pointers to pointers and then succeeded passing the reference to the first element...
14
by: amitnanda | last post by:
Hi Guys, I have a matrix multiplication program in C that multiplies two matrices. When their size is 3*3 or 800*800, the program runs fine. But above that size, I get a "segmentation fault"....
1
by: conor.robinson | last post by:
Using large arrays of data I found it is MUCH faster to cast arrays to matricies and then multiply the two matricies togther (scipy.matrix(ARRAY1)*scipy.matrix(ARRAY2)) in order to do a matrix...
1
by: mclaugb | last post by:
I want to multiply two arrays: a matrice and the conjugate of its transpose. Then i wish to invert the resulting matrix. In Matlab, the statement is : Z= inv(M .' * M) To implement in...
1
by: hello12 | last post by:
hello, i have 2 upper triangular matrices A and B.. the values are stored in efficient format in the text file. I wanted to use those values for matrix multiplication and display the result C...
1
emaghero
by: emaghero | last post by:
Does anybody know an algorithm for the fast multiplication of three n-x-n symmetric matrices? I have an algorithm, which I'm not too pleased with, that does the job. Does anybody know a faster...
1
by: dcatunlucky | last post by:
Ok, I have an assignment to write a program that multiplies two matrices. The matrices dimensions will be user defined as well as the numbers (floating point values) inside of them. The program must...
1
by: glitchized | last post by:
hi, can anyone help me with matrices multiplication function. how do i go about doing it if i wanna do multiplication of 2 square matrices? i'll first take in the size of the matrix example: cin...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.