@@ -24,7 +24,7 @@ abstract Metric <: SemiMetric
24
24
25
25
# Generic functions
26
26
27
- result_type (:: PreMetric , T1 :: Type , T2 :: Type ) = Float64
27
+ result_type (:: PreMetric , :: AbstractArray , :: AbstractArray ) = Float64
28
28
29
29
30
30
# Generic column-wise evaluation
62
62
63
63
function colwise (metric:: PreMetric , a:: AbstractMatrix , b:: AbstractMatrix )
64
64
n = get_common_ncols (a, b)
65
- r = Array (result_type (metric, eltype (a), eltype (b) ), n)
65
+ r = Array (result_type (metric, a, b ), n)
66
66
colwise! (r, metric, a, b)
67
67
end
68
68
69
69
function colwise (metric:: PreMetric , a:: AbstractVector , b:: AbstractMatrix )
70
70
n = size (b, 2 )
71
- r = Array (result_type (metric, eltype (a), eltype (b) ), n)
71
+ r = Array (result_type (metric, a, b ), n)
72
72
colwise! (r, metric, a, b)
73
73
end
74
74
75
75
function colwise (metric:: PreMetric , a:: AbstractMatrix , b:: AbstractVector )
76
76
n = size (a, 2 )
77
- r = Array (result_type (metric, eltype (a), eltype (b) ), n)
77
+ r = Array (result_type (metric, a, b ), n)
78
78
colwise! (r, metric, a, b)
79
79
end
80
80
@@ -117,19 +117,19 @@ end
117
117
function pairwise (metric:: PreMetric , a:: AbstractMatrix , b:: AbstractMatrix )
118
118
m = size (a, 2 )
119
119
n = size (b, 2 )
120
- r = Array (result_type (metric, eltype (a), eltype (b) ), (m, n))
120
+ r = Array (result_type (metric, a, b ), (m, n))
121
121
pairwise! (r, metric, a, b)
122
122
end
123
123
124
124
function pairwise (metric:: PreMetric , a:: AbstractMatrix )
125
125
n = size (a, 2 )
126
- r = Array (result_type (metric, eltype (a), eltype (a) ), (n, n))
126
+ r = Array (result_type (metric, a, a ), (n, n))
127
127
pairwise! (r, metric, a)
128
128
end
129
129
130
130
function pairwise (metric:: SemiMetric , a:: AbstractMatrix )
131
131
n = size (a, 2 )
132
- r = Array (result_type (metric, eltype (a), eltype (a) ), (n, n))
132
+ r = Array (result_type (metric, a, a ), (n, n))
133
133
pairwise! (r, metric, a)
134
134
end
135
135
0 commit comments