|
Celeritas 0.7-develop+980877a
|
Find the most common rotation among set of transformations. More...
#include <RotationCounter.hh>
Classes | |
| struct | Results |
Public Member Functions | |
| void | count (VariantTransform const &transform) |
| Count a single transform's rotation. | |
| Results | calc_most_common () const |
| Calculate the most common rotation and the number of transforms sharing it. | |
| size_type | num_rotations () const |
| Get the number of distinct rotations (including the identity) | |
Find the most common rotation among set of transformations.
The most common rotation is used for universe alignment, such that an LV is oriented with the majority of it's daughters axis-aligned. Rotations are hashed based on their exact values; there is no notion of soft equivalence.
TransformInserter ). | auto celeritas::RotationCounter::calc_most_common | ( | ) | const |
Calculate the most common rotation and the number of transforms sharing it.
The identity wins any tie. If there is a tie between other rotations, the one returned is whichever is encountered first in the hash map's iteration order, which is not guaranteed to be consistent across multiple platforms. Therefore, client code should only use rotations when they constitute a majority, i.e., > 50% of all transforms.
| void celeritas::RotationCounter::count | ( | VariantTransform const & | transform | ) |
Count a single transform's rotation.
Transforms without a rotation are tallied separately rather than hashing an identity matrix for each one, since they are typically the most common.