Celeritas 0.7.0-dev.228+develop.9905a715
Loading...
Searching...
No Matches
Classes | Macros | Functions
DistributionVisitor.hh File Reference
#include "corecel/Types.hh"
#include "corecel/random/data/DistributionData.hh"
#include "DistributionTypeTraits.hh"

Classes

class  celeritas::DistributionVisitor
 Expand a macro to a switch statement over all possible distribution types. More...
 

Macros

#define CELER_DISTRIB_CASE(ENUM, FIELD)
 
#define CELER_DISTRIB_CASE(ENUM, FIELD)
 

Functions

template<class Visitor , class Dist , class Engine >
CELER_FUNCTION decltype(autoceleritas::sample_with (Visitor &&visit, Dist &&dist, Engine &rng)
 Helper function for sampling from a distribution.
 

Macro Definition Documentation

◆ CELER_DISTRIB_CASE [1/2]

#define CELER_DISTRIB_CASE (   ENUM,
  FIELD 
)
Value:
case ODT::ENUM: { \
using TypeT = typename OnedDistributionTypeTraits<ODT::ENUM>::type; \
return celeritas::forward<F>(func)( \
TypeT{params_.FIELD[ItemId<TypeT::RecordT>(idx)]}); \
}

◆ CELER_DISTRIB_CASE [2/2]

#define CELER_DISTRIB_CASE (   ENUM,
  FIELD 
)
Value:
case TDT::ENUM: { \
using TypeT = typename ThreedDistributionTypeTraits<TDT::ENUM>::type; \
return celeritas::forward<F>(func)( \
TypeT{params_.FIELD[ItemId<TypeT::RecordT>(idx)]}); \
}