@@ -16,7 +16,6 @@ DiffEqArray(vec::AbstractVector{T}, ts, dims::NTuple{N}) where {T, N} = DiffEqAr
1616# Assume that the first element is representative all all other elements
1717DiffEqArray (vec:: AbstractVector ,ts:: AbstractVector ) = DiffEqArray (vec, ts, (size (vec[1 ])... , length (vec)))
1818
19-
2019# Interface for the linear indexing. This is just a view of the underlying nested structure
2120@inline Base. firstindex (VA:: AbstractVectorOfArray ) = firstindex (VA. u)
2221@inline Base. lastindex (VA:: AbstractVectorOfArray ) = lastindex (VA. u)
@@ -95,12 +94,17 @@ vecarr_to_vectors(VA::AbstractVectorOfArray) = [VA[i,:] for i in eachindex(VA[1]
9594Base. vec (VA:: AbstractVectorOfArray ) = vec (convert (Array,VA)) # Allocates
9695
9796# statistics
98- Statistics. mean (VA:: AbstractVectorOfArray ;kwargs... ) = mean (Array (VA);kwargs... )
99- Statistics. median (VA:: AbstractVectorOfArray ;kwargs... ) = median (Array (VA);kwargs... )
100- Statistics. std (VA:: AbstractVectorOfArray ;kwargs... ) = std (Array (VA);kwargs... )
101- Statistics. var (VA:: AbstractVectorOfArray ;kwargs... ) = var (Array (VA);kwargs... )
102- Statistics. cov (VA:: AbstractVectorOfArray ;kwargs... ) = cov (Array (VA);kwargs... )
103- Statistics. cor (VA:: AbstractVectorOfArray ;kwargs... ) = cor (Array (VA);kwargs... )
97+ @inline Base. sum (f, VA:: AbstractVectorOfArray ) = sum (f,Array (VA))
98+ @inline Base. sum (VA:: AbstractVectorOfArray ;kwargs... ) = sum (Array (VA);kwargs... )
99+ @inline Base. prod (f, VA:: AbstractVectorOfArray ) = prod (f,Array (VA))
100+ @inline Base. prod (VA:: AbstractVectorOfArray ;kwargs... ) = prod (Array (VA);kwargs... )
101+
102+ @inline Statistics. mean (VA:: AbstractVectorOfArray ;kwargs... ) = mean (Array (VA);kwargs... )
103+ @inline Statistics. median (VA:: AbstractVectorOfArray ;kwargs... ) = median (Array (VA);kwargs... )
104+ @inline Statistics. std (VA:: AbstractVectorOfArray ;kwargs... ) = std (Array (VA);kwargs... )
105+ @inline Statistics. var (VA:: AbstractVectorOfArray ;kwargs... ) = var (Array (VA);kwargs... )
106+ @inline Statistics. cov (VA:: AbstractVectorOfArray ;kwargs... ) = cov (Array (VA);kwargs... )
107+ @inline Statistics. cor (VA:: AbstractVectorOfArray ;kwargs... ) = cor (Array (VA);kwargs... )
104108
105109# make it show just like its data
106110Base. show (io:: IO , x:: AbstractVectorOfArray ) = show (io, x. u)
0 commit comments