Skip to content

Commit b4dfd02

Browse files
Merge pull request #117 from mkg33/master
Documentation changes
2 parents fc7f71b + a1285ef commit b4dfd02

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ VectorOfArray(u::AbstractVector)
1717
```
1818

1919
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
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
2222
structure is:
2323

2424
```julia
@@ -28,16 +28,16 @@ A[j1,...,jN,i] # Returns the (j1,...,jN) component of the ith array
2828
```
2929

3030
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:
31+
The `AbstractArray` interface is implemented, giving access to `copy`, `push`, `append!`, etc. functions,
32+
which act appropriately. Points to note are:
3333

3434
- The length is the number of vectors, or `length(A.u)` where `u` is the vector of arrays.
3535
- Iteration follows the linear index and goes over the vectors
3636

37-
Additionally, the `convert(Array,VA::AbstractVectorOfArray)` function is provided which transforms
37+
Additionally, the `convert(Array,VA::AbstractVectorOfArray)` function is provided, which transforms
3838
the `VectorOfArray` into a matrix/tensor. Also, `vecarr_to_vectors(VA::AbstractVectorOfArray)`
39-
returns a vector of the series for each component, that is `A[i,:]` for each `i`.
40-
A plot recipe is provided which plots the `A[i,:]` series.
39+
returns a vector of the series for each component, that is, `A[i,:]` for each `i`.
40+
A plot recipe is provided, which plots the `A[i,:]` series.
4141

4242
#### DiffEqArray
4343

@@ -47,7 +47,7 @@ Related to the `VectorOfArray` is the `DiffEqArray`
4747
DiffEqArray(u::AbstractVector,t::AbstractVector)
4848
```
4949

50-
This is a `VectorOfArray` which stores `A.t` which matches `A.u`. This will plot
50+
This is a `VectorOfArray`, which stores `A.t` that matches `A.u`. This will plot
5151
`(A.t[i],A[i,:])`. The function `tuples(diffeq_arr)` returns tuples of `(t,u)`.
5252

5353
To construct a DiffEqArray
@@ -67,25 +67,25 @@ A.t
6767
ArrayPartition(x::AbstractArray...)
6868
```
6969

70-
An `ArrayPartition` `A` is an array which is made up of different arrays `A.x`.
70+
An `ArrayPartition` `A` is an array, which is made up of different arrays `A.x`.
7171
These index like a single array, but each subarray may have a different type.
7272
However, broadcast is overloaded to loop in an efficient manner, meaning that
7373
`A .+= 2.+B` is type-stable in its computations, even if `A.x[i]` and `A.x[j]`
7474
do not match types. A full array interface is included for completeness, which
75-
allows this array type to be used in place of a standard array in places where
75+
allows this array type to be used in place of a standard array where
7676
such a type stable broadcast may be needed. One example is in heterogeneous
7777
differential equations for [DifferentialEquations.jl](https://github.com/JuliaDiffEq/DifferentialEquations.jl).
7878

7979
An `ArrayPartition` acts like a single array. `A[i]` indexes through the first
80-
array, then the second, etc. all linearly. But `A.x` is where the arrays are stored.
81-
Thus for
80+
array, then the second, etc., all linearly. But `A.x` is where the arrays are stored.
81+
Thus, for:
8282

8383
```julia
8484
using RecursiveArrayTools
8585
A = ArrayPartition(y,z)
8686
```
8787

88-
We would have `A.x[1]==y` and `A.x[2]==z`. Broadcasting like `f.(A)` is efficient.
88+
we would have `A.x[1]==y` and `A.x[2]==z`. Broadcasting like `f.(A)` is efficient.
8989

9090
### Functions
9191

@@ -100,9 +100,9 @@ like `copy!` on arrays of scalars.
100100
convert(Array,vecvec)
101101
```
102102

103-
Technically just a Base fallback that works well. Takes in a vector of arrays,
103+
Technically, just a Base fallback that works well. Takes in a vector of arrays,
104104
returns an array of dimension one greater than the original elements.
105-
Works on `AbstractVectorOfArray`. If the `vecvec` is ragged, i.e. not all of the
105+
Works on `AbstractVectorOfArray`. If the `vecvec` is ragged, i.e., not all of the
106106
elements are the same, then it uses the size of the first element to determine
107107
the conversion.
108108

@@ -116,18 +116,18 @@ Calls `f` on each element of a vecvec `v`.
116116
copyat_or_push!{T}(a::AbstractVector{T},i::Int,x)
117117
```
118118

119-
If `i<length(x)`, it's simply a `recursivecopy!` to the `i`th element. Otherwise it will
119+
If `i<length(x)`, it's simply a `recursivecopy!` to the `i`th element. Otherwise, it will
120120
`push!` a `deepcopy`.
121121

122122
```julia
123123
recursive_one(a)
124124
```
125125

126-
Calls `one` on the bottom container to get the "true element one type"
126+
Calls `one` on the bottom container to get the "true element one type".
127127

128128
```julia
129129
mean{T<:AbstractArray}(vecvec::Vector{T})
130130
mean{T<:AbstractArray}(matarr::Matrix{T},region=0)
131131
```
132132

133-
Generalized mean functions for vectors of arrays and matrix of arrays.
133+
Generalized mean functions for vectors of arrays and a matrix of arrays.

src/array_partition.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ end
155155
"""
156156
getindex(A::ArrayPartition, i::Int, j...)
157157
158-
Return the entry at index `j...` of the `i`th partition of `A`.
158+
Returns the entry at index `j...` of the `i`th partition of `A`.
159159
"""
160160
Base.@propagate_inbounds function Base.getindex(A::ArrayPartition, i::Int, j...)
161161
@boundscheck 0 < i <= length(A.x) || throw(BoundsError(A.x, i))
@@ -167,7 +167,7 @@ end
167167
"""
168168
getindex(A::ArrayPartition, ::Colon)
169169
170-
Return vector with all elements of array partition `A`.
170+
Returns a vector with all elements of array partition `A`.
171171
"""
172172
Base.getindex(A::ArrayPartition{T,S}, ::Colon) where {T,S} = T[a for a in Chain(A.x)]
173173

src/vector_of_array.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Base.@propagate_inbounds function Base.setindex!(VA::AbstractVectorOfArray{T,N},
6161
return VA.u[i][jj] = x
6262
end
6363

64-
# Interface for the two dimensional indexing, a more standard AbstractArray interface
64+
# Interface for the two-dimensional indexing, a more standard AbstractArray interface
6565
@inline Base.size(VA::AbstractVectorOfArray) = (size(VA.u[1])..., length(VA.u))
6666
Base.@propagate_inbounds Base.getindex(VA::AbstractVectorOfArray{T, N}, I::Int...) where {T, N} = VA.u[I[end]][Base.front(I)...]
6767
Base.@propagate_inbounds Base.getindex(VA::AbstractVectorOfArray{T, N}, ::Colon, I::Int) where {T, N} = VA.u[I]
@@ -191,7 +191,7 @@ end
191191
"""
192192
narrays(A...)
193193
194-
Retrieve number of arrays in the AbstractVectorOfArrays of a broadcast
194+
Retrieve number of arrays in the AbstractVectorOfArrays of a broadcast.
195195
"""
196196
narrays(A) = 0
197197
narrays(A::AbstractVectorOfArray) = length(A)

0 commit comments

Comments
 (0)