Skip to content

Commit f61115a

Browse files
authored
slsqp: check ptot>n, not p>n
src/algs/slsqp/slsqp.c (src/algs/slsqp/slsqp.c): Fix the check for more equality constraints than variables (introduced by PR #593 to fix #592) so that vector constraints (mconstraints) are correctly counted: the count to consider here is ptot (the total number of scalar equality constraints), not p (the number of equality constraints that may be vector constraints).
1 parent bb608c3 commit f61115a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/algs/slsqp/slsqp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,7 @@ nlopt_result nlopt_slsqp(unsigned n, nlopt_func f, void *f_data,
24592459
unsigned max_cdim;
24602460
int want_grad = 1;
24612461

2462-
if (p > n) {
2462+
if (ptot > n) {
24632463
nlopt_stop_msg(stop, "slsqp: more equality constraints than variables");
24642464
return NLOPT_INVALID_ARGS;
24652465
}

0 commit comments

Comments
 (0)