We know some signature/checksum methods for text, like md5,sha.
Now, I want to compute a checksum for a matrix, to represent the exact matrix. Say, two matrixes with different sizes, or with different values, have different checksum. And slightly different matrixes(same size) result in slightly different checksum. So, both layout and values should be considered.
Although the most intuitive method is to compare two matrixes directly, however, sometimes it’s inconvenient to get the two matrixes in the same environment.
Maybe I should check the md5 algorithm, and adapt a similar method. Just post it here for better advices.
3
Of the top of my head, it should be fine to convert the martix to a string representation and then do an MD5 of that. The string representation of two matrices with identical dimensions and identical entries would be identical.
For example, despite having identical objects when converted to a single dimension, these two matrices have different string representations.
"[[1,2],[3,4]]" != "[1,2,3,4]"
However you approach this, you’ll need to compare dimentionality and contents.