gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
scanner_utils.hpp File Reference

Utility Functions for the Gambit Scanner. More...

#include <type_traits>
#include <utility>
#include <ostream>
#include <sstream>
#include <unordered_map>
#include <algorithm>
#include <cctype>
#include <boost/iterator/zip_iterator.hpp>
#include <boost/range.hpp>
#include "gambit/Utils/exceptions.hpp"
#include "gambit/Utils/local_info.hpp"
#include "gambit/Utils/util_macros.hpp"
#include "gambit/Utils/factory_registry.hpp"
#include "gambit/Utils/variadic_functions.hpp"
#include "gambit/Utils/yaml_options.hpp"
Include dependency graph for scanner_utils.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Gambit::Scanner::func_ptr_type< T >
 
struct  Gambit::Scanner::func_ptr_type< void(args...)>
 
struct  Gambit::Scanner::remove_all_func< T >
 
struct  Gambit::Scanner::remove_all_func< ret(args...)>
 
struct  Gambit::Scanner::return_type<... >
 
struct  Gambit::Scanner::return_type< ret(args...)>
 
struct  Gambit::Scanner::first_arg_type<... >
 
struct  Gambit::Scanner::first_arg_type< ret(T, args...)>
 
struct  Gambit::Scanner::is_args_convertible< T >
 
struct  Gambit::Scanner::__is_args_convertible__< bool, T1, T2 >
 
struct  Gambit::Scanner::__is_args_convertible__< false, T1, T2 >
 
struct  Gambit::Scanner::is_args_convertible< ret1(arg1, args1...), ret2(arg2, args2...)>
 
struct  Gambit::Scanner::__find_variadic_type_not_exact__< T >
 
struct  Gambit::Scanner::_find_variadic_type_not_exact_< T >
 
struct  Gambit::Scanner::_find_variadic_type_not_exact_< T1, T2, T... >
 
struct  Gambit::Scanner::find_variadic_type_not_exact< T >
 
struct  Gambit::Scanner::find_variadic_type_not_exact< void(args...)>
 
struct  Gambit::Scanner::__find_variadic_type_not_exact__< void(args...), ret(args...), T1, T... >
 
struct  Gambit::Scanner::__find_variadic_type_not_exact__< void(args...), ret(args2...), T1, T... >
 
struct  Gambit::Scanner::find_variadic_type_exact< T >
 
struct  Gambit::Scanner::find_variadic_type_exact< void(args...), ret(args2...), T... >
 
struct  Gambit::Scanner::find_variadic_type_exact< void(args...), ret(args...), T... >
 
struct  Gambit::Scanner::find_variadic_type_exact< void(args...)>
 
struct  Gambit::Scanner::__find_variadic_type_convert__< bool, T >
 
struct  Gambit::Scanner::_find_variadic_type_convert_< T >
 
struct  Gambit::Scanner::_find_variadic_type_convert_< Tc, T1, T... >
 
struct  Gambit::Scanner::find_variadic_type_convert< T >
 
struct  Gambit::Scanner::find_variadic_type_convert< ret(args...)>
 
struct  Gambit::Scanner::__find_variadic_type_convert__< b, Tc, T1, T... >
 
struct  Gambit::Scanner::__find_variadic_type_convert__< true, Tc, T1, T... >
 
struct  Gambit::Scanner::__find_variadic_type__< bool, bool, bool,... >
 
struct  Gambit::Scanner::find_variadic_type< T >
 
struct  Gambit::Scanner::__find_variadic_type__< true, b1, b2, T... >
 
struct  Gambit::Scanner::__find_variadic_type__< false, true, b2, T... >
 
struct  Gambit::Scanner::__find_variadic_type__< false, false, true, T... >
 

Namespaces

 Gambit
 TODO: see if we can use this one:
 
 Gambit::Scanner
 
 Gambit::Scanner::Errors
 

Macros

#define SCAN_ERR
 
#define SCAN_WARN
 
#define SCAN_END_INTERNAL
 
#define SCAN_END   std::endl, SCAN_END_INTERNAL
 
#define SCAN_FLUSH   std::flush, SCAN_END_INTERNAL \
 
#define scan_err   SCAN_ERR
 Defined to macros to output errors in the form: scan_err << "error" << scan_end; scan_warn << "warning" << scan_end;. More...
 
#define scan_warn   SCAN_WARN
 
#define scan_end   SCAN_END
 
#define scan_flush   SCAN_FLUSH
 

Functions

std::stringstream & Gambit::Scanner::Errors::_err_ ()
 
std::stringstream & Gambit::Scanner::Errors::_warn_ ()
 
bool & Gambit::Scanner::Errors::_bool_ ()
 
EXPORT_SYMBOLS error & Gambit::Scanner::scan_error ()
 Scanner errors. More...
 
EXPORT_SYMBOLS warning & Gambit::Scanner::scan_warning ()
 Scanner warnings. More...
 
template<typename... T>
auto Gambit::Scanner::zip (const T &... containers) -> boost::iterator_range< boost::zip_iterator< decltype(boost::make_tuple(std::begin(containers)...))>>
 Use for combine container in a range loop: for (auto &&x : zip(a, b)){...}. More...
 
std::string Gambit::Scanner::demangle (const std::string &in)
 Demangles gnu c++ name. More...
 
template<typename T >
std::vector< T > Gambit::Scanner::get_yaml_vector (const YAML::Node &node)
 Input a vector from the yaml file of the following forms: vec: [a, b, ...] vec: a, b, ... More...
 
int Gambit::Scanner::StringToInt (const std::string &str)
 Converts a string to an int. More...
 
std::string Gambit::Scanner::IntToString (const int &in)
 Converts a int into a string. More...
 
double Gambit::Scanner::pi ()
 Output pi. More...
 
std::map< std::string, std::vector< std::string > > Gambit::Scanner::convert_to_map (const std::vector< std::string > &vec)
 Turns a vector with enters [model::parameter, ...] into a map with [{model, parameter}, ...]. More...
 
void Gambit::Scanner::input_variadic_vector (std::vector< void *> &)
 Inputs a varibadic pack into a vector. More...
 
template<typename T , typename... args>
void Gambit::Scanner::input_variadic_vector (std::vector< void *> &input, const T &value, const args &... params)
 
template<typename ret >
std::enable_if<!std::is_floating_point< ret >::value, ret >::type Gambit::Scanner::scanner_plugin_def_ret ()
 Turns a type into an object. More...
 
template<typename ret >
std::enable_if< std::is_floating_point< ret >::value, ret >::type Gambit::Scanner::scanner_plugin_def_ret ()
 
template<int i>
double Gambit::Scanner::pow (const double &a)
 Outputs a^i. More...
 
template<>
double Gambit::Scanner::pow< 0 > (const double &)
 
template<>
double Gambit::Scanner::pow< 1 > (const double &a)
 
template<int i>
int Gambit::Scanner::pow (const int &a)
 
template<>
int Gambit::Scanner::pow< 0 > (const int &)
 
template<>
int Gambit::Scanner::pow< 1 > (const int &a)
 
template<typename T >
std::enable_if< is_container< T >::value, std::ostream & >::type Gambit::Scanner::operator<< (std::ostream &out, const T &in)
 Outputs containers to an output stream. More...
 
template<typename T >
std::enable_if< is_pair< T >::value, std::ostream & >::type Gambit::Scanner::operator<< (std::ostream &out, const T &in)
 
template<typename T >
std::enable_if<!is_container< T >::value &&!is_pair< T >::value, void >::type Gambit::Scanner::resume_file_output (std::ofstream &out, T &param)
 Functions to output data for the plugin resume functions. More...
 
template<typename T >
std::enable_if< is_container< T >::value, void >::type Gambit::Scanner::resume_file_output (std::ofstream &out, T &param)
 
template<typename T >
std::enable_if< is_pair< T >::value, void >::type Gambit::Scanner::resume_file_output (std::ofstream &out, T &param)
 
template<typename T >
std::enable_if<!is_container< T >::value &&!is_pair< T >::value, void >::type Gambit::Scanner::resume_file_input (std::ifstream &in, T &param)
 
template<typename T >
std::enable_if< is_container< T >::value, void >::type Gambit::Scanner::resume_file_input (std::ifstream &in, T &param)
 
template<typename T >
std::enable_if< is_pair< T >::value, void >::type Gambit::Scanner::resume_file_input (std::ifstream &in, T &param)
 
template<typename T >
std::enable_if<!is_container< T >::value &&!is_pair< T >::value, size_t >::type Gambit::Scanner::resume_size_of (T &)
 
template<typename T >
std::enable_if< is_container< T >::value, size_t >::type Gambit::Scanner::resume_size_of (T &param)
 
template<typename T >
std::enable_if< is_pair< T >::value, size_t >::type Gambit::Scanner::resume_size_of (T &)
 
void Gambit::Scanner::resume_file_input (std::ifstream &in, std::string &param)
 
void Gambit::Scanner::resume_file_output (std::ofstream &out, std::string &param)
 
size_t Gambit::Scanner::resume_size_of (std::string &param)
 

Detailed Description

Utility Functions for the Gambit Scanner.


Authors

(add name and date if you modify)

Author
Gregory Martinez (grego.nosp@m.ry.d.nosp@m.avid..nosp@m.mart.nosp@m.inez@.nosp@m.gmai.nosp@m.l.com)
Date
2013 July
2014 Feb
Author
Pat Scott (patsc.nosp@m.ott@.nosp@m.physi.nosp@m.cs.m.nosp@m.cgill.nosp@m..ca)
Date
2014 Mar, Dec

Definition in file scanner_utils.hpp.

Macro Definition Documentation

◆ scan_end

#define scan_end   SCAN_END

Definition at line 56 of file scanner_utils.hpp.

Referenced by Gambit::Scanner::Plugins::pluginInfo::clear_alt_min_LogL_state(), Gambit::Priors::CompositePrior::CompositePrior(), Gambit::Scanner::demangle(), Gambit::Priors::DoubleLogFlatJoin::DoubleLogFlatJoin(), Gambit::MultiNest::LogLikeWrapper::dumper(), Gambit::PolyChord::LogLikeWrapper::dumper(), Gambit::Scanner::Plugins::Plugin_Main_Interface_Base< ret(args...)>::enterMain(), Gambit::Scanner::Plugins::Plugin_Loader::find(), Gambit::Priors::FixedPrior::FixedPrior(), Gambit::Priors::DoubleLogFlatJoin::get_option(), Gambit::Scanner::get_yaml_vector(), Gambit::Scanner::Plugins::pluginInfo::iniFile(), Gambit::Scanner::Plugins::Plugin_Interface_Base::initPlugin(), Gambit::Priors::Plugin::inverse_transform(), Gambit::Priors::DoubleLogFlatJoin::inverse_transform(), Gambit::Priors::None::inverse_transform(), Gambit::Priors::MultiPriors::MultiPriors(), objective_plugin(), Gambit::Priors::DoubleLogFlatJoin::operator()(), Gambit::Scanner::Plugins::VersionCompare::operator()(), Gambit::Scanner::Plugins::pluginInfo::operator()(), Gambit::Scanner::scan_ptr< ret(args...)>::operator=(), Gambit::Priors::Plugin::Plugin(), Gambit::Scanner::Plugins::Plugin_Loader::Plugin_Loader(), Gambit::Priors::RangePrior1D< T >::RangePrior1D(), Gambit::Scanner::Scan_Manager::Run(), Gambit::Scanner::Scan_Manager::Scan_Manager(), Gambit::Scanner::scan_ptr< ret(args...)>::scan_ptr(), scanner_plugin(), Gambit::Priors::DoubleLogFlatJoin::transform(), Gambit::Priors::None::transform(), and Gambit::Scanner::Plugins::VersionCompare::VersionCompare().

◆ SCAN_END

#define SCAN_END   std::endl, SCAN_END_INTERNAL

Definition at line 82 of file scanner_utils.hpp.

◆ SCAN_END_INTERNAL

#define SCAN_END_INTERNAL
Value:
( \
) \
: \
( \
) \
std::stringstream & _warn_()
#define LOCAL_INFO
Definition: local_info.hpp:34
std::stringstream & _err_()
std::string str
Shorthand for a standard string.
Definition: Analysis.hpp:35
EXPORT_SYMBOLS warning & scan_warning()
Scanner warnings.
EXPORT_SYMBOLS error & scan_error()
Scanner errors.

Definition at line 68 of file scanner_utils.hpp.

◆ scan_err

#define scan_err   SCAN_ERR

Defined to macros to output errors in the form: scan_err << "error" << scan_end; scan_warn << "warning" << scan_end;.

Definition at line 54 of file scanner_utils.hpp.

Referenced by Gambit::Scanner::Plugins::pluginInfo::clear_alt_min_LogL_state(), Gambit::Priors::CompositePrior::CompositePrior(), Gambit::Scanner::demangle(), Gambit::Priors::DoubleLogFlatJoin::DoubleLogFlatJoin(), Gambit::MultiNest::LogLikeWrapper::dumper(), Gambit::PolyChord::LogLikeWrapper::dumper(), Gambit::Scanner::Plugins::Plugin_Main_Interface_Base< ret(args...)>::enterMain(), Gambit::Scanner::Plugins::Plugin_Loader::find(), Gambit::Priors::FixedPrior::FixedPrior(), Gambit::Priors::DoubleLogFlatJoin::get_option(), Gambit::Scanner::get_yaml_vector(), Gambit::Scanner::Plugins::pluginInfo::iniFile(), Gambit::Scanner::Plugins::Plugin_Interface_Base::initPlugin(), Gambit::Priors::Plugin::inverse_transform(), Gambit::Priors::DoubleLogFlatJoin::inverse_transform(), Gambit::Priors::None::inverse_transform(), Gambit::Priors::MultiPriors::MultiPriors(), objective_plugin(), Gambit::Priors::DoubleLogFlatJoin::operator()(), Gambit::Scanner::Plugins::VersionCompare::operator()(), Gambit::Scanner::Plugins::pluginInfo::operator()(), Gambit::Scanner::scan_ptr< ret(args...)>::operator=(), Gambit::Priors::Plugin::Plugin(), Gambit::Scanner::Plugins::Plugin_Loader::Plugin_Loader(), Gambit::Priors::RangePrior1D< T >::RangePrior1D(), Gambit::Scanner::Scan_Manager::Run(), Gambit::Scanner::Scan_Manager::Scan_Manager(), Gambit::Scanner::scan_ptr< ret(args...)>::scan_ptr(), scanner_plugin(), Gambit::Priors::DoubleLogFlatJoin::transform(), Gambit::Priors::None::transform(), and Gambit::Scanner::Plugins::VersionCompare::VersionCompare().

◆ SCAN_ERR

#define SCAN_ERR

◆ scan_flush

#define scan_flush   SCAN_FLUSH

Definition at line 57 of file scanner_utils.hpp.

◆ SCAN_FLUSH

#define SCAN_FLUSH   std::flush, SCAN_END_INTERNAL \

Definition at line 84 of file scanner_utils.hpp.

◆ scan_warn

◆ SCAN_WARN

#define SCAN_WARN