Efficiently computing the inner product of three arrays, two of which are MDA (multidimensional array)

2 Ansichten (letzte 30 Tage)
My problem involves finding the inner product over a field of 91 x 361. Consider an array,g, which is an MDA, 91x361x4, and R is 4 x 4. I am trying to efficiently compute conj(g)*R*g (e.g. g^H*R*g at each point in the field) to produce a scalar at each and every point on the 91x361 field. Moreover,I subsequently need to find the maximum value of the resulting scalar field. I am currently using two loops (1:91 and 1:361), which is naturally very slow. I am trying to use matrix/vector multiplication to speed the process up, as I must perform this process for several hundred iterations.
  1 Kommentar
James Tursa
James Tursa am 11 Jul. 2015
Are you open to mex solutions? This computation would be very easy to code up in a C mex routine (I could do it and post it) and would probably run a couple of orders magnitude faster than what you are currently doing. What are the complexities of the variables involved? Btw, your memory storage is lousy for what you are doing ... g should be 4x91x36 so that the 4-vector you are using to multiply by R is contiguous in memory.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Abhishek Pandey
Abhishek Pandey am 15 Jul. 2015
Hello Robert,
You might find this link useful. It talks about multiple multiplications between matrices, vectors, or scalars contained in two multidimensional arrays, with automatic virtual array expansion.
- Abhishek

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by