diff options
author | Pjotr Prins | 2018-08-26 09:24:26 +0000 |
---|---|---|
committer | Pjotr Prins | 2018-08-26 09:24:26 +0000 |
commit | e760e53fac224f252db47dfe7c37f76d6bebb4dc (patch) | |
tree | e765c8874a12cfd1f5fd9837a6e360f82a7d5e83 /src | |
parent | de52274064b78c5020f7e1edf4b023fa986b68e0 (diff) | |
download | pangemma-e760e53fac224f252db47dfe7c37f76d6bebb4dc.tar.gz |
Make sure tau_inv is initialized outside loop - gets rid of compiler warning
Diffstat (limited to 'src')
-rw-r--r-- | src/vc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -1935,7 +1935,7 @@ void VC::CalcVCacl(const gsl_matrix *K, const gsl_matrix *W, size_t n1 = K->size1, n2 = K->size2; size_t n_vc = n2 / n1; - double d, y2_sum, tau_inv; + double d, y2_sum; // New matrices/vectors. gsl_matrix *K_scale = gsl_matrix_alloc(n1, n2); @@ -2049,6 +2049,7 @@ void VC::CalcVCacl(const gsl_matrix *K, const gsl_matrix *W, // Iterate to solve tau and h's. size_t it = 0; double s = 1; + double tau_inv = y2_sum / (double)n1 - d / ((double)n1 * ((double)n1 - 1)); while (abs(s) > 1e-3 && it < 100) { // Update tau_inv. |