https://github.com/JuliaMatrices/BlockBandedMatrices.jl
A Julia package for representing block-banded matrices and banded-block-banded matrices
https://github.com/JuliaMatrices/BlockBandedMatrices.jl
Last synced: about 2 months ago
JSON representation
A Julia package for representing block-banded matrices and banded-block-banded matrices
- Host: GitHub
- URL: https://github.com/JuliaMatrices/BlockBandedMatrices.jl
- Owner: JuliaLinearAlgebra
- License: mit
- Created: 2016-12-10T03:10:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T12:29:16.000Z (12 months ago)
- Last Synced: 2024-04-17T14:12:06.267Z (12 months ago)
- Language: Julia
- Homepage: https://julialinearalgebra.github.io/BlockBandedMatrices.jl/
- Size: 880 KB
- Stars: 56
- Watchers: 8
- Forks: 13
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-sciml - JuliaMatrices/BlockBandedMatrices.jl: A Julia package for representing block-banded matrices and banded-block-banded matrices
README
# BlockBandedMatrices.jl
A Julia package for representing block-banded matrices and banded-block-banded matrices[](https://github.com/JuliaLinearAlgebra/BlockBandedMatrices.jl/actions)
[](https://codecov.io/gh/JuliaLinearAlgebra/BlockBandedMatrices.jl)
[](https://github.com/JuliaTesting/Aqua.jl)
[](https://juliahub.com/ui/Packages/General/BlockBandedMatrices)
[](https://juliahub.com/ui/Packages/General/BlockBandedMatrices?t=2)
[](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html)[](https://JuliaLinearAlgebra.github.io/BlockBandedMatrices.jl/stable)
[](https://JuliaLinearAlgebra.github.io/BlockBandedMatrices.jl/dev)This package supports representing block-banded and banded-block-banded matrices by only
storing the entries in the non-zero bands.A `BlockBandedMatrix` is a subtype of `BlockMatrix` of [BlockArrays.jl](https://github.com/JuliaArrays/BlockArrays.jl)
whose layout of non-zero blocks is banded. We can construct a `BlockBandedMatrix` as follows:
```julia
using FillArrays, LinearAlgebra
l,u = 2,1 # block bandwidths
N = M = 4 # number of row/column blocks
cols = rows = 1:N # block sizesBlockBandedMatrix(Zeros(sum(rows),sum(cols)), rows,cols, (l,u)) # creates a block-banded matrix of zeros
BlockBandedMatrix(Ones(sum(rows),sum(cols)), rows,cols, (l,u)) # creates a block-banded matrix with ones in the non-zero entries
BlockBandedMatrix(I, rows,cols, (l,u)) # creates a block-banded identity matrix
```A `BandedBlockBandedMatrix` has the added structure that the blocks themselves are
banded, and conform to the banded matrix interface of [BandedMatrices.jl](https://github.com/JuliaLinearAlgebra/BandedMatrices.jl).
We can construct a `BandedBlockBandedMatrix` as follows:
```julia
using FillArrays, LinearAlgebra
l,u = 2,1 # block bandwidths
λ,μ = 1,2 # sub-block bandwidths: the bandwidths of each block
N = M = 4 # number of row/column blocks
cols = rows = 1:N # block sizesBandedBlockBandedMatrix(Zeros(sum(rows),sum(cols)), rows,cols, (l,u), (λ,μ)) # creates a banded-block-banded matrix of zeros
BandedBlockBandedMatrix(Ones(sum(rows),sum(cols)), rows,cols, (l,u), (λ,μ)) # creates a banded-block-banded matrix with ones in the non-zero entries
BandedBlockBandedMatrix(I, rows,cols, (l,u), (λ,μ)) # creates a banded-block-banded identity matrix
```