Get an element
double get(Body bi, Body bj) { int i = bi.index; int j = bj.index; if (j > i) { final temp = j; j = i; i = temp; } return matrix[((i * (i + 1)) >> 1) + j - 1]; }