This commit is contained in:
Vítor Santos Costa
2019-04-05 02:04:06 +01:00
parent c840e9cabb
commit ead29987d6
4 changed files with 25 additions and 23 deletions

View File

@@ -75,6 +75,7 @@ static lbfgsfloatval_t evaluate(void *instance, const lbfgsfloatval_t *x,
rc = YAP_IntOfTerm(o);
else
rc = YAP_FloatOfTerm(o);
YAP_ShutdownGoal(true);
YAP_RecoverSlots(1, sl);
return rc;
}
@@ -123,9 +124,10 @@ static int progress(void *instance, const lbfgsfloatval_t *local_x,
if (YAP_IsIntTerm(o)) {
int v = YAP_IntOfTerm(o);
return (int)v;
YAP_ShutdownGoal(true);
return (int)v;
}
YAP_ShutdownGoal(true);
fprintf(stderr, "ERROR: The progress call back function did not return an "
"integer as last argument\n");
return 1;