Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: BlockVector * Adjoint{BlockVector} crashes #450

Open
ogauthe opened this issue Feb 26, 2025 · 0 comments
Open

BUG: BlockVector * Adjoint{BlockVector} crashes #450

ogauthe opened this issue Feb 26, 2025 · 0 comments

Comments

@ogauthe
Copy link
Contributor

ogauthe commented Feb 26, 2025

using BlockArrays: BlockArray, blockedrange
d = blockedrange([2,3])
v = ones(d)
v2 = BlockArray(v)
v3 = Array(v)

v * v' isa BlockedArray  # true
v3 * v3' isa Array  # true
v2 * v2' isa Any  # BoundsError
ERROR: BoundsError: attempt to access 2-blocked 5-element BlockVector{Float64} at index [BlockSlice(Block(1)[1:2],1:2), BlockSlice(Block(1)[1:2],Base.OneTo(2))]
Stacktrace:
  [1] throw_boundserror(A::BlockVector{Float64, Vector{…}, Tuple{…}}, I::Tuple{BlockArrays.BlockSlice{…}, BlockArrays.BlockSlice{…}})
    @ Base ./essentials.jl:14
  [2] checkbounds
    @ ./abstractarray.jl:699 [inlined]
  [3] view
    @ ./subarray.jl:214 [inlined]
  [4] _bview
    @ ~/.julia/packages/BlockArrays/tOOU0/src/blockbroadcast.jl:124 [inlined]
  [5] (::BlockArrays.var"#56#61"{Base.Broadcast.Broadcasted{}, Tuple{}})(i::Int64)
    @ BlockArrays ~/.julia/packages/BlockArrays/tOOU0/src/blockbroadcast.jl:156
  [6] ntuple
    @ ./ntuple.jl:19 [inlined]
  [7] _generic_blockbroadcast_copyto!(dest::BlockMatrix{…}, bc::Base.Broadcast.Broadcasted{…})
    @ BlockArrays ~/.julia/packages/BlockArrays/tOOU0/src/blockbroadcast.jl:156
  [8] copyto!(dest::BlockMatrix{…}, bc::Base.Broadcast.Broadcasted{…})
    @ BlockArrays ~/.julia/packages/BlockArrays/tOOU0/src/blockbroadcast.jl:163
  [9] copy
    @ ./broadcast.jl:897 [inlined]
 [10] materialize
    @ ./broadcast.jl:872 [inlined]
 [11] broadcast(::typeof(*), ::BlockVector{Float64, Vector{…}, Tuple{…}}, ::LinearAlgebra.Adjoint{Float64, BlockVector{…}})
    @ Base.Broadcast ./broadcast.jl:810
 [12] *(u::BlockVector{Float64, Vector{…}, Tuple{…}}, v::LinearAlgebra.Adjoint{Float64, BlockVector{…}})
    @ LinearAlgebra ~/.julia/juliaup/julia-1.11.3+0.x64.linux.gnu/share/julia/stdlib/v1.11/LinearAlgebra/src/adjtrans.jl:484
 [13] top-level scope
    @ REPL[55]:1
Some type information was truncated. Use `show(err)` to see complete types.

BlockArrays v1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant