GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - SciML/RecursiveArrayTools.jl: Tools for easily handling objects like arrays of arrays and deeper nestings in scientific machine learning (SciML) and other applications

BranchesTags
Open more actions menu

Latest commit

 

History

1,666 Commits
1,666 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
benchmark
benchmark
 
 
docs
docs
 
 
ext
ext
 
 
lib
lib
 
 
src
src
 
 
test
test
 
 
.codecov.yml
.codecov.yml
 
 
.gitignore
.gitignore
 
 
.typos.toml
.typos.toml
 
 
CITATION.bib
CITATION.bib
 
 
LICENSE.md
LICENSE.md
 
 
Project.toml
Project.toml
 
 
README.md
README.md
 
 

Repository files navigation

RecursiveArrayTools.jl

Join the chat at https://julialang.zulipchat.com #sciml-bridged Global Docs

codecov Build Status build status

ColPrac: Contributor's Guide on Collaborative Practices for Community Packages SciML Code Style

RecursiveArrayTools.jl is a set of tools for dealing with recursive arrays like arrays of arrays.

Tutorials and Documentation

For information on using the package, see the stable documentation. Use the in-development documentation for the version of the documentation, which contains the unreleased features.

Example

VectorOfArray

using RecursiveArrayTools
a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
b = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
vA = VectorOfArray(a)
vB = VectorOfArray(b)

vA .* vB # Now all standard array stuff works!

# you can also create it directly with a vector-like syntax:
c = VA[[1, 2, 3], [4, 5, 6], [7, 8, 9]]
d = VA[[1, 2, 3], [4, 5, 6], [7, 8, 9]]

c .* d

Ragged Arrays

using RecursiveArrayTools

# VectorOfArray with ragged data uses zero-padded rectangular interpretation
ragged = VectorOfArray([[1, 2], [3, 4, 5]])
size(ragged)     # (3, 2) — max inner length is 3
ragged[3, 1]     # 0      — implicit zero
Array(ragged)    # [1 3; 2 4; 0 5]

# For true ragged structure without zero-padding:
using RecursiveArrayToolsRaggedArrays

A = RaggedVectorOfArray([[1, 2, 3], [4, 5, 6, 7], [8, 9]])
A[end, 1]   # 3  — last of first array (length 3)
A[end, 2]   # 7  — last of second array (length 4)
A[end, 3]   # 9  — last of third array (length 2)

ArrayPartition

a = (rand(5), rand(5))
b = (rand(5), rand(5))
pA = ArrayPartition(a)
pB = ArrayPartition(b)

pA .* pB # Now all standard array stuff works!

# or using the vector syntax:
x0 = rand(3, 3)
v0 = rand(3, 3)
a0 = rand(3, 3)
u0 = AP[x0, v0, a0]
u0.x[1] === x0 # true

u0 .+= 1
u0.x[2] === v0 # still true

# do some calculations creating a new partitioned array
unew = u0 * 10
# easily access the individual components without having to rely on complicated indexing
xnew, vnew, anew = unew.x

About

Tools for easily handling objects like arrays of arrays and deeper nestings in scientific machine learning (SciML) and other applications

docs.sciml.ai/RecursiveArrayTools/stable/

Topics

arrayrecursionscientific-machine-learningscimlvector

Resources

Readme
License

Code of conduct

Code of conduct

Contributing

Contributing

Security policy

Security policy
Activity
Custom properties

Stars

234 stars

Watchers

6 watching

Forks

77 forks
Report repository

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.