diff options
-rw-r--r-- | src/bslmmdap.cpp | 4 | ||||
-rw-r--r-- | src/fastblas.cpp | 8 | ||||
-rw-r--r-- | src/lmm.cpp | 7 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/bslmmdap.cpp b/src/bslmmdap.cpp index f55ce19..e9900e3 100644 --- a/src/bslmmdap.cpp +++ b/src/bslmmdap.cpp @@ -152,7 +152,7 @@ void ReadFile_bf(const string &file_bf, vector<string> &vec_rs, vector<vector<double>> mat_bf; char *ch_ptr; - size_t bf_size, flag_block; + size_t bf_size = 0, flag_block; getline(infile, line); @@ -687,7 +687,7 @@ void BSLMMDAP::DAP_EstimateHyper( // clock_t time_start; // Set up BF. - double h, rho, sigma_a2, sigma_b2, d, s, logm, logm_save; + double h, rho, sigma_a2, sigma_b2, d, s, logm, logm_save = nan(""); size_t t1, t2; size_t n_grid = wab.size(), ns_test = vec_rs.size(); diff --git a/src/fastblas.cpp b/src/fastblas.cpp index de7e27b..20456ef 100644 --- a/src/fastblas.cpp +++ b/src/fastblas.cpp @@ -38,15 +38,15 @@ gsl_matrix *fast_copy(gsl_matrix *m, const double *mem) { auto rows = m->size1; auto cols = m->size2; if (is_strict_mode()) { // slower correct version - for (auto r=0; r<rows; r++) { - for (auto c=0; c<cols; c++) { + for (size_t r=0; r<rows; r++) { + for (size_t c=0; c<cols; c++) { gsl_matrix_set(m,r,c,mem[r*cols+c]); } } } else { // faster goes by row auto v = gsl_vector_calloc(cols); enforce(v); // just to be sure - for (auto r=0; r<rows; r++) { + for (size_t r=0; r<rows; r++) { assert(v->size == cols); assert(v->block->size == cols); assert(v->stride == 1); @@ -76,9 +76,9 @@ void fast_cblas_dgemm(const enum CBLAS_ORDER Order, double *C, const size_t ldc) { #ifndef NDEBUG - size_t i,j; if (is_debug_mode()) { #ifdef DISABLED + size_t i,j; printf (" Top left corner of matrix A: \n"); for (i=0; i<min(M,6); i++) { for (j=0; j<min(K,6); j++) { diff --git a/src/lmm.cpp b/src/lmm.cpp index 6b07b6c..683858d 100644 --- a/src/lmm.cpp +++ b/src/lmm.cpp @@ -1502,15 +1502,14 @@ void LMM::AnalyzePlink(const gsl_matrix *U, const gsl_vector *eval, ifstream infile(file_bed.c_str(), ios::binary); enforce_msg(infile,"error reading genotype (.bed) file"); - bitset<8> bset8; - char ch[1]; // buffer + char ch[1]; // 1 byte buffer // Calculate n_bit and c, the number of bit for each SNP. const size_t n_bit = (ni_total % 4 == 0 ? ni_total / 4 : ni_total / 4 + 1); // first three magic numbers. for (int i = 0; i < 3; ++i) { infile.read(ch, 1); - const bitset<8> b = ch[0]; + // const bitset<8> b = ch[0]; b is never used } std::vector <double> gs; @@ -1527,7 +1526,7 @@ void LMM::AnalyzePlink(const gsl_matrix *U, const gsl_vector *eval, // ---- for all genotypes for (uint i = 0; i < n_bit; ++i) { infile.read(ch, 1); - bset8 = ch[0]; + bitset<8> bset8 = ch[0]; // Minor allele homozygous: 2.0; major: 0.0. for (size_t j = 0; j < 4; ++j) { |