Skip to content

Commit 803400b

Browse files
authored
col/rowsupport with empty (#82)
1 parent b771251 commit 803400b

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "LazyArrays"
22
uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02"
3-
version = "0.14.7"
3+
version = "0.14.8"
44

55

66
[deps]

src/cache.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,16 @@ function convexunion(a::AbstractVector, b::AbstractVector)
147147
min(minimum(a),minimum(b)):max(maximum(a),maximum(b))
148148
end
149149

150-
colsupport(A::CachedMatrix, i) =
150+
function colsupport(A::CachedMatrix, i)
151+
isempty(i) && return 1:0
151152
minimum(i)  A.datasize[2] ? convexunion(colsupport(A.array, i),colsupport(A.data,i) Base.OneTo(A.datasize[1])) : colsupport(A.array, i)
153+
end
152154
colsupport(A::CachedVector, i) =
153155
convexunion(colsupport(A.array, i),colsupport(A.data,i) Base.OneTo(A.datasize[1]))
154-
rowsupport(A::CachedMatrix, i) =
156+
function rowsupport(A::CachedMatrix, i)
157+
isempty(i) && return 1:0
155158
minimum(i)  A.datasize[1] ? convexunion(rowsupport(A.array, i),rowsupport(A.data,i) Base.OneTo(A.datasize[2])) : rowsupport(A.array, i)
159+
end
156160

157161
replace_in_print_matrix(A::CachedMatrix, i::Integer, j::Integer, s::AbstractString) =
158162
i in colsupport(A,j) ? s : replace_with_centered_mark(s)

0 commit comments

Comments
 (0)