Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "LazyArrays"
uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02"
version = "2.5.1"
version = "2.5.2"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand Down
13 changes: 6 additions & 7 deletions ext/LazyArraysBandedMatricesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
bandwidths(B::CachedMatrix) = bandwidths(B.data)
isbanded(B::CachedMatrix) = isbanded(B.data)

cache_layout(::BandedLayouts, A::AbstractMatrix{T}) where T = CachedArray(BandedMatrix{T}(undef, (0,0), bandwidths(A)), A)
cache_layout(::BandedLayouts, A::AbstractMatrix) = CachedArray(BandedMatrix{eltype(A)}(undef, (0,0), bandwidths(A)), A)

Check warning on line 456 in ext/LazyArraysBandedMatricesExt.jl

View check run for this annotation

Codecov / codecov/patch

ext/LazyArraysBandedMatricesExt.jl#L456

Added line #L456 was not covered by tests

function bandeddata(A::CachedMatrix)
resizedata!(A, size(A)...)
Expand Down Expand Up @@ -537,12 +537,11 @@
# overload copy as overloading `mulreduce` requires `copyto!` overloads
# Should probably be redesigned in a trait-based way, but hard to see how to do this

const BandedLazyLayouts = Union{AbstractLazyBandedLayout, BandedColumns{LazyLayout}, BandedRows{LazyLayout},
TriangularLayout{UPLO,UNIT,BandedRows{LazyLayout}} where {UPLO,UNIT},
TriangularLayout{UPLO,UNIT,BandedColumns{LazyLayout}} where {UPLO,UNIT},
TriangularLayout{UPLO,UNIT,LazyBandedLayout} where {UPLO,UNIT},
SymTridiagonalLayout{LazyLayout}, BidiagonalLayout{LazyLayout}, TridiagonalLayout{LazyLayout},
SymmetricLayout{BandedColumns{LazyLayout}}, HermitianLayout{BandedColumns{LazyLayout}}}
const BandedLazyLayouts = Union{AbstractLazyBandedLayout, BandedColumns{<:AbstractLazyLayout}, BandedRows{<:AbstractLazyLayout},
StructuredLayoutTypes{<:AbstractLazyBandedLayout},
StructuredLayoutTypes{<:BandedColumns{<:AbstractLazyLayout}},
StructuredLayoutTypes{<:BandedRows{<:AbstractLazyLayout}},
SymTridiagonalLayout{<:AbstractLazyLayout}, BidiagonalLayout{<:AbstractLazyLayout}, TridiagonalLayout{<:AbstractLazyLayout}}

@inline islazy_layout(::BandedLazyLayouts) = Val(true)

Expand Down
2 changes: 2 additions & 0 deletions src/padded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
B
end

_vcat_resizedata!(_, B, m...) = B # by default we can't resize

Check warning on line 119 in src/padded.jl

View check run for this annotation

Codecov / codecov/patch

src/padded.jl#L119

Added line #L119 was not covered by tests

resizedata!(B::Vcat, m...) = _vcat_resizedata!(MemoryLayout(B), B, m...)

function ==(A::CachedVector{<:Any,<:Any,<:Zeros}, B::CachedVector{<:Any,<:Any,<:Zeros})
Expand Down
5 changes: 5 additions & 0 deletions test/concattests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,11 @@ import LazyArrays: MemoryLayout, DenseColumnMajor, materialize!, call, paddeddat
A = Vcat([1 2 3], [4 5 6])
@test A[2:-1:1,1:-1:1] == [4; 1 ;;]
end

@testset "resizedata! for non-cached" begin
A = @inferred(Vcat(1:10, 1:20))
@test resizedata!(A, 3) ≡ A
end
end

end # module
Loading