MurrellGroup / MolecularEvolution.jl

A Julia framework for developing phylogenetic models
MIT License
9 stars 4 forks source link

LazyPartition #21

Closed nossleinad closed 2 weeks ago

nossleinad commented 1 month ago

Introduces LazyPartition

Summary

With this data structure, you can wrap a partition of choice. The idea is that in some message passing algorithms, there is only a wave of partitions which need to actualize. For instance, a wave following a root-leaf path, or a depth-first traversal. In which case, we can be more economical with our memory consumption. With a worst case memory complexity of O(log(n)), where n is the number of nodes, functionality is provided for:

Documentation

An example of how to use LazyPartition is provided in https://github.com/nossleinad/MolecularEvolution.jl/tree/LazyPartition/docs/src/models.md

Use case

An argument in favour of this PR is that LazyPartition could be integrated in the difFUBAR method with brevity, where it dramatically reduced the memory footprint of larger datasets. https://github.com/MurrellGroup/CodonMolecularEvolution.jl/commit/b09b0c95cabd43cf3d7a604d810cf4351cfc460e