diff --git a/Project.toml b/Project.toml index 7016bd6..3af1b1d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "BlockFactorizations" uuid = "5c499583-5bfe-4591-9b59-c1e192d48697" authors = ["Sebastian Ament "] -version = "1.2.1" +version = "1.2.2" [deps] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/src/BlockFactorizations.jl b/src/BlockFactorizations.jl index 5ccda8b..7bebe9d 100644 --- a/src/BlockFactorizations.jl +++ b/src/BlockFactorizations.jl @@ -9,7 +9,7 @@ const AbstractMatOrFacOrUni{T} = Union{AbstractMatrix{T}, Factorization{T}, Unif const AbstractVecOfVec{T} = AbstractVector{<:AbstractVector{T}} const AbstractVecOfVecOrMat{T} = AbstractVector{<:AbstractVecOrMat{T}} -export BlockFactorization +export BlockFactorization, BlockDiagonalFactorization include("block.jl") diff --git a/src/block.jl b/src/block.jl index 27fe6d0..8e76412 100644 --- a/src/block.jl +++ b/src/block.jl @@ -19,6 +19,7 @@ function BlockFactorization(A::AbstractMatrix, nindices, mindices) BlockFactorization{T, typeof(A), typeof(nindices), typeof(mindices)}(A, nindices, mindices) end const StridedBlockFactorization = BlockFactorization{<:Any, <:Any, <:StepRange, <:StepRange} +const BlockDiagonalFactorization = BlockFactorization{<:Any, <:Diagonal, <:Any, <:Any} # calculates the element type of the BlockFactorization with blocks given by A block_eltype(A::AbstractMatrix{<:Number}) = eltype(A) diff --git a/test/block.jl b/test/block.jl index 368e9e3..b5b61f4 100644 --- a/test/block.jl +++ b/test/block.jl @@ -122,6 +122,11 @@ using Test @test eltype(A) == Any B = BlockFactorization(A) @test eltype(B) == elty_A + + d, n = 2, 3 + A = Diagonal([randn(elty_A, d, d) for _ in 1:n]) + B = BlockFactorization(A) + @test B isa BlockDiagonalFactorization end end end