aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniil Cherednik <dan.cherednik@gmail.com>2024-10-06 00:03:43 +0200
committerDaniil Cherednik <dan.cherednik@gmail.com>2024-10-06 00:03:43 +0200
commita9cefceaf856df82c6867e853a357b0298d566ce (patch)
tree27f7d6af79a21bc69f88ccd3bbc5f2e4cd88e653
parentc201ca5d3825f932ba66fab3f029e3eec2cdf3b3 (diff)
downloadlibgha-a9cefceaf856df82c6867e853a357b0298d566ce.tar.gz
[bugfix] do not call residual cb in case of unsuccessful multidimensional optimization result
-rw-r--r--src/gha.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gha.c b/src/gha.c
index d2365c9..5cc8470 100644
--- a/src/gha.c
+++ b/src/gha.c
@@ -400,7 +400,7 @@ void gha_extract_many_simple(FLOAT* pcm, struct gha_info* info, size_t k, gha_ct
int gha_adjust_info(const FLOAT* pcm, struct gha_info* info, size_t k, gha_ctx_t ctx, resuidal_cb_t cb, void* user_ctx)
{
int rv = gha_adjust_info_newton_md(pcm, info, k, ctx);
- if (cb)
+ if (cb && rv != -1)
cb(ctx->tmp_buf, ctx->size, user_ctx);
return rv;