Skip to content

Releases: orxfun/orx-tree

Copy, Send and Sync for NodePtr and NodeIdx

23 Nov 21:50
18d4afc

Choose a tag to compare

Changes

This version Implements Copy for NodePtr.

Implements Send and Sync for NodeIdx.

Carries out a major refactoring for pointers and indices passed as values rather than references.

Finally, missing methods leaves_mut, leaves_mut_with, into_leaves and into_leaves_with methods are added for NodeMut.

Breaking Changes

This version introduces breaking changes due to the Copy implementation of the node pointer and node index. As recommended, their methods now take self rather than &self. Further, Tree methods that takes a node pointer or index as an argument now accept values by copy semantics rather than as references as in the prior version. Although this makes it more convenient to work with indices, it leads to compilation errors in the old code.

For instance, the following code block will not compile in the new version:

use orx_tree::*;

let mut tree = DynTree::new(1i32);

let mut root = tree.root_mut();
let [id2, id3] = root.push_children([2, 3]);

let node2 = tree.node(&id2); // errpr

It needs to be fixed as below:

let node2 = tree.node(id2);

Thanks to @hasezoey for suggestions and reviews.

NodeIdx Hash & Copy

19 Nov 17:24
796f6ff

Choose a tag to compare

Changes

  • MSRV is added to readme, and CI jobs run on both stable and MSRV.
  • CI enabled on all branches.
  • Clippy suggestions enabled for tests, fixes are made wrt suggestions.
  • NodeIdx implements Hash.
  • NodeIdx always implements Copy regardless of whether the variant implements Copy or not.
  • parallel feature is explicitly listed. The older feature name orx-parallel is kept until next major version.

Thanks to @hasezoey for all these improvements.

Upgrade pinned vector dependencies 3.21

20 Oct 18:23
76c1c1a

Choose a tag to compare

Upgrades PinnedVec for improved safety guarantees: https://github.com/orxfun/orx-pinned-vec/releases/tag/3.21.0

Also upgrades orx-parallel dependency.

Upgrade pinned vector dependencies

02 Aug 05:04
c09bb39

Choose a tag to compare

Merge pull request #164 from orxfun/new-pinned-vector-versions

upgrade to new pinned vec and con iter versions

Parallel Walks

07 Jun 19:05
ddb2d0b

Choose a tag to compare

Parallelized Walks

  • The main contribution of this release is enabling parallel iterators over various tree iterators and walks with any of the traversals. Parallelization is obtained simply by adding _par suffix to name of the sequential counterpart. These methods return a orx_parallel::ParIter which allows for significant improvements in computation time. The following is the list of new methods returning parallel iterators:
    • children_par
    • ancestors_par
    • custom_walk_par
    • walk_par
    • walk_with_par
    • paths_par
    • paths_with_par
    • leaves_par
    • leaves_with_par

Custom Walks

  • custom_walk(next_node) method is implemented. This method returns an iterator over the nodes with custom traversal strategy. Traversal strategy is determined by the argument next_node. next_node is a function with the signature Fn(Node) -> Option<Node>. Iteration starts with the self and terminates when next_node returns None. This provides a convenient and flexible way to create custom walks. Notice that iteration in all directions can be defined and infinite iterations can be created. Mutable version custom_walk_mut(next_node) is also implemented for NodeMut.

Allocation-Free Paths Iterator

  • paths was returning impl Iterator<Item = impl Iterator<&V::Item>>. Now it returns impl Iterator<Item = impl Iterator<&V::Item> + Clone>. In other words, each path element is a cheaply cloneable iterator. This allows for converting the path into_iterable which can be iterated over multiple times, and hence, provides the means to avoid allocation and collecting the paths into collections.
  • Examples for different iterators, walks are added and linked from the documentation.

Parallelization

29 May 08:06
6d3f76a

Choose a tag to compare

This release provides the initial support for parallelization over trees:

  • Introduces par and into_par methods on the Tree. These methods create parallel iterators over all nodes of the tree in arbitrary order. In other words, they are the parallel counterpart of the iter and into_iter methods of the tree.
  • These implementations use direct parallelization over the underlying pinned vector, and hence, result in efficient gains in computation time. Benchmarks and examples are added to test and experiment parallel computations.
  • Parallel execution is handled by the orx-parallel crate which is added as an optional dependency. Importantly note that "orx-parallel" requires "std". Therefore, for no-std use cases this features must be excluded. Since "orx-parallel" is added as a default feature, it must be excluded by --no-default-features.

recursive_set

27 Apr 17:42
847af89

Choose a tag to compare

recursive_set method is defined and implemented for NodeMut. This method provides an expressive way to update the values of a tree where value of a node is a function of its prior value and values of its children. Since the values of its children subsequently depend on their own children, it immediately follows that the value of the node depends on values of all of its descendants that must be computed to be able to compute the node's value.

In addition mutable_recursive_traversal example is created to demonstrate different ways to approach to this problem.

Fixes 159.

2024edition

11 Apr 08:40
812b6e0

Choose a tag to compare

Migration to edition2024.

CI action is added.

Upgrade PseudoDefault dependency

11 Feb 16:07
861d69d

Choose a tag to compare

Merge pull request #156 from orxfun/Upgrade-PseudoDefault-dependency

Upgrade PseudoDefault dependency

Dual license

08 Feb 17:49
fa9ca5c

Choose a tag to compare

Merge pull request #155 from orxfun/dual-licenses

dual licenses