aboutsummaryrefslogtreecommitdiff
path: root/src/lmm.cpp
diff options
context:
space:
mode:
authorPjotr Prins2017-11-22 10:25:47 +0000
committerPjotr Prins2017-11-22 10:25:47 +0000
commit385dd86c0d58cdba4eefd4e39694ee47ff3ab3e6 (patch)
tree5a3efd63957dd5bc2a8bb70fc3669425651de73a /src/lmm.cpp
parent262af77b80267d65324d9a2de395022b9bbcb9d1 (diff)
downloadpangemma-385dd86c0d58cdba4eefd4e39694ee47ff3ab3e6.tar.gz
Remove compiler warnings and add check is_nan
Diffstat (limited to 'src/lmm.cpp')
-rw-r--r--src/lmm.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lmm.cpp b/src/lmm.cpp
index 1a2614b..99a8436 100644
--- a/src/lmm.cpp
+++ b/src/lmm.cpp
@@ -45,6 +45,7 @@
#include "fastblas.h"
#include "lapack.h"
#include "lmm.h"
+#include "mathfunc.h"
using namespace std;
@@ -228,6 +229,7 @@ void CalcPab(const size_t n_cvt, const size_t e_mode, const gsl_vector *Hi_eval,
gsl_matrix_const_column(Uab, index_ab);
gsl_blas_ddot(Hi_eval, &Uab_col.vector, &p_ab);
if (e_mode != 0) {
+ assert(false);
p_ab = gsl_vector_get(ab, index_ab) - p_ab;
}
gsl_matrix_set(Pab, 0, index_ab, p_ab);
@@ -389,8 +391,10 @@ double LogL_f(double l, void *params) {
index_yy = GetabIndex(n_cvt + 2, n_cvt + 2, n_cvt);
double P_yy = gsl_matrix_get(Pab, nc_total, index_yy);
- f = c - 0.5 * logdet_h - 0.5 * (double)ni_test * log(P_yy);
+ assert(!is_nan(P_yy));
+ f = c - 0.5 * logdet_h - 0.5 * (double)ni_test * log(P_yy);
+ assert(!is_nan(f));
gsl_matrix_safe_free(Pab); // FIXME
gsl_vector_safe_free(Hi_eval);
gsl_vector_safe_free(v_temp);