In mathematical terms, matrix equality requires all corresponding elements of two matrices, A and B have the same value. Thus A = B if and only if Ai,j = Bi,j for all i, j.
In your case, where you are looking at implementation in C++, you will need to verify the Matrix
instances this
and m
are the same size, and they each contain the same value at corresponding locations. If they are the same size and have the same values in the corresponding locations, then ==
will return true
(false
otherwise), and !=
will return false
(true
otherwise).