Skip to content

Commit

Permalink
added BlockDiagonalFactorization shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianAment committed Apr 29, 2022
1 parent 711c27a commit 2bf2500
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BlockFactorizations"
uuid = "5c499583-5bfe-4591-9b59-c1e192d48697"
authors = ["Sebastian Ament <[email protected]>"]
version = "1.2.1"
version = "1.2.2"

[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Expand Down
2 changes: 1 addition & 1 deletion src/BlockFactorizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down
1 change: 1 addition & 0 deletions src/block.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 5 additions & 0 deletions test/block.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2bf2500

Please sign in to comment.