hep-mc  0.8
Public Types | Public Member Functions | List of all members
hep::callback< Checkpoint > Class Template Reference

Detailed Description

template<typename Checkpoint>
class hep::callback< Checkpoint >

Default callback type used by all integration algorithms.

Examples:
vegas_stop_after_precision.cpp.

Public Types

using numeric_type = typename Checkpoint::result_type::numeric_type
 

Public Member Functions

 callback (callback_mode mode=callback_mode::verbose, std::string const &filename="", numeric_type target_rel_err=numeric_type())
 
bool operator() (Checkpoint const &chkpt)
 
void mode (callback_mode mode)
 
callback_mode mode () const
 

Member Typedef Documentation

◆ numeric_type

template<typename Checkpoint >
using hep::callback< Checkpoint >::numeric_type = typename Checkpoint::result_type::numeric_type

Numeric type used by the checkpoint.

Constructor & Destructor Documentation

◆ callback()

template<typename Checkpoint >
hep::callback< Checkpoint >::callback ( callback_mode  mode = callback_mode::verbose,
std::string const &  filename = "",
numeric_type  target_rel_err = numeric_type() 
)
inline

Constructor. The parameter mode determines the behaviour of operator()(). If mode is callback_mode::verbose_and_write_chkpt, then filename is the file the checkpoint is written to. If target_rel_err is strictly larger than zero, the integration is stopped if the accumulated result has a relative precision which is better than target_rel_err.

Member Function Documentation

◆ mode() [1/2]

template<typename Checkpoint >
void hep::callback< Checkpoint >::mode ( callback_mode  mode)
inline

Sets the mode of this callback function.

◆ mode() [2/2]

template<typename Checkpoint >
callback_mode hep::callback< Checkpoint >::mode ( ) const
inline

Returns the mode of this callback function.

◆ operator()()

template<typename Checkpoint >
bool hep::callback< Checkpoint >::operator() ( Checkpoint const &  chkpt)
inline

Callback function whose behaviour is determined by mode given in the constructor. This function always returns true.