src/Util.jl

changeset 29
69242e8598eb
parent 28
ffd693c381f2
child 33
a60d2f12ef93
equal deleted inserted replaced
28:ffd693c381f2 29:69242e8598eb
193 y′=reshape(y, (size(y, 1), prod(size(y)[2:end]))) 193 y′=reshape(y, (size(y, 1), prod(size(y)[2:end])))
194 194
195 @inbounds @simd for i=1:size(y′, 2)# in CartesianIndices(size(y)[2:end]) 195 @inbounds @simd for i=1:size(y′, 2)# in CartesianIndices(size(y)[2:end])
196 n² = norm₂²(@view(y′[:, i])) 196 n² = norm₂²(@view(y′[:, i]))
197 if n²>α² 197 if n²>α²
198 @. @views y′[:, i] = y′[:, i]*(α/√n²) 198 @views y′[:, i] .*= (α/√n²)
199 end 199 end
200 end 200 end
201 end 201 end
202 end 202 end
203 203

mercurial