@@ -25,7 +25,7 @@ BlockMap{T}(maps::As, rows::Rs) where {T, As<:LinearMapTuple, Rs} =
25
25
MulStyle (A:: BlockMap ) = MulStyle (A. maps... )
26
26
27
27
@inline function _getranges (maps, dim, inds:: NTuple{N,Int} = ntuple (identity, Val (length (maps)))) where {N}
28
- sizes = ntuple (i -> (@inbounds size (maps[inds[i]], dim)), Val (length (inds) ))
28
+ sizes = ntuple (i -> (@inbounds size (maps[inds[i]], dim)), Val (N ))
29
29
ends = cumsum (sizes)
30
30
starts = (1 , (1 .+ Base. front (ends)). .. )
31
31
return UnitRange .(starts, ends)
@@ -49,9 +49,9 @@ function rowcolranges(maps, rows)
49
49
# introduce "line breaks"
50
50
colranges = ntuple (Val (length (maps))) do i
51
51
# for each map find the index of the respective row-wise first map
52
- firstmapind = firstmapinds[something (findlast (<= (i), firstmapinds), 1 )]
52
+ @inbounds firstmapind = firstmapinds[something (findlast (<= (i), firstmapinds), 1 )]
53
53
# shift ranges by the first col-index of the row-wise first map
54
- return temp[i] .- first (temp[firstmapind]) .+ 1
54
+ return @inbounds temp[i] .- first (temp[firstmapind]) .+ 1
55
55
end
56
56
return rowranges, colranges
57
57
end
@@ -88,7 +88,7 @@ function Base.hcat(As::Union{LinearMap, UniformScaling, AbstractVecOrMat}...)
88
88
j = findfirst (x -> ! isa (x, UniformScaling), As)
89
89
# this should not happen, function should only be called with at least one LinearMap
90
90
@assert ! isnothing (j)
91
- nrows = size (As[j], 1 )
91
+ @inbounds nrows = size (As[j], 1 )
92
92
93
93
return BlockMap {T} (promote_to_lmaps (ntuple (_ -> nrows, Val (nbc)), 1 , 1 , As... ), (nbc,))
94
94
end
@@ -126,9 +126,9 @@ function Base.vcat(As::Union{LinearMap,UniformScaling,AbstractVecOrMat}...)
126
126
j = findfirst (x -> ! isa (x, UniformScaling), As)
127
127
# this should not happen, function should only be called with at least one LinearMap
128
128
@assert ! isnothing (j)
129
- ncols = size (As[j], 2 )
129
+ @inbounds ncols = size (As[j], 2 )
130
130
131
- rows = ntuple (i -> 1 , Val (nbr))
131
+ rows = ntuple (_ -> 1 , Val (nbr))
132
132
return BlockMap {T} (promote_to_lmaps (ntuple (_ -> ncols, Val (nbr)), 1 , 2 , As... ), rows)
133
133
end
134
134
0 commit comments