Skip to content

Commit

Permalink
v1.0 (#255)
Browse files Browse the repository at this point in the history
* Compact show for `BlockRange` (#248)

* Compact show for BlockRange

* update docstrings

* don't specialize show for zero dim

* fix missing io in print

* missing show tests

* show for BlockIndexRange

* Bump version to v1.0.0-dev

* Add `BlockedOneTo` as the axis type for a `BlockedArray` (#348)

* Add BlockedOneTo

* axes for AbstractBlockedUnitRange returns BlockedOneTo

* Rewrite test using blockedrange instead of BlockedUnitRange

* Update BlockedUnitRange docstring and add for BlockedOneTo/blockedrange

* Show for BlockedOneTo

* Blocklengths for OrdinalRange block sizes

* Update docs

* Return BlockedOneTo in indexing with BlockRange

* Be less fussy in show tests

* Require 1-based lasts in blockedrange

* Disallow offset arrays  in BlockedUnitRange

* undo unnecessary doc change

* Test conversions between BlockedOneTo and BlockedUnitRange

* Reduce the number of convert methods

* Remove axes1 specialization

* Disallow offset block axes and blocks in BlockArray constructor

* Remove unused axes method

* Infinite broadcast tests (#383)

* Specialize blockedrange BroadcastStyle for LazyArrayStyle (#384)

* Specialize blockedrange BroadcastStyle for LazyArrayStyle

* Add compat for LazyArrays

* Define dataids for PseudoBlockArrays (#364) (#385)

* Define dataids for PseudoBlockArrays (#364)

* Don't use dataids of axes

* Banded Matrix extension (#388)

* Move BandedMatrices+BlockArrays code in BlockBandedMatrices to extension

* Bump julia-actions/setup-julia from 1 to 2 (#387)

Bumps [julia-actions/setup-julia](https://github.com/julia-actions/setup-julia) from 1 to 2.
- [Release notes](https://github.com/julia-actions/setup-julia/releases)
- [Commits](julia-actions/setup-julia@v1...v2)

---
updated-dependencies:
- dependency-name: julia-actions/setup-julia
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Move over blockbanded code

* Add tests

* Update Project.toml

* add tests

* Update Project.toml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Generalize the element type of `BlockedUnitRange` (#337)

* Allow more general BlockUnitRange element types

* Restrict element type

* Get tests passing

* Fix some tests

* Fix some doctests

* Skip broken test in Julia v1.6

* Better support for unitful numbers

* Fix tests

* Stricter types in _BlockedUnitRange

* Improve tests coverage

* Allow non-Int eltypes in BlockedOneTo (#395)

* Allow non-Int eltypes in BlockedOneTo

* Specific constructors in BlockedOneTo

* Restrict eltype to integers in BlockedOneTo constructors

* Tests for construction from a Tuple

* Move LazyArrays extension to LazyArrays.jl (#393)

* Move LazyArrays extension to LazyArrays.jl

* remove LazyArrays

* Move over OneToCumsum

This was type piracy in LazyBandedMatrices.jl

* Update blockaxis.jl

* move out InfiniteArrays.jl tests

* Use FillArrays accumulate overloads (#397)

* Bump julia-actions/setup-julia from 1 to 2 (#387)

Bumps [julia-actions/setup-julia](https://github.com/julia-actions/setup-julia) from 1 to 2.
- [Release notes](https://github.com/julia-actions/setup-julia/releases)
- [Commits](julia-actions/setup-julia@v1...v2)

---
updated-dependencies:
- dependency-name: julia-actions/setup-julia
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Map imported names to correct parentmodules (#391)

* Remove unused imported names (#392)

* Don't import Base.Cartesian (#394)

I don't think this is being used anymore

* Use FillArrays accumulate

* Bump julia-actions/cache from 1 to 2 (#398)

Bumps [julia-actions/cache](https://github.com/julia-actions/cache) from 1 to 2.
- [Release notes](https://github.com/julia-actions/cache/releases)
- [Commits](julia-actions/cache@v1...v2)

---
updated-dependencies:
- dependency-name: julia-actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update Project.toml

* Update Project.toml

* try running Pkg.update()

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com>

* Redefine blocksizes (#399)

* Redefine blocksizes

* Revert change to docstring

* Add tests, fix some tests, add docstring

* Fix more tests

* Add test Project.toml

* Git ignore vim temp files

* Fixes to test Project.toml

* Another test Project.toml fix

* Move code, change type design, better code coverage

* Backwards compatibility. Fix doctest.

* Fix tests

* Redesign BlockSizes to be AbstractArray subtype

* Rename PseudoBlockArray to BlockedArray (#401)

* v1.0, add README

* rename files

* Update README.md

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jishnu Bhattacharya <jishnub.github@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Matt Fishman <mtfishman@users.noreply.github.com>
  • Loading branch information
4 people committed May 17, 2024
1 parent 0ccad75 commit bb3bf1b
Show file tree
Hide file tree
Showing 41 changed files with 1,740 additions and 920 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
version: '1.10'
- uses: julia-actions/cache@v2
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
run: julia --project=docs/ -e 'using Pkg; Pkg.update(); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ src/.DS_Store
Manifest.toml
Manifest-v*.*.toml
.DS_Store
.*.swp
build
19 changes: 14 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
name = "BlockArrays"
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
version = "0.16.44-dev"
version = "1.0.0"

[deps]
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

[weakdeps]
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"

[extensions]
BlockArraysBandedMatricesExt = "BandedMatrices"

[compat]
Aqua = "0.8"
ArrayLayouts = "1.0.8"
Documenter = "1"
FillArrays = "1"
BandedMatrices = "1.0"
Documenter = "1.0"
FillArrays = "1.11"
LinearAlgebra = "1.6"
OffsetArrays = "1"
OffsetArrays = "1.0"
Random = "1.6"
SparseArrays = "1.6"
StaticArrays = "1.6"
Expand All @@ -22,6 +30,7 @@ julia = "1.6"

[extras]
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -30,4 +39,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Aqua", "Documenter", "OffsetArrays", "SparseArrays", "StaticArrays", "Test", "Random"]
test = ["Aqua", "BandedMatrices", "Documenter", "OffsetArrays", "SparseArrays", "StaticArrays", "Test", "Random"]
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@

A block array is a partition of an array into blocks or subarrays, see [wikipedia](https://en.wikipedia.org/wiki/Block_matrix) for a more extensive description. This package has two purposes. Firstly, it defines an interface for an `AbstractBlockArray` block arrays that can be shared among types representing different types of block arrays. The advantage to this is that it provides a consistent API for block arrays.

Secondly, it also implements two different type of block arrays that follow the `AbstractBlockArray` interface. The type `BlockArray` stores each block contiguously while the type `PseudoBlockArray` stores the full matrix contiguously. This means that `BlockArray` supports fast non copying extraction and insertion of blocks while `PseudoBlockArray` supports fast access to the full matrix to use in in for example a linear solver.
Secondly, it also implements two different type of block arrays that follow the `AbstractBlockArray` interface. The type `BlockArray` stores each block contiguously while the type `BlockedArray` stores the full matrix contiguously. This means that `BlockArray` supports fast non copying extraction and insertion of blocks while `BlockedArray` supports fast access to the full matrix to use in in for example a linear solver.

A simple way to produce `BlockArray`s is via `mortar`, which combines an array of arrays into a `BlockArray`:
```julia
julia> using BlockArrays

julia> mortar([randn(3), randn(4)])
2-blocked 7-element BlockVector{Float64}:
-0.19808699390960527
Expand All @@ -33,11 +35,43 @@ julia> mortar(reshape([randn(2,2), randn(1,2), randn(2,3), randn(1,3)],2,2))
0.430093 -0.0263753-1.31275 0.278447 -0.139579
```

Alternatively, one can add block structure on top of an existing array by wrapping the array in `BlockedArray`, where the extra arguments give the sizes of the blocks:
```julia
julia> BlockedArray(randn(7), [3,4])
2-blocked 7-element BlockedVector{Float64}:
-0.17348560551451797
-0.5680124317024628
1.699007590285868
─────────────────────
-0.7437814954416642
-0.018198226033108045
1.3335354818213445
-0.03512135185007728

julia> BlockedArray(randn(3,5), [2,1], [2,3])
2×2-blocked 3×5 BlockedMatrix{Float64}:
0.444186 0.7888230.743428 -0.815026 0.715779
-0.721074 -0.437831.07413 -0.336926 0.539873
──────────────────────┼─────────────────────────────────
0.128836 -0.350202-2.71365 1.67605 -0.25611
```


## Documentation

- [**STABLE**][docs-stable-url] &mdash; **most recently tagged version of the documentation.**
- [**LATEST**][docs-dev-url] &mdash; *in-development version of the documentation.*

## Changes in v1.0

We are excited to release v1.0! There are some important breaking changes from previous versions of BlockArrays.jl:

- `BlockedArray` replaces `PseudoBlockArray`.
- Axes are now typically `BlockedOneTo` instead of `BlockUnitRange`.
- Support for some simple block-banded matrices has been moved here from BlockBandedMatrices.jl.
- The definition of `blocksizes(array::AbstractArray)` is changed from `blocklengths.(axes(array))` to an iterator of size `blocksize(array)` over the sizes of each block of `array`.
- `BlockedUnitRange` is now parametrized by the element type instead of hardcoded to `Int`.

## Contributing

Possible ways of contributing to this package include:
Expand Down
2 changes: 1 addition & 1 deletion benchmark/runbenchmarks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ g = addgroup!(SUITE, "indexing")
g_size = addgroup!(SUITE, "size")

for n = (5,)
for BT in (BlockArray, PseudoBlockArray)
for BT in (BlockArray, BlockedArray)
block_vec = BT(rand(n), [1,3,1])
block_mat = BT(rand(n,n), [1,3,1], [4,1])
block_arr = BT(rand(n,n,n), [1,3,1], [4,1], [3, 2])
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ makedocs(
"Manual" => [
"man/abstractblockarrayinterface.md",
"man/blockarrays.md",
"man/pseudoblockarrays.md",
"man/blockedarrays.md",
],
"API" => [
"lib/public.md",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

A block array is a partition of an array into multiple blocks or subarrays, see [wikipedia](https://en.wikipedia.org/wiki/Block_matrix) for a more extensive description. This package has two purposes. Firstly, it defines an interface for an `AbstractBlockArray` block arrays that can be shared among types representing different types of block arrays. The advantage to this is that it provides a consistent API for block arrays.

Secondly, it also implements two concrete types of block arrays that follow the `AbstractBlockArray` interface. The type `BlockArray` stores each single block contiguously, by wrapping an `AbstractArray{<:AbstractArray{T,N},N}` to concatenate all blocks – the complete array is thus not stored contiguously. Conversely, a `PseudoBlockArray` stores the full matrix contiguously (by wrapping only one `AbstractArray{T, N}`) and only superimposes a block structure. This means that `BlockArray` supports fast non copying extraction and insertion of blocks, while `PseudoBlockArray` supports fast access to the full matrix to use in, for example, a linear solver.
Secondly, it also implements two concrete types of block arrays that follow the `AbstractBlockArray` interface. The type `BlockArray` stores each single block contiguously, by wrapping an `AbstractArray{<:AbstractArray{T,N},N}` to concatenate all blocks – the complete array is thus not stored contiguously. Conversely, a `BlockedArray` stores the full matrix contiguously (by wrapping only one `AbstractArray{T, N}`) and only superimposes a block structure. This means that `BlockArray` supports fast non copying extraction and insertion of blocks, while `BlockedArray` supports fast access to the full matrix to use in, for example, a linear solver.


## Terminology
Expand Down Expand Up @@ -39,7 +39,7 @@ A block array layout is specified its _block sizes_ – a tuple of `AbstractArra
## Manual Outline

```@contents
Pages = ["man/abstractblockarrayinterface.md", "man/blockarrays.md", "man/pseudoblockarrays.md"]
Pages = ["man/abstractblockarrayinterface.md", "man/blockarrays.md", "man/blockedarrays.md"]
Depth = 2
```

Expand Down
2 changes: 2 additions & 0 deletions docs/src/lib/internals.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Pages = ["internals.md"]
```@docs
blockcolsupport
blockrowsupport
blockedrange
BlockedOneTo
BlockedUnitRange
BlockRange
BlockIndexRange
Expand Down
8 changes: 4 additions & 4 deletions docs/src/lib/public.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ Base.popfirst!
```


## PseudoBlockArray
## BlockedArray

```@docs
PseudoBlockArray
PseudoBlockVector
PseudoBlockMatrix
BlockedArray
BlockedVector
BlockedMatrix
Base.resize!
```

Expand Down
6 changes: 3 additions & 3 deletions docs/src/man/abstractblockarrayinterface.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# The block axis interface

A block array's block structure is dictated by its axes, which
are typically a `BlockedUnitRange` but may also be a `UnitRange`,
which is assumed to be a single block, or other type that implements
A block array's block structure is dictated by its axes. These
are typically `BlockedOneTo`s, but may also be standard and non-blocked `AbstractUnitRange`s
(which are assumed to correspond to a single block), or other type that implements
the block axis interface.


Expand Down
8 changes: 4 additions & 4 deletions docs/src/man/blockarrays.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ julia> BlockArray(Array(reshape(1:16, 4, 4)), [2,2], [1,1,2])
julia> S = spzeros(4,5); S[1,2] = S[4,3] = 1;
julia> block_array_sparse = BlockArray(S, [1,3], [2,3])
2×2-blocked 4×5 BlockMatrix{Float64, Matrix{SparseMatrixCSC{Float64, Int64}}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}:
2×2-blocked 4×5 BlockMatrix{Float64, Matrix{SparseMatrixCSC{Float64, Int64}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}, BlockedOneTo{Int64, Vector{Int64}}}}:
⋅ 1.0 │ ⋅ ⋅ ⋅
──────────┼───────────────
⋅ ⋅ │ ⋅ ⋅ ⋅
Expand Down Expand Up @@ -67,7 +67,7 @@ The `block_type` should be an array type. It specifies the internal block type,

```jldoctest
julia> BlockArray(undef_blocks, SparseVector{Float64, Int}, [1,2])
2-blocked 3-element BlockVector{Float64, Vector{SparseVector{Float64, Int64}}, Tuple{BlockedUnitRange{Vector{Int64}}}}:
2-blocked 3-element BlockVector{Float64, Vector{SparseVector{Float64, Int64}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}}}:
#undef
──────
#undef
Expand Down Expand Up @@ -151,7 +151,7 @@ julia> view(A, Block(2)) .= [3,4]; A[Block(2)]
4.0
julia> view(A, Block.(1:2))
3-element view(::BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedUnitRange{ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}}}, BlockSlice(BlockRange(1:2),1:1:3)) with eltype Float64 with indices 1:1:3:
3-element view(::BlockVector{Float64, Vector{Vector{Float64}}, Tuple{BlockedOneTo{Int64, ArrayLayouts.RangeCumsum{Int64, UnitRange{Int64}}}}}, BlockSlice(BlockRange(1:2),1:1:3)) with eltype Float64 with indices BlockedOneTo([1, 3]):
1.0
3.0
4.0
Expand All @@ -167,7 +167,7 @@ An array can be repacked into a `BlockArray` with `BlockArray(array, block_sizes
julia> S = spzeros(4,5); S[1,2] = S[4,3] = 1;
julia> block_array_sparse = BlockArray(S, [1,3], [2,3])
2×2-blocked 4×5 BlockMatrix{Float64, Matrix{SparseMatrixCSC{Float64, Int64}}, Tuple{BlockedUnitRange{Vector{Int64}}, BlockedUnitRange{Vector{Int64}}}}:
2×2-blocked 4×5 BlockMatrix{Float64, Matrix{SparseMatrixCSC{Float64, Int64}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}, BlockedOneTo{Int64, Vector{Int64}}}}:
⋅ 1.0 │ ⋅ ⋅ ⋅
──────────┼───────────────
⋅ ⋅ │ ⋅ ⋅ ⋅
Expand Down
24 changes: 12 additions & 12 deletions docs/src/man/pseudoblockarrays.md → docs/src/man/blockedarrays.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# PseudoBlockArrays
# BlockedArrays

```@meta
DocTestSetup = quote
Expand All @@ -8,22 +8,22 @@ DocTestSetup = quote
end
```

A `PseudoBlockArray` is similar to a [`BlockArray`](@ref) except the full array is stored
A `BlockedArray` is similar to a [`BlockArray`](@ref) except the full array is stored
contiguously instead of block by block. This means that is not possible to insert and retrieve
blocks without copying data. On the other hand, converting a `PseudoBlockArray` to the "full" underlying array is instead instant since
blocks without copying data. On the other hand, converting a `BlockedArray` to the "full" underlying array is instead instant since
it can just return the wrapped array.

When iteratively solving a set of equations with a gradient method the Jacobian typically has a block structure. It can be convenient
to use a `PseudoBlockArray` to build up the Jacobian block by block and then pass the resulting matrix to
to use a `BlockedArray` to build up the Jacobian block by block and then pass the resulting matrix to
a direct solver using `Matrix`.

## Creating PseudoBlockArrays
## Creating BlockedArrays

Creating a `PseudoBlockArray` works in the same way as a `BlockArray`.
Creating a `BlockedArray` works in the same way as a `BlockArray`.

```jldoctest A
julia> pseudo = PseudoBlockArray(reshape([1:9;], 3, 3), [1,2], [2,1])
2×2-blocked 3×3 PseudoBlockMatrix{Int64}:
julia> pseudo = BlockedArray(reshape([1:9;], 3, 3), [1,2], [2,1])
2×2-blocked 3×3 BlockedMatrix{Int64}:
1 4 │ 7
──────┼───
2 5 │ 8
Expand All @@ -38,8 +38,8 @@ This "takes ownership" of the passed in array so no copy of the array is made.
A block array can be created with uninitialized entries using the `BlockArray{T}(undef, block_sizes...)`
function. The block_sizes are each an `AbstractVector{Int}` which determines the size of the blocks in that dimension. We here create a `[1,2]×[3,2]` block matrix of `Float32`s:
```julia
julia> PseudoBlockArray{Float32}(undef, [1,2], [3,2])
2×2-blocked 3×5 PseudoBlockMatrix{Float32}:
julia> BlockedArray{Float32}(undef, [1,2], [3,2])
2×2-blocked 3×5 BlockedMatrix{Float32}:
1.02295e-43 0.0 1.09301e-430.0 1.17709e-43
───────────────────────────────────────┼──────────────────────────
0.0 1.06499e-43 0.01.14906e-43 0.0
Expand Down Expand Up @@ -79,9 +79,9 @@ The underlying array is accessed with `Array` just like for `BlockArray`.

## Views of blocks

We can also view and modify views of blocks of `PseudoBlockArray` using the `view` syntax:
We can also view and modify views of blocks of `BlockedArray` using the `view` syntax:
```jldoctest
julia> A = PseudoBlockArray(ones(6), 1:3);
julia> A = BlockedArray(ones(6), 1:3);
julia> view(A, Block(2))
2-element view(::Vector{Float64}, 2:3) with eltype Float64:
Expand Down
30 changes: 30 additions & 0 deletions ext/BlockArraysBandedMatricesExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module BlockArraysBandedMatricesExt

using BandedMatrices, BlockArrays
using BlockArrays.ArrayLayouts
import BandedMatrices: isbanded, AbstractBandedLayout, bandeddata, bandwidths
import BlockArrays: blockcolsupport, blockrowsupport, AbstractBlockedUnitRange
import ArrayLayouts: sub_materialize


bandeddata(P::BlockedMatrix) = bandeddata(P.blocks)
bandwidths(P::BlockedMatrix) = bandwidths(P.blocks)

function blockcolsupport(::AbstractBandedLayout, B, j)
m,n = axes(B)
cs = colsupport(B,n[j])
findblock(m,first(cs)):findblock(m,last(cs))
end

function blockrowsupport(::AbstractBandedLayout, B, k)
m,n = axes(B)
rs = rowsupport(B,m[k])
findblock(n,first(rs)):findblock(n,last(rs))
end

# ambiguity
sub_materialize(::AbstractBandedLayout, V, ::Tuple{AbstractBlockedUnitRange,Base.OneTo{Int}}) = BandedMatrix(V)
sub_materialize(::AbstractBandedLayout, V, ::Tuple{Base.OneTo{Int},AbstractBlockedUnitRange}) = BandedMatrix(V)


end
11 changes: 7 additions & 4 deletions src/BlockArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ export AbstractBlockArray, AbstractBlockMatrix, AbstractBlockVector, AbstractBlo
export Block, getblock, getblock!, setblock!, eachblock, blocks
export blockaxes, blocksize, blocklength, blockcheckbounds, BlockBoundsError, BlockIndex
export blocksizes, blocklengths, blocklasts, blockfirsts, blockisequal
export BlockRange, blockedrange, BlockedUnitRange
export BlockRange, blockedrange, BlockedUnitRange, BlockedOneTo

export BlockArray, BlockMatrix, BlockVector, BlockVecOrMat, mortar
export PseudoBlockArray, PseudoBlockMatrix, PseudoBlockVector, PseudoBlockVecOrMat
export BlockedArray, BlockedMatrix, BlockedVector, BlockedVecOrMat

export undef_blocks, undef, findblock, findblockindex

Expand Down Expand Up @@ -60,7 +60,7 @@ include("blockindices.jl")
include("blockaxis.jl")
include("abstractblockarray.jl")
include("blockarray.jl")
include("pseudo_blockarray.jl")
include("blockedarray.jl")
include("views.jl")
include("blocks.jl")

Expand All @@ -72,11 +72,14 @@ include("show.jl")
include("blockreduce.jl")
include("blockdeque.jl")
include("blockarrayinterface.jl")
include("blockbanded.jl")

@deprecate getblock(A::AbstractBlockArray{T,N}, I::Vararg{Integer, N}) where {T,N} view(A, Block(I))
@deprecate getblock!(X, A::AbstractBlockArray{T,N}, I::Vararg{Integer, N}) where {T,N} copyto!(X, view(A, Block(I)))
@deprecate setblock!(A::AbstractBlockArray{T,N}, v, I::Vararg{Integer, N}) where {T,N} (A[Block(I...)] = v)


if !isdefined(Base, :get_extension)
include("../ext/BlockArraysBandedMatricesExt.jl")
end

end # module
Loading

2 comments on commit bb3bf1b

@dlfivefifty
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/107071

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.0.0 -m "<description of version>" bb3bf1bc6eee0fb69951d90b1f5c584135d6cfbc
git push origin v1.0.0

Please sign in to comment.