You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia>using BlockArrays
julia> a =mortar([Block(1)[1:2], Block(2)[1:2]])
2-blocked 4-element BlockVector{BlockIndex{1}, Vector{BlockArrays.BlockIndexRange{1, Tuple{UnitRange{Int64}}}}, Tuple{BlockedOneTo{Int64, Vector{Int64}}}}:Block(1)[1]
Block(1)[2]
───────────
Block(2)[1]
Block(2)[2]
julia> a[Block(1)]
2-element Vector{BlockIndex{1}}:Block(1)[1]
Block(1)[2]
julia>typeof(a[Block(1)])
Vector{BlockIndex{1}} (alias for Array{BlockIndex{1}, 1})
julia>blocks(a)[1]
Block(1)[1:2]
julia>typeof(blocks(a)[1])
BlockArrays.BlockIndexRange{1, Tuple{UnitRange{Int64}}}
julia>import Pkg; Pkg.status("BlockArrays")
Status `.../Project.toml`
[8e7c35d0] BlockArrays v1.0.1
julia>versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-0410:41 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU:10× Apple M1 Max
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads:1 default, 0 interactive, 1 GC (on 8 virtual cores)
Ideally a[Block(1)] would act like blocks(a)[1] and preserve the type of the block as it was input, i.e. have the type BlockIndexRange{1}.
The text was updated successfully, but these errors were encountered:
mtfishman
changed the title
a[Block(i...)] sometimes outputs a different type from block(a)[i...]block(a)[i...] sometimes preserves block types better than a[Block(i...)]Jun 10, 2024
mtfishman
changed the title
block(a)[i...] sometimes preserves block types better than a[Block(i...)]mortar([Block(1)[1:2], Block(2)[1:2]])[Block(1) has type Vector{BlockIndex{1}} instead of BlockIndexRange{1}Jun 10, 2024
mtfishman
changed the title
mortar([Block(1)[1:2], Block(2)[1:2]])[Block(1) has type Vector{BlockIndex{1}} instead of BlockIndexRange{1}mortar([Block(1)[1:2], Block(2)[1:2]])[Block(1)] has type Vector{BlockIndex{1}} instead of BlockIndexRange{1}Jun 17, 2024
For example:
Ideally
a[Block(1)]
would act likeblocks(a)[1]
and preserve the type of the block as it was input, i.e. have the typeBlockIndexRange{1}
.The text was updated successfully, but these errors were encountered: