Skip to content

Commit 2bf2500

Browse files
added BlockDiagonalFactorization shorthand
1 parent 711c27a commit 2bf2500

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockFactorizations"
22
uuid = "5c499583-5bfe-4591-9b59-c1e192d48697"
33
authors = ["Sebastian Ament <sebastianeament@gmail.com>"]
4-
version = "1.2.1"
4+
version = "1.2.2"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/BlockFactorizations.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const AbstractMatOrFacOrUni{T} = Union{AbstractMatrix{T}, Factorization{T}, Unif
99
const AbstractVecOfVec{T} = AbstractVector{<:AbstractVector{T}}
1010
const AbstractVecOfVecOrMat{T} = AbstractVector{<:AbstractVecOrMat{T}}
1111

12-
export BlockFactorization
12+
export BlockFactorization, BlockDiagonalFactorization
1313

1414
include("block.jl")
1515

src/block.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function BlockFactorization(A::AbstractMatrix, nindices, mindices)
1919
BlockFactorization{T, typeof(A), typeof(nindices), typeof(mindices)}(A, nindices, mindices)
2020
end
2121
const StridedBlockFactorization = BlockFactorization{<:Any, <:Any, <:StepRange, <:StepRange}
22+
const BlockDiagonalFactorization = BlockFactorization{<:Any, <:Diagonal, <:Any, <:Any}
2223

2324
# calculates the element type of the BlockFactorization with blocks given by A
2425
block_eltype(A::AbstractMatrix{<:Number}) = eltype(A)

test/block.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ using Test
122122
@test eltype(A) == Any
123123
B = BlockFactorization(A)
124124
@test eltype(B) == elty_A
125+
126+
d, n = 2, 3
127+
A = Diagonal([randn(elty_A, d, d) for _ in 1:n])
128+
B = BlockFactorization(A)
129+
@test B isa BlockDiagonalFactorization
125130
end
126131
end
127132
end

0 commit comments

Comments
 (0)