title: How to parallelize this matrix operation
body: <p>In the calculation of the resistance distance matrix there is a bottleneck in the final step, which is as follows:</p>
  <pre><code>matrix1[i, j] = matrix2[i, i] - 2*matrix2[i, j] + matrix[j, j]
  </code></pre>
  <p>Every algorithm I find parallelizes every step except this one, so right now I just have a double for loop. The matrices are 16000x16000 so this is quite time costly. Is there a way to speed up such an operation?</p>