diff options
author | Pjotr Prins | 2018-08-25 11:32:46 +0000 |
---|---|---|
committer | Pjotr Prins | 2018-08-25 11:32:46 +0000 |
commit | be551a1b3c324dc96750cf992b6a5784e2b92ec7 (patch) | |
tree | 01830a02558f85b33fcb6ce7d54d1daab28ca669 /src/lmm.cpp | |
parent | a24297bb1cb686d3630db3a0da8fa8a2079ad178 (diff) | |
download | pangemma-be551a1b3c324dc96750cf992b6a5784e2b92ec7.tar.gz |
Number format checking in strict mode. Also fixes #149
Diffstat (limited to 'src/lmm.cpp')
-rw-r--r-- | src/lmm.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lmm.cpp b/src/lmm.cpp index 7e4c3e1..ed1366d 100644 --- a/src/lmm.cpp +++ b/src/lmm.cpp @@ -28,6 +28,7 @@ #include <cstring> #include <iomanip> #include <iostream> +#include <regex> #include <stdio.h> #include <stdlib.h> @@ -1498,8 +1499,11 @@ void LMM::AnalyzeBimbam(const gsl_matrix *U, const gsl_vector *eval, for (size_t i = 0; i < ni_total; ++i) { ch_ptr = strtok_safe2(NULL, " , \t",infilen); - if (strcmp(ch_ptr, "NA") != 0) + if (strcmp(ch_ptr, "NA") != 0) { gs[i] = atof(ch_ptr); + if (is_strict_mode() && gs[i] == 0.0) + enforce_is_float(std::string(__STRING(ch_ptr))); // only allow for NA and valid numbers + } } return std::make_tuple(snp,gs); }; @@ -1873,7 +1877,7 @@ void CalcLmmVgVeBeta(const gsl_vector *eval, const gsl_matrix *UtW, gsl_vector_view HiW_col = gsl_matrix_column(HiW, i); gsl_vector_mul(&HiW_col.vector, Hi_eval); } - gsl_blas_dgemm(CblasTrans, CblasNoTrans, 1.0, HiW, UtW, 0.0, WHiW); + fast_dgemm("T", "N", 1.0, HiW, UtW, 0.0, WHiW); gsl_blas_dgemv(CblasTrans, 1.0, HiW, Uty, 0.0, WHiy); int sig; |