-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Documenter.jl
committed
Dec 21, 2023
1 parent
e54f92b
commit 5f3668d
Showing
5 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-20T11:08:38","documenter_version":"1.2.1"}} | ||
{"documenter":{"julia_version":"1.9.4","generation_timestamp":"2023-12-21T01:56:04","documenter_version":"1.2.1"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Recursive Array Types · RecursiveArrayTools.jl</title><meta name="title" content="Recursive Array Types · RecursiveArrayTools.jl"/><meta property="og:title" content="Recursive Array Types · RecursiveArrayTools.jl"/><meta property="twitter:title" content="Recursive Array Types · RecursiveArrayTools.jl"/><meta name="description" content="Documentation for RecursiveArrayTools.jl."/><meta property="og:description" content="Documentation for RecursiveArrayTools.jl."/><meta property="twitter:description" content="Documentation for RecursiveArrayTools.jl."/><meta property="og:url" content="https://docs.sciml.ai/RecursiveArrayTools/stable/array_types/"/><meta property="twitter:url" content="https://docs.sciml.ai/RecursiveArrayTools/stable/array_types/"/><link rel="canonical" href="https://docs.sciml.ai/RecursiveArrayTools/stable/array_types/"/><script data-outdated-warner src="../assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL=".."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="../assets/documenter.js"></script><script src="../search_index.js"></script><script src="../siteinfo.js"></script><script src="../../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="../assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="../assets/themeswap.js"></script><link href="../assets/favicon.ico" rel="icon" type="image/x-icon"/></head><body><div id="documenter"><nav class="docs-sidebar"><a class="docs-logo" href="../"><img src="../assets/logo.png" alt="RecursiveArrayTools.jl logo"/></a><div class="docs-package-name"><span class="docs-autofit"><a href="../">RecursiveArrayTools.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li><a class="tocitem" href="../">Home</a></li><li class="is-active"><a class="tocitem" href>Recursive Array Types</a><ul class="internal"><li><a class="tocitem" href="#Abstract-Types"><span>Abstract Types</span></a></li><li><a class="tocitem" href="#Concrete-Types"><span>Concrete Types</span></a></li></ul></li><li><a class="tocitem" href="../recursive_array_functions/">Recursive Array Functions</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Recursive Array Types</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Recursive Array Types</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://github.com/SciML/RecursiveArrayTools.jl" title="View the repository on GitHub"><span class="docs-icon fa-brands"></span><span class="docs-label is-hidden-touch">GitHub</span></a><a class="docs-navbar-link" href="https://github.com/SciML/RecursiveArrayTools.jl/blob/master/docs/src/array_types.md" title="Edit source on GitHub"><span class="docs-icon fa-solid"></span></a><a class="docs-settings-button docs-navbar-link fa-solid fa-gear" id="documenter-settings-button" href="#" title="Settings"></a><a class="docs-article-toggle-button fa-solid fa-chevron-up" id="documenter-article-toggle-button" href="javascript:;" title="Collapse all docstrings"></a></div></header><article class="content" id="documenter-page"><h1 id="Recursive-Array-Types"><a class="docs-heading-anchor" href="#Recursive-Array-Types">Recursive Array Types</a><a id="Recursive-Array-Types-1"></a><a class="docs-heading-anchor-permalink" href="#Recursive-Array-Types" title="Permalink"></a></h1><p>The Recursive Array types are types which implement an <code>AbstractArray</code> 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.</p><h2 id="Abstract-Types"><a class="docs-heading-anchor" href="#Abstract-Types">Abstract Types</a><a id="Abstract-Types-1"></a><a class="docs-heading-anchor-permalink" href="#Abstract-Types" title="Permalink"></a></h2><h2 id="Concrete-Types"><a class="docs-heading-anchor" href="#Concrete-Types">Concrete Types</a><a id="Concrete-Types-1"></a><a class="docs-heading-anchor-permalink" href="#Concrete-Types" title="Permalink"></a></h2><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="RecursiveArrayTools.VectorOfArray" href="#RecursiveArrayTools.VectorOfArray"><code>RecursiveArrayTools.VectorOfArray</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">VectorOfArray(u::AbstractVector)</code></pre><p>A <code>VectorOfArray</code> is an array which has the underlying data structure <code>Vector{AbstractArray{T}}</code> (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:</p><pre><code class="language-julia hljs">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</code></pre><p>which presents itself as a column-major matrix with the columns being the arrays from the vector. The <code>AbstractArray</code> interface is implemented, giving access to <code>copy</code>, <code>push</code>, <code>append!</code>, etc. functions, which act appropriately. Points to note are:</p><ul><li>The length is the number of vectors, or <code>length(A.u)</code> where <code>u</code> is the vector of arrays.</li><li>Iteration follows the linear index and goes over the vectors</li></ul><p>Additionally, the <code>convert(Array,VA::AbstractVectorOfArray)</code> function is provided, which transforms the <code>VectorOfArray</code> into a matrix/tensor. Also, <code>vecarr_to_vectors(VA::AbstractVectorOfArray)</code> returns a vector of the series for each component, that is, <code>A[i,:]</code> for each <code>i</code>. A plot recipe is provided, which plots the <code>A[i,:]</code> series.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/SciML/RecursiveArrayTools.jl/blob/4dc8305719bc4ce7b502f1d2c3f7d27c3ffab350/src/vector_of_array.jl#L3-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="RecursiveArrayTools.DiffEqArray" href="#RecursiveArrayTools.DiffEqArray"><code>RecursiveArrayTools.DiffEqArray</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DiffEqArray(u::AbstractVector, t::AbstractVector)</code></pre><p>This is a <code>VectorOfArray</code>, which stores <code>A.t</code> that matches <code>A.u</code>. This will plot <code>(A.t[i],A[i,:])</code>. The function <code>tuples(diffeq_arr)</code> returns tuples of <code>(t,u)</code>.</p><p>To construct a DiffEqArray</p><pre><code class="language-julia hljs">t = 0.0:0.1:10.0 | ||
A[j1, ..., jN, i] # Returns the (j1,...,jN) component of the ith array</code></pre><p>which presents itself as a column-major matrix with the columns being the arrays from the vector. The <code>AbstractArray</code> interface is implemented, giving access to <code>copy</code>, <code>push</code>, <code>append!</code>, etc. functions, which act appropriately. Points to note are:</p><ul><li>The length is the number of vectors, or <code>length(A.u)</code> where <code>u</code> is the vector of arrays.</li><li>Iteration follows the linear index and goes over the vectors</li></ul><p>Additionally, the <code>convert(Array,VA::AbstractVectorOfArray)</code> function is provided, which transforms the <code>VectorOfArray</code> into a matrix/tensor. Also, <code>vecarr_to_vectors(VA::AbstractVectorOfArray)</code> returns a vector of the series for each component, that is, <code>A[i,:]</code> for each <code>i</code>. A plot recipe is provided, which plots the <code>A[i,:]</code> series.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/SciML/RecursiveArrayTools.jl/blob/dd5c75672dc8f7c38a97bdfbabc326a74e68fe31/src/vector_of_array.jl#L3-L30">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="RecursiveArrayTools.DiffEqArray" href="#RecursiveArrayTools.DiffEqArray"><code>RecursiveArrayTools.DiffEqArray</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">DiffEqArray(u::AbstractVector, t::AbstractVector)</code></pre><p>This is a <code>VectorOfArray</code>, which stores <code>A.t</code> that matches <code>A.u</code>. This will plot <code>(A.t[i],A[i,:])</code>. The function <code>tuples(diffeq_arr)</code> returns tuples of <code>(t,u)</code>.</p><p>To construct a DiffEqArray</p><pre><code class="language-julia hljs">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</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/SciML/RecursiveArrayTools.jl/blob/4dc8305719bc4ce7b502f1d2c3f7d27c3ffab350/src/vector_of_array.jl#L36-L55">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="RecursiveArrayTools.ArrayPartition" href="#RecursiveArrayTools.ArrayPartition"><code>RecursiveArrayTools.ArrayPartition</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">ArrayPartition(x::AbstractArray...)</code></pre><p>An <code>ArrayPartition</code> <code>A</code> is an array, which is made up of different arrays <code>A.x</code>. 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 <code>A .+= 2.+B</code> is type-stable in its computations, even if <code>A.x[i]</code> and <code>A.x[j]</code> 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 <a href="https://docs.sciml.ai/DiffEqDocs/stable/">DifferentialEquations.jl</a>.</p><p>An <code>ArrayPartition</code> acts like a single array. <code>A[i]</code> indexes through the first array, then the second, etc., all linearly. But <code>A.x</code> is where the arrays are stored. Thus, for:</p><pre><code class="language-julia hljs">using RecursiveArrayTools | ||
A = ArrayPartition(y, z)</code></pre><p>we would have <code>A.x[1]==y</code> and <code>A.x[2]==z</code>. Broadcasting like <code>f.(A)</code> is efficient.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/SciML/RecursiveArrayTools.jl/blob/4dc8305719bc4ce7b502f1d2c3f7d27c3ffab350/src/array_partition.jl#L1-L25">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../recursive_array_functions/">Recursive Array Functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Wednesday 20 December 2023 11:08">Wednesday 20 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> | ||
A.t</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/SciML/RecursiveArrayTools.jl/blob/dd5c75672dc8f7c38a97bdfbabc326a74e68fe31/src/vector_of_array.jl#L36-L55">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="RecursiveArrayTools.ArrayPartition" href="#RecursiveArrayTools.ArrayPartition"><code>RecursiveArrayTools.ArrayPartition</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">ArrayPartition(x::AbstractArray...)</code></pre><p>An <code>ArrayPartition</code> <code>A</code> is an array, which is made up of different arrays <code>A.x</code>. 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 <code>A .+= 2.+B</code> is type-stable in its computations, even if <code>A.x[i]</code> and <code>A.x[j]</code> 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 <a href="https://docs.sciml.ai/DiffEqDocs/stable/">DifferentialEquations.jl</a>.</p><p>An <code>ArrayPartition</code> acts like a single array. <code>A[i]</code> indexes through the first array, then the second, etc., all linearly. But <code>A.x</code> is where the arrays are stored. Thus, for:</p><pre><code class="language-julia hljs">using RecursiveArrayTools | ||
A = ArrayPartition(y, z)</code></pre><p>we would have <code>A.x[1]==y</code> and <code>A.x[2]==z</code>. Broadcasting like <code>f.(A)</code> is efficient.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/SciML/RecursiveArrayTools.jl/blob/dd5c75672dc8f7c38a97bdfbabc326a74e68fe31/src/array_partition.jl#L1-L25">source</a></section></article></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../">« Home</a><a class="docs-footer-nextpage" href="../recursive_array_functions/">Recursive Array Functions »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.2.1 on <span class="colophon-date" title="Thursday 21 December 2023 01:56">Thursday 21 December 2023</span>. Using Julia version 1.9.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.