Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove equality constriant number check when adding constraint #509

Merged
merged 1 commit into from
May 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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