Skip to content

Commit eca72e7

Browse files
authored
SemiseparableMatrices v0.3 (#94)
* SemiseparableMatrices v0.3 * Eye ambiguities * bandedTopelitz * padded * Update Project.toml * v0.6.3
1 parent ddca8a6 commit eca72e7

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

Project.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "InfiniteLinearAlgebra"
22
uuid = "cde9dba0-b1de-11e9-2c62-0bab9446c55c"
3-
version = "0.6.2"
3+
version = "0.6.3"
44

55
[deps]
66
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
@@ -22,12 +22,12 @@ BandedMatrices = "0.16.9"
2222
BlockArrays = "0.16"
2323
BlockBandedMatrices = "0.11"
2424
DSP = "0.7"
25-
FillArrays = "0.11, 0.12"
25+
FillArrays = "0.12"
2626
InfiniteArrays = "0.12"
27-
LazyArrays = "0.21.8, 0.22"
28-
LazyBandedMatrices = "0.7.1"
27+
LazyArrays = "0.22"
28+
LazyBandedMatrices = "0.7.2"
2929
MatrixFactorizations = "0.8"
30-
SemiseparableMatrices = "0.2.7"
30+
SemiseparableMatrices = "0.3"
3131
julia = "1.6"
3232

3333
[extras]

src/banded/infbanded.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,16 @@ _bandedfill_mul(M::MulAdd, ::Tuple{Any,InfAxes}, ::Tuple{InfAxes,Any}) = ApplyAr
434434

435435
mulreduce(M::Mul{BandedToeplitzLayout, BandedToeplitzLayout}) = ApplyArray(M)
436436
mulreduce(M::Mul{BandedToeplitzLayout}) = ApplyArray(M)
437+
mulreduce(M::Mul{BandedToeplitzLayout,<:PaddedLayout}) = MulAdd(M)
437438
mulreduce(M::Mul{<:Any, BandedToeplitzLayout}) = ApplyArray(M)
438439
mulreduce(M::Mul{<:BandedColumns{<:AbstractFillLayout}, PertToeplitzLayout}) = ApplyArray(M)
439440
mulreduce(M::Mul{<:PertToeplitzLayout, <:BandedColumns{<:AbstractFillLayout}}) = ApplyArray(M)
440441
mulreduce(M::Mul{<:BandedColumns{<:AbstractFillLayout}, BandedToeplitzLayout}) = ApplyArray(M)
441442
mulreduce(M::Mul{BandedToeplitzLayout, <:BandedColumns{<:AbstractFillLayout}}) = ApplyArray(M)
442443
mulreduce(M::Mul{<:AbstractQLayout, BandedToeplitzLayout}) = ApplyArray(M)
443444
mulreduce(M::Mul{<:AbstractQLayout, PertToeplitzLayout}) = ApplyArray(M)
445+
mulreduce(M::Mul{<:DiagonalLayout, BandedToeplitzLayout}) = Lmul(M)
446+
mulreduce(M::Mul{BandedToeplitzLayout, <:DiagonalLayout}) = Rmul(M)
444447

445448

446449
function _bidiag_forwardsub!(M::Ldiv{<:Any,<:PaddedLayout})

test/test_infbanded.jl

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using InfiniteLinearAlgebra, InfiniteArrays, BandedMatrices, FillArrays, LazyBandedMatrices, Test
1+
using InfiniteLinearAlgebra, InfiniteArrays, BandedMatrices, FillArrays, LazyBandedMatrices, LazyArrays, Test
22
import BandedMatrices: _BandedMatrix
33

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

48+
@test Eye(∞) * A isa BandedMatrix
49+
@test A * Eye(∞) isa BandedMatrix
50+
51+
@test A * [1; 2; Zeros(∞)] isa Vcat
52+
@test A * [1; 2; Zeros(∞)] == [A[1:5,1:2] * [1,2]; Zeros(∞)]
53+
4854
@test MemoryLayout(Tridiagonal(Fill(1,∞), Fill(2,∞), Fill(3,∞))) isa TridiagonalToeplitzLayout
4955
@test MemoryLayout(Bidiagonal(Fill(1,∞), Fill(2,∞), :U)) isa BidiagonalToeplitzLayout
5056
@test MemoryLayout(SymTridiagonal(Fill(1,∞), Fill(2,∞))) isa TridiagonalToeplitzLayout
@@ -88,6 +94,9 @@ import BandedMatrices: _BandedMatrix
8894
@test A[2:∞,2:∞] isa PertToeplitz
8995

9096
@test (A + 2I)[1:10,1:10] == (2I + A)[1:10,1:10] == A[1:10,1:10] + 2I
97+
98+
@test Eye(∞) * A isa BandedMatrix
99+
@test A * Eye(∞) isa BandedMatrix
91100
end
92101

93102
@testset "TriPert" begin
@@ -140,4 +149,13 @@ import BandedMatrices: _BandedMatrix
140149
A, B = Diagonal(Fill(2,∞)) , LazyBandedMatrices.Bidiagonal(exp.(1:∞), exp.(1:∞), :L)
141150
@test (A*B)[1:10,1:10] (B*A)[1:10,1:10] 2B[1:10,1:10]
142151
end
152+
153+
@testset "concat" begin
154+
H = ApplyArray(hvcat, 2, 1, [1 Zeros(1,∞)], [1; Zeros(∞)], Diagonal(1:∞))
155+
@test bandwidths(H) == (1,1)
156+
H = ApplyArray(hvcat, 2, 1, [0 Zeros(1,∞)], [0; Zeros(∞)], Diagonal(1:∞))
157+
@test bandwidths(H) == (0,0)
158+
H = ApplyArray(hvcat, (2,2), 1, [1 Zeros(1,∞)], [1; Zeros(∞)], Diagonal(1:∞))
159+
@test_broken bandwidths(H) == (1,1)
160+
end
143161
end

0 commit comments

Comments
 (0)