Skip to content

Commit cb0e56b

Browse files
authored
remove unbound type parameters (#107)
I didn't check, but unbound type parameters often cause performance issues, so this may not be merely cosmetic.
1 parent ade9957 commit cb0e56b

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/ArrayLayouts.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ end
102102
# work-around issue with complex conjugation of pointer
103103
unsafe_convert(::Type{Ptr{T}}, Ac::Adjoint{<:Complex}) where T<:Complex = unsafe_convert(ConjPtr{T}, parent(Ac))
104104
unsafe_convert(::Type{ConjPtr{T}}, Ac::Adjoint{<:Complex}) where T<:Complex = unsafe_convert(Ptr{T}, parent(Ac))
105-
function unsafe_convert(::Type{ConjPtr{T}}, V::SubArray{T,2}) where {T,N,P}
105+
function unsafe_convert(::Type{ConjPtr{T}}, V::SubArray{T,2}) where {T}
106106
kr, jr = parentindices(V)
107107
unsafe_convert(Ptr{T}, view(parent(V)', jr, kr))
108108
end

src/factorizations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ struct AdjQRPackedQLayout{SLAY,TLAY} <: AbstractQLayout end
114114
struct QRCompactWYQLayout{SLAY,TLAY} <: AbstractQLayout end
115115
struct AdjQRCompactWYQLayout{SLAY,TLAY} <: AbstractQLayout end
116116

117-
MemoryLayout(::Type{<:LinearAlgebra.QRPackedQ{<:Any,S}}) where {S,T} =
117+
MemoryLayout(::Type{<:LinearAlgebra.QRPackedQ{<:Any,S}}) where {S} =
118118
QRPackedQLayout{typeof(MemoryLayout(S)),DenseColumnMajor}()
119-
MemoryLayout(::Type{<:LinearAlgebra.QRCompactWYQ{<:Any,S}}) where {S,T} =
119+
MemoryLayout(::Type{<:LinearAlgebra.QRCompactWYQ{<:Any,S}}) where {S} =
120120
QRCompactWYQLayout{typeof(MemoryLayout(S)),DenseColumnMajor}()
121121

122122
adjointlayout(::Type, ::QRPackedQLayout{SLAY,TLAY}) where {SLAY,TLAY} = AdjQRPackedQLayout{SLAY,TLAY}()

src/lmul.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for Typ in (:Lmul, :Rmul)
1919
size(M::$Typ) = map(length,axes(M))
2020
axes(M::$Typ) = (axes(M.A,1),axes(M.B,2))
2121

22-
similar(M::$Typ, ::Type{T}, axes) where {T,N} = similar(Array{T}, axes)
22+
similar(M::$Typ, ::Type{T}, axes) where {T} = similar(Array{T}, axes)
2323
similar(M::$Typ, ::Type{T}) where T = similar(M, T, axes(M))
2424
similar(M::$Typ) = similar(M, eltype(M))
2525
end
@@ -122,4 +122,4 @@ macro layoutrmul(Typ)
122122
ArrayLayouts.@_layoutrmul LowerTriangular{T, <:$Typ{T}} where T
123123
ArrayLayouts.@_layoutrmul UnitLowerTriangular{T, <:$Typ{T}} where T
124124
end)
125-
end
125+
end

src/memorylayout.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ transposelayout(ml::TridiagonalLayout) = ml
591591
transposelayout(ml::ConjLayout{DiagonalLayout}) = ml
592592

593593
triangularlayout(::Type{<:TriangularLayout{'L','N'}}, ::TridiagonalLayout{DL,D,DU}) where {DL,D,DU} = BidiagonalLayout{D,DL}()
594-
triangularlayout(::Type{<:TriangularLayout{'U','N'}}, ::TridiagonalLayout{DL,D,DU}) where {UPLO,DL,D,DU} = BidiagonalLayout{D,DU}()
594+
triangularlayout(::Type{<:TriangularLayout{'U','N'}}, ::TridiagonalLayout{DL,D,DU}) where {DL,D,DU} = BidiagonalLayout{D,DU}()
595595
triangularlayout(::Type{<:TriangularLayout{'L','N'}}, ::TridiagonalLayout{FillLayout,FillLayout,FillLayout}) = BidiagonalLayout{FillLayout,FillLayout}()
596596
triangularlayout(::Type{<:TriangularLayout{'U','N'}}, ::TridiagonalLayout{FillLayout,FillLayout,FillLayout}) = BidiagonalLayout{FillLayout,FillLayout}()
597597
triangularlayout(::Type{<:TriangularLayout{UPLO,'U'}}, ::TridiagonalLayout{FillLayout,FillLayout,FillLayout}) where UPLO = BidiagonalLayout{FillLayout,FillLayout}()
@@ -712,4 +712,4 @@ axes(A::AbstractTriangular{<:Any,<:SubArray{<:Any,2,<:LayoutMatrix}}) = axes(par
712712
function axes(D::Diagonal{<:Any,<:LayoutVector})
713713
a = axes(parent(D),1)
714714
(a,a)
715-
end
715+
end

src/mul.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The Default is `MulAdd`. Note that the lowered type must overload `copyto!` and
8080
"""
8181
mulreduce(M::Mul) = MulAdd(M)
8282

83-
similar(M::Mul, ::Type{T}, axes) where {T,N} = similar(mulreduce(M), T, axes)
83+
similar(M::Mul, ::Type{T}, axes) where {T} = similar(mulreduce(M), T, axes)
8484
similar(M::Mul, ::Type{T}) where T = similar(mulreduce(M), T)
8585
similar(M::Mul) = similar(mulreduce(M))
8686

src/muladd.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ length(M::MulAdd) = prod(size(M))
3838
size(M::MulAdd) = map(length,axes(M))
3939
axes(M::MulAdd) = axes(M.C)
4040

41-
similar(M::MulAdd, ::Type{T}, axes) where {T,N} = similar(Array{T}, axes)
42-
similar(M::MulAdd{<:DualLayout,<:Any,<:Any,<:Any,<:Adjoint}, ::Type{T}, axes) where {T,N} = similar(Array{T}, axes[2])'
43-
similar(M::MulAdd{<:DualLayout,<:Any,<:Any,<:Any,<:Transpose}, ::Type{T}, axes) where {T,N} = transpose(similar(Array{T}, axes[2]))
41+
similar(M::MulAdd, ::Type{T}, axes) where {T} = similar(Array{T}, axes)
42+
similar(M::MulAdd{<:DualLayout,<:Any,<:Any,<:Any,<:Adjoint}, ::Type{T}, axes) where {T} = similar(Array{T}, axes[2])'
43+
similar(M::MulAdd{<:DualLayout,<:Any,<:Any,<:Any,<:Transpose}, ::Type{T}, axes) where {T} = transpose(similar(Array{T}, axes[2]))
4444
similar(M::MulAdd, ::Type{T}) where T = similar(M, T, axes(M))
4545
similar(M::MulAdd) = similar(M, eltype(M))
4646

src/triangular.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,13 +184,13 @@ BLAS.trmm!('R', 'L', 'T', UNIT, one(T), transpose(triangulardata(A)), x)
184184
end
185185

186186
@inline function materialize!(M::BlasMatRmulMat{<:AbstractStridedLayout,
187-
<:TriangularLayout{'L',UNIT,<:ConjLayout{<:AbstractRowMajor}},T}) where {UPLO,UNIT,T<:BlasComplex}
187+
<:TriangularLayout{'L',UNIT,<:ConjLayout{<:AbstractRowMajor}},T}) where {UNIT,T<:BlasComplex}
188188
x,A = M.A,M.B
189189
BLAS.trmm!('R', 'U', 'C', UNIT, one(T), triangulardata(A)', x)
190190
end
191191

192192
@inline function materialize!(M::BlasMatRmulMat{<:AbstractStridedLayout,
193-
<:TriangularLayout{'U',UNIT,<:ConjLayout{<:AbstractRowMajor}},T}) where {UPLO,UNIT,T<:BlasComplex}
193+
<:TriangularLayout{'U',UNIT,<:ConjLayout{<:AbstractRowMajor}},T}) where {UNIT,T<:BlasComplex}
194194
x,A = M.A,M.B
195195
BLAS.trmm!('R', 'L', 'C', UNIT, one(T), triangulardata(A)', x)
196196
end

0 commit comments

Comments
 (0)