Skip to content

Commit 372c1de

Browse files
committed
deprecate eye on instances
1 parent b97d834 commit 372c1de

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/inv.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ end
6161
quote
6262
@_inline_meta
6363
LUp = lu(A)
64-
LUp.U \ (LUp.L \ eye(A)[LUp.p,:])
64+
LUp.U \ (LUp.L \ eye(typeof(A))[LUp.p,:])
6565
end
6666
else
6767
:(@_inline_meta; similar_type(A)(inv(Matrix(A))))

src/linalg.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,12 @@ end
164164
end
165165
end
166166

167+
# deprecate eye, keep around for as long as LinearAlgebra.eye exists
168+
@static if isdefined(LinearAlgebra, :eye)
169+
@deprecate eye(A::SM) where {SM<:StaticMatrix} eye(typeof(A))
170+
end
171+
167172
#if VERSION < v"0.7-"
168-
@inline eye(::SM) where {SM <: StaticMatrix} = _eye(Size(SM), SM)
169173
@inline eye(::Type{SM}) where {SM <: StaticMatrix} = _eye(Size(SM), SM)
170174
@generated function _eye(::Size{S}, ::Type{SM}) where {S, SM <: StaticArray}
171175
T = eltype(SM) # should be "hyperpure"

0 commit comments

Comments
 (0)