diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bslmmdap.cpp | 6 | ||||
-rw-r--r-- | src/mathfunc.cpp | 14 | ||||
-rw-r--r-- | src/param.cpp | 2 | ||||
-rw-r--r-- | src/vc.cpp | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/src/bslmmdap.cpp b/src/bslmmdap.cpp index 6f9aba7..f55ce19 100644 --- a/src/bslmmdap.cpp +++ b/src/bslmmdap.cpp @@ -659,13 +659,13 @@ void single_ct_regression(const gsl_matrix_int *Xd, sum_pip[i] = sum[i] = 0; } - for (int i = 0; i < Xd->size1; i++) { + for (size_t i = 0; i < Xd->size1; i++) { int cat = gsl_matrix_int_get(Xd, i, 0); sum_pip[cat] += gsl_vector_get(pip_vec, i); sum[cat] += 1; } - for (int i = 0; i < Xd->size1; i++) { + for (size_t i = 0; i < Xd->size1; i++) { int cat = gsl_matrix_int_get(Xd, i, 0); gsl_vector_set(prior_vec, i, sum_pip[cat] / sum[cat]); } @@ -684,7 +684,7 @@ void BSLMMDAP::DAP_EstimateHyper( const vector<double> &vec_sa2, const vector<double> &vec_sb2, const vector<double> &wab, const vector<vector<vector<double>>> &BF, gsl_matrix *Ac, gsl_matrix_int *Ad, gsl_vector_int *dlevel) { - clock_t time_start; + // clock_t time_start; // Set up BF. double h, rho, sigma_a2, sigma_b2, d, s, logm, logm_save; diff --git a/src/mathfunc.cpp b/src/mathfunc.cpp index e7dff73..ba71b64 100644 --- a/src/mathfunc.cpp +++ b/src/mathfunc.cpp @@ -211,8 +211,8 @@ bool isMatrixSymmetric(const gsl_matrix *G) { auto m = G->data; // upper triangle auto size = G->size1; - for(auto c = 0; c < size; c++) { - for(auto r = 0; r < c; r++) { + for(size_t c = 0; c < size; c++) { + for(size_t r = 0; r < c; r++) { int x1 = c, y1 = r, x2 = r, y2 = c; auto idx1 = y1*size+x1, idx2 = y2*size+x2; // printf("(%d,%d %f - %d,%d %f)",x1,y1,m[idx1],x2,y2,m[idx2]); @@ -261,7 +261,7 @@ tuple<double, double, double> abs_minmax(const gsl_vector *v) { auto min = std::abs(v->data[0]); auto min1 = std::abs(v->data[0]); auto max = std::abs(v->data[0]); - for (auto i=0; i<v->size; i++) { + for (size_t i=0; i<v->size; i++) { auto value = std::abs(v->data[i]); if (value < min) { min1 = min; @@ -277,7 +277,7 @@ tuple<double, double, double> abs_minmax(const gsl_vector *v) { // the lowest value bool has_negative_values_but_one(const gsl_vector *v) { bool one_skipped = false; - for (auto i=0; i<v->size; i++) { + for (size_t i=0; i<v->size; i++) { if (v->data[i] < 0.0) { if (one_skipped) return true; @@ -289,7 +289,7 @@ bool has_negative_values_but_one(const gsl_vector *v) { uint count_small_values(const gsl_vector *v, double min) { uint count = 0; - for (auto i=0; i<v->size; i++) { + for (size_t i=0; i<v->size; i++) { if (v->data[i] < min) count += 1; } @@ -316,14 +316,14 @@ bool isMatrixIllConditioned(const gsl_vector *eigenvalues, double max_ratio) { double sum(const double *m, size_t rows, size_t cols) { double sum = 0.0; - for (auto i = 0; i<rows*cols; i++) + for (size_t i = 0; i<rows*cols; i++) sum += m[i]; return sum; } double SumVector(const gsl_vector *v) { double sum = 0; - for (int i = 0; i < v->size; i++ ) { + for (size_t i = 0; i < v->size; i++ ) { sum += gsl_vector_get(v, i); } return( sum ); diff --git a/src/param.cpp b/src/param.cpp index 1ead475..919e258 100644 --- a/src/param.cpp +++ b/src/param.cpp @@ -98,7 +98,7 @@ PARAM::PARAM(void) rho_ngrid(10), s_min(0), s_max(300), w_step(100000), s_step(1000000), r_pace(10), w_pace(1000), n_accept(0), n_mh(10), geo_mean(2000.0), randseed(-1), window_cm(0), window_bp(0), window_ns(0), n_block(200), - error(false), ni_subsample(0), n_cvt(1), n_vc(1), n_cat(0), + error(false), ni_subsample(0), n_cvt(1), n_cat(0), n_vc(1), time_total(0.0), time_G(0.0), time_eigen(0.0), time_UtX(0.0), time_UtZ(0.0), time_opt(0.0), time_Omega(0.0) {} @@ -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, se_tau_inv; + double d, y2_sum, tau_inv; // New matrices/vectors. gsl_matrix *K_scale = gsl_matrix_alloc(n1, n2); @@ -2134,7 +2134,7 @@ void VC::CalcVCacl(const gsl_matrix *K, const gsl_matrix *W, // Compute variance for tau_inv. gsl_blas_dgemv(CblasNoTrans, 1.0, V_mat, y_scale, 0.0, n1_vec); gsl_blas_ddot(y_scale, n1_vec, &d); - se_tau_inv = sqrt(2 * d) / (double)n1; + // auto se_tau_inv = sqrt(2 * d) / (double)n1; UNUSED // Transform pve back to the original scale and save data. v_pve.clear(); |