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

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 件のコメント

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.

サインインしてコメントする。

回答 (1 件)

Abhishek Pandey
Abhishek Pandey 2015 年 7 月 15 日
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

カテゴリ

ヘルプ センター および File ExchangeOperators and Elementary Operations についてさらに検索

質問済み:

2015 年 7 月 10 日

回答済み:

2015 年 7 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by