diff options
author | Peter Carbonetto | 2017-10-11 07:26:43 -0500 |
---|---|---|
committer | GitHub | 2017-10-11 07:26:43 -0500 |
commit | 3c976e26e5eb6864586cc736a2399ac8f5e9e7aa (patch) | |
tree | be2f3659350534f066973c1f53a2eb35ffcb02ae | |
parent | 7e78870664ca33a365c609f348208fb8b534c856 (diff) | |
parent | cc840ea408a6dea80f41c308cdcbc0e9f146ccc1 (diff) | |
download | pangemma-3c976e26e5eb6864586cc736a2399ac8f5e9e7aa.tar.gz |
Merge pull request #100 from genenetwork/master
Fix bug in bimbam format (introduced with LOCO).
-rw-r--r-- | src/debug.cpp | 4 | ||||
-rw-r--r-- | src/lmm.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/debug.cpp b/src/debug.cpp index b7a69f1..0d3c9cc 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -34,11 +34,11 @@ void do_validate_K(const gsl_matrix *K, bool do_check, bool strict, const char * warning_at_msg(__file,__line,"K is ill conditioned!"); if (!isMatrixSymmetric(K)) fail_at_msg(strict,__file,__line,"K is not symmetric!" ); - bool negative_values = has_negative_values_but_one(eigenvalues); + const bool negative_values = has_negative_values_but_one(eigenvalues); if (negative_values) { warning_at_msg(__file,__line,"K has more than one negative eigenvalues!"); } - if (count_small>0 && negative_values && !isMatrixPositiveDefinite(K)) + if (count_small>1 && negative_values && !isMatrixPositiveDefinite(K)) fail_at_msg(strict,__file,__line,"K is not positive definite!"); gsl_vector_free(eigenvalues); } diff --git a/src/lmm.cpp b/src/lmm.cpp index 1193700..134fbf9 100644 --- a/src/lmm.cpp +++ b/src/lmm.cpp @@ -1414,7 +1414,7 @@ void LMM::AnalyzeBimbam(const gsl_matrix *U, const gsl_vector *eval, gsl_vector_memcpy(&Xlarge_col.vector, x); c++; // count SNPs going in - if (c == msize) + if (c % msize == 0) batch_compute(msize); } batch_compute(c % msize); |