hep-mc  0.8
Public Member Functions | List of all members
hep::chkpt_with_rng< RandomNumberEngine, Checkpoint > Class Template Reference

Detailed Description

template<typename RandomNumberEngine, typename Checkpoint>
class hep::chkpt_with_rng< RandomNumberEngine, Checkpoint >

Class representing a checkpoint together with a random number generators which were used to generate the results.

Inheritance diagram for hep::chkpt_with_rng< RandomNumberEngine, Checkpoint >:

Public Member Functions

template<typename... Args>
 chkpt_with_rng (RandomNumberEngine const &generator, Args &&... args)
 
 chkpt_with_rng (std::istream &in)
 
void add (typename Checkpoint::result_type const &result, RandomNumberEngine const &generator)
 
RandomNumberEngine generator () const
 
void serialize (std::ostream &out) const override
 

Constructor & Destructor Documentation

◆ chkpt_with_rng() [1/2]

template<typename RandomNumberEngine , typename Checkpoint >
template<typename... Args>
hep::chkpt_with_rng< RandomNumberEngine, Checkpoint >::chkpt_with_rng ( RandomNumberEngine const &  generator,
Args &&...  args 
)
inlineexplicit

Constructor.

◆ chkpt_with_rng() [2/2]

template<typename RandomNumberEngine , typename Checkpoint >
hep::chkpt_with_rng< RandomNumberEngine, Checkpoint >::chkpt_with_rng ( std::istream &  in)
inlineexplicit

Deserialization constructor. This creates a checkpoint by reading from the stream in.

Member Function Documentation

◆ add()

template<typename RandomNumberEngine , typename Checkpoint >
void hep::chkpt_with_rng< RandomNumberEngine, Checkpoint >::add ( typename Checkpoint::result_type const &  result,
RandomNumberEngine const &  generator 
)
inline

Adds a result and a random number generator to this checkpoint. The argument result must correspond to the result created with the random number generator returned previously with generator. The argument generator will be random number generator for the next iteration.

◆ generator()

template<typename RandomNumberEngine , typename Checkpoint >
RandomNumberEngine hep::chkpt_with_rng< RandomNumberEngine, Checkpoint >::generator ( ) const
inline

Returns the random number generator which will be used in the next iteration.

◆ serialize()

template<typename RandomNumberEngine , typename Checkpoint >
void hep::chkpt_with_rng< RandomNumberEngine, Checkpoint >::serialize ( std::ostream &  out) const
inlineoverride