@@ -120,7 +120,7 @@ struct RandSeedAlg <: SeedingAlgorithm end
120
120
Initialize `iseeds` with the indices of cluster seeds for the `X` data matrix
121
121
using the `alg` seeding algorithm.
122
122
"""
123
- function initseeds! (iseeds:: IntegerVector , alg:: RandSeedAlg , X:: AbstractMatrix{<:Real} ;
123
+ function initseeds! (iseeds:: AbstractVector{<:Integer} , alg:: RandSeedAlg , X:: AbstractMatrix{<:Real} ;
124
124
rng:: AbstractRNG = Random. GLOBAL_RNG)
125
125
check_seeding_args (X, iseeds)
126
126
sample! (rng, 1 : size (X, 2 ), iseeds; replace= false )
@@ -137,7 +137,7 @@ Here, `costs[i, j]` is the cost of assigning points ``i`` and ``j``
137
137
to the same cluster. One may, for example, use the squared Euclidean distance
138
138
between the points as the cost.
139
139
"""
140
- function initseeds_by_costs! (iseeds:: IntegerVector , alg:: RandSeedAlg , X:: AbstractMatrix{<:Real} ; rng:: AbstractRNG = Random. GLOBAL_RNG)
140
+ function initseeds_by_costs! (iseeds:: AbstractVector{<:Integer} , alg:: RandSeedAlg , X:: AbstractMatrix{<:Real} ; rng:: AbstractRNG = Random. GLOBAL_RNG)
141
141
check_seeding_args (X, iseeds)
142
142
sample! (rng, 1 : size (X,2 ), iseeds; replace= false )
143
143
end
@@ -157,7 +157,7 @@ proportional to the minimum cost of assigning it to the existing seeds.
157
157
"""
158
158
struct KmppAlg <: SeedingAlgorithm end
159
159
160
- function initseeds! (iseeds:: IntegerVector , alg:: KmppAlg ,
160
+ function initseeds! (iseeds:: AbstractVector{<:Integer} , alg:: KmppAlg ,
161
161
X:: AbstractMatrix{<:Real} ,
162
162
metric:: PreMetric = SqEuclidean ();
163
163
rng:: AbstractRNG = Random. GLOBAL_RNG)
@@ -190,7 +190,7 @@ function initseeds!(iseeds::IntegerVector, alg::KmppAlg,
190
190
return iseeds
191
191
end
192
192
193
- function initseeds_by_costs! (iseeds:: IntegerVector , alg:: KmppAlg ,
193
+ function initseeds_by_costs! (iseeds:: AbstractVector{<:Integer} , alg:: KmppAlg ,
194
194
costs:: AbstractMatrix{<:Real} ;
195
195
rng:: AbstractRNG = Random. GLOBAL_RNG)
196
196
n = size (costs, 1 )
@@ -233,7 +233,7 @@ Choose the ``k`` points with the highest *centrality* as seeds.
233
233
"""
234
234
struct KmCentralityAlg <: SeedingAlgorithm end
235
235
236
- function initseeds_by_costs! (iseeds:: IntegerVector , alg:: KmCentralityAlg ,
236
+ function initseeds_by_costs! (iseeds:: AbstractVector{<:Integer} , alg:: KmCentralityAlg ,
237
237
costs:: AbstractMatrix{<:Real} ; kwargs... )
238
238
239
239
n = size (costs, 1 )
@@ -258,6 +258,6 @@ function initseeds_by_costs!(iseeds::IntegerVector, alg::KmCentralityAlg,
258
258
return iseeds
259
259
end
260
260
261
- initseeds! (iseeds:: IntegerVector , alg:: KmCentralityAlg , X:: AbstractMatrix{<:Real} ,
261
+ initseeds! (iseeds:: AbstractVector{<:Integer} , alg:: KmCentralityAlg , X:: AbstractMatrix{<:Real} ,
262
262
metric:: PreMetric = SqEuclidean (); kwargs... ) =
263
263
initseeds_by_costs! (iseeds, alg, pairwise (metric, X, dims= 2 ); kwargs... )
0 commit comments