Skip to content

Commit bb3bf1b

Browse files
dlfivefiftyjishnubdependabot[bot]mtfishman
authored
v1.0 (#255)
* 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> 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] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jishnu Bhattacharya <[email protected]> * 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] <[email protected]> Co-authored-by: Jishnu Bhattacharya <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Matt Fishman <[email protected]>
1 parent 0ccad75 commit bb3bf1b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1740
-920
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
version: '1.10'
3232
- uses: julia-actions/cache@v2
3333
- name: Install dependencies
34-
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
34+
run: julia --project=docs/ -e 'using Pkg; Pkg.update(); Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
3535
- name: Build and deploy
3636
env:
3737
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # If authenticating with GitHub Actions token

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ src/.DS_Store
99
Manifest.toml
1010
Manifest-v*.*.toml
1111
.DS_Store
12+
.*.swp
1213
build

Project.toml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
name = "BlockArrays"
22
uuid = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
3-
version = "0.16.44-dev"
3+
version = "1.0.0"
44

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

11+
[weakdeps]
12+
BandedMatrices = "aae01518-5342-5314-be14-df237901396f"
13+
14+
[extensions]
15+
BlockArraysBandedMatricesExt = "BandedMatrices"
16+
1017
[compat]
1118
Aqua = "0.8"
1219
ArrayLayouts = "1.0.8"
13-
Documenter = "1"
14-
FillArrays = "1"
20+
BandedMatrices = "1.0"
21+
Documenter = "1.0"
22+
FillArrays = "1.11"
1523
LinearAlgebra = "1.6"
16-
OffsetArrays = "1"
24+
OffsetArrays = "1.0"
1725
Random = "1.6"
1826
SparseArrays = "1.6"
1927
StaticArrays = "1.6"
@@ -22,6 +30,7 @@ julia = "1.6"
2230

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

3241
[targets]
33-
test = ["Aqua", "Documenter", "OffsetArrays", "SparseArrays", "StaticArrays", "Test", "Random"]
42+
test = ["Aqua", "BandedMatrices", "Documenter", "OffsetArrays", "SparseArrays", "StaticArrays", "Test", "Random"]

README.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010

1111
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.
1212

13-
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.
13+
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.
1414

1515
A simple way to produce `BlockArray`s is via `mortar`, which combines an array of arrays into a `BlockArray`:
1616
```julia
17+
julia> using BlockArrays
18+
1719
julia> mortar([randn(3), randn(4)])
1820
2-blocked 7-element BlockVector{Float64}:
1921
-0.19808699390960527
@@ -33,11 +35,43 @@ julia> mortar(reshape([randn(2,2), randn(1,2), randn(2,3), randn(1,3)],2,2))
3335
0.430093 -0.0263753-1.31275 0.278447 -0.139579
3436
```
3537

38+
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:
39+
```julia
40+
julia> BlockedArray(randn(7), [3,4])
41+
2-blocked 7-element BlockedVector{Float64}:
42+
-0.17348560551451797
43+
-0.5680124317024628
44+
1.699007590285868
45+
─────────────────────
46+
-0.7437814954416642
47+
-0.018198226033108045
48+
1.3335354818213445
49+
-0.03512135185007728
50+
51+
julia> BlockedArray(randn(3,5), [2,1], [2,3])
52+
2×2-blocked 3×5 BlockedMatrix{Float64}:
53+
0.444186 0.7888230.743428 -0.815026 0.715779
54+
-0.721074 -0.437831.07413 -0.336926 0.539873
55+
──────────────────────┼─────────────────────────────────
56+
0.128836 -0.350202-2.71365 1.67605 -0.25611
57+
```
58+
59+
3660
## Documentation
3761

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

65+
## Changes in v1.0
66+
67+
We are excited to release v1.0! There are some important breaking changes from previous versions of BlockArrays.jl:
68+
69+
- `BlockedArray` replaces `PseudoBlockArray`.
70+
- Axes are now typically `BlockedOneTo` instead of `BlockUnitRange`.
71+
- Support for some simple block-banded matrices has been moved here from BlockBandedMatrices.jl.
72+
- 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`.
73+
- `BlockedUnitRange` is now parametrized by the element type instead of hardcoded to `Int`.
74+
4175
## Contributing
4276

4377
Possible ways of contributing to this package include:

benchmark/runbenchmarks.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ g = addgroup!(SUITE, "indexing")
1212
g_size = addgroup!(SUITE, "size")
1313

1414
for n = (5,)
15-
for BT in (BlockArray, PseudoBlockArray)
15+
for BT in (BlockArray, BlockedArray)
1616
block_vec = BT(rand(n), [1,3,1])
1717
block_mat = BT(rand(n,n), [1,3,1], [4,1])
1818
block_arr = BT(rand(n,n,n), [1,3,1], [4,1], [3, 2])

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ makedocs(
1313
"Manual" => [
1414
"man/abstractblockarrayinterface.md",
1515
"man/blockarrays.md",
16-
"man/pseudoblockarrays.md",
16+
"man/blockedarrays.md",
1717
],
1818
"API" => [
1919
"lib/public.md",

docs/src/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
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.
88

9-
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.
9+
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.
1010

1111

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

4141
```@contents
42-
Pages = ["man/abstractblockarrayinterface.md", "man/blockarrays.md", "man/pseudoblockarrays.md"]
42+
Pages = ["man/abstractblockarrayinterface.md", "man/blockarrays.md", "man/blockedarrays.md"]
4343
Depth = 2
4444
```
4545

docs/src/lib/internals.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ Pages = ["internals.md"]
2121
```@docs
2222
blockcolsupport
2323
blockrowsupport
24+
blockedrange
25+
BlockedOneTo
2426
BlockedUnitRange
2527
BlockRange
2628
BlockIndexRange

docs/src/lib/public.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ Base.popfirst!
6565
```
6666

6767

68-
## PseudoBlockArray
68+
## BlockedArray
6969

7070
```@docs
71-
PseudoBlockArray
72-
PseudoBlockVector
73-
PseudoBlockMatrix
71+
BlockedArray
72+
BlockedVector
73+
BlockedMatrix
7474
Base.resize!
7575
```
7676

docs/src/man/abstractblockarrayinterface.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# The block axis interface
22

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

88

0 commit comments

Comments
 (0)