diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mathfunc.cpp | 8 | ||||
-rw-r--r-- | src/mvlmm.cpp | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/mathfunc.cpp b/src/mathfunc.cpp index 644b3e8..2cce43f 100644 --- a/src/mathfunc.cpp +++ b/src/mathfunc.cpp @@ -264,8 +264,12 @@ bool isMatrixPositiveDefinite(const gsl_matrix *G) { auto s = gsl_linalg_cholesky_decomp(G2); #endif gsl_set_error_handler(handler); - gsl_matrix_safe_free(G2); - return (s == GSL_SUCCESS); + if (s == GSL_SUCCESS) { + gsl_matrix_safe_free(G2); + return true; + } + gsl_matrix_free(G2); + return (false); } gsl_vector *getEigenValues(const gsl_matrix *G) { diff --git a/src/mvlmm.cpp b/src/mvlmm.cpp index 95a59d7..eee562d 100644 --- a/src/mvlmm.cpp +++ b/src/mvlmm.cpp @@ -29,6 +29,7 @@ #include <stdio.h> #include <stdlib.h> +#include "gsl/gsl_blas.h" #include "gsl/gsl_cdf.h" #include "gsl/gsl_linalg.h" #include "gsl/gsl_matrix.h" |