matrix row/col mapping

250 Views Asked by At

Many square matrices are symmetric. i.e. $a_{i,j}=a_{j,i}$ For such matrices, we can only store the upper triangle elements, i.e. any $a_{i,j}$ for which $i<=j$. Assume a 10x10 matrix. Using this method, we store 10 elements from the first row and 1 element from the last row. I want a simple mapping that selects entries from each row in a more balanced way (5 or 6) entries from each row and still cover all the entries.

EDIT: The particular situation that I needed this for was when I wanted to calculate the pairwise correlation coefficients between every pairs of N vectors using N different machines in parallel.

1

There are 1 best solutions below

0
On BEST ANSWER

I found the following answer:

f(i,j)= ((i+j) mod 2)== (i>=j)