Thank you for answer, Sergey.
I am confuse. In article, that I read there is one formula (really it is not Mahalanobis distance, just similar):
And as you can see covariance matrix must be the same size as vector X (X=A-B). And this covariance matrix made of A and B. I guess something wrong. May be it is covariance matrix of X. Or cross-covariance matrix of A and B.
And with cross-correlation the same problem:
http://en.wikipedia.org/wiki/Cross-covariance
According to this wkipedia article cross-covariance matrix counted that way
That is mean that its size Num_of_Observations_of_X x Num_of_Observation_of_Y
but in Alglib docs
C - array[M1,M2], cross-covariance matrix (zero if N=0 or N=1)
M1 - M1>0, number of variables in X
M2 - M2>0, number of variables in Y
What do you think?