Skip to content

Commit 819c375

Browse files
committed
Add element_ptr(A::VectorOfArrays)
1 parent d819cbc commit 819c375

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/vector_of_arrays.jl

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,28 @@ Base.convert(VA::Type{VectorOfArrays{T,N}}, A::AbstractVector{AbstractArray{U,N}
9191
Base.convert(VA::Type{VectorOfArrays}, A::AbstractVector{AbstractArray{T,N}}) where {T,N} = VA(A)
9292

9393

94+
"""
95+
internal_element_ptr(A::VectorOfArrays)
96+
97+
Returns the internal element pointer vector of `A`.
98+
99+
Do *not* change modify the returned vector in any way, as this would break the
100+
inner consistency of `A`.
101+
102+
Use with care, see [`element_ptr`](@ref) for a safe version of this function.
103+
"""
104+
internal_element_ptr(A::VectorOfArrays) = A.elem_ptr
105+
106+
107+
"""
108+
element_ptr(A::VectorOfArrays)
109+
110+
Returns a copy of the internal element pointer vector of `A`.
111+
"""
112+
element_ptr(A::VectorOfArrays) = deepcopy(internal_element_ptr(A))
113+
114+
115+
94116
function full_consistency_checks(A::VectorOfArrays)
95117
simple_consistency_checks(A)
96118
all(eachindex(A.kernel_size)) do i

0 commit comments

Comments
 (0)