Skip to content

Commit

Permalink
SemiseparableMatrices v0.3 (#94)
Browse files Browse the repository at this point in the history
* SemiseparableMatrices v0.3

* Eye ambiguities

* bandedTopelitz * padded

* Update Project.toml

* v0.6.3
  • Loading branch information
dlfivefifty authored Sep 27, 2021
1 parent ddca8a6 commit eca72e7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "InfiniteLinearAlgebra"
uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c"
version = "0.6.2"
version = "0.6.3"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
Expand All @@ -22,12 +22,12 @@ BandedMatrices = "0.16.9"
BlockArrays = "0.16"
BlockBandedMatrices = "0.11"
DSP = "0.7"
FillArrays = "0.11, 0.12"
FillArrays = "0.12"
InfiniteArrays = "0.12"
LazyArrays = "0.21.8, 0.22"
LazyBandedMatrices = "0.7.1"
LazyArrays = "0.22"
LazyBandedMatrices = "0.7.2"
MatrixFactorizations = "0.8"
SemiseparableMatrices = "0.2.7"
SemiseparableMatrices = "0.3"
julia = "1.6"

[extras]
Expand Down
3 changes: 3 additions & 0 deletions src/banded/infbanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -434,13 +434,16 @@ _bandedfill_mul(M::MulAdd, ::Tuple{Any,InfAxes}, ::Tuple{InfAxes,Any}) = ApplyAr

mulreduce(M::Mul{BandedToeplitzLayout, BandedToeplitzLayout}) = ApplyArray(M)
mulreduce(M::Mul{BandedToeplitzLayout}) = ApplyArray(M)
mulreduce(M::Mul{BandedToeplitzLayout,<:PaddedLayout}) = MulAdd(M)
mulreduce(M::Mul{<:Any, BandedToeplitzLayout}) = ApplyArray(M)
mulreduce(M::Mul{<:BandedColumns{<:AbstractFillLayout}, PertToeplitzLayout}) = ApplyArray(M)
mulreduce(M::Mul{<:PertToeplitzLayout, <:BandedColumns{<:AbstractFillLayout}}) = ApplyArray(M)
mulreduce(M::Mul{<:BandedColumns{<:AbstractFillLayout}, BandedToeplitzLayout}) = ApplyArray(M)
mulreduce(M::Mul{BandedToeplitzLayout, <:BandedColumns{<:AbstractFillLayout}}) = ApplyArray(M)
mulreduce(M::Mul{<:AbstractQLayout, BandedToeplitzLayout}) = ApplyArray(M)
mulreduce(M::Mul{<:AbstractQLayout, PertToeplitzLayout}) = ApplyArray(M)
mulreduce(M::Mul{<:DiagonalLayout, BandedToeplitzLayout}) = Lmul(M)
mulreduce(M::Mul{BandedToeplitzLayout, <:DiagonalLayout}) = Rmul(M)


function _bidiag_forwardsub!(M::Ldiv{<:Any,<:PaddedLayout})
Expand Down
20 changes: 19 additions & 1 deletion test/test_infbanded.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using InfiniteLinearAlgebra, InfiniteArrays, BandedMatrices, FillArrays, LazyBandedMatrices, Test
using InfiniteLinearAlgebra, InfiniteArrays, BandedMatrices, FillArrays, LazyBandedMatrices, LazyArrays, Test
import BandedMatrices: _BandedMatrix

@testset "∞-banded" begin
Expand Down Expand Up @@ -45,6 +45,12 @@ import BandedMatrices: _BandedMatrix
@test (A * Fill(2,∞))[1:10] 2A[1:10,1:16]*ones(16)
@test (Fill(2,∞,∞)*A)[1:10,1:10] fill(2,10,13)A[1:13,1:10]

@test Eye(∞) * A isa BandedMatrix
@test A * Eye(∞) isa BandedMatrix

@test A * [1; 2; Zeros(∞)] isa Vcat
@test A * [1; 2; Zeros(∞)] == [A[1:5,1:2] * [1,2]; Zeros(∞)]

@test MemoryLayout(Tridiagonal(Fill(1,∞), Fill(2,∞), Fill(3,∞))) isa TridiagonalToeplitzLayout
@test MemoryLayout(Bidiagonal(Fill(1,∞), Fill(2,∞), :U)) isa BidiagonalToeplitzLayout
@test MemoryLayout(SymTridiagonal(Fill(1,∞), Fill(2,∞))) isa TridiagonalToeplitzLayout
Expand Down Expand Up @@ -88,6 +94,9 @@ import BandedMatrices: _BandedMatrix
@test A[2:∞,2:∞] isa PertToeplitz

@test (A + 2I)[1:10,1:10] == (2I + A)[1:10,1:10] == A[1:10,1:10] + 2I

@test Eye(∞) * A isa BandedMatrix
@test A * Eye(∞) isa BandedMatrix
end

@testset "TriPert" begin
Expand Down Expand Up @@ -140,4 +149,13 @@ import BandedMatrices: _BandedMatrix
A, B = Diagonal(Fill(2,∞)) , LazyBandedMatrices.Bidiagonal(exp.(1:∞), exp.(1:∞), :L)
@test (A*B)[1:10,1:10] (B*A)[1:10,1:10] 2B[1:10,1:10]
end

@testset "concat" begin
H = ApplyArray(hvcat, 2, 1, [1 Zeros(1,∞)], [1; Zeros(∞)], Diagonal(1:∞))
@test bandwidths(H) == (1,1)
H = ApplyArray(hvcat, 2, 1, [0 Zeros(1,∞)], [0; Zeros(∞)], Diagonal(1:∞))
@test bandwidths(H) == (0,0)
H = ApplyArray(hvcat, (2,2), 1, [1 Zeros(1,∞)], [1; Zeros(∞)], Diagonal(1:∞))
@test_broken bandwidths(H) == (1,1)
end
end

2 comments on commit eca72e7

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/45612

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.6.3 -m "<description of version>" eca72e773ff5ca570c743b0d8ab6d72430cb9b1f
git push origin v0.6.3

Please sign in to comment.