Skip to content

Commit efc8d50

Browse files
committed
improve performance of svd on static matrix
- calling `Hermitian` on a `StaticMatrix` converts it to a regular matrix
1 parent badab8a commit efc8d50

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/compressor.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,10 +230,10 @@ kernels; see
230230
for more details.
231231
"""
232232
min_svd_vals(x::Number) = abs(x)
233-
function min_svd_vals(A::AbstractMatrix{T}) where {T}
233+
function min_svd_vals(A::SMatrix)
234234
n, m = size(A)
235235
if (n == 2) || (n == 3)
236-
λ = eigmin(Hermitian(adjoint(A) * A))
236+
λ = eigmin(SHermitianCompact(A * adjoint(A)))
237237
# try to avoid some floating point issues
238238
return max(λ, zero(λ)) |> sqrt
239239
else

0 commit comments

Comments
 (0)