Skip to content

Commit de4c8d4

Browse files
Merge remote-tracking branch 'origin/master'
2 parents bfc519e + 1343182 commit de4c8d4

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,35 @@ arrays of arrays. The current functionality includes:
1010

1111
### Types
1212

13+
#### VectorOfArray
14+
15+
```julia
16+
VectorOfArray(vec::AbstractVector)
17+
```
18+
19+
A `VectorOfArray` is an array which has the underlying data structure `Vector{AbstractArray{T}}`
20+
(but hopefully concretely typed!). This wrapper over such data structures allows one to lazily
21+
act like it's a higher dimensional vector, and easily convert to different forms. The indexing
22+
structure is:
23+
24+
```julia
25+
A[i] # Returns the ith array in the vector of arrays
26+
A[j,i] # Returns the jth component in the ith array
27+
A[j1,...,jN,i] # Returns the (j1,...,jN) component of the ith array
28+
```
29+
30+
which presents itself as a column-major matrix with the columns being the arrays from the vector.
31+
The `AbstractArray` interface is implemented, giving access to `copy`, `push`, `append!`, etc. function
32+
which act appropriate. Points to note are:
33+
34+
- The length is the number of vectors, or `length(A.u)` where `u` is the vector of arrays.
35+
- Iteration follows the linear index and goes over the vectors
36+
37+
Additionally, the `vecarr_to_arr(VA::AbstractVectorOfArray)` function is provided which transforms
38+
the `VectorOfArray` into a matrix/tensor.
39+
40+
#### ArrayPartition
41+
1342
```julia
1443
ArrayPartition(x::AbstractArray...)
1544
```

0 commit comments

Comments
 (0)