This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Fast Multidimensional Array Product and Sum

Tags: None
(comma "," separated)
MarkoFranko
Registered Member
Posts
11
Karma
0
OS
Hello!

I have the following problem:

Two objects are F_ijkl and F'_i'j'k'l' which are 4-dimensional matrices with complex numbers.
The other object is K_ij,a 2-dimensional matrix with complex numbers.
These objects are not sparse.

With these objects I have to calculate the following sum:

Code: Select all
Sum_{j,k,l,i',j',k'}( F_ijkl*K_ji'*K_kj'*K_lk'*F'_i'j'k'l')


How can I do it fast and memory efficient? (I have access to 200 Gig Ram)
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
The result is a 2-dimentional matrix with indices i and l', right?
Anyway, the best is probably to check whether you rewrite this sum such that it involves matrix-matrix product and use Eigen's matrix product to evaluate them (it will optimize cache usage for you). If there are multiple ways to leverage matrix-matrix operations, then choose the option which maximize the involved matrix sizes. For curiosity, what are the typical sizes of the objects?


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]