Skip to content

Commit 63adb2a

Browse files
Add reshape
1 parent 4b439c9 commit 63adb2a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/vector_of_array.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ function Base.fill!(VA::AbstractVectorOfArray, x)
7676
return VA
7777
end
7878

79+
function Base._reshape(parent::VectorOfArray, dims::Base.Dims)
80+
n = prod(size(parent))
81+
prod(dims) == n || _throw_dmrs(n, "size", dims)
82+
Base.__reshape((parent, IndexStyle(parent)), dims)
83+
end
84+
7985
# Need this for ODE_DEFAULT_UNSTABLE_CHECK from DiffEqBase to work properly
8086
@inline Base.any(f, VA::AbstractVectorOfArray) = any(any(f,VA[i]) for i in eachindex(VA))
8187
@inline Base.all(f, VA::AbstractVectorOfArray) = all(all(f,VA[i]) for i in eachindex(VA))

0 commit comments

Comments
 (0)