Coder Social home page Coder Social logo

Comments (16)

ChrisRackauckas avatar ChrisRackauckas commented on May 30, 2024 1

Yes, it's basically a hierarchical vector with a few things:

  1. The .y nodes are outside of the hierarchy at each level and are used to store things like cell-specific morphogen gradients (current PDE solutions).
  2. Broadcasted operations are quite efficient through recursion: https://github.com/JuliaDiffEq/MultiScaleArrays.jl/blob/master/src/math.jl#L19-L42
  3. Resizing is straightforward and cheap https://github.com/JuliaDiffEq/MultiScaleArrays.jl/blob/master/src/diffeq.jl
  4. The nodes at the bottom can all be different sizes (for different cell types)
  5. You can add new fields to the nodes to be able to signify cell types and track cell lineages.

It's basically for building beefed up simulations of http://docs.juliadiffeq.org/latest/features/callback_functions.html#Example-3:-Growing-Cell-Population-1 where you have entire gene regulatory networks, different cell types, and morphogen gradients across space. I built it for modeling single cell RNA-seq data, so it needs to satisfy those 5 points. I'd be surprised if anything else really hits this dead on because it's a very specific list of requirements for a specific modeling application.

from multiscalearrays.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 30, 2024 1

It would be fun to try it with an n-body simulation (which I think is an application of fast multipole? And HierarchicalMatrix solvers == Fast multipole)

Let's take that over to DiffEqPhysics. There might be a GSoC for n-body problems so this would be great to handle.

from multiscalearrays.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 30, 2024

Does it work inside the ODE and SDE solvers, and does have easy resizing?

from multiscalearrays.jl.

dlfivefifty avatar dlfivefifty commented on May 30, 2024

What do you mean by easy resizing?

from multiscalearrays.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 30, 2024
tissue3 = construct(Tissue, deepcopy([population, population2]))
add_node!(embryo, tissue3) # Adds a new tissue to the embryo
remove_node!(embryo, 2, 1) # Removes population 1 from tissue 2 of the embryo

The main purpose of this package is to be able to add and remove portions of the array with minimal cost.

from multiscalearrays.jl.

dlfivefifty avatar dlfivefifty commented on May 30, 2024

On the matrix level what does add_node! do? Adds additional rows/columns?

from multiscalearrays.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 30, 2024

This is an abstract vector. If it was a matrix it would be a ragged array in general, but it would be like adding rows and columns

from multiscalearrays.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on May 30, 2024

HierarchicalMatrices.jl is meant to create matrices with heterogeneous leaf types (cell types in MultiScaleArrays.jl). Also, in HierarchicalMatrices.jl, the nodes can support further hierarchical nodes and leaves themselves. The main application (so far) is a fast BLAS-overridden A_mul_B! in the 0.6 syntax, but fast linear solves should be no problem either.

It can modify the block types on-the-fly (provided the new type was included in the parse-time list), but it can't modify the number of blocks on-the-fly as it stores a concrete matrix of each type as a placeholder.

from multiscalearrays.jl.

dlfivefifty avatar dlfivefifty commented on May 30, 2024

Ahhh.... so it's more of a HierarchicalVector?

https://github.com/JuliaApproximation/SingularIntegralEquations.jl/blob/aa6426f512fb826530be862f12ef6ac9aeb91b14/src/LinearAlgebra/HierarchicalVector.jl

from multiscalearrays.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on May 30, 2024

I mean, it could "remove" a block by replacing it with a type of zero array (or just change the referenced type of block number in the hash table assigned.)

from multiscalearrays.jl.

dlfivefifty avatar dlfivefifty commented on May 30, 2024

Does it work inside the ODE and SDE solvers

It would be fun to try it with an n-body simulation (which I think is an application of fast multipole? And HierarchicalMatrix solvers == Fast multipole)

from multiscalearrays.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on May 30, 2024

Yes, that would be fantastic. The example shows usage for a couple different potentials.

from multiscalearrays.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on May 30, 2024

so explicit methods work immediately

from multiscalearrays.jl.

dlfivefifty avatar dlfivefifty commented on May 30, 2024

Does this package overlap with HierarchicalMatrices.jl?
it can't modify the number of blocks on-the-fly

So it sounds like the answer is "yes it overlaps, but not 100%".

So the question is whether there is enough overlap to try to make a common interface.

BlockArrays.jl is another overlapping package. I'd suggest at the very least both HierarchicalMatrices.jl and MultiScaleArrays.jl support Block from BlockArrays.jl, so that you can dig into the hierarchy via (MultiScaleArrays.jl) A[Block(1)][Block(3)][Block(2)] and (HierarchicalMatrices.jl) A[Block(1,1)][Block(2,3)][Block(3,4)].

from multiscalearrays.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on May 30, 2024

P.S. How many levels deep do you usually go? I've found that indexing usually slows down past about 10-12 levels, curious what you find.

from multiscalearrays.jl.

ChrisRackauckas avatar ChrisRackauckas commented on May 30, 2024

Usually just 3.

from multiscalearrays.jl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.