diff options
author | Pjotr Prins | 2017-12-07 12:03:09 +0000 |
---|---|---|
committer | Pjotr Prins | 2017-12-07 12:03:09 +0000 |
commit | a398947aa3734738a27fc7b2811ef72fbcbfcd90 (patch) | |
tree | c1a9eed4e3613df67643ff2efb2214d5dd8c6eef /src/mathfunc.cpp | |
parent | b1fdf72b0723982a1305a2439f0151ceaf2c1176 (diff) | |
download | pangemma-a398947aa3734738a27fc7b2811ef72fbcbfcd90.tar.gz |
Travis: fixes
Diffstat (limited to 'src/mathfunc.cpp')
-rw-r--r-- | src/mathfunc.cpp | 8 |
1 files changed, 6 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) { |