Commit 6e71e8d2 authored by Alois SCHLOEGL's avatar Alois SCHLOEGL

improve accuracy of matrix_sum

parent 38bf02b0
......@@ -262,9 +262,15 @@ int gen_corr_gaussian(const int N_nodes, double sqrt_diag, double sqrt_recip,
row_sums[i] += gaus_ind;
column_sums[j] += gaus_ind;
matrix_sum += gaus_ind;
// Check danger of Rounding errors, do a SUM over column_sums or row_sums instead
for (int i=0; i<N_nodes; i++) {
matrix_sum += row_sums[i] + column_sums[i];
matrix_sum *= 0.5;
for (int i=0; i<N_nodes; i++){
int i_tda=i*tda;
for (int j=0; j<N_nodes; j++){
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment