Typedef Documentation◆ time_point
Definition at line 46 of file logging.hpp. Function Documentation◆ are_similar()Check if two strings are a "close" match Used for "did you mean?" type checking during command line argument processing. Definition at line 345 of file util_functions.cpp. References check1(), and check2(). Referenced by is_disjoint(), and Gambit::gambit_core::run_diagnostic(). 350 //TODO: Add more checks? These ones are pretty minimal. Maybe something that computes percentage match between strings... bool check2(const str &s1, const str &s2) Sub-check for are_similar. Definition: util_functions.cpp:371 bool check1(const str &s1, const str &s2) Sub-check for are_similar. Definition: util_functions.cpp:354
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ base_name()
Get file name from full path+filename (POSIX) Definition at line 286 of file util_functions.cpp. Referenced by Gambit::Printers::HDF5::find_temporary_files(), is_disjoint(), and main().
Here is the caller graph for this function:
![]() ◆ beginA()
template<typename T , size_t N>
Get pointers to beginning and end of array. Definition at line 156 of file util_functions.hpp. ◆ check1()Sub-check for are_similar. true if s1 can be obtained by deleting one character from s2 Definition at line 354 of file util_functions.cpp. Referenced by are_similar(), is_disjoint(), and Gambit::DarkBit::RD_oh2_Axions().
Here is the caller graph for this function:
![]() ◆ check2()Sub-check for are_similar. true if s1 can be obtained from s2 by changing no more than X characters (X=2 for now) Definition at line 371 of file util_functions.cpp. Referenced by are_similar(), is_disjoint(), and Gambit::DarkBit::RD_oh2_Axions().
Here is the caller graph for this function:
![]() ◆ construct_runtime_scratch()
Construct the path to the run-specific scratch directory This version is safe to call from a destructor. Definition at line 67 of file util_functions.cpp. References ensure_path_exists(), LOCAL_INFO, and Gambit::utils_error(). Referenced by Gambit::Logging::LogMaster::emit_backlog(), and runtime_scratch(). 82 utils_error().raise(LOCAL_INFO, "Tried to call construct_runtime_scratch without MPI initialised!"); 88 return ensure_path_exists(GAMBIT_DIR "/scratch/run_time/machine_" + std::to_string(gethostid()) + master_procID + "/");
EXPORT_SYMBOLS const str & ensure_path_exists(const str &) Ensure that a path exists (and then return the path, for chaining purposes) Definition: util_functions.cpp:227
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ delimiterSplit()Split a string into a vector of strings, using a delimiter, and removing any whitespace around the delimiter. Split a string into a vector of strings using a delimiter, and remove any whitespace around the delimiters. Definition at line 93 of file util_functions.cpp. References split(), and daFunk::vec(). Referenced by Gambit::PostProcessor::get_done_points(), Gambit::Logging::LogMaster::initialise(), Gambit::module_functor_common::makeBackendMatchingRule(), Gambit::module_functor_common::makeBackendOptionRule(), Gambit::module_functor_common::makeBackendRuleForModel(), Gambit::Printers::parse_label_for_ModelParameters(), Gambit::Printers::parse_label_for_spectrum_entry(), Gambit::PostProcessor::PPDriver::PPDriver(), Gambit::functor::setAllowedModelGroupCombo(), Gambit::module_functor_common::setBackendConditionalDependency(), Gambit::module_functor_common::setBackendReq(), Gambit::module_functor_common::setModelConditionalBackendReq(), Gambit::module_functor_common::setModelConditionalDependency(), and Gambit::functor::setModelGroup(). EXPORT_SYMBOLS std::vector< std::string > split(const std::string &input, const std::string &delimiter) Split string into vector of strings, using a delimiter string. Definition: util_functions.cpp:209
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ dir_name()
Get directory name from full path+filename (POSIX) Definition at line 276 of file util_functions.cpp. Referenced by Gambit::Printers::HDF5::find_temporary_files(), Gambit::IniParser::importRound(), and is_disjoint().
Here is the caller graph for this function:
![]() ◆ dummy_function() [1/3]
template<typename... T>
Definition at line 242 of file util_functions.hpp. Referenced by dummy_function().
Here is the caller graph for this function:
![]() ◆ dummy_function() [2/3]
template<typename T >
◆ dummy_function() [3/3]
template<typename T1 , typename... T>
Definition at line 248 of file util_functions.hpp. References find_all_gambit_bits::args, dummy_function(), and void. void dummy_function(T1 first, T... args) Definition: util_functions.hpp:248
Here is the call graph for this function:
![]() ◆ endA()
template<typename T , size_t N>
Definition at line 158 of file util_functions.hpp. References generate_raster_scan_settings::N. Referenced by Gambit::SMSimpleSpec::fill_getter_maps(), Gambit::Models::VectorSingletDM_Z2SimpleSpec::fill_getter_maps(), Gambit::Models::DiracSingletDM_Z2SimpleSpec::fill_getter_maps(), Gambit::Models::MajoranaSingletDM_Z2SimpleSpec::fill_getter_maps(), Gambit::SpecBit::MDMSpec< MI >::fill_getter_maps(), Gambit::SpecBit::ScalarSingletDM_Z2Spec< MI >::fill_getter_maps(), Gambit::SpecBit::ScalarSingletDM_Z3Spec< MI >::fill_getter_maps(), Gambit::Models::ScalarSingletDM_Z2SimpleSpec::fill_getter_maps(), Gambit::MSSMSimpleSpec::fill_getter_maps(), Gambit::Models::ScalarSingletDM_Z3SimpleSpec::fill_getter_maps(), Gambit::SpecBit::MDMSpec< MI >::fill_setter_maps(), Gambit::SpecBit::ScalarSingletDM_Z2Spec< MI >::fill_setter_maps(), Gambit::SpecBit::ScalarSingletDM_Z3Spec< MI >::fill_setter_maps(), Gambit::Models::VectorSingletDM_Z2SimpleSpec::fill_setter_maps(), Gambit::Models::DiracSingletDM_Z2SimpleSpec::fill_setter_maps(), Gambit::Models::MajoranaSingletDM_Z2SimpleSpec::fill_setter_maps(), Gambit::Models::ScalarSingletDM_Z2SimpleSpec::fill_setter_maps(), Gambit::Models::ScalarSingletDM_Z3SimpleSpec::fill_setter_maps(), Gambit::SpecBit::light_quark_test(), and Gambit::SpecBit::Spectrum_test().
Here is the caller graph for this function:
![]() ◆ endsWith()
Checks whether `str' ends with `suffix'. Definition at line 398 of file util_functions.cpp. References daFunk::delta(). Referenced by Gambit::Printers::HDF5Printer2::check_consistency(), Gambit::Printers::HDF5MasterBuffer::get_all_dset_names_on_disk(), Gambit::Printers::lsGroup_process(), and main().
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ ensure_path_exists()
Ensure that a path exists (and then return the path, for chaining purposes) Definition at line 227 of file util_functions.cpp. Referenced by Gambit::IniParser::Parser::basicParse(), Gambit::Printers::asciiPrinter::common_constructor(), Gambit::Printers::HDF5Printer::common_constructor(), construct_runtime_scratch(), Gambit::Scanner::Plugins::pluginInfo::dump(), Gambit::initialise_standalone_logs(), is_disjoint(), main(), Gambit::SpecBit::make_vpp_inputs(), Gambit::Scanner::Plugins::pluginInfo::resume(), scanner_plugin(), and Gambit::Scanner::Plugins::pluginInfo::temp_file_path().
Here is the caller graph for this function:
![]() ◆ file_exists()
Check if a file exists. Definition at line 241 of file util_functions.cpp. Referenced by Gambit::DarkBit::alt_erg_integrand(), Gambit::Scanner::Plugins::pluginInfo::check_alt_min_LogL_state(), Gambit::Printers::HDF5Printer::combine_output(), Gambit::Printers::HDF5::hdf5_stuff::Enter_Aux_Parameters(), Gambit::PostProcessor::get_done_points(), Gambit::ColliderBit::getHepMCEvent(), Gambit::ColliderBit::getLHEvent(), Gambit::Printers::HDF5::hdf5_stuff::hdf5_stuff(), is_disjoint(), main(), Gambit::Printers::nonePrinter::nonePrinter(), and Gambit::PostProcessor::record_done_points().
Here is the caller graph for this function:
![]() ◆ fix_type()Clean out whitespace and strip Gambit and default BOSSed class namespaces. Definition at line 34 of file type_equivalency.cpp. References replace_leading_namespace(), strip_leading_namespace(), and strip_whitespace_except_after_const(). Referenced by Gambit::Utils::type_equivalency::add(), Gambit::IniParser::IniFile::getRules(), Gambit::DRes::matchesRules(), Gambit::module_functor_common::setBackendReq(), Gambit::module_functor_common::setDependency(), and Gambit::module_functor_common::setModelConditionalBackendReqSingular(). 38 // Loop over all the default versions of BOSSed backends and replace any corresponding leading namespace. 39 for (auto it = Backends::backendInfo().default_safe_versions.begin(); it != Backends::backendInfo().default_safe_versions.end(); ++it) EXPORT_SYMBOLS str replace_leading_namespace(str s, str ns, str ns_new) Replaces a namespace at the start of a string, or after "const". Definition: util_functions.cpp:115 EXPORT_SYMBOLS void strip_whitespace_except_after_const(str &) Strip all whitespace except that following "const", in which case the whitespace is replaced by a sin... Definition: util_functions.cpp:123 EXPORT_SYMBOLS str strip_leading_namespace(str s, str ns) Strips namespace from the start of a string, or after "const". Definition: util_functions.cpp:107
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ get_clock_now()
Get clock time. Get current system clock time. Definition at line 328 of file util_functions.cpp. Referenced by Gambit::SpecBit::helper_run_vevacious(), and is_disjoint().
Here is the caller graph for this function:
![]() ◆ iequals()
Perform a (possibly) case-insensitive string comparison. Perform a simple case-insensitive string comparison From: https://stackoverflow.com/a/4119881/1447953. Definition at line 195 of file util_functions.cpp. References b. Referenced by Gambit::Printers::SQLitePrinter::ensure_column_exists(), Gambit::Printers::SQLitePrinter::insert_data(), Gambit::Printers::parse_label_for_ModelParameters(), and Gambit::Printers::parse_label_for_spectrum_entry().
Here is the caller graph for this function:
![]() ◆ integrate_cquad()
Integrate a std::function using GSL cquad. Definition at line 40 of file integration.cpp. References Gambit::invalid_point(), Gambit::invalid_point_exception::raise(), and unwrap(). Referenced by Gambit::DecayBit::chargino_plus_1_decays_smallsplit(), and Gambit::DecayBit::stau_1_decays_smallsplit(). double unwrap(double x, void *p) Unwrapper for passing std::function to GSL integrator Based on example from https://martin-ueding.de/articles/cpp-lambda-into-gsl/index.html. Definition: integration.cpp:33 virtual void raise(const std::string &) Raise the exception, i.e. throw it. Exact override of base method. Definition: exceptions.cpp:422 invalid_point_exception & invalid_point() Invalid point exceptions. Definition: standalone_error_handlers.cpp:83
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ is_disjoint()
template<class Set1 , class Set2 >
Test if two sets are disjoint (works on any sorted std container I think) Definition at line 163 of file util_functions.hpp. References are_similar(), base_name(), check1(), check2(), dir_name(), ensure_path_exists(), EXPORT_SYMBOLS, file_exists(), get_clock_now(), isInteger(), ls_dir(), remove_all_files_in(), return_time_and_date(), and sqr(). Referenced by Gambit::Logging::LogMaster::finalsend(), Gambit::module_functor_common::makeBackendOptionRule(), and Gambit::module_functor_common::makeBackendRuleForModel().
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ isInteger()
Check if a string represents an integer From: http://stackoverflow.com/a/2845275/1447953. Definition at line 175 of file util_functions.cpp. Referenced by Gambit::Printers::HDF5::find_temporary_files(), and is_disjoint().
Here is the caller graph for this function:
![]() ◆ ls_dir()
Return a vector of strings listing the contents of a directory (POSIX) Return a vector of strings listing the contents of a directory (POSIX) Based on http://www.gnu.org/software/libtool/manual/libc/Simple-Directory-Lister.html. Definition at line 251 of file util_functions.cpp. References void. Referenced by Gambit::Printers::HDF5::find_temporary_files(), and is_disjoint().
Here is the caller graph for this function:
![]() ◆ remove_all_files_in()Delete all files in a directory (does not act recursively) Definition at line 296 of file util_functions.cpp. References LOCAL_INFO, and Gambit::utils_error(). Referenced by is_disjoint(), and scanner_plugin().
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ replace_leading_namespace()Replaces a namespace at the start of a string, or after "const". Definition at line 115 of file util_functions.cpp. Referenced by fix_type(), and Gambit::DRes::typeComp().
Here is the caller graph for this function:
![]() ◆ return_time_and_date()
Get date and time. Return (locally defined) date and time corresponding to time_point. Definition at line 334 of file util_functions.cpp. Referenced by is_disjoint(), and Gambit::Logging::StdLogger::write().
Here is the caller graph for this function:
![]() ◆ runtime_scratch()
Return the path to the run-specific scratch directory Don't call this from a destructor, as the internal static str may have already been destroyed. Definition at line 59 of file util_functions.cpp. References construct_runtime_scratch(). Referenced by Gambit::gambit_core::check_databases(), and Gambit::gambit_core::model_diagnostic(). EXPORT_SYMBOLS str construct_runtime_scratch(bool fail_on_mpi_uninitialised=true) Construct the path to the run-specific scratch directory This version is safe to call from a destruct... Definition: util_functions.cpp:67
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ sgn()
template<typename T >
Get the sign of a (hopefully numeric type) Definition at line 239 of file util_functions.hpp. ◆ split()
Split string into vector of strings, using a delimiter string. Definition at line 209 of file util_functions.cpp. Referenced by delimiterSplit(), scanner+_harvester::main(), and Gambit::Printers::HDF5Printer2::resume_reader_options().
Here is the caller graph for this function:
![]() ◆ sqr()returns square of double - saves tedious repetition Definition at line 391 of file util_functions.cpp. Referenced by Gambit::SpecBit::ScalarSingletDM_Z2Spec< MI >::AccessError(), Gambit::MSSMea::get_sinthW2_DRbar(), Gambit::SpecBit::get_sinthW2_DRbar(), Gambit::SpecBit::get_sinthW2_MSbar(), Gambit::SpecBit::get_sinthW2_MSbar2(), Gambit::SMea::get_sinthW2_pole(), Gambit::SpecBit::get_sinthW2_pole(), is_disjoint(), Gambit::PrecisionBit::lnL_gm2(), and Gambit::ColliderBit::ATLAS::smearElectronEnergy().
Here is the caller graph for this function:
![]() ◆ sspairset_contains() [1/5]
Test if a set of str,str pairs contains any entry with first element matching a given string. Referenced by sspairset_contains().
Here is the caller graph for this function:
![]() ◆ sspairset_contains() [2/5]
Tests if a set of str,str pairs contains an entry matching two given strings. ◆ sspairset_contains() [3/5]Tests if a set of str,str pairs contains an entry matching a given pair. Definition at line 153 of file util_functions.cpp. ◆ sspairset_contains() [4/5]
Test if a set of str,str pairs contains any entry with first element matching a given string. Definition at line 140 of file util_functions.cpp. ◆ sspairset_contains() [5/5]
Tests if a set of str,str pairs contains an entry matching two given strings. Definition at line 147 of file util_functions.cpp. References sspairset_contains(). bool sspairset_contains(const str &el1, const str &el2, const std::set< std::pair< str, str >> &set) Tests if a set of str,str pairs contains an entry matching two given strings. Definition: util_functions.cpp:147
Here is the call graph for this function:
![]() ◆ startsWith()
Checks whether `str' begins with `prefix'. Definition at line 410 of file util_functions.cpp. Referenced by Gambit::PostProcessor::PPDriver::check_settings(), Gambit::PostProcessor::get_done_points(), and Gambit::Printers::parse_label_for_ModelParameters().
Here is the caller graph for this function:
![]() ◆ str_fixed_len()Created a str of a specified length. Created a std::string of a specified length. Definition at line 159 of file util_functions.cpp. Referenced by strcpy2f().
Here is the caller graph for this function:
![]() ◆ strcpy2f()Copy a str to a character array, stripping the null termination character. Copy a std::string to a character array, stripping the null termination character. Good for sending to Fortran. Definition at line 186 of file util_functions.cpp. References str_fixed_len(). Referenced by scanner_plugin(). EXPORT_SYMBOLS str str_fixed_len(str, int) Created a str of a specified length. Definition: util_functions.cpp:159
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]() ◆ strip_leading_namespace()Strips namespace from the start of a string, or after "const". Definition at line 107 of file util_functions.cpp. Referenced by fix_type().
Here is the caller graph for this function:
![]() ◆ strip_parentheses()Strips leading and/or trailing parentheses from a string. Definition at line 133 of file util_functions.cpp. Referenced by Gambit::module_functor_common::makeBackendMatchingRule(), Gambit::module_functor_common::makeBackendOptionRule(), Gambit::module_functor_common::makeBackendRuleForModel(), Gambit::functor::setAllowedModelGroupCombo(), Gambit::module_functor_common::setBackendReq(), and Gambit::functor::setModelGroup().
Here is the caller graph for this function:
![]() ◆ strip_whitespace_except_after_const()Strip all whitespace except that following "const", in which case the whitespace is replaced by a single space. Strips all whitespaces from a string, but re-inserts a single regular space after "const". Definition at line 123 of file util_functions.cpp. Referenced by fix_type(), and Gambit::functor::setAllowedModelGroupCombo().
Here is the caller graph for this function:
![]() ◆ strtolower()
Convert a whole string to lowercase. Definition at line 217 of file util_functions.cpp. References b. ◆ typeEquivalencies()
Backend info accessor function. Type equivalency accessor function. Definition at line 25 of file equivalency_singleton.cpp. Referenced by Gambit::add_equivrelation(), and main().
Here is the caller graph for this function:
![]() ◆ unwrap()Unwrapper for passing std::function to GSL integrator Based on example from https://martin-ueding.de/articles/cpp-lambda-into-gsl/index.html. Definition at line 33 of file integration.cpp. Referenced by integrate_cquad().
Here is the caller graph for this function:
![]() Variable Documentation◆ buildtime_scratch
Return the path to the build-time scratch directory. Definition at line 70 of file util_functions.hpp. Referenced by Gambit::Scanner::Plugins::Plugin_Loader::Plugin_Loader(). ◆ whitespacesDefinition at line 55 of file util_functions.cpp. |