|
Orrery
A GPU-accelerated N-body gravitational simulator
|
The particles of a configuration, in the order the tree wants them. More...
#include <orrery/solvers/morton.hpp>
Public Member Functions | |
| void | build (core::Vec3Span< const core::Real > positions, backend::Executor *executor) |
| Compute and sort the codes of positions. | |
| std::span< const MortonKey > | keys () const noexcept |
| The keys, ascending. Empty until build has been called. | |
| const BoundingCube & | cube () const noexcept |
| The cube the codes were computed in. | |
The particles of a configuration, in the order the tree wants them.
Holds the sorted keys and the scratch space the sort needs, so that a solver evaluating millions of times allocates on the first evaluation and on none of the rest.
| void orrery::solvers::MortonOrdering::build | ( | core::Vec3Span< const core::Real > | positions, |
| backend::Executor * | executor ) |
Compute and sort the codes of positions.
Runs the sort through executor where one is given, and on the calling thread otherwise. The result does not depend on which: the ordering is total, so every path produces the same permutation.
Safe to call with no particles.