Which ways are used to calculate distance between 2 matrices?
Which one is the fastest one?
Do you think using Hash table is a good idea?
Google found this:
I don't think you'd need a hash table for calculating a norm. But then, was that a math or a programming question?One measures the distance between vectors by the norm of their difference. In particular, the size of length of a vector x in this sense is its norm, x , i.e., its distance from the zero vector. One also measures the distance between two matrices by the norm of their difference, with the norm of a matrix A its corresponding distance A from the zero matrix.
As Firefly says, the usual way to measure the distance between two matrices is to take the norm of their difference. There are many possible choices of norm for matrices. Some of them are listed here. Of the norms in that list, the max norm is the easiest to compute, and the operator norm is probably the hardest.