recursivearraytools.jl-731186ca-8d62-57ce-b412-fbd966d074cd
Last mirrored from https://github.com/JuliaDiffEq/RecursiveArrayTools.jl.git on 2019-11-19T04:38:05.728-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.33 , triggered by Travis cron job on branch "master"
https://github.com/unofficialjuliamirror/recursivearraytools.jl-731186ca-8d62-57ce-b412-fbd966d074cd
Science Score: 18.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
○codemeta.json file
-
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.6%) to scientific vocabulary
Repository
Last mirrored from https://github.com/JuliaDiffEq/RecursiveArrayTools.jl.git on 2019-11-19T04:38:05.728-05:00 by @UnofficialJuliaMirrorBot via Travis job 481.33 , triggered by Travis cron job on branch "master"
Basic Info
- Host: GitHub
- Owner: UnofficialJuliaMirror
- License: other
- Language: Julia
- Default Branch: master
- Size: 144 KB
Statistics
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
RecursiveArrayTools.jl
RecursiveArrayTools.jl is a set of tools for dealing with recursive arrays like arrays of arrays. The current functionality includes:
Types
VectorOfArray
julia
VectorOfArray(u::AbstractVector)
A VectorOfArray is an array which has the underlying data structure Vector{AbstractArray{T}}
(but hopefully concretely typed!). This wrapper over such data structures allows one to lazily
act like it's a higher dimensional vector, and easily convert to different forms. The indexing
structure is:
julia
A[i] # Returns the ith array in the vector of arrays
A[j,i] # Returns the jth component in the ith array
A[j1,...,jN,i] # Returns the (j1,...,jN) component of the ith array
which presents itself as a column-major matrix with the columns being the arrays from the vector.
The AbstractArray interface is implemented, giving access to copy, push, append!, etc. function
which act appropriate. Points to note are:
- The length is the number of vectors, or
length(A.u)whereuis the vector of arrays. - Iteration follows the linear index and goes over the vectors
Additionally, the convert(Array,VA::AbstractVectorOfArray) function is provided which transforms
the VectorOfArray into a matrix/tensor. Also, vecarr_to_vectors(VA::AbstractVectorOfArray)
returns a vector of the series for each component, that is A[i,:] for each i.
A plot recipe is provided which plots the A[i,:] series.
DiffEqArray
Related to the VectorOfArray is the DiffEqArray
julia
DiffEqArray(u::AbstractVector,t::AbstractVector)
This is a VectorOfArray which stores A.t which matches A.u. This will plot
(A.t[i],A[i,:]). The function tuples(diffeq_arr) returns tuples of (t,u).
ArrayPartition
julia
ArrayPartition(x::AbstractArray...)
An ArrayPartition A is an array which is made up of different arrays A.x.
These index like a single array, but each subarray may have a different type.
However, broadcast is overloaded to loop in an efficient manner, meaning that
A .+= 2.+B is type-stable in its computations, even if A.x[i] and A.x[j]
do not match types. A full array interface is included for completeness, which
allows this array type to be used in place of a standard array in places where
such a type stable broadcast may be needed. One example is in heterogeneous
differential equations for DifferentialEquations.jl.
An ArrayPartition acts like a single array. A[i] indexes through the first
array, then the second, etc. all linearly. But A.x is where the arrays are stored.
Thus for
julia
using RecursiveArrayTools
A = ArrayPartition(y,z)
We would have A.x[1]==y and A.x[2]==z. Broadcasting like f.(A) is efficient.
Functions
julia
recursivecopy!(b::Array{T,N},a::Array{T,N})
A recursive copy! function. Acts like a deepcopy! on arrays of arrays, but
like copy! on arrays of scalars.
julia
convert(Array,vecvec)
Technically just a Base fallback that works well. Takes in a vector of arrays,
returns an array of dimension one greater than the original elements.
Works on AbstractVectorOfArray. If the vecvec is ragged, i.e. not all of the
elements are the same, then it uses the size of the first element to determine
the conversion.
julia
vecvecapply(f::Base.Callable,v)
Calls f on each element of a vecvec v.
julia
copyat_or_push!{T}(a::AbstractVector{T},i::Int,x)
If i<length(x), it's simply a recursivecopy! to the ith element. Otherwise it will
push! a deepcopy.
julia
recursive_one(a)
Calls one on the bottom container to get the "true element one type"
julia
mean{T<:AbstractArray}(vecvec::Vector{T})
mean{T<:AbstractArray}(matarr::Matrix{T},region=0)
Generalized mean functions for vectors of arrays and matrix of arrays.
Owner
- Name: Unofficial Julia Mirror
- Login: UnofficialJuliaMirror
- Kind: organization
- Website: https://github.com/UnofficialJuliaMirror/MirrorUpdater.jl
- Repositories: 3
- Profile: https://github.com/UnofficialJuliaMirror
Mirror of all registered Julia packages. Updated weekly by @UnofficialJuliaMirrorBot. See also: @UnofficialJuliaMirrorSnapshots.
Citation (CITATION.bib)
@article{DifferentialEquations.jl-2017,
author = {Rackauckas, Christopher and Nie, Qing},
doi = {10.5334/jors.151},
journal = {The Journal of Open Source Software},
keywords = {Applied Mathematics},
note = {Exported from https://app.dimensions.ai on 2019/05/05},
number = {1},
pages = {},
title = {DifferentialEquations.jl – A Performant and Feature-Rich Ecosystem for Solving Differential Equations in Julia},
url = {https://app.dimensions.ai/details/publication/pub.1085583166 and http://openresearchsoftware.metajnl.com/articles/10.5334/jors.151/galley/245/download/},
volume = {5},
year = {2017}
}