Skip to content

Commit

Permalink
remove equality constriant number check (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shuenhoy authored May 21, 2023
1 parent be19856 commit f1d28c0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/api/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,6 @@ nlopt_result NLOPT_STDCALL nlopt_add_equality_mconstraint(nlopt_opt opt, unsigne
ret = NLOPT_INVALID_ARGS;
else if (!equality_ok(opt->algorithm))
ret = ERR(NLOPT_INVALID_ARGS, opt, "invalid algorithm for constraints");
else if (nlopt_count_constraints(opt->p, opt->h) + m > opt->n)
ret = ERR(NLOPT_INVALID_ARGS, opt, "too many equality constraints");
else
ret = add_constraint(opt, &opt->p, &opt->p_alloc, &opt->h, m, NULL, fc, NULL, fc_data, tol);
if (ret < 0 && opt && opt->munge_on_destroy)
Expand All @@ -649,8 +647,6 @@ nlopt_result NLOPT_STDCALL nlopt_add_precond_equality_constraint(nlopt_opt opt,
ret = NLOPT_INVALID_ARGS;
else if (!equality_ok(opt->algorithm))
ret = ERR(NLOPT_INVALID_ARGS, opt, "invalid algorithm for constraints");
else if (nlopt_count_constraints(opt->p, opt->h) + 1 > opt->n)
ret = ERR(NLOPT_INVALID_ARGS, opt, "too many equality constraints");
else
ret = add_constraint(opt, &opt->p, &opt->p_alloc, &opt->h, 1, fc, NULL, pre, fc_data, &tol);
if (ret < 0 && opt && opt->munge_on_destroy)
Expand Down

0 comments on commit f1d28c0

Please sign in to comment.