Efficiently computing the inner product of three arrays, two of which are MDA (multidimensional array)
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
James Tursa
le 11 Juil 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.
Réponses (1)
Abhishek Pandey
le 15 Juil 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
0 commentaires
Voir également
Catégories
En savoir plus sur Operators and Elementary Operations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!