Lines Matching +full:boost +full:- +full:root
3 // Use, modification and distribution is subject to the Boost Software
5 // http://www.boost.org/LICENSE_1_0.txt)
10 #include <boost/mpi/detail/computation_tree.hpp>
12 namespace boost { namespace mpi { namespace detail { namespace
17 ::computation_tree(int rank, int size, int root, int branching_factor) in computation_tree() argument
18 : rank(rank), size(size), root(root), in computation_tree()
23 // The position in the tree, once we've adjusted for non-zero in computation_tree()
25 int n = (rank + size - root) % size; in computation_tree()
45 while (n--) { in level_index()
54 if (rank == root) return rank; in parent()
55 int n = rank + size - 1 - root; in parent()
56 return ((n % size / branching_factor_) + root) % size ; in parent()
61 // Zero-based index of this node in child_begin()
62 int n = (rank + size - root) % size; in child_begin()
64 // Compute the index of the child (in a zero-based tree) in child_begin()
66 + branching_factor_ * (n - level_index(level_)); in child_begin()
68 if (child_index >= size) return root; in child_begin()
69 else return (child_index + root) % size; in child_begin()
72 } } } // end namespace boost::mpi::detail