[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: "eigen@xxxxxxxxxxxxxxxxxxx" <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] MatrixBase==
- From: Rob Conde <rob.conde@xxxxxxxxxxxxxxxx>
- Date: Tue, 4 Jul 2017 00:15:17 +0000
- Accept-language: en-US
- Authentication-results: lists.tuxfamily.org; dkim=none (message not signed) header.d=none;lists.tuxfamily.org; dmarc=none action=none header.from=ai-solutions.com;
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aisolutions365.onmicrosoft.com; s=selector1-aisolutions-com0e; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=q/bcM3XTf+CvQB5tbrFXyKDcGnpMqYV5WwkgVQAEcgI=; b=q/Ga3hWwWPoxfTLV2JYwXY+nWnd3bNlNwQITkiCN3L3a3AxjjzABC/nG7i0yILbyW2/s2nbIXH7CqQiKHsCvkxqNFKZKjh3RQeMiDkrZoH7CSx+b3CZ1BvHBkLIZN2jlXFetI+mi9BP7+9/dnd2InpJH3hkNHkTHOviwXvYhuuc=
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
- Thread-index: AQHS8bf3M8O2Pwy31UmInWReF7HU3qJCAeAAgADP6sg=
- Thread-topic: [eigen] MatrixBase==
If the result of == was a matrix (for example) as the other binary operators do I would agree, but as it is I don’t think it makes sense. Ideally == WOULD return a matrix and then you would have a isEqualTo method. But I doubt you’d want to make that breaking
change...so the latter would be good at least.
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 ?