From e21f54b4dbf54924915211ca1419052197a5feb0 Mon Sep 17 00:00:00 2001 From: "Documenter.jl" Date: Fri, 22 Dec 2023 06:58:05 +0000 Subject: [PATCH] build based on 9b152ff --- dev/.documenter-siteinfo.json | 2 +- dev/array_types/index.html | 6 +++--- dev/assets/Manifest.toml | 2 +- dev/index.html | 6 +++--- dev/recursive_array_functions/index.html | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dev/.documenter-siteinfo.json b/dev/.documenter-siteinfo.json index 92cf1d03..60d8deaa 100644 --- a/dev/.documenter-siteinfo.json +++ b/dev/.documenter-siteinfo.json @@ -1 +1 @@ -{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-22T06:57:37","documenter_version":"1.2.1"}} \ No newline at end of file +{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-22T06:58:00","documenter_version":"1.2.1"}} \ No newline at end of file diff --git a/dev/array_types/index.html b/dev/array_types/index.html index e299c316..17eac1f6 100644 --- a/dev/array_types/index.html +++ b/dev/array_types/index.html @@ -1,11 +1,11 @@ Recursive Array Types · RecursiveArrayTools.jl

Recursive Array Types

The Recursive Array types are types which implement an AbstractArray interface so that recursive arrays can be handled with standard array functionality. For example, wrapped arrays will automatically do things like recurse broadcast, define optimized mapping and iteration functions, and more.

Abstract Types

Concrete Types

RecursiveArrayTools.VectorOfArrayType
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 it to different forms. The indexing structure is:

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. functions, which act appropriately. Points to note are:

  • The length is the number of vectors, or length(A.u) where u is 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.

source
RecursiveArrayTools.DiffEqArrayType
DiffEqArray(u::AbstractVector, t::AbstractVector)

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

To construct a DiffEqArray

t = 0.0:0.1:10.0
+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. functions, which act appropriately. Points to note are:

  • The length is the number of vectors, or length(A.u) where u is 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.

source
RecursiveArrayTools.DiffEqArrayType
DiffEqArray(u::AbstractVector, t::AbstractVector)

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

To construct a DiffEqArray

t = 0.0:0.1:10.0
 f(t) = t - 1
 f2(t) = t^2
 vals = [[f(tval) f2(tval)] for tval in t]
 A = DiffEqArray(vals, t)
 A[1, :]  # all time periods for f(t)
-A.t
source
RecursiveArrayTools.ArrayPartitionType
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 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:

using RecursiveArrayTools
-A = ArrayPartition(y, z)

we would have A.x[1]==y and A.x[2]==z. Broadcasting like f.(A) is efficient.

source
+A.tsource
RecursiveArrayTools.ArrayPartitionType
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 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:

using RecursiveArrayTools
+A = ArrayPartition(y, z)

we would have A.x[1]==y and A.x[2]==z. Broadcasting like f.(A) is efficient.

source
diff --git a/dev/assets/Manifest.toml b/dev/assets/Manifest.toml index 2eec7b7d..855ed695 100644 --- a/dev/assets/Manifest.toml +++ b/dev/assets/Manifest.toml @@ -280,7 +280,7 @@ version = "1.3.4" deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "Requires", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] path = "/home/runner/work/RecursiveArrayTools.jl/RecursiveArrayTools.jl" uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" -version = "3.2.2" +version = "3.2.3" [deps.RecursiveArrayTools.extensions] RecursiveArrayToolsMeasurementsExt = "Measurements" diff --git a/dev/index.html b/dev/index.html index b69934b6..cab4f43f 100644 --- a/dev/index.html +++ b/dev/index.html @@ -2,7 +2,7 @@ Home · RecursiveArrayTools.jl

RecursiveArrayTools.jl: Arrays of Arrays and Even Deeper

RecursiveArrayTools.jl is a set of tools for dealing with recursive arrays, like arrays of arrays. It contains type wrappers for making recursive arrays act more like normal arrays (for example, automating the recursion of broadcast, maps, iteration, and more), and utility functions which make it easier to work with recursive arrays.

Installation

To install RecursiveArrayTools.jl, use the Julia package manager:

using Pkg
 Pkg.add("RecursiveArrayTools")

Contributing

Reproducibility

The documentation of this SciML package was built using these direct dependencies,
Status `~/work/RecursiveArrayTools.jl/RecursiveArrayTools.jl/docs/Project.toml`
   [e30172f5] Documenter v1.2.1
-  [731186ca] RecursiveArrayTools v3.2.2 `~/work/RecursiveArrayTools.jl/RecursiveArrayTools.jl`
and using this machine and Julia version.
Julia Version 1.9.4
+  [731186ca] RecursiveArrayTools v3.2.3 `~/work/RecursiveArrayTools.jl/RecursiveArrayTools.jl`
and using this machine and Julia version.
Julia Version 1.9.4
 Commit 8e5136fa297 (2023-11-14 08:46 UTC)
 Build Info:
   Official https://julialang.org/ release
@@ -34,7 +34,7 @@
   [aea7be01] PrecompileTools v1.2.0
   [21216c6a] Preferences v1.4.1
   [3cdcf5f2] RecipesBase v1.3.4
-  [731186ca] RecursiveArrayTools v3.2.2 `~/work/RecursiveArrayTools.jl/RecursiveArrayTools.jl`
+  [731186ca] RecursiveArrayTools v3.2.3 `~/work/RecursiveArrayTools.jl/RecursiveArrayTools.jl`
   [2792f1a3] RegistryInstances v0.1.0
   [ae029012] Requires v1.3.0
   [1e83bf80] StaticArraysCore v1.4.2
@@ -86,4 +86,4 @@
   [83775a58] Zlib_jll v1.2.13+0
   [8e850b90] libblastrampoline_jll v5.8.0+0
   [8e850ede] nghttp2_jll v1.52.0+1
-  [3f19e933] p7zip_jll v17.4.0+0

You can also download the manifest file and the project file.

+ [3f19e933] p7zip_jll v17.4.0+0

You can also download the manifest file and the project file.

diff --git a/dev/recursive_array_functions/index.html b/dev/recursive_array_functions/index.html index d21ce549..7a6ffa4f 100644 --- a/dev/recursive_array_functions/index.html +++ b/dev/recursive_array_functions/index.html @@ -1,2 +1,2 @@ -Recursive Array Functions · RecursiveArrayTools.jl

Recursive Array Functions

These are functions designed for recursive arrays, like arrays of arrays, and do not require that the RecursiveArrayTools types are used.

Function List

RecursiveArrayTools.recursivecopyFunction
recursivecopy(a::Union{AbstractArray{T, N}, AbstractVectorOfArray{T,N}})

A recursive copy function. Acts like a deepcopy on arrays of arrays, but like copy on arrays of scalars.

source
RecursiveArrayTools.recursivecopy!Function
recursivecopy!(b::AbstractArray{T, N}, a::AbstractArray{T, N})

A recursive copy! function. Acts like a deepcopy! on arrays of arrays, but like copy! on arrays of scalars.

source
RecursiveArrayTools.copyat_or_push!Function
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.

source
+Recursive Array Functions · RecursiveArrayTools.jl

Recursive Array Functions

These are functions designed for recursive arrays, like arrays of arrays, and do not require that the RecursiveArrayTools types are used.

Function List

RecursiveArrayTools.recursivecopyFunction
recursivecopy(a::Union{AbstractArray{T, N}, AbstractVectorOfArray{T,N}})

A recursive copy function. Acts like a deepcopy on arrays of arrays, but like copy on arrays of scalars.

source
RecursiveArrayTools.recursivecopy!Function
recursivecopy!(b::AbstractArray{T, N}, a::AbstractArray{T, N})

A recursive copy! function. Acts like a deepcopy! on arrays of arrays, but like copy! on arrays of scalars.

source
RecursiveArrayTools.copyat_or_push!Function
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.

source