Beluga named requirements: Particle

What an implementation of a particle in Beluga should provide.

Requirements

P is a Particle type if given:

  • An instance p of P.

  • A possibly const instance cp of P.

The following is satisfied:

  • beluga::state(cp) is a valid expression and returns the particle state.

  • beluga::weight(cp) is a valid expression and returns the particle weight.

  • beluga::state(p) is a valid expression and returns a mutable reference to the particle state.

  • beluga::weight(p) is a valid expression and returns a mutable reference to the particle weight.

Notes

Both beluga::state and beluga::weight are customization point objects. Users have two customization alternatives:

  • Specifying state() and weight() as instance members of their custom type.

  • Creating free functions state(p) and weight(p) overloaded for their custom type in the same namespace where that type is defined (so it can be found by ADL).