Skip to content

Commit

Permalink
Use julia 1.9 feature for kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendesignolle committed Nov 25, 2024
1 parent 0794dc8 commit 5ba3e9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ function _orthonormal_range_svd!(
end

_orthonormal_range_svd(A::AbstractMatrix; tol::Union{Real,Nothing} = nothing) =
_orthonormal_range_svd!(deepcopy(A); tol = tol)
_orthonormal_range_svd!(deepcopy(A); tol)

function _orthonormal_range_qr(A::SA.AbstractSparseMatrix{T,M}; tol::Union{Real,Nothing} = nothing) where {T<:Number,M}
dec = qr(A)
Expand All @@ -332,7 +332,7 @@ function orthonormal_range(
mode == 1 && SA.issparse(A) && throw(ArgumentError("SVD does not work with sparse matrices, use a dense matrix."))
mode == -1 && (mode = SA.issparse(A) ? 0 : 1)

return (mode == 0 ? _orthonormal_range_qr(A; tol = tol) : _orthonormal_range_svd(A; tol = tol))
return (mode == 0 ? _orthonormal_range_qr(A; tol) : _orthonormal_range_svd(A; tol))
end
export orthonormal_range

Expand Down
2 changes: 1 addition & 1 deletion test/basic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@
@test collect(n_body_basis(0, 2)) == [I(4)]
@test length(collect(n_body_basis(2, 3))) == 27
sb = [I(2), I(2), I(2)]
@test collect(n_body_basis(1, 3; eye = 2I(2), sb = sb)) == [4I(8) for _ in 1:9]
@test collect(n_body_basis(1, 3; eye = 2I(2), sb)) == [4I(8) for _ in 1:9]
end
end

0 comments on commit 5ba3e9d

Please sign in to comment.