Skip to content

Commit acfe346

Browse files
committed
Add some missing docs
1 parent ed9186f commit acfe346

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

src/BandedBlockBandedMatrix.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ BandedBlockBandedMatrix{T}(::Uninitialized, block_sizes::BandedBlockBandedSizes)
8383
_BandedBlockBandedMatrix(
8484
PseudoBlockArray{T}(uninitialized, block_sizes.data_block_sizes), block_sizes)
8585

86+
@doc """
87+
BlockBandedMatrix{T}(uninitialized, (rows, cols), (l, u), (λ, μ))
88+
89+
returns an uninitialized `sum(rows)`×`sum(cols)` banded-block-banded matrix `A`
90+
of type `T` with block-bandwidths `(l,u)` and where `A[Block(K,J)]`
91+
is a `BandedMatrix{T}` of size `rows[K]`×`cols[J]` with bandwidths `(λ,μ)`.
92+
"""
8693
BandedBlockBandedMatrix{T}(::Uninitialized, dims::NTuple{2, AbstractVector{Int}},
8794
lu::NTuple{2, Int}, λμ::NTuple{2, Int}) where T =
8895
BandedBlockBandedMatrix{T}(uninitialized, BandedBlockBandedSizes(dims..., lu..., λμ...))
@@ -345,8 +352,21 @@ end
345352
# end
346353
# end
347354

355+
@doc """
356+
subblockbandwidths(A)
348357
358+
returns the sub-block bandwidths of `A`, where `A` is a banded-block-banded
359+
matrix. In other words, `A[Block(K,J)]` will return a `BandedMatrix` with
360+
bandwidths given by `subblockbandwidths(A)`.
361+
"""
349362
subblockbandwidths(A::BandedBlockBandedMatrix) = A.λ, A.μ
363+
@doc """
364+
subblockbandwidth(A, i)
365+
366+
returns the sub-block lower (`i == 1`) or upper (`i == 2`) bandwidth of `A`,
367+
where `A` is a banded-block-banded matrix. In other words, `A[Block(K,J)]` will
368+
return a `BandedMatrix` with the returned lower/upper bandwidth.
369+
"""
350370
subblockbandwidth(A::BandedBlockBandedMatrix, k::Integer) = ifelse(k==1 , A.λ , A.μ)
351371

352372

src/BlockBandedMatrix.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ end
7979

8080
function _BandedBlockMatrix end
8181

82+
8283
# A block matrix where only the bands are nonzero
8384
# isomorphic to BandedMatrix{Matrix{T}}
8485
struct BlockBandedMatrix{T} <: AbstractBlockBandedMatrix{T}
@@ -100,6 +101,13 @@ end
100101
@inline BlockBandedMatrix{T}(::Uninitialized, block_sizes::BlockBandedSizes) where T =
101102
_BlockBandedMatrix(Vector{T}(uninitialized, bb_numentries(block_sizes)), block_sizes)
102103

104+
@doc """
105+
BlockBandedMatrix{T}(uninitialized, (rows, cols), (l, u))
106+
107+
returns an uninitialized `sum(rows)`×`sum(cols)` block-banded matrix `A`
108+
of type `T` with block-bandwidths `(l,u)` and where `A[Block(K,J)]`
109+
is a `Matrix{T}` of size `rows[K]`×`cols[J]`.
110+
"""
103111
@inline BlockBandedMatrix{T}(::Uninitialized, dims::NTuple{2, AbstractVector{Int}}, lu::NTuple{2, Int}) where T =
104112
BlockBandedMatrix{T}(uninitialized, BlockBandedSizes(dims..., lu...))
105113

0 commit comments

Comments
 (0)