Re: [eigen] MatrixBase==

[ Thread Index | Date Index | More Archives ]

We assumed that a size mismatch was a programming mistake for any binary operators. In the case of operator==, I understand your point that it could accept objects of different sizes and simply returns zero in that case. Nonetheless, I still have the feeling that when you write if(A==B)  and that A and B are of different sizes, then a bug is likely hidden somewhere...

Perhaps a A.isSameSize(B) helper could help ?


On Fri, Jun 30, 2017 at 5:46 PM, Rob Conde <rob.conde@xxxxxxxxxxxxxxxx> wrote:

I was a bit surprised that for dynamically sized matrices MatrixBase== doesn't check dimension equivalence before doing a component wise equals. Obviously, this is easy to check myself, but is there a canonical way to do it? I can see this making sense for fixed size matrices where a mismatch leads to a constant condition, but it doesn't seem like the right thing to do for dynamic sized matrices.



Mail converted by MHonArc 2.6.19+