@@ -203,7 +203,6 @@ function Base.Array{U}(VA::AbstractVectorOfArray{T, N}) where {U, T, N}
203203 end
204204end
205205
206- # AbstractVectorOfArray is already an AbstractArray, so convert is identity
207206
208207function Adapt. adapt_structure (to, VA:: AbstractVectorOfArray )
209208 return VectorOfArray (Adapt. adapt .((to,), VA. u))
506505
507506Base. IndexStyle (:: Type{<:AbstractVectorOfArray} ) = IndexCartesian ()
508507
509- # # lastindex inherited from AbstractArray (uses size)
510508
511509# # Linear indexing: convert to Cartesian and dispatch to the N-ary getindex
512510Base. @propagate_inbounds function Base. getindex (A:: AbstractVectorOfArray{T, N} , i:: Int ) where {T, N}
@@ -527,7 +525,6 @@ Base.@propagate_inbounds function Base.setindex!(A::AbstractVectorOfArray{T, N},
527525 return @inbounds A[ci] = v
528526end
529527
530- # # RaggedEnd/RaggedRange types removed — lastindex now returns plain Ints from AbstractArray
531528
532529Base. @propagate_inbounds function _getindex (
533530 A:: AbstractVectorOfArray{T, N} , :: NotSymbolic , :: Colon , I:: Int
@@ -690,7 +687,6 @@ Base.@propagate_inbounds function _getindex(
690687 return getindex (A, all_variable_symbols (A), args... )
691688end
692689
693- # # RaggedEnd/RaggedRange resolution machinery removed — lastindex returns plain Ints now
694690
695691# CartesianIndex with more dimensions than ndims(A) — for heterogeneous inner arrays
696692# where (inner_indices..., column_index) may have more entries than ndims(A)
@@ -756,7 +752,6 @@ Base.@propagate_inbounds function Base.getindex(A::AbstractVectorOfArray, _arg,
756752 end
757753end
758754
759- # # Adjoint getindex inherited from AbstractArray (Adjoint <: AbstractMatrix)
760755
761756function _observed (A:: AbstractDiffEqArray{T, N} , sym, i:: Int ) where {T, N}
762757 return observed (A, sym)(A. u[i], A. p, A. t[i])
@@ -775,7 +770,6 @@ Base.@propagate_inbounds function Base.setindex!(
775770 return VA. u[I] = v
776771end
777772
778- # # Single-Int setindex! is now handled by the N-ary method via AbstractArray linear indexing
779773
780774Base. @propagate_inbounds function Base. setindex! (
781775 VA:: AbstractVectorOfArray{T, N} , v,
@@ -784,7 +778,6 @@ Base.@propagate_inbounds function Base.setindex!(
784778 return VA. u[I] = v
785779end
786780
787- # # Colon setindex! for single arg removed - use VA[:, :] = v or VA.u[:] = v
788781
789782Base. @propagate_inbounds function Base. setindex! (
790783 VA:: AbstractVectorOfArray{T, N} , v,
@@ -793,7 +786,6 @@ Base.@propagate_inbounds function Base.setindex!(
793786 return VA. u[I] = v
794787end
795788
796- # # AbstractArray{Int} setindex! for single arg removed - use VA[:, I] = v or VA.u[I] = v
797789
798790Base. @propagate_inbounds function Base. setindex! (
799791 VA:: AbstractVectorOfArray{T, N} , v, i:: Int ,
@@ -804,7 +796,6 @@ Base.@propagate_inbounds function Base.setindex!(
804796 end
805797 return v
806798end
807- # # CartesianIndex setindex! handled by AbstractArray flattening to Int... method
808799
809800Base. @propagate_inbounds function Base. setindex! (
810801 VA:: AbstractVectorOfArray{T, N} ,
832823 end
833824 return (leading... , length (VA. u))
834825end
835- # # Adjoint size inherited from LinearAlgebra (Adjoint <: AbstractMatrix)
836826
837827Base. @propagate_inbounds function Base. setindex! (
838828 VA:: AbstractVectorOfArray{T, N} , v,
@@ -877,7 +867,6 @@ function Base.:(==)(A::AbstractVectorOfArray, B::AbstractVectorOfArray)
877867end
878868# Comparison with plain arrays uses AbstractArray element-wise comparison via default
879869
880- # Iteration is inherited from AbstractArray (iterates over elements in linear order)
881870tuples (VA:: DiffEqArray ) = tuple .(VA. t, VA. u)
882871
883872# Growing the array simply adds to the container vector
@@ -978,10 +967,7 @@ function Base.view(A::AbstractVectorOfArray, I::Vararg{Any, M}) where {M}
978967 @boundscheck checkbounds (A, J... )
979968 return SubArray (A, J)
980969end
981- # # SubArray constructor inherited from AbstractArray
982- # # isassigned, ndims, eltype, check_parent_index_match inherited from AbstractArray
983970
984- # # checkbounds inherited from AbstractArray (uses axes derived from size)
985971function Base. copyto! (
986972 dest:: AbstractVectorOfArray{T, N} ,
987973 src:: AbstractVectorOfArray{T2, N}
@@ -1014,16 +1000,8 @@ function Base.copyto!(
10141000 copyto! (dest. u, src)
10151001 return dest
10161002end
1017- # # maybeview inherited from AbstractArray
1018-
1019- # # isapprox inherited from AbstractArray
1020-
1021- # # Arithmetic (+, -, *, /) inherited from AbstractArray / broadcasting
1022-
1023- # # CartesianIndices inherited from AbstractArray (uses axes/size)
10241003
10251004# Tools for creating similar objects
1026- # eltype is inherited from AbstractArray{T, N}
10271005
10281006# similar(VA) - same type and size
10291007function Base. similar (
@@ -1065,7 +1043,6 @@ end
10651043 return similar (Array{T}, dims)
10661044end
10671045
1068- # # similar(VA, dims) inherited from AbstractArray (returns Array)
10691046
10701047# fill!
10711048# For DiffEqArray it ignores ts and fills only u
@@ -1084,20 +1061,8 @@ function Base.fill!(VA::AbstractVectorOfArray, x)
10841061 end
10851062 return VA
10861063end
1087-
1088- # # reshape inherited from AbstractArray
1089-
1090- # any/all inherited from AbstractArray (iterates over all elements including ragged zeros)
1091-
10921064# conversion tools
10931065vecarr_to_vectors (VA:: AbstractVectorOfArray ) = [VA[i, :] for i in eachindex (VA. u[1 ])]
1094- # # vec inherited from AbstractArray
1095- # # convert(Array, VA) inherited from AbstractArray (calls Array(VA))
1096-
1097- # sum, prod inherited from AbstractArray
1098-
1099- # # adjoint inherited from AbstractArray
1100-
11011066# linear algebra
11021067ArrayInterface. issingular (va:: AbstractVectorOfArray ) = ArrayInterface. issingular (Matrix (va))
11031068
@@ -1127,12 +1092,6 @@ end
11271092@recipe function f (VA:: DiffEqArray{T, 1} ) where {T}
11281093 VA. t, VA. u
11291094end
1130-
1131- # map is inherited from AbstractArray (maps over elements)
1132- # To map over inner arrays, use `map(f, A.u)`
1133-
1134- # # mapreduce inherited from AbstractArray
1135-
11361095# # broadcasting
11371096
11381097struct VectorOfArrayStyle{N} <: Broadcast.AbstractArrayStyle{N} end # N is only used when voa sees other abstract arrays
@@ -1162,7 +1121,6 @@ end
11621121function Broadcast. BroadcastStyle (:: Type{<:AbstractVectorOfArray{T, N}} ) where {T, N}
11631122 return VectorOfArrayStyle {N} ()
11641123end
1165- # # broadcastable inherited from AbstractArray
11661124
11671125# recurse through broadcast arguments and return a parent array for
11681126# the first VoA or DiffEqArray in the bc arguments
@@ -1306,5 +1264,3 @@ nested = VA[
13061264
13071265"""
13081266struct VA end
1309- # VA[...] shorthand moved to RecursiveArrayTools.ShorthandConstructors to avoid invalidations.
1310- # `using RecursiveArrayTools.ShorthandConstructors` to enable.
0 commit comments