yalmip / YALMIP

MATLAB toolbox for optimization modeling
https://yalmip.github.io/
Other
479 stars 137 forks source link

Yalmip incorrectly determines equality constraints to be trivially true #1170

Closed alastair-abbott closed 1 year ago

alastair-abbott commented 2 years ago

There appears to be a bug in how yalmip determines equality constraints to be trivially true.

For example:

>> a = sdpvar(1); optimize([a,0] == [a,1],0)
Warning: Equality constraint evaluated to trivial true. 
> In constraint (line 45)
In  ==  (line 13) 

When the constraint is clearly trivially false, not true.

The error appears to be on line 44 of constraint.m. It should check all(Z == 0) rather than all(Z) == 0

johanlofberg commented 2 years ago

Right, thanks.