Could someone confirm for me whether DistanceMatrix
is behaving differently in V11?
In V10 I could return the signed differenced between two vectors using
DistanceMatrix[u,v,DistanceFunction->Subtract]
However, in V11 the returned values are all positive. Using an undefined function f
for DistanceFunction
reveals that DistanceMatrix
is adding the Abs
internally in V11 thus prohibiting signed returns:
DistanceMatrix[Range[2], Range[3], DistanceFunction -> f]
V11 output
{{Abs[f[1, 1]], Abs[f[1, 2]], Abs[f[1, 3]]}, {Abs[f[2, 1]], Abs[f[2, 2]], Abs[f[2, 3]]}}
V10.3 output
{{f[{1}, {1}], f[{1}, {2}], f[{1}, {3}], f[{2}, {1}], f[{2}, {2}], f[{2}, {3}]}}
I feel like including Abs
by default isn't very helpful as I could always add it in if I wanted it!
Thus I have two questions:
- Is there any way to remove it? I
- Is there a smarter way to get the signed differences of two lists - I know I can use
Outer
but have been usingDistanceMatrix
following the discussion here
Outer
mathematica.stackexchange.com/questions/21861/… $\endgroup$