SciML / SciML/RecursiveArrayTools.jl
Wrong indexing of the last element of VectorOfArray
Open
Nobody has claimed this yet.
bug
- Dominant language
- Julia
- Stars
- 233
- Forks
- 76
- Avg merge
- 2h 17m
- Merged PRs (30d)
- 9
Description
Describe the bug 🐞
julia> a = [[1 2; 3 4], [4 5; 6 7], [7 8; 9 10]]
julia> va = VectorOfArray(a)
VectorOfArray{Int64,3}:
3-element Vector{Matrix{Int64}}:
[1 2; 3 4]
[4 5; 6 7]
[7 8; 9 10]
julia> va[end]
2×2 Matrix{Int64}:
7 8
9 10
julia> va.u[end]
2×2 Matrix{Int64}:
7 8
9 10
julia> va[:, end]
2×2 Matrix{Int64}:
4 5
6 7
Expected behavior
I thought this should be the same no matter whether we are using va[:,end] or va.u[end]?
Environment (please complete the following information):
- Output of
using Pkg; Pkg.status()
[47edcb42] ADTypes v1.7.1
[79e6a3ab] Adapt v4.0.4
[4fba245c] ArrayInterface v7.15.0
[aae01518] BandedMatrices v1.7.2
[2569d6c7] ConcreteStructs v0.2.3
[2b5f629d] DiffEqBase v6.152.2
[9d29842c] FastAlmostBandedMatrices v0.1.3
[9aa1b823] FastClosures v0.3.2
[f6369f11] ForwardDiff v0.10.36
[7ed4a6bd] LinearSolve v2.32.0
[8913a72c] NonlinearSolve v3.14.0
[1dea7af3] OrdinaryDiffEq v6.87.0
[d236fae5] PreallocationTools v0.4.23
[aea7be01] PrecompileTools v1.2.1
[21216c6a] Preferences v1.4.3
[731186ca] RecursiveArrayTools v3.27.0
[189a3867] Reexport v1.2.2
[0bca4576] SciMLBase v2.48.1
[efcf1570] Setfield v1.1.1
[47a9eef4] SparseDiffTools v2.20.0
[37e2e46d] LinearAlgebra
[56ddb016] Logging
[2f01184e] SparseArrays v1.10.0
- Output of
versioninfo()
Julia Version 1.10.4
Commit 48d4fd4843 (2024-06-04 10:41 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
JULIA_DEPOT_PATH = D:\Julia\.julia
JULIA_PKGDIR = D:\Julia\JuliaPKG
JULIA_PKG_SERVER = us-west.pkg.julialang.org
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the VectorOfArray example in Julia and compare va[end], va.u[end], and va[:, end]. Trace the indexing behavior responsible for the differing last element, then add or update coverage so the relevant indexing results agree with the intended behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100