BlockBandedMatrices.jl Documentation
Creating block-banded and banded-block-banded matrices
BlockBandedMatrices.BlockBandedMatrix
— TypeBlockBandedMatrix
A BlockBandedMatrix
is a subtype of BlockMatrix
of BlockArrays.jl
whose layout of non-zero blocks is banded.
BlockBandedMatrices.BlockBandedMatrix
— MethodBlockBandedMatrix(A::Union{AbstractMatrix,UniformScaling},
+Home · BlockBandedMatrices.jl BlockBandedMatrices.jl Documentation
Creating block-banded and banded-block-banded matrices
BlockBandedMatrices.BlockBandedMatrix
— TypeBlockBandedMatrix
A BlockBandedMatrix
is a subtype of BlockMatrix
of BlockArrays.jl
whose layout of non-zero blocks is banded.
sourceBlockBandedMatrices.BlockBandedMatrix
— MethodBlockBandedMatrix(A::Union{AbstractMatrix,UniformScaling},
rows::AbstractVector{Int}, cols::AbstractVector{Int},
(l,u)::NTuple{2,Int})
Return a sum(rows) × sum(cols)
BlockBandedMatrix
, with rows
by cols
blocks, with (l,u)
as the block-bandwidth. The structural non-zero entries are equal to the corresponding indices of A
.
Examples
julia> using LinearAlgebra, FillArrays
@@ -29,7 +29,7 @@
─────┼────────────┼───────────────
⋅ │ ⋅ ⋅ │ 1.0 1.0 1.0
⋅ │ ⋅ ⋅ │ 1.0 1.0 1.0
- ⋅ │ ⋅ ⋅ │ 1.0 1.0 1.0
sourceBlockBandedMatrices.BlockBandedMatrix
— MethodBlockBandedMatrix(A::AbstractMatrix, (l,u)::NTuple{2,Int})
Return a BlockBandedMatrix
with block-bandwidths (l,u)
, where the structural non-zero blocks correspond to those of A
.
Examples
julia> using BlockArrays
+ ⋅ │ ⋅ ⋅ │ 1.0 1.0 1.0
sourceBlockBandedMatrices.BlockBandedMatrix
— MethodBlockBandedMatrix(A::AbstractMatrix, (l,u)::NTuple{2,Int})
Return a BlockBandedMatrix
with block-bandwidths (l,u)
, where the structural non-zero blocks correspond to those of A
.
Examples
julia> using BlockArrays
julia> B = BlockArray(ones(6,6), 1:3, 1:3);
@@ -42,8 +42,8 @@
─────┼────────────┼───────────────
⋅ │ 1.0 1.0 │ 1.0 1.0 1.0
⋅ │ 1.0 1.0 │ 1.0 1.0 1.0
- ⋅ │ 1.0 1.0 │ 1.0 1.0 1.0
sourceBlockBandedMatrices.BlockBandedMatrix
— MethodBlockBandedMatrix{T}(undef, rows::AbstractVector{Int}, cols::AbstractVector{Int},
- (l,u)::NTuple{2,Int})
Return an unitialized sum(rows) × sum(cols)
BlockBandedMatrix
having eltype
T
, with rows
by cols
blocks and (l,u)
as the block-bandwidth.
sourceBlockBandedMatrices.BandedBlockBandedMatrix
— TypeBandedBlockBandedMatrix(M::Union{UniformScaling,AbstractMatrix},
+ ⋅ │ 1.0 1.0 │ 1.0 1.0 1.0
sourceBlockBandedMatrices.BlockBandedMatrix
— MethodBlockBandedMatrix{T}(undef, rows::AbstractVector{Int}, cols::AbstractVector{Int},
+ (l,u)::NTuple{2,Int})
Return an unitialized sum(rows) × sum(cols)
BlockBandedMatrix
having eltype
T
, with rows
by cols
blocks and (l,u)
as the block-bandwidth.
sourceBlockBandedMatrices.BandedBlockBandedMatrix
— TypeBandedBlockBandedMatrix(M::Union{UniformScaling,AbstractMatrix},
rows, cols, (l, u), (λ, μ))
Return a sum(rows) × sum(cols)
banded-block-banded matrix A
, with block-bandwidths (l,u)
and where A[Block(K,J)]
is a BandedMatrix
of size rows[K]
×cols[J]
with bandwidths (λ,μ)
. The structural non-zero elements of the returned matrix corresponds to those of M
.
Examples
julia> using LinearAlgebra, FillArrays
julia> BandedBlockBandedMatrix(I, [3,4,3], [3,4,3], (1,1), (1,1))
@@ -74,7 +74,7 @@
────────────┼─────────────────┼────────────
⋅ ⋅ ⋅ ⋅ │ 1 1 ⋅ ⋅ ⋅ │ 1 1 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ │ 1 1 1 ⋅ ⋅ │ 1 1 1 ⋅
- ⋅ ⋅ ⋅ ⋅ │ ⋅ 1 1 1 ⋅ │ ⋅ 1 1 1
sourceBlockBandedMatrices.BandedBlockBandedMatrix
— MethodBandedBlockBandedMatrix{T}(undef, rows, cols, (l, u), (λ, μ))
Return an unitialized BandedBlockBandedMatrix
having eltype
T
, with block-bandwidths (l,u)
and where A[Block(K,J)]
is a BandedMatrix{T}
of size rows[K]×cols[J]
with bandwidths (λ,μ)
.
sourceBlockBandedMatrices.BlockSkylineMatrix
— TypeBlockSkylineMatrix{T,LL,UU}(M::Union{UndefInitializer,UniformScaling,AbstractMatrix},
+ ⋅ ⋅ ⋅ ⋅ │ ⋅ 1 1 1 ⋅ │ ⋅ 1 1 1
sourceBlockBandedMatrices.BandedBlockBandedMatrix
— MethodBandedBlockBandedMatrix{T}(undef, rows, cols, (l, u), (λ, μ))
Return an unitialized BandedBlockBandedMatrix
having eltype
T
, with block-bandwidths (l,u)
and where A[Block(K,J)]
is a BandedMatrix{T}
of size rows[K]×cols[J]
with bandwidths (λ,μ)
.
sourceBlockBandedMatrices.BlockSkylineMatrix
— TypeBlockSkylineMatrix{T,LL,UU}(M::Union{UndefInitializer,UniformScaling,AbstractMatrix},
rows, cols, (l::LL, u::UU))
returns a sum(rows)
×sum(cols)
block-banded matrix A
having elements of type T
, with block-bandwidths (l,u)
and where A[Block(K,J)]
is a Matrix{T}
of size rows[K]
×cols[J]
.
(l,u)
may be integers for constant bandwidths or integer vectors of lengths rows
and cols
, respectively, for ragged bands.
Examples
julia> using LinearAlgebra, FillArrays
julia> BlockSkylineMatrix(I, [2,3,4], [1,2,3], ([2,0,1],[1,1,1]))
@@ -103,7 +103,7 @@
1.0 │ ⋅ ⋅ │ 1.0 1.0 1.0
1.0 │ ⋅ ⋅ │ 1.0 1.0 1.0
1.0 │ ⋅ ⋅ │ 1.0 1.0 1.0
- 1.0 │ ⋅ ⋅ │ 1.0 1.0 1.0
sourceAccessing block-banded and banded-block-banded matrices
BlockBandedMatrices.isblockbanded
— Functionisblockbanded(A)
returns true if a matrix implements the block banded interface.
sourceBlockBandedMatrices.blockbandwidths
— Functionblockbandwidths(A)
Returns a tuple containing the upper and lower blockbandwidth of A
.
sourceBlockBandedMatrices.blockbandwidth
— Functionblockbandwidth(A,i)
Returns the lower blockbandwidth (i==1
) or the upper blockbandwidth (i==2
).
sourceBlockBandedMatrices.blockbandrange
— Functionblockbandrange(A)
Returns the range -blockbandwidth(A,1):blockbandwidth(A,2)
.
sourceBlockBandedMatrices.subblockbandwidths
— Functionsubblockbandwidths(A)
returns the sub-block bandwidths of A
, where A
is a banded-block-banded matrix. In other words, A[Block(K,J)]
will return a BandedMatrix
with bandwidths given by subblockbandwidths(A)
.
sourceBlockBandedMatrices.subblockbandwidth
— Functionsubblockbandwidth(A, i)
returns the sub-block lower (i == 1
) or upper (i == 2
) bandwidth of A
, where A
is a banded-block-banded matrix. In other words, A[Block(K,J)]
will return a BandedMatrix
with the returned lower/upper bandwidth.
sourceImplementation
A BlockBandedMatrix
stores the entries in a single vector, ordered by columns. For example, if A
is a BlockBandedMatrix
with block-bandwidths (A.l,A.u) == (1,0)
and the block sizes fill(2, N)
where N = 3
is the number of row and column blocks, then A
has zero structure
[ a_11 a_12 │ ⋅ ⋅
+ 1.0 │ ⋅ ⋅ │ 1.0 1.0 1.0
sourceAccessing block-banded and banded-block-banded matrices
BlockBandedMatrices.isblockbanded
— Functionisblockbanded(A)
returns true if a matrix implements the block banded interface.
sourceBlockBandedMatrices.blockbandwidths
— Functionblockbandwidths(A)
Returns a tuple containing the upper and lower blockbandwidth of A
.
sourceBlockBandedMatrices.blockbandwidth
— Functionblockbandwidth(A,i)
Returns the lower blockbandwidth (i==1
) or the upper blockbandwidth (i==2
).
sourceBlockBandedMatrices.blockbandrange
— Functionblockbandrange(A)
Returns the range -blockbandwidth(A,1):blockbandwidth(A,2)
.
sourceBlockBandedMatrices.subblockbandwidths
— Functionsubblockbandwidths(A)
returns the sub-block bandwidths of A
, where A
is a banded-block-banded matrix. In other words, A[Block(K,J)]
will return a BandedMatrix
with bandwidths given by subblockbandwidths(A)
.
sourceBlockBandedMatrices.subblockbandwidth
— Functionsubblockbandwidth(A, i)
returns the sub-block lower (i == 1
) or upper (i == 2
) bandwidth of A
, where A
is a banded-block-banded matrix. In other words, A[Block(K,J)]
will return a BandedMatrix
with the returned lower/upper bandwidth.
sourceImplementation
A BlockBandedMatrix
stores the entries in a single vector, ordered by columns. For example, if A
is a BlockBandedMatrix
with block-bandwidths (A.l,A.u) == (1,0)
and the block sizes fill(2, N)
where N = 3
is the number of row and column blocks, then A
has zero structure
[ a_11 a_12 │ ⋅ ⋅
a_21 a_22 │ ⋅ ⋅
──────────┼──────────
a_31 a_32 │ a_33 a_34
@@ -121,4 +121,4 @@
a_21 × │ a_43 ×
──────────┼──────────
a_31 a_42 │ a_53 a_64
- a_41 × │ a_63 × ]
where ×
is an entry in memory that is not used.
The reasoning behind this storage scheme as that each block still satisfies the banded matrix interface.
Layout
BlockBandedMatrices.AbstractBlockBandedLayout
— TypeAbstractBlockBandedLayout
isa a MemoryLayout
that indicates that the array implements the block-banded interface.
sourceBlockBandedMatrices.AbstractBandedBlockBandedLayout
— TypeAbstractBandedBlockBandedLayout
isa a MemoryLayout
that indicates that the array implements the banded-block-banded interface.
sourceSettings
This document was generated with Documenter.jl version 1.2.1 on Wednesday 6 December 2023. Using Julia version 1.9.4.
where ×
is an entry in memory that is not used.
The reasoning behind this storage scheme as that each block still satisfies the banded matrix interface.
Layout
BlockBandedMatrices.AbstractBlockBandedLayout
— TypeAbstractBlockBandedLayout
isa a MemoryLayout
that indicates that the array implements the block-banded interface.
BlockBandedMatrices.AbstractBandedBlockBandedLayout
— TypeAbstractBandedBlockBandedLayout
isa a MemoryLayout
that indicates that the array implements the banded-block-banded interface.