diff --git a/Project.toml b/Project.toml index 0c105c0..79c2f1d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "InfiniteLinearAlgebra" uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c" -version = "0.10.2" +version = "0.10.3" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" @@ -26,12 +26,12 @@ FillArrays = "1.0" InfiniteArrays = "0.15" InfiniteRandomArrays = "0.2" Infinities = "0.1" -LazyArrays = "2.7" +LazyArrays = "2.9.7" LazyBandedMatrices = "0.11" LinearAlgebra = "1" MatrixFactorizations = "3.0" Random = "1" -SemiseparableMatrices = "0.4" +SemiseparableMatrices = "0.4, 0.5" SpecialFunctions = "2" StaticArrays = "1" Test = "1" diff --git a/src/InfiniteLinearAlgebra.jl b/src/InfiniteLinearAlgebra.jl index 9c3a8ca..5208644 100644 --- a/src/InfiniteLinearAlgebra.jl +++ b/src/InfiniteLinearAlgebra.jl @@ -40,7 +40,7 @@ import LazyArrays: AbstractCachedMatrix, AbstractCachedVector, AbstractLazyLayou CachedArray, CachedLayout, CachedMatrix, CachedVector, LazyArrayStyle, LazyLayout, LazyLayouts, LazyMatrix, LazyVector, AbstractPaddedLayout, PaddedColumns, _broadcast_sub_arguments, applybroadcaststyle, applylayout, arguments, cacheddata, paddeddata, resizedata!, simplifiable, - simplify, islazy, islazy_layout, cache_getindex, cache_layout, AbstractInvLayout + simplify, islazy, islazy_layout, cache_getindex, cache_layout, AbstractInvLayout, pad, _colon2axes import LazyBandedMatrices: AbstractLazyBandedBlockBandedLayout, AbstractLazyBandedLayout, AbstractLazyBlockBandedLayout, ApplyBandedLayout, BlockVec, BroadcastBandedLayout, KronTravBandedBlockBandedLayout, LazyBandedLayout, @@ -114,18 +114,8 @@ function chop(A::AbstractMatrix{T}, tol::Real=zero(real(T))) where T return A end -pad(c::AbstractVector{T}, ax::Union{OneTo,OneToInf}) where T = Vcat(c, Zeros{T}(length(ax)-length(c))) -pad(c::AbstractVector{T}, n::Int) where T = Vcat(c, Zeros{T}(n-length(c))) - -_colon2axes(::Tuple{}, bx::Tuple{}) = () -_colon2axes(ax::Tuple, bx::Tuple{Colon, Vararg{Any}}) = (first(ax), _colon2axes(tail(ax), tail(bx))...) -_colon2axes(ax::Tuple, bx::Tuple{Union{Integer,Infinity}, Vararg{Any}}) = (oneto(first(bx)), _colon2axes(tail(ax), tail(bx))...) -_colon2axes(ax::Tuple, bx::Tuple) = (first(bx), _colon2axes(tail(ax), tail(bx))...) -pad(c, ax...) = PaddedArray(c, _colon2axes(axes(c), ax)) -pad(c, ax::Colon...) = c - -pad(c::Transpose, ax, bx) = transpose(pad(parent(c), bx, ax)) -pad(c::Adjoint, ax, bx) = adjoint(pad(parent(c), bx, ax)) +_colon2axes(ax::Tuple, bx::Tuple{Infinity, Vararg{Any}}) = (oneto(first(bx)), _colon2axes(tail(ax), tail(bx))...) +pad(c::AbstractVector{T}, ax::OneToInf) where T = Vcat(c, Zeros{T}(length(ax)-length(c))) pad(c::BlockVec, ax::BlockedOneTo{Int,<:InfStepRange}) = BlockVec(pad(c.args[1], size(c.args[1],1), ∞)) export ∞, ContinuousSpectrumError, BlockTridiagonal, TridiagonalConjugation, BidiagonalConjugation diff --git a/test/runtests.jl b/test/runtests.jl index 39fb11f..9223227 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -45,7 +45,7 @@ end @test pad(X, oneto(3), oneto(∞)) isa PaddedArray @test pad(X, :, oneto(∞)) isa PaddedArray @test pad(X, :, :) isa Matrix - @test pad(X, oneto(10), :) isa PaddedArray + @test pad(X, oneto(10), :) isa Vcat P = pad(BlockVec(X), blockedrange(Fill(3,∞))) @test P isa BlockVec @test MemoryLayout(P) isa PaddedColumns