118118function _recursive_normalized_cut (W, thres, num_cuts)
119119 m, n = size (W)
120120 (m <= 1 ) && return ones (Int, m) # trivial
121- D = Diagonal (vec (sum (W, dims= 2 )))
121+ D = Diagonal (vec (sum (W; dims= 2 )))
122122
123123 # check that the diagonal is not degenerated as otherwise invDroot errors
124124 dnz = abs .(diag (D)) .>= 1E-16
@@ -137,7 +137,7 @@ function _recursive_normalized_cut(W, thres, num_cuts)
137137 # At least some versions of ARPACK have a bug, this is a workaround
138138 invDroot = sqrt .(inv (D)) # equal to Cholesky factorization for diagonal D
139139 if n > 12
140- _, Q = eigs (invDroot' * (D - W) * invDroot, nev= 12 , which= SR ())
140+ _, Q = eigs (invDroot' * (D - W) * invDroot; nev= 12 , which= SR ())
141141 (size (Q, 2 ) <= 1 ) && return collect (1 : m) # no 2nd eigenvector
142142 ret = convert (Vector, real (view (Q, :, 2 )))
143143 else
@@ -149,7 +149,7 @@ function _recursive_normalized_cut(W, thres, num_cuts)
149149 min_cost = Inf
150150 best_thres = - 1
151151 vmin, vmax = extrema (v)
152- for t in range (vmin, stop= vmax, length= num_cuts)
152+ for t in range (vmin; stop= vmax, length= num_cuts)
153153 cut = v .> t
154154 cost = _normalized_cut_cost (cut, W, D)
155155 if cost < min_cost
0 commit comments