Celeritas 0.7-develop+980877a
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
celeritas::RotationCounter Class Reference

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)
 

Detailed Description

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.

Todo:
Merge rotations that are soft equal (see similar todo in TransformInserter ).

Member Function Documentation

◆ calc_most_common()

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.

◆ count()

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.


The documentation for this class was generated from the following files: