Matrix calculation problem

A vector sequence A, another vector sequence B, now requires a matrix C, $ C_ij $ denotes the Euclidean distance between A_i $ $ and $ B_j $. X-A elements, B elements of Y.
There are M thread, storing in memory all the time up to N vector sequence, each thread distance calculation with a pair of the vectors is P, each loaded from the hard disk memory used as a vector Q.
Q: In the case of the thread to meet the constraints (time constraints), memory constraints (space constraints), and how long it takes to calculate the fastest matrix C. (Matrix C share memory has been opened up completed, no need to consider the memory occupied by C).

A heuristic idea is as follows: C zigzag scanning array, the value C of each element is calculated.

Guess you like

Origin www.cnblogs.com/weiyinfu/p/10987866.html