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

조회 수: 8 (최근 30일)
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
James Tursa
James Tursa 2015년 7월 11일
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

카테고리

Help CenterFile Exchange에서 Operators and Elementary Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by