Skip to content

Commit b72c4b4

Browse files
update README
1 parent 1c865a2 commit b72c4b4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
RecursiveArrayTools.jl is a set of tools for dealing with recursive arrays like
99
arrays of arrays. The current functionality includes:
1010

11+
### Types
12+
13+
```julia
14+
ArrayPartition(x::AbstractArray...)
15+
```
16+
17+
An `ArrayPartition` `A` is an array which is made up of different arrays `A.x`.
18+
These index like a single array, but each subarray may have a different type.
19+
However, broadcast is overloaded to loop in an efficient manner, meaning that
20+
`A .+= 2.+B` is type-stable in its computations, even if `A.x[i]` and `A.x[j]`
21+
do not match types. A full array interface is included for completeness, which
22+
allows this array type to be used in place of a standard array in places where
23+
such a type stable broadcast may be needed. One example is in heterogeneous
24+
differential equations for [DifferentialEquations.jl](https://github.com/JuliaDiffEq/DifferentialEquations.jl).
25+
26+
### Functions
27+
1128
```julia
1229
recursivecopy!(b::Array{T,N},a::Array{T,N})
1330
```
@@ -33,3 +50,16 @@ copyat_or_push!{T}(a::AbstractVector{T},i::Int,x)
3350

3451
If `i<length(x)`, it's simply a `recursivecopy!` to the `i`th element. Otherwise it will
3552
`push!` a `deepcopy`.
53+
54+
```julia
55+
recursive_one(a)
56+
```
57+
58+
Calls `one` on the bottom container to get the "true element one type"
59+
60+
```julia
61+
mean{T<:AbstractArray}(vecvec::Vector{T})
62+
mean{T<:AbstractArray}(matarr::Matrix{T},region=0)
63+
```
64+
65+
Generalized mean functions for vectors of arrays and matrix of arrays.

0 commit comments

Comments
 (0)