Empirical
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
emp Namespace Reference

If we are in emscripten, make sure to include the header. More...

Namespaces

 __impl_variadics_type_traits
 
 cl
 
 datastruct
 
 detail
 
 evo
 
 Grid
 
 internal
 
 pack
 
 serialize
 
 tools
 
 web
 

Classes

class  Action
 
class  Action< RETURN(ARGS...)>
 
class  Action< void(ARGS...)>
 
class  ActionBase
 
class  ActionManager
 
class  ActionSize
 
struct  AdaptFunction
 
struct  AlertObj
 
class  Angle
 
class  array
 
class  Author
 
class  AvidaCPU_Base
 
struct  AvidaCPU_InstLib
 
class  AvidaGP
 
class  AvidaHardware
 
class  BaseTrait
 
class  BatchConfig
 
class  Bibliography
 
class  BitMatrix
 A simple class to manage a COLS x ROWS matrix of bits. More...
 
class  BitSet
 
class  BitVector
 A drop-in replacement for std::vector<bool>, but with extra bitwise logic features. More...
 
class  Body2D_Base
 
class  Cache
 
class  ce_array
 
class  ce_array< T, 0 >
 
class  ce_array< T, 1 >
 
class  ce_string
 
class  Circle2D
 
class  CircleBody2D
 
class  Citation
 
class  ComboIDs
 
class  Config
 Master configuration class that manages all of the settings. More...
 
class  ConfigEntry
 Base class for all configuration settings. More...
 
class  ConfigLexer
 
class  ConfigManager
 
class  ConfigManager_Base
 
class  ConfigParser
 
class  ContainerDataFile
 
class  DataFile
 
class  DataInterface
 A generic interface to a DataNode (so that you don't need to know the node's exact type) More...
 
class  DataInterface_Impl
 
class  DataManager
 DataManagers handle sets of DataNode objects that all have the same tracking settings. More...
 
struct  DataModInfo
 
struct  DataModInfo< data::Archive >
 
struct  DataModInfo< data::FullRange >
 
struct  DataModInfo< data::Stats >
 
struct  DataModuleRequisiteAdd
 
struct  DataModuleRequisiteAdd< CUR_MOD, MODS... >
 
struct  DataModuleRequisiteAdd<>
 
class  DataNode
 
class  DataNode_Interface
 
class  DataNode_Interface< VAL_TYPE, IntPack< IMODS... > >
 Outermost interface to all DataNode modules. More...
 
class  DataNodeModule
 Generic form of DataNodeModule (should never be used; trigger error!) More...
 
class  DataNodeModule< VAL_TYPE >
 Base form of DataNodeModule (available in ALL data nodes.) More...
 
class  DataNodeModule< VAL_TYPE, data::Archive, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::Current, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::FullRange, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::Histogram, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::Info, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::Log, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::Pull, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::Range, MODS... >
 
class  DataNodeModule< VAL_TYPE, data::Stats, MODS... >
 
struct  DFAStatus
 Structure to track the current status of a DFA. More...
 
class  DynamicString
 
class  EventDrivenGP_AW
 A linear GP (inspired by AvidaGP) virtual hardware CPU that supports an event-driven programming paradigm. More...
 
class  EventLib
 
struct  ExceptInfo
 Information about an exception that has occured. More...
 
class  File
 A class to maintin files for loading, writing, storing, and easy access to components. More...
 
class  fixed
 
class  flex_function
 
class  flex_function< R(ARGS...)>
 
struct  FormatDataMods
 
class  Function
 
class  Function< RETURN(PARAMS...)>
 
struct  function_traits
 
struct  function_traits< ReturnType(ClassType::*)(Args...) const >
 
class  FunctionSet
 
class  FunctionSet< RETURN_T(ARGS...)>
 
class  FunctionSet< void(ARGS...)>
 A specialized version of FunctionSet for void functions. More...
 
class  GenericFunction
 
class  Graph
 A graph class that maintains a set of vertices (nodes) and edges (connecting pairs of nodes) More...
 
class  IndexMap
 
class  InstLib
 InstLib maintains a set of instructions for use in virtual hardware. More...
 
struct  Instruction
 A single instruction in a linear genome. More...
 
struct  IntPack
 
struct  IntPack< V1, Vs... >
 
struct  IntPack<>
 
struct  is_invocable
 
struct  is_ptr_type
 
struct  is_ptr_type< Ptr< T > >
 
struct  is_ptr_type< T * >
 
struct  is_ptr_type< T *const >
 
class  Lexer
 A lexer with a set of token types (and associated regular expressions) More...
 
class  LinearCode
 
class  Mancala
 
class  memo_function
 
class  memo_function< R(A1, A2, EXTRA...)>
 
class  memo_function< R(ARG)>
 
class  NKLandscape
 
class  NKLandscapeMemo
 
struct  null_t
 
class  OrgInterface
 
class  Othello8
 Class for size-8 othello games. More...
 
struct  Othello_Base
 Base class for all sizes of Othello games. More...
 
class  Othello_Game
 Class for othello games of a specific size. More...
 
class  Parser
 Full information about a parser, including a lexer, symbols, and rules. More...
 
struct  ParseRule
 A rule for how parsing should work. More...
 
struct  ParseSymbol
 A single symbol in a grammer including the patterns that generate it. More...
 
class  PayoffMatrix
 
class  Physics2D
 
class  Point2D
 
class  Processor
 
class  Ptr
 
struct  ptr_pair
 
struct  ptr_pair< const T, T >
 
struct  ptr_pair< T, const T >
 
struct  ptr_pair< T, T >
 
class  PtrInfo
 
class  PtrTracker
 Facilitate tracking of all Ptr objects in this run. More...
 
class  ra_set
 
class  Random
 A versatile and non-patterned pseudo-random-number generator (Mersenne Twister). More...
 
struct  RandomStdAdaptor
 This is an adaptor to make Random behave like a proper STL random number generator. More...
 
class  Range
 A range of values from a lower limit to and upper limit, of any provided type. More...
 
class  RawImage
 Fundamental information about a single image. More...
 
class  RegEx
 A basic regular expression handler. More...
 
struct  remove_ptr_type
 
struct  remove_ptr_type< Ptr< T > >
 
struct  remove_ptr_type< T * >
 
class  Resource
 
struct  run_and_ignore
 
class  Signal
 Generic version of Signals; needs specialization to a function type.. More...
 
class  Signal< RETURN(ARGS...)>
 
class  Signal< void(ARGS...)>
 Signals with void return. More...
 
class  SignalBase
 Base class for all signals. More...
 
class  SignalControl
 
class  SignalKey
 SignalKey tracks a specific function triggered by a signal. For now, its just a value pair. More...
 
class  SignalManager
 
class  SolveState
 
class  StateGrid
 A StateGrid describes a map of grid positions to the current state of each position. More...
 
class  StateGridInfo
 Full information about the states available in a state grid and meanings of each state. More...
 
class  StateGridStatus
 Information about a particular agent on a state grid. More...
 
class  Surface2D
 
class  Systematics
 A tool to track phylogenetic relationships among organisms. The systematics class tracks the relationships among all organisms based on the INFO_TYPE provided. If an offspring has the same value for INFO_TYPE as its parent, it is grouped into the same taxon. Otherwise a new Taxon is created and the old one is used as its parent in the phylogeny. If the provided INFO_TYPE is the organsism's genome, a traditional phylogeny is formed, with genotypes. If the organism's behavior/task set is used, then organisms are grouped by phenotypes. If the organsims's position is used, the evolutionary path through space is tracked. Any other aspect of organisms can be tracked this way as well. More...
 
class  SystematicsBase
 
class  Taxon
 A Taxon represents a type of organism in a phylogeny. More...
 
class  tDFA
 
struct  TemplateID
 
struct  tIntMath
 
struct  tIntMath< I >
 
class  tNFA
 A dynamic NFA class, for easily building non-determanistic finite automata. More...
 
class  tNFA_State
 Information about the current full state (i.e., set of legal states) of an NFA. More...
 
struct  Token
 Information about a token instance from an input stream. More...
 
struct  TokenInfo
 Information about an individual token type to be processed within a Lexer. More...
 
struct  TrackedType
 The base class of any type to be tracked. More...
 
class  Trait
 
class  TraitDef
 
struct  TraitKey
 
class  TraitManager
 
class  TraitSet
 A TraitSet houses a collection of traits and can trigger them to all be evaluated at once. More...
 
struct  TupleHash
 Setup tuples to be able to be used in hash tables. More...
 
struct  TypeID
 
struct  TypeID< bool >
 
struct  TypeID< char >
 
struct  TypeID< char16_t >
 
struct  TypeID< char32_t >
 
struct  TypeID< double >
 
struct  TypeID< emp::array< T, N > >
 Ensure that emp::array works with TypeID. More...
 
struct  TypeID< emp::TypePack< T, Ts... > >
 
struct  TypeID< emp::TypePack<> >
 
struct  TypeID< emp::vector< T, Ts... > >
 
struct  TypeID< float >
 
struct  TypeID< int16_t >
 
struct  TypeID< int32_t >
 
struct  TypeID< int64_t >
 
struct  TypeID< int8_t >
 
struct  TypeID< std::string >
 
struct  TypeID< T * >
 
struct  TypeID< TEMPLATE< Ts... > >
 
struct  TypeID< uint16_t >
 
struct  TypeID< uint32_t >
 
struct  TypeID< uint64_t >
 
struct  TypeID< uint8_t >
 
struct  TypeID< void >
 
struct  TypePack
 
struct  TypePack< T1, Ts... >
 
struct  TypePack<>
 
struct  TypeTracker
 
struct  TypeTracker_Class
 
class  UnorderedIndexMap
 
class  valsort_map
 
struct  variadic_concat
 
struct  variadic_concat< Variadic< A... >, Rest... >
 
struct  variadic_contains
 
struct  variadic_contains< Needle, Variadic< U... >, Cmp >
 
struct  variadic_filter
 
struct  variadic_filter< Variadic< U... >, Filter >
 
struct  variadic_index_of
 
struct  variadic_index_of< Needle, Haystack< U... >, Cmp >
 
struct  variadic_intersection
 
struct  variadic_intersection< Cmp, Variadic< U... > >
 
struct  variadic_intersection< Cmp, Variadic< U0... >, U1, U... >
 
struct  variadic_remove_duplicates
 
struct  variadic_remove_duplicates< Variadic< U... >, Cmp >
 
struct  variadic_union
 
struct  variadic_union< Cmp, Variadic< U... > >
 
struct  variadic_union< Cmp, Variadic< U0... >, U1, U... >
 
class  vector
 Build a debug wrapper emp::vector around std::vector. More...
 
class  vector< bool, Ts... >
 Build a specialized debug wrapper for emp::vector<bool> More...
 
class  WeightedGraph
 
class  World
 Setup a World with a population of organisms that can evolve or deal with ecological effects. More...
 
class  World_iterator
 
struct  World_MinDistInfo
 Build a class to track distances between organisms. More...
 
class  WorldPosition
 
class  WorldVector
 A vector that can be indexed with a WorldPosition. More...
 

Typedefs

template<typename RUN_T >
using BatchConfig = BatchConfig< RUN_T, RUN_T::config_t >
 
template<emp::data... MODS>
using ModPack = emp::IntPack<(int) MODS... >
 A shortcut for converting DataNode mod ID's to IntPacks. More...
 
template<typename T , emp::data... MODS>
using DataMonitor = DataNode< T, data::Current, data::Info, data::Range, data::Stats, MODS... >
 
template<typename T , emp::data... MODS>
using DataLog = DataNode< T, data::Current, data::Info, data::Log, MODS... >
 
template<typename T , emp::data... MODS>
using DataArchive = DataNode< T, data::Info, data::Archive, data::FullRange, MODS... >
 
template<typename ORG >
using find_genome_t = decltype(Org2Genome< ORG >(true))
 
using Othello = Othello_Game< 8 >
 
using Circle = Circle2D< double >
 
using Point = Point2D<>
 
using EventDrivenGP = EventDrivenGP_AW< 8 >
 A convenient shortcut for using EventDrivenGP_AW class with affinity width set to a default of 8. More...
 
template<int START, int END, int STEP = 1>
using IntPackRange = typename internal::ip_range<(START >=END), START, END, STEP >::type
 
template<typename T1 , typename... Ts>
using first_type = T1
 
template<typename T1 , typename T2 , typename... Ts>
using second_type = T2
 
template<typename T1 , typename T2 , typename T3 , typename... Ts>
using third_type = T3
 
template<size_t ID, typename... Ts>
using pack_id = typename internal::pack_id_impl< ID, Ts... >::type
 
template<typename... Ts>
using last_type = pack_id< sizeof...(Ts)-1, Ts... >
 
template<typename REAL_TYPE , typename EVAL_TYPE >
using sfinae_decoy = REAL_TYPE
 
template<typename REAL_TYPE , typename EVAL_TYPE >
using type_decoy = REAL_TYPE
 
template<typename EVAL_TYPE >
using bool_decoy = bool
 
template<typename EVAL_TYPE >
using int_decoy = int
 
template<typename T , typename... U>
using AdaptTemplate = typename internal::AdaptTemplateHelper< T, U... >::type
 
template<typename T , typename U >
using AdaptTemplate_Arg1 = typename internal::AdaptTemplateHelper_Arg1< T, U >::type
 
template<typename T , template< typename... > class FILTER>
using type_if = typename internal::EMP_eval_type< T, FILTER< T >::value >::type
 
template<typename T >
using remove_ptr_type_t = typename remove_ptr_type< T >::type
 
template<typename... Variadics>
using variadic_concat_t = typename variadic_concat< Variadics... >::type
 
template<typename Variadic , template< typename > class Filter>
using variadic_filter_t = typename variadic_filter< Variadic, Filter >::type
 
template<typename Variadic , template< typename, typename > class... Cmp>
using variadic_remove_duplicates_t = typename variadic_remove_duplicates< Variadic, Cmp... >::type
 
template<template< typename, typename > class Cmp, typename... U>
using variadic_union_t = typename variadic_union< Cmp, U... >::type
 
template<template< typename, typename > class Cmp, typename... U>
using variadic_intersection_t = typename variadic_intersection< Cmp, U... >::type
 
template<typename T , int N>
using TypePackFill = typename tp_pad< TypePack<>, T, N >::type
 
using DFA = tDFA< 128, uint8_t >
 Setup DFA to be a simple tDFA with the basic character set for symbols. More...
 
using NFA = tNFA< 128, uint8_t >
 NFA is the most standard tNFA setup. More...
 
using NFA_State = tNFA_State< 128, uint8_t >
 NFA_State is the most standard tNFA_State setup. More...
 

Enumerations

enum  PtrStatus { PtrStatus::DELETED =0, PtrStatus::ACTIVE, PtrStatus::ARRAY }
 
enum  data {
  data::Current, data::Info, data::Log, data::Archive,
  data::Range, data::FullRange, data::Histogram, data::Stats,
  data::Pull, data::SignalReset, data::SignalData, data::SignalDatum,
  data::SignalRange, data::SignalLimits, data::UNKNOWN
}
 A set of modifiers are available do describe DataNode. More...
 
enum  ScopeType {
  ScopeType::NONE =0, ScopeType::ROOT, ScopeType::BASIC, ScopeType::LOOP,
  ScopeType::FUNCTION
}
 

Functions

static const ExceptInfoGetEmptyExcept ()
 Function to generate an empty exception (returned when an exception is checked, but none exist.) More...
 
static std::multimap< std::string, ExceptInfo > & GetExceptMap ()
 A map of all exceptions that have occurred and are awaiting to be dealt with. More...
 
void TriggerExcept (const std::string &in_id, const std::string &in_desc, bool in_error=true)
 Provide information about an exception that needs to be triggered. More...
 
const ExceptInfoGetExcept (const std::string &id)
 Get the first waiting exception. More...
 
ExceptInfo PopExcept (const std::string &id)
 Get and remove a waiting exception. More...
 
size_t CountExcepts ()
 How many exceptions are waiting to be dealt with? More...
 
bool HasExcept ()
 Are any exceptions waiting? More...
 
bool HasExcept (const std::string &id)
 Are any exceptions of a particular type waiting? More...
 
void ClearExcepts ()
 Remove all waiting exceptions. More...
 
void ClearExcept (const std::string &id)
 Remove all waiting exceptions of the desginated type. More...
 
template<typename... Ts>
void Notify (Ts &&...args)
 Send information to a program user (via standard error in native mode, or alter in Emscripten) More...
 
template<typename... Ts>
void NotifyWarning (Ts &&...msg)
 End user has done something possibly a problem. More...
 
template<typename... Ts>
void NotifyError (Ts &&...msg)
 End user has done something resulting in an non-recoverable problem. More...
 
template<typename... Ts>
void LibraryWarning (Ts &&...msg)
 Library user has made an error in how they are using the library. More...
 
template<typename... Ts>
void LibraryError (Ts &&...msg)
 Library user has made an error in how they are using the library. More...
 
template<typename... Ts>
void InternalError (Ts &&...msg)
 Original library implementers must have made an error. More...
 
void SetPtrDebug (bool _d=true)
 
bool GetPtrDebug ()
 
template<typename T >
std::ostream & operator<< (std::ostream &out, const emp::Ptr< T > &ptr)
 
template<typename T , typename... Ts>
std::istream & operator>> (std::istream &is, emp::Ptr< T > &ptr)
 
template<typename T >
Ptr< T > ToPtr (T *_in, bool own=false)
 Convert a T* to a Ptr<T>. By default, don't track. More...
 
template<typename T >
Ptr< T > TrackPtr (T *_in, bool own=true)
 Convert a T* to a Ptr<T> that we DO track. More...
 
template<typename T , typename... ARGS>
Ptr< T > NewPtr (ARGS &&...args)
 Create a new Ptr of the target type; use the args in the constructor. More...
 
template<typename T >
Ptr< T > CopyPtr (Ptr< T > in)
 Copy an object pointed to and return a Ptr to the copy. More...
 
template<typename T >
emp::vector< Ptr< T > > CopyPtrs (const emp::vector< Ptr< T >> &in)
 Copy a vector of objects pointed to; return a vector of Ptrs to the new copies. More...
 
template<typename T >
emp::vector< Ptr< T > > ClonePtrs (const emp::vector< Ptr< T >> &in)
 Copy a vector of objects pointed to by using their Clone() member function; return vector. More...
 
template<typename T , typename... ARGS>
Ptr< T > NewArrayPtr (size_t array_size, ARGS &&...args)
 Create a pointer to an array of objects. More...
 
template<typename ForwardIterator , typename OutputIterator , typename RNG >
void sample_with_replacement (ForwardIterator first, ForwardIterator last, OutputIterator ofirst, OutputIterator olast, RNG rng)
 Draw a sample (with replacement) from an input range, copying to the output range. More...
 
template<typename RETURN , typename... ARGS>
auto make_action (const std::function< RETURN(ARGS...)> &in_fun, const std::string &name="")
 Build an action object using this function. More...
 
template<typename CONTAINER >
ContainerDataFile< CONTAINER > MakeContainerDataFile (std::function< CONTAINER(void)> fun, const std::string &filename, const std::string &b="", const std::string &s=",", const std::string &e="\n")
 
template<typename VAL_TYPE , emp::data... EXTRA>
DataInterfaceMakeDataInterface ()
 
template<typename ORG >
void ResourceSelect (World< ORG > &world, const emp::vector< std::function< double(const ORG &)> > &extra_funs, emp::vector< emp::Resource > &pools, size_t t_size, size_t tourny_count=1, double frac=.0025, double max_bonus=5, double cost=0, bool use_base=true)
 
template<typename taxon_t >
int LineageLength (Ptr< taxon_t > taxon)
 
template<typename taxon_t >
int CountMutSteps (Ptr< taxon_t > taxon, std::string type="substitution")
 
template<typename taxon_t >
int CountMutSteps (Ptr< taxon_t > taxon, emp::vector< std::string > types)
 
template<typename taxon_t >
int CountMuts (Ptr< taxon_t > taxon, std::string type="substitution")
 
template<typename taxon_t >
int CountMuts (Ptr< taxon_t > taxon, emp::vector< std::string > types)
 
template<typename taxon_t >
int CountDeleteriousSteps (Ptr< taxon_t > taxon)
 
template<typename taxon_t >
int CountPhenotypeChanges (Ptr< taxon_t > taxon)
 
template<typename taxon_t >
int CountUniquePhenotypes (Ptr< taxon_t > taxon)
 
template<typename WORLD_TYPE >
DataFileAddPhylodiversityFile (WORLD_TYPE &world, int systematics_id=0, const std::string &fpath="phylodiversity.csv")
 
template<typename WORLD_TYPE >
DataFileAddLineageMutationFile (WORLD_TYPE &world, int systematics_id=0, const std::string &fpath="lineage_mutations.csv", emp::vector< std::string > mut_types={"substitution"})
 
template<typename WORLD , typename ORG >
void SetDefaultFitFun (WORLD &world)
 
template<typename WORLD , typename ORG >
void SetDefaultMutFun (WORLD &world)
 
template<typename WORLD , typename ORG >
void SetDefaultPrintFun (WORLD &world)
 
template<typename WORLD , typename ORG >
void SetDefaultGetGenomeFun (WORLD &world)
 
template<typename ORG >
void EliteSelect (World< ORG > &world, size_t e_count=1, size_t copy_count=1)
 
template<typename ORG >
void RandomSelect (World< ORG > &world, size_t r_count=1, size_t copy_count=1)
 
template<typename ORG >
void TournamentSelect (World< ORG > &world, size_t t_size, size_t tourny_count=1)
 
template<typename ORG >
void RouletteSelect (World< ORG > &world, size_t count=1)
 
template<typename ORG >
void LexicaseSelect (World< ORG > &world, const emp::vector< std::function< double(ORG &)> > &fit_funs, size_t repro_count=1, size_t max_funs=0)
 
template<typename ORG >
void EcoSelect (World< ORG > &world, const emp::vector< std::function< double(ORG &)> > &extra_funs, const emp::vector< double > &pool_sizes, size_t t_size, size_t tourny_count=1)
 
template<typename ORG >
void EcoSelect (World< ORG > &world, const emp::vector< typename World< ORG >::fun_calc_fitness_t > &extra_funs, double pool_sizes, size_t t_size, size_t tourny_count=1)
 EcoSelect can be provided a single value if all pool sizes are identical. More...
 
template<typename ORG >
void SetPools (World< ORG > &world, size_t num_pools, size_t pool_size, bool synchronous_gen=false)
 
template<typename ORG >
void SetMapElites (World< ORG > &world, TraitSet< ORG > traits, const emp::vector< size_t > &trait_counts)
 
template<typename ORG >
void SetMapElites (World< ORG > &world, TraitSet< ORG > traits)
 
template<typename ORG >
void SetMapElites (World< ORG > &world, const emp::vector< size_t > &trait_counts)
 
template<typename ORG >
void SetMapElites (World< ORG > &world)
 
template<typename ORG >
void SetDiverseElites (World< ORG > &world, TraitSet< ORG > traits, size_t world_size)
 This first version will setup a Diverse-Elites world and specify traits to use. More...
 
template<typename ORG >
void SetDiverseElites (World< ORG > &world, size_t world_size)
 Setup a Diverse-Elites world, given the provided world already has set of phenotypes. More...
 
template<typename TEST >
constexpr bool has_type ()
 
template<typename TEST , typename FIRST , typename... OTHERS>
constexpr bool has_type ()
 
template<typename TEST >
constexpr size_t count_type ()
 
template<typename TEST , typename FIRST , typename... OTHERS>
constexpr size_t count_type ()
 
template<typename TEST_T , typename... Ts>
constexpr int get_type_index ()
 
template<typename TYPE1 >
constexpr bool has_unique_first_type ()
 
template<typename TYPE1 >
constexpr bool has_unique_types ()
 
template<typename TYPE1 , typename TYPE2 , typename... TYPE_LIST>
constexpr bool has_unique_first_type ()
 
template<typename TYPE1 , typename TYPE2 , typename... TYPE_LIST>
constexpr bool has_unique_types ()
 
template<template< typename... > class TEST, typename T >
constexpr bool test_type_exist ()
 
template<template< typename... > class TEST, typename T >
constexpr bool test_type_value ()
 
template<template< typename... > class TEST, typename T >
constexpr bool test_type ()
 
template<typename R , typename... PARAMS, typename... ARGS>
auto TruncateCall (std::function< R(PARAMS...)> fun, ARGS &&...args)
 
template<typename T >
std::size_t Hash (const T &x)
 
template<typename T >
std::size_t CombineHash (const T &x)
 
template<typename T1 , typename T2 , typename... EXTRA>
std::size_t CombineHash (const T1 &x1, const T2 &x2, const EXTRA &...x_extra)
 
template<typename Function >
function_traits< Function >::pointer to_function_pointer (Function &lambda)
 
template<typename Function >
function_traits< Function >::function to_function (Function &lambda)
 
template<typename RETURN , typename... FUN_ARGS, typename... CALL_ARGS>
auto SubsetCall (std::function< RETURN(FUN_ARGS...)> fun, CALL_ARGS...args) -> RETURN
 Identify the number of parameters in a function and pass in correct number of argument. More...
 
template<typename T >
constexpr bool is_ptr_type_v (const T &)
 
void Alert (const std::string &msg)
 
template<typename... TYPE_SET>
static void CappedAlert (size_t cap, TYPE_SET...inputs)
 A version of Alert that will cap how many times it can go off. More...
 
template<size_t NUM_BITS1, size_t NUM_BITS2>
BitSet< NUM_BITS1+NUM_BITS2 > join (const BitSet< NUM_BITS1 > &in1, const BitSet< NUM_BITS2 > &in2)
 
template<size_t NUM_BITS>
double SimpleMatchCoeff (const BitSet< NUM_BITS > &in1, const BitSet< NUM_BITS > &in2)
 Computes simple matching coefficient (https://en.wikipedia.org/wiki/Simple_matching_coefficient). More...
 
template<int NUM_BITS>
constexpr uint32_t UIntMaskFirst ()
 Create a series of a specified number of ones (at compile time) in a uint. More...
 
template<>
constexpr uint32_t UIntMaskFirst< 0 > ()
 Create an empty bit mask (all zeros) More...
 
constexpr size_t count_bits (uint64_t val)
 Count the number of bits in a 64-bit unsigned integer. More...
 
constexpr size_t count_bits (uint32_t val)
 Count the number of bits in a 32-bit unsigned integer. More...
 
constexpr size_t find_bit (const uint64_t &val)
 Return the position of the first one bit (in a 64-bit unsigned int) More...
 
constexpr size_t find_bit (const uint32_t &val)
 Return the position of the first one bit (in a 32-bit unsigned int) More...
 
template<typename T >
constexpr T MaxValue ()
 Determine the maximum value for any type. More...
 
template<typename T >
constexpr double InterpolateTable (T &&table, double pos, double tsize)
 The following function takes a table and a position [0.0, 1.0) and intepolates a value. More...
 
static void Depricated (const std::string &name, const std::string &desc="")
 Depricated() prints its contents exactly once to notify a user of a depricated function. More...
 
static double TimeFun (std::function< void()> test_fun)
 A function timer that takes a functor an identifies how long it takes to complete when run. More...
 
bool Toggle (bool &in_bool)
 Toggle an input bool. More...
 
constexpr bool AllTrue ()
 Combine bools to AND them all together. More...
 
template<typename... Ts>
bool AllTrue (bool result, Ts...OTHER)
 
constexpr bool AnyTrue ()
 Combine bools to OR them all together. More...
 
template<typename... Ts>
bool AnyTrue (bool result, Ts...OTHER)
 
template<typename T >
static emp::vector< T > BuildRange (T min, T max, T step=1)
 Build a vector with a range of values from min to max at the provided step size. More...
 
template<typename T , size_t N>
constexpr size_t GetSize (T(&)[N])
 Determine the size of a built-in array. More...
 
static size_t UniqueVal ()
 A function that will always return a unique value (and trip an assert if it can't...) More...
 
static std::string UniqueName (const std::string &prefix="", const std::string &postfix="")
 
Graph shuffle_graph (const Graph &in_graph, Random &random)
 
Graph build_graph_ring (size_t v_count, Random &random)
 Construct a graph where all vertics are degree two and form a single ring. More...
 
Graph build_graph_tree (size_t v_count, Random &random)
 
Graph build_graph_random (size_t v_count, size_t e_count, Random &random, bool connected=true)
 
Graph build_graph_grid (size_t width, size_t height, Random &random, double prob_use=1.0)
 Construct a graph with width x height vertices setup into a grid structure. More...
 
Graph build_graph_clique_set (size_t clique_size, size_t clique_count, Random &random, double extra_prob=0.5)
 
Graph build_graph_dag (size_t v_count, size_t e_count, Random &random, bool connected=true)
 
WeightedGraph build_weighted_graph_tree (size_t v_count, size_t min_weight, size_t max_weight, Random &random)
 
WeightedGraph build_weighted_graph_random (size_t v_count, size_t e_count, size_t min_weight, size_t max_weight, Random &random, bool connected=true)
 
Graph load_graph_sym (std::istream &is, bool sub1=false)
 
Graph load_graph_sym (std::string filename, bool sub1=false)
 Load a graph with a specified filename. More...
 
Graph load_graph_table (std::istream &is)
 
Graph load_graph_table (std::string filename)
 Load a graph from a connection matrix in a file by the specified name. More...
 
template<typename CONTAINER >
double Entropy (const CONTAINER &weights)
 Convert a vector of weights to probabilities and return the entropy of the system. More...
 
template<typename CONTAINER , typename WEIGHT_FUN >
double Entropy (const CONTAINER &objs, WEIGHT_FUN fun, double total=0.0)
 
constexpr double Entropy2 (const double p)
 Calculate the entropy when their are two possibile states based on one state's probability. More...
 
template<typename CONTAINER , typename CAT_FUN_X , typename CAT_FUN_Y , typename WEIGHT_FUN >
double Entropy (const CONTAINER &objs, CAT_FUN_X funX, CAT_FUN_Y funY, WEIGHT_FUN funW)
 
static const DFAto_DFA (const DFA &dfa)
 Converting DFA to DFA – no change needed. More...
 
static const NFAto_NFA (const NFA &nfa)
 Converting NFA to MFA – no change needed. More...
 
static DFA to_DFA (const NFA &nfa, int keep_invalid=false)
 Systematic conversion of NFA to DFA... More...
 
static NFA to_NFA (const DFA &dfa)
 Systematic up-conversion of DFA to NFA... More...
 
template<typename T1 >
static NFA MergeNFA (T1 &&in)
 Merge multiple automata into one NFA (base case, single converstion) More...
 
template<typename T1 , typename T2 , typename... Ts>
static NFA MergeNFA (T1 &&in1, T2 &&in2, Ts &&...others)
 Merge multiple automata (DFA, NFA, RegEx) into one NFA. More...
 
template<typename T1 , typename T2 , typename... Ts>
static DFA MergeDFA (T1 &&in1, T2 &&in2, Ts &&...others)
 Merge multiple automata (DFA, NFA, RegEx) into one DFA. More...
 
std::string FindExample (const DFA &dfa, const size_t min_size=1)
 Method to find an example string that satisfies a DFA. More...
 
template<class MAP_T , class KEY_T >
bool Has (const MAP_T &in_map, const KEY_T &key)
 Take any map type, and run find to determine if a key is present. More...
 
template<class MAP_T , class KEY_T >
auto Find (const MAP_T &in_map, const KEY_T &key, const typename MAP_T::mapped_type &dval)
 
template<class MAP_T , class KEY_T >
const auto & FindRef (const MAP_T &in_map, const KEY_T &key, const typename MAP_T::mapped_type &dval)
 
template<typename A , typename B >
constexpr std::pair< B, A > flip_pair (const std::pair< A, B > &p)
 Take an std::pair<A,B> and return the flipped pair std::pair<B,A> More...
 
template<typename A , typename B >
std::multimap< B, A > flip_map (const std::map< A, B > &src)
 Take an std::map<A,B> and return the flipped map (now multimap to be safe): std::multimap<B,A> More...
 
constexpr int Mod (int in_val, int mod_val)
 % is actually remainder; Mod is a proper modulus command that handles negative #'s correctly More...
 
double Mod (double in_val, double mod_val)
 Regular Mod doesn't work on doubles. Build one that does! More...
 
template<typename T >
constexpr T Abs (T in)
 Find the absolute value for any variable. More...
 
template<typename TYPE >
constexpr TYPE ToRange (const TYPE &value, const TYPE &in_min, const TYPE &in_max)
 Run both min and max on a value to put it into a desired range. More...
 
template<typename T >
constexpr T Min (T in1)
 Min of only one element is that element itself! More...
 
template<typename T , typename... Ts>
constexpr T Min (T in1, T in2, Ts...extras)
 Min of multiple elements is solved recursively. More...
 
template<typename T >
constexpr T Max (T in1)
 Max of only one element is that element itself! More...
 
template<typename T , typename... Ts>
constexpr T Max (T in1, T in2, Ts...extras)
 Max of multiple elements is solved recursively. More...
 
template<typename T >
constexpr const T & MinRef (const T &in1)
 
template<typename T , typename... Ts>
constexpr const T & MinRef (const T &in1, const T &in2, const Ts &...extras)
 MinRef of multiple elements returns reference to minimum value. More...
 
template<typename T >
constexpr const T & MaxRef (const T &in1)
 
template<typename T , typename... Ts>
constexpr const T & MaxRef (const T &in1, const T &in2, const Ts &...extras)
 MaxRef of multiple elements returns reference to maximum value. More...
 
static constexpr double Log2 (double x)
 Compile-time log base 2 calculator. More...
 
static constexpr double Log (double x, double base=10.0)
 Compile-time log calculator. More...
 
static constexpr double Ln (double x)
 Compile-time natural log calculator. More...
 
static constexpr double Log10 (double x)
 Compile-time log base 10 calculator. More...
 
template<typename T >
static constexpr T Square (T val)
 A simple function to square a value. More...
 
template<typename T >
static constexpr type_if< T, std::is_integral > Pow (T base, T p)
 A fast (O(log p)) integral-power command. More...
 
static constexpr double Pow2 (double exp)
 A fast 2^x command. More...
 
template<typename TYPE >
static constexpr TYPE IntPow (TYPE base, TYPE exp)
 A fast method for calculating exponents for int types. More...
 
static constexpr double Pow (double base, double exp)
 A fast method for calculating exponents on doubles. More...
 
static constexpr double Exp (double exp)
 A fast method of calculating e^x. More...
 
template<typename TYPE >
static constexpr int IntLog2 (TYPE x)
 A compile-time int-log calculator (aka, significant bits) More...
 
template<typename TYPE >
static constexpr int CountOnes (TYPE x)
 A compile-time bit counter. More...
 
template<typename TYPE >
static constexpr TYPE MaskLow (std::size_t num_bits)
 Quick bit-mask generator for low bits. More...
 
template<typename TYPE >
static constexpr TYPE MaskHigh (std::size_t num_bits)
 Quick bit-mask generator for high bits. More...
 
template<typename T >
constexpr const T & Min (const T &in1, const T &in2, const T &in3)
 Return the minimum of three values. More...
 
template<typename T >
const T & Min (std::initializer_list< const T & > lst)
 A version of Min that allows a variable number of inputs to be compared. More...
 
template<typename T >
const T & Max (std::initializer_list< const T & > lst)
 A version of Max that allows a variable number of inputs to be compared. More...
 
template<typename T >
void Shuffle (Random &random, emp::vector< T > &v, size_t max_count)
 
template<typename T >
void Shuffle (Random &random, emp::vector< T > &v)
 
emp::vector< size_t > GetPermutation (Random &random, size_t size)
 Return an emp::vector<int> numbered 0 through size-1 in a random order. More...
 
void Choose (Random &random, size_t N, size_t K, std::vector< size_t > &choices)
 Choose K positions from N possibilities. More...
 
std::vector< size_t > Choose (Random &random, size_t N, size_t K)
 
BitVector RandomBitVector (Random &random, size_t size, double p=0.5)
 Generate a random BitVector of the specified size. More...
 
emp::vector< double > RandomDoubleVector (Random &random, size_t size, double min, double max)
 Generate a random double vector in the specified range. More...
 
emp::vector< size_t > RandomUIntVector (Random &random, size_t size, size_t min, size_t max)
 Generate a random size_t vector in the specified range. More...
 
template<typename T >
emp::vector< T > RandomVector (Random &random, size_t size, T min, T max)
 Generate a random vector in the specified type and range. More...
 
void RandomizeBitVector (BitVector &bits, Random &random, double p=0.5)
 Generate a random BitVector of the specified size. More...
 
template<typename T >
void RandomizeVector (emp::vector< T > &vals, Random &random, T min, T max)
 Generate a random vector in the specified type and range. More...
 
template<typename T >
Range< T > MakeRange (T _l, T _u)
 Build a new range with auto-detected type. More...
 
Range< int > IntRange (int _l, int _u)
 Build a new range of type int. More...
 
Range< double > DRange (double _l, double _u)
 Build a new range of type double. More...
 
static NFA to_NFA (const RegEx &regex, size_t stop_id=1)
 Simple conversion of RegEx to NFA (mostly implemented in RegEx) More...
 
static DFA to_DFA (const RegEx &regex)
 Conversion of RegEx to DFA, via NFA intermediate. More...
 
template<typename TYPE >
size_t calc_hamming_distance (const TYPE &in1, const TYPE &in2, int offset=0)
 
template<typename TYPE >
size_t calc_edit_distance (const TYPE &in1, const TYPE &in2)
 
template<typename TYPE , typename GAP_TYPE >
size_t align (TYPE &in1, TYPE &in2, GAP_TYPE gap)
 
template<typename T >
void insert (std::set< T > &s1, const std::set< T > &s2)
 Insert the full contents of s2 into s1. More...
 
template<typename T , typename H >
bool Has (const std::set< T, H > &s, const T &val)
 Test if an std::set has a particular element without modifying the set in any way. More...
 
template<typename T , typename H >
bool Has (const std::multiset< T, H > &s, const T &val)
 Test if an std::multiset has a particular element without modifying the set in any way. More...
 
template<typename T , typename H >
bool Has (const std::unordered_set< T, H > &s, const T &val)
 Test if an std::unordered_set has a particular element without modifying the set in any way. More...
 
template<typename T , typename H >
bool Has (const std::unordered_multiset< T, H > &s, const T &val)
 Test if an std::unordere_multiset has a particular element without modifying the set in any way. More...
 
template<typename T >
std::set< T > difference (std::set< T > &s1, std::set< T > &s2)
 Compute the set difference of. More...
 
template<typename T >
std::set< T > difference (emp::vector< T > s1, emp::vector< T > &s2)
 Compute the set difference of. More...
 
template<typename T >
std::set< T > difference (std::set< T > &s1, emp::vector< T > s2)
 Compute the set difference of. More...
 
template<typename T >
std::set< T > difference (emp::vector< T > s1, std::set< T > &s2)
 Compute the set difference of. More...
 
template<typename T >
std::set< T > intersection (std::set< T > s1, std::set< T > s2)
 Compute the set intersection of. More...
 
template<typename T >
std::set< T > intersection (emp::vector< T > s1, emp::vector< T > s2)
 Compute the set intersection of. More...
 
template<typename T >
std::set< T > intersection (std::set< T > s1, emp::vector< T > s2)
 Compute the set intersection of. More...
 
template<typename T >
std::set< T > intersection (emp::vector< T > s1, std::set< T > s2)
 Compute the set intersection of. More...
 
template<typename T >
std::set< T > set_union (std::set< T > s1, std::set< T > s2)
 Compute the set union of. More...
 
template<typename T >
std::set< T > set_union (emp::vector< T > s1, emp::vector< T > s2)
 Compute the set union of. More...
 
template<typename T >
std::set< T > set_union (std::set< T > s1, emp::vector< T > s2)
 Compute the set union of. More...
 
template<typename T >
std::set< T > set_union (emp::vector< T > s1, std::set< T > s2)
 Compute the set union of. More...
 
template<typename T >
std::set< T > symmetric_difference (std::set< T > s1, std::set< T > s2)
 Compute the set symmetric_difference of. More...
 
template<typename T >
std::set< T > symmetric_difference (emp::vector< T > s1, emp::vector< T > s2)
 Compute the set symmetric_difference of. More...
 
template<typename T >
std::set< T > symmetric_difference (std::set< T > s1, emp::vector< T > s2)
 Compute the set symmetric_difference of. More...
 
template<typename T >
std::set< T > symmetric_difference (emp::vector< T > s1, std::set< T > s2)
 Compute the set symmetric_difference of. More...
 
template<typename C >
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename C::value_type >::value, typename C::value_type >::type Sum (C &elements)
 
template<typename C >
std::enable_if< emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename emp::remove_ptr_type< typename C::value_type >::type >::value, typename emp::remove_ptr_type< typename C::value_type >::type >::type Sum (C &elements)
 
template<typename C >
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value, double >::type ShannonEntropy (C &elements)
 Calculate Shannon Entropy of the members of the container passed. More...
 
template<typename C >
std::enable_if< emp::is_ptr_type< typename C::value_type >::value, double >::type ShannonEntropy (C &elements)
 Calculate Shannon Entropy of the members of the container when those members are pointers. More...
 
template<typename C >
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename C::value_type >::value, double >::type Variance (C &elements)
 
template<typename C >
std::enable_if< emp::is_ptr_type< typename C::value_type >::value &&std::is_scalar< typename emp::remove_ptr_type< typename C::value_type >::type >::value, double >::type Variance (C &elements)
 
template<typename C >
emp::sfinae_decoy< double, typename C::value_type > Mean (C &elements)
 
template<typename C >
emp::sfinae_decoy< double, typename C::value_type > StandardDeviation (C &elements)
 
template<typename C >
std::enable_if<!emp::is_ptr_type< typename C::value_type >::value, int >::type UniqueCount (C &elements)
 Count the number of unique elements in a container. More...
 
template<typename C >
std::enable_if< emp::is_ptr_type< typename C::value_type >::value, int >::type UniqueCount (C &elements)
 
template<typename C , typename RET_TYPE , typename ARG_TYPE >
RET_TYPE MaxResult (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements)
 Run the provided function on every member of a container and return the MAXIMUM result. More...
 
template<typename C , typename RET_TYPE , typename ARG_TYPE >
RET_TYPE MinResult (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements)
 Run the provided function on every member of a container and return the MINIMUM result. More...
 
template<typename C , typename RET_TYPE , typename ARG_TYPE >
std::enable_if< std::is_scalar< RET_TYPE >::value, double >::type MeanResult (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements)
 
template<typename C , typename RET_TYPE , typename ARG_TYPE >
emp::vector< RET_TYPE > ApplyFunction (std::function< RET_TYPE(ARG_TYPE)> &fun, C &elements)
 Run the provided function on every member of a container and return a vector of ALL results. More...
 
static const std::string & empty_string ()
 
static std::string to_escaped_string (char value)
 Convert a single chararcter to one that uses a proper escape sequence (in a string) if needed. More...
 
static std::string to_escaped_string (const std::string &value)
 Convert a full string to one that uses proper escape sequences, as needed. More...
 
template<typename LIT_TYPE >
std::string to_literal (const LIT_TYPE &value)
 Take a value and convert it to a C++-style literal. More...
 
static std::string to_literal (char value)
 Take a char and convert it to a C++-style literal. More...
 
static std::string to_literal (const std::string &value)
 Take a string and convert it to a C++-style literal. More...
 
static std::string to_upper (std::string value)
 Convert a string to all uppercase. More...
 
static std::string to_lower (std::string value)
 Convert a string to all lowercase. More...
 
static std::string to_roman_numeral (int val, const std::string &prefix="")
 
bool is_whitespace (char test_char)
 Determine if a character is whitespace. More...
 
bool is_upper_letter (char test_char)
 Determine if a character is an uppercase letter. More...
 
bool is_lower_letter (char test_char)
 Determine if a character is a lowercase letter. More...
 
bool is_letter (char test_char)
 Determine if a character is a letter of any kind. More...
 
bool is_digit (char test_char)
 Determine if a character is a digit. More...
 
bool is_alphanumeric (char test_char)
 Determine if a character is a letter or digit. More...
 
bool is_idchar (char test_char)
 Determine if a character is a letter, digit, or underscore. More...
 
static bool is_one_of (char test_char, const std::string &char_set)
 Determine if a character is in a set of characters (represented as a string) More...
 
static bool is_composed_of (const std::string &test_str, const std::string &char_set)
 Determine if a string is composed only of a set of characters (represented as a string) More...
 
bool has_whitespace (const std::string &test_str)
 Determine if there is whitespace anywhere in a string. More...
 
bool has_upper_letter (const std::string &test_str)
 Determine if there are any uppercase letters in a string. More...
 
bool has_lower_letter (const std::string &test_str)
 Determine if there are any lowercase letters in a string. More...
 
bool has_letter (const std::string &test_str)
 Determine if there are any letters in a string. More...
 
bool has_digit (const std::string &test_str)
 Determine if there are any digits in a string. More...
 
bool has_alphanumeric (const std::string &test_str)
 Determine if there are any letters or digits anywhere in a string. More...
 
bool has_idchar (const std::string &test_str)
 Determine if there are any letters, digit, or underscores anywhere in a string. More...
 
static bool has_one_of (const std::string &test_str, const std::string &char_set)
 Determine if a specified set of characters appears anywhere in a string. More...
 
bool is_valid (char test_char)
 If no functions are provided to is_valid(), always return false as base case. More...
 
template<typename... FUNS>
bool is_valid (char test_char, std::function< bool(char)> fun1, FUNS...funs)
 Determine if a character passes any of the test functions provided. More...
 
template<typename... FUNS>
static bool is_valid (const std::string &test_str, FUNS...funs)
 For a string to be valid, each character must pass at least one provided function. More...
 
static std::string string_pop_fixed (std::string &in_string, std::size_t end_pos, size_t delim_size=0)
 Pop a segment from the beginning of a string as another string, shortening original. More...
 
static std::string string_get_range (const std::string &in_string, std::size_t start_pos, std::size_t end_pos)
 Get a segment from the beginning of a string as another string, leaving original untouched. More...
 
std::string string_pop (std::string &in_string, const char delim=' ')
 
std::string string_get (const std::string &in_string, const char delim, size_t start_pos=0)
 
std::string string_pop (std::string &in_string, const std::string &delim_set)
 
std::string string_get (const std::string &in_string, const std::string &delim_set, size_t start_pos=0)
 
std::string string_pop_word (std::string &in_string)
 Remove a prefix of a string, up to the first whitespace, and return it. More...
 
std::string string_get_word (const std::string &in_string, size_t start_pos=0)
 Return a prefix of a string, up to the first whitespace (do not modify the original string) More...
 
std::string string_pop_line (std::string &in_string)
 Remove a prefix of a string, up to the first newline, and return it. More...
 
std::string string_get_line (const std::string &in_string, size_t start_pos=0)
 Return a prefix of a string, up to the first newline (do not modify the original string) More...
 
std::string left_justify (std::string &in_string)
 Remove all whitespace at the beginning of a string. Return the whitespace removed. More...
 
void right_justify (std::string &in_string)
 Remove all whitespace at the end of a string. More...
 
static void remove_chars (std::string &in_string, std::string chars)
 Remove instances of characters from file. More...
 
static void compress_whitespace (std::string &in_string)
 Every time one or more whitespace characters appear replace them with a single space. More...
 
static void remove_whitespace (std::string &in_string)
 Remove all whitespace from anywhere within a string. More...
 
static void remove_punctuation (std::string &in_string)
 Remove all characters from a string except letters, numbers, and whitespace. More...
 
static void slice (const std::string &in_string, emp::vector< std::string > &out_set, char delim='\n')
 Cut up a string based on the provided delimitor; fill them in to the provided vector. More...
 
static emp::vector< std::string > slice (const std::string &in_string, char delim='\n')
 Slice a string without passing in result vector (may be less efficient). More...
 
template<typename... ALL_TYPES>
std::string to_string (ALL_TYPES &&...all_values)
 
template<typename T >
from_string (const std::string &str)
 
template<typename... Ts>
void from_string (const std::string &str, Ts &...args)
 The from_string() function can also take multiple args instead of a return. More...
 
template<typename T >
emp::vector< T > from_strings (const emp::vector< std::string > &string_v)
 
template<typename TUPLE_T >
constexpr int tuple_size ()
 Quick way to calculate tuple size. More...
 
template<typename... Ts, int... Ps>
auto shuffle_tuple (const std::tuple< Ts... > &tup, IntPack< Ps... >)
 Reorganize the entries in tuple; the provided int pack must specify the new ordering. More...
 
template<typename FUN_T , typename TUPLE_T , int... N>
auto ApplyTuple (const FUN_T &fun, const TUPLE_T &tup, IntPack< N... >)
 
template<typename FUN_T , typename TUPLE_T >
auto ApplyTuple (const FUN_T &fun, const TUPLE_T &tup)
 Apply a tuple as arguments to a function, in order. More...
 
template<typename T >
int FindValue (const emp::vector< T > vec, const T &val, size_t start_pos=0)
 Return the first position of a value in a vector (or -1 if none exists) More...
 
template<typename T >
bool Has (const emp::vector< T > vec, const T &val)
 Return whether a value exists in a vector.s. More...
 
template<typename T >
void Print (const emp::vector< T > &v, std::ostream &os=std::cout, const std::string &spacer=" ")
 Print the contects of a vector. More...
 
template<typename T >
size_t FindIndex (const T &v, const std::function< bool(typename T::value_type, typename T::value_type)> &fun)
 
template<typename T >
size_t FindMinIndex (const T &v)
 Find the index with the minimal value (picks first in cases of a tie). More...
 
template<typename T >
size_t FindMaxIndex (const T &v)
 Find the index with the maximal value (picks first in cases of a tie). More...
 
template<typename T >
Sum (const emp::vector< T > &v)
 Sum up the contents of a vector. More...
 
template<typename T >
Product (const emp::vector< T > &v)
 Multiply all of the contents of a vector. More...
 
template<typename T , typename... Ts>
void Sort (emp::vector< T > &v, Ts...args)
 A quick shortcut for sorting a vector. More...
 
template<typename T >
emp::vector< T > Slice (emp::vector< T > vec, int start, int stop)
 
constexpr size_t tree_left (size_t id)
 Tree manipulation in vectors. More...
 
constexpr size_t tree_right (size_t id)
 
constexpr size_t tree_parent (size_t id)
 
template<typename T >
bool Heapify (emp::vector< T > &v, size_t id)
 Heapify an individual node in a vector. More...
 
template<typename T >
void Heapify (emp::vector< T > &v)
 Heapify all elements in a vector. More...
 
template<typename T >
HeapExtract (emp::vector< T > &v)
 Extraxt maximum element from a heap. More...
 
template<typename T >
void HeapInsert (emp::vector< T > &v, T val)
 Insert a new element into a heap. More...
 
std::string ColorHSL (double h, double s, double l)
 Generate a string to describe a JS color out of HSL values. More...
 
std::string ColorRGB (int r, int g, int b)
 Generate a string to describe a JS color out of RGB values. More...
 
std::string ColorRGB (int r, int g, int b, double a)
 Generate a string to describe a JS color with an alpha channel. More...
 
const emp::vector< std::string > & GetHueMap (size_t map_size, double min_h=0.0, double max_h=360.0, int s=100, int l=50)
 
emp::vector< std::string > GetHSLMap (size_t map_size, double min_h=0.0, double max_h=360.0, int min_s=100, int max_s=100, int min_l=50, int max_l=50)
 Generate a vector of color strings providing ranges of all of hue, satuation and luminosity. More...
 
static void DelayCall (const std::function< void()> &in_fun, int delay)
 Call a function after a specified amount of time. More...
 
static void OnResize (const std::function< void()> &in_fun)
 Provide a function to call whenever a window's size changes (no arguments). More...
 
static void OnResize (const std::function< void(int, int)> &in_fun)
 Provide a function to call whenever a window's size changes (new size as arguments) More...
 
double GetTime ()
 Get the current time, as provided by the web browser. More...
 
int GetWindowInnerWidth ()
 Determine with width of the current window. More...
 
int GetWindowInnerHeight ()
 Determine with height of the current window. More...
 
static void SetBackgroundColor (const std::string color)
 Set the background color of this web page. More...
 
static void SetColor (const std::string color)
 
static void SetCursor (const char *type)
 
static void OpenWindow (const std::string &url)
 
static std::string text2html (const std::string &text)
 
std::ofstream debug_file ("debug_file")
 
static bool Initialize ()
 Stub for when Emscripten is not in use. More...
 
static bool InitializeAnim ()
 Stub for when Emscripten is not in use. More...
 
std::map< std::string, std::string > get_type_to_string_map ()
 
template<typename C , class = typename C::value_type>
void pass_array_to_javascript (C values)
 
template<std::size_t SIZE, typename T >
void pass_array_to_cpp (emp::array< T, SIZE > &arr, bool recurse=false)
 
template<typename T >
void pass_vector_to_cpp (emp::vector< T > &arr, bool recurse=false)
 Same as pass_array_to_cpp, but lets you store values in a vector instead. More...
 

Variables

constexpr const int32_t sin_chart_1K []
 
constexpr const int32_t cos_chart_1K []
 
constexpr const int32_t tan_chart_1K []
 
template<typename Needle , typename Haystack , template< typename, typename > class... Cmp>
constexpr bool variadic_contains_v
 
template<typename Needle , typename Haystack , template< typename, typename > class... Cmp>
static constexpr auto variadic_index_of_v
 
constexpr size_t ByteCount [256]
 How many bits are set to one in each possible byte? More...
 
constexpr const double E = 2.71828
 e More...
 
constexpr const double PHI = 1.61803398874
 Golden ratio. More...
 
constexpr const double PI = 3.14159265358979
 pi More...
 
constexpr const double SQRT2 = 1.41421356237310
 sqrt(2) More...
 
constexpr const uint32_t MAX_BYTE = 255
 (2^8 - 1) More...
 
constexpr const uint32_t MAX_2BYTE = 65535
 (2^16 - 1) More...
 
constexpr const uint32_t MAX_WORD = 65535
 (2^16 - 1) More...
 
constexpr const uint32_t MAX_3BYTE = 16777215
 (2^24 - 1) More...
 
constexpr const uint32_t MAX_UINT = 4294967295
 (2^32 - 1) More...
 
constexpr const uint32_t MAX_4BYTE = 4294967295
 (2^32 - 1) More...
 
constexpr const int32_t MIN_INT = -2147483648
 (- 2^31) More...
 
constexpr const double log2_chart_1_2 []
 Large table to log base-2 results. More...
 
constexpr const double pow2_chart_bits []
 Table to provide results of Pow2 for values of bits (0.1, 0.01, 0.001, etc, in binary) More...
 
constexpr const double pow2_chart_0_1 []
 Table to provide results of Pow2 from 0 to 1. More...
 

Detailed Description

If we are in emscripten, make sure to include the header.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2018

This file contains extra analysis tools to use with systematics managers that have non-null DATA_TYPES.

Note
This file is part of Empirical, https://github.com/devosoft/Empirical
Date
2018

This file contains functions for adding additional data files to Worlds.

Typedef Documentation

template<typename T , typename... U>
using emp::AdaptTemplate = typedef typename internal::AdaptTemplateHelper<T, U...>::type
template<typename T , typename U >
using emp::AdaptTemplate_Arg1 = typedef typename internal::AdaptTemplateHelper_Arg1<T, U>::type
template<typename RUN_T >
using emp::BatchConfig = typedef BatchConfig<RUN_T, RUN_T::config_t>
template<typename EVAL_TYPE >
using emp::bool_decoy = typedef bool
using emp::Circle = typedef Circle2D<double>
template<typename T , emp::data... MODS>
using emp::DataArchive = typedef DataNode<T, data::Info, data::Archive, data::FullRange, MODS...>

A node that stores all data it recieves in an archive (vector of vectors). The inner vectors are groups of data that were recieved between resets. This node also keeps a record of the min, max, count, and total of each vector, so you don't have to recalculate it later. Additionally, it allows you to give it a name, description, and keyword.

template<typename T , emp::data... MODS>
using emp::DataLog = typedef DataNode<T, data::Current, data::Info, data::Log, MODS...>

A node that stores data about the most recent value it recieved, as well as all values it has recieved since the last reset. It also allows you to give it a name, description, and keyword.

template<typename T , emp::data... MODS>
using emp::DataMonitor = typedef DataNode<T, data::Current, data::Info, data::Range, data::Stats, MODS...>

A node that stores data about the most recent value it recieved, as well as the distribution (min, max, count, total, and mean) of values it has recieved since the last reset. It also allows you to give it a name, description, and keyword.

using emp::DFA = typedef tDFA<128, uint8_t>

Setup DFA to be a simple tDFA with the basic character set for symbols.

A convenient shortcut for using EventDrivenGP_AW class with affinity width set to a default of 8.

template<typename ORG >
using emp::find_genome_t = typedef decltype( Org2Genome<ORG>(true) )
template<typename T1 , typename... Ts>
using emp::first_type = typedef T1
template<typename EVAL_TYPE >
using emp::int_decoy = typedef int
template<int START, int END, int STEP = 1>
using emp::IntPackRange = typedef typename internal::ip_range<(START >= END), START, END, STEP>::type
template<typename... Ts>
using emp::last_type = typedef pack_id<sizeof...(Ts)-1,Ts...>
template<emp::data... MODS>
using emp::ModPack = typedef emp::IntPack<(int) MODS...>

A shortcut for converting DataNode mod ID's to IntPacks.

using emp::NFA = typedef tNFA<128, uint8_t>

NFA is the most standard tNFA setup.

using emp::NFA_State = typedef tNFA_State<128, uint8_t>

NFA_State is the most standard tNFA_State setup.

using emp::Othello = typedef Othello_Game<8>
template<size_t ID, typename... Ts>
using emp::pack_id = typedef typename internal::pack_id_impl<ID,Ts...>::type
using emp::Point = typedef Point2D<>
template<typename T >
using emp::remove_ptr_type_t = typedef typename remove_ptr_type<T>::type
template<typename T1 , typename T2 , typename... Ts>
using emp::second_type = typedef T2
template<typename REAL_TYPE , typename EVAL_TYPE >
using emp::sfinae_decoy = typedef REAL_TYPE
template<typename T1 , typename T2 , typename T3 , typename... Ts>
using emp::third_type = typedef T3
template<typename REAL_TYPE , typename EVAL_TYPE >
using emp::type_decoy = typedef REAL_TYPE
template<typename T , template< typename... > class FILTER>
using emp::type_if = typedef typename internal::EMP_eval_type< T, FILTER<T>::value >::type

A template for making a type exist if and only if it passes a template test. For example: type_if<T, std::is_integral> This becomes T if the type is integral; it's undefined otherwise.

template<typename T , int N>
using emp::TypePackFill = typedef typename tp_pad<TypePack<>,T,N>::type
template<typename... Variadics>
using emp::variadic_concat_t = typedef typename variadic_concat<Variadics...>::type
template<typename Variadic , template< typename > class Filter>
using emp::variadic_filter_t = typedef typename variadic_filter<Variadic, Filter>::type
template<template< typename, typename > class Cmp, typename... U>
using emp::variadic_intersection_t = typedef typename variadic_intersection<Cmp, U...>::type
template<typename Variadic , template< typename, typename > class... Cmp>
using emp::variadic_remove_duplicates_t = typedef typename variadic_remove_duplicates<Variadic, Cmp...>::type
template<template< typename, typename > class Cmp, typename... U>
using emp::variadic_union_t = typedef typename variadic_union<Cmp, U...>::type

Enumeration Type Documentation

enum emp::data
strong

A set of modifiers are available do describe DataNode.

Enumerator
Current 

Track most recent value.

Info 

Include information (name, keyword, description) for each instance.

Log 

Track all values since last Reset()

Archive 

Track Log + ALL values over time (with purge options)

Range 

Track min, max, mean, total.

FullRange 

Track Range data over time.

Histogram 

Keep a full histogram.

Stats 

Track Range + variance, standard deviation, skew, kertosis.

Pull 

Enable data collection on request.

Various signals are possible:

SignalReset 

Include a signal that triggers BEFORE Reset() to process data.

SignalData 

Include a signal when new data is added (as a group)

SignalDatum 

Include a signal when each datum is added.

SignalRange 

Include a signal for data in a range.

SignalLimits 

Include a signal for data OUTSIDE a range.

UNKNOWN 

Unknown modifier; will trigger error.

enum emp::PtrStatus
strong
Enumerator
DELETED 
ACTIVE 
ARRAY 
enum emp::ScopeType
strong

ScopeType is used for scopes that we need to do something special at the end. Eg: LOOP needs to go back to beginning of loop; FUNCTION needs to return to call.

Enumerator
NONE 
ROOT 
BASIC 
LOOP 
FUNCTION 

Function Documentation

template<typename T >
constexpr T emp::Abs ( in)

Find the absolute value for any variable.

template<typename WORLD_TYPE >
DataFile& emp::AddLineageMutationFile ( WORLD_TYPE &  world,
int  systematics_id = 0,
const std::string &  fpath = "lineage_mutations.csv",
emp::vector< std::string >  mut_types = {"substitution"} 
)
template<typename WORLD_TYPE >
DataFile& emp::AddPhylodiversityFile ( WORLD_TYPE &  world,
int  systematics_id = 0,
const std::string &  fpath = "phylodiversity.csv" 
)
void emp::Alert ( const std::string &  msg)

Send msg to cerr if in C++, or show msg in an alert box if compiled to Javascript Input can be any number of arguments of any types as long as the can be converted to strings with emp::to_string().

template<typename TYPE , typename GAP_TYPE >
size_t emp::align ( TYPE &  in1,
TYPE &  in2,
GAP_TYPE  gap 
)

Use edit distance to find the minimum number of insertions, deletions and substitutions to convert one array to another, and then insert gaps into the arrays appropriately.

constexpr bool emp::AllTrue ( )
inline

Combine bools to AND them all together.

template<typename... Ts>
bool emp::AllTrue ( bool  result,
Ts...  OTHER 
)
inline
constexpr bool emp::AnyTrue ( )
inline

Combine bools to OR them all together.

template<typename... Ts>
bool emp::AnyTrue ( bool  result,
Ts...  OTHER 
)
inline
template<typename C , typename RET_TYPE , typename ARG_TYPE >
emp::vector<RET_TYPE> emp::ApplyFunction ( std::function< RET_TYPE(ARG_TYPE)> &  fun,
C &  elements 
)

Run the provided function on every member of a container and return a vector of ALL results.

template<typename FUN_T , typename TUPLE_T , int... N>
auto emp::ApplyTuple ( const FUN_T &  fun,
const TUPLE_T &  tup,
IntPack< N... >   
)

Apply a tuple as arguments to a function, where all argument positions in function are specified with and IntPack

template<typename FUN_T , typename TUPLE_T >
auto emp::ApplyTuple ( const FUN_T &  fun,
const TUPLE_T &  tup 
)

Apply a tuple as arguments to a function, in order.

Graph emp::build_graph_clique_set ( size_t  clique_size,
size_t  clique_count,
Random random,
double  extra_prob = 0.5 
)

Build a set of cliques (such that one member of each can be part of an independent set) and then links them together

Graph emp::build_graph_dag ( size_t  v_count,
size_t  e_count,
Random random,
bool  connected = true 
)

Construct a random, graph with the specified number of vertices and edges. If connected is set, start by building a tree. Then connect random (unconnected) pairs of vertices until the proper number of edges are included.

Graph emp::build_graph_grid ( size_t  width,
size_t  height,
Random random,
double  prob_use = 1.0 
)

Construct a graph with width x height vertices setup into a grid structure.

Graph emp::build_graph_random ( size_t  v_count,
size_t  e_count,
Random random,
bool  connected = true 
)

Construct a random, graph with the specified number of vertices and edges. If connected is set, start by building a tree. Then connect random (unconnected) pairs of vertices until the proper number of edges are included.

Graph emp::build_graph_ring ( size_t  v_count,
Random random 
)

Construct a graph where all vertics are degree two and form a single ring.

Graph emp::build_graph_tree ( size_t  v_count,
Random random 
)

Construct a random tree graph (new vertices are repeatedly attached to a random position in a treee as it is constructed.)

WeightedGraph emp::build_weighted_graph_random ( size_t  v_count,
size_t  e_count,
size_t  min_weight,
size_t  max_weight,
Random random,
bool  connected = true 
)

Construct a random, WEIGHTED graph with the specified number of vertices, edges, and range of edge weights. If connected is set, start by building a tree. Then connect random (unconnected) pairs of vertices until the proper number of edges are included.

WeightedGraph emp::build_weighted_graph_tree ( size_t  v_count,
size_t  min_weight,
size_t  max_weight,
Random random 
)

Construct a random WEIGHTED tree graph (new vertices are repeatedly attached to a random position in a treee as it is constructed.)

template<typename T >
static emp::vector<T> emp::BuildRange ( min,
max,
step = 1 
)
inlinestatic

Build a vector with a range of values from min to max at the provided step size.

template<typename TYPE >
size_t emp::calc_edit_distance ( const TYPE &  in1,
const TYPE &  in2 
)

Edit distance is the minimum number of insertions, deletions and substitutions to convert one array to another.

template<typename TYPE >
size_t emp::calc_hamming_distance ( const TYPE &  in1,
const TYPE &  in2,
int  offset = 0 
)

Hamming distance is a simple count of substitutions needed to convert one array to another.

Parameters
in1The first sequence to compare.
in2The second sequence to compare.
offset(optional) Position in the first sequence to start the second sequence.
template<typename... TYPE_SET>
static void emp::CappedAlert ( size_t  cap,
TYPE_SET...  inputs 
)
static

A version of Alert that will cap how many times it can go off.

void emp::Choose ( Random random,
size_t  N,
size_t  K,
std::vector< size_t > &  choices 
)
inline

Choose K positions from N possibilities.

std::vector<size_t> emp::Choose ( Random random,
size_t  N,
size_t  K 
)
inline
void emp::ClearExcept ( const std::string &  id)
inline

Remove all waiting exceptions of the desginated type.

void emp::ClearExcepts ( )
inline

Remove all waiting exceptions.

template<typename T >
emp::vector<Ptr<T> > emp::ClonePtrs ( const emp::vector< Ptr< T >> &  in)

Copy a vector of objects pointed to by using their Clone() member function; return vector.

std::string emp::ColorHSL ( double  h,
double  s,
double  l 
)

Generate a string to describe a JS color out of HSL values.

std::string emp::ColorRGB ( int  r,
int  g,
int  b 
)

Generate a string to describe a JS color out of RGB values.

std::string emp::ColorRGB ( int  r,
int  g,
int  b,
double  a 
)

Generate a string to describe a JS color with an alpha channel.

template<typename T >
std::size_t emp::CombineHash ( const T &  x)
template<typename T1 , typename T2 , typename... EXTRA>
std::size_t emp::CombineHash ( const T1 &  x1,
const T2 &  x2,
const EXTRA &...  x_extra 
)
static void emp::compress_whitespace ( std::string &  in_string)
inlinestatic

Every time one or more whitespace characters appear replace them with a single space.

template<typename T >
Ptr<T> emp::CopyPtr ( Ptr< T >  in)

Copy an object pointed to and return a Ptr to the copy.

template<typename T >
emp::vector<Ptr<T> > emp::CopyPtrs ( const emp::vector< Ptr< T >> &  in)

Copy a vector of objects pointed to; return a vector of Ptrs to the new copies.

constexpr size_t emp::count_bits ( uint64_t  val)
inline

Count the number of bits in a 64-bit unsigned integer.

constexpr size_t emp::count_bits ( uint32_t  val)
inline

Count the number of bits in a 32-bit unsigned integer.

template<typename TEST >
constexpr size_t emp::count_type ( )
template<typename TEST , typename FIRST , typename... OTHERS>
constexpr size_t emp::count_type ( )
template<typename taxon_t >
int emp::CountDeleteriousSteps ( Ptr< taxon_t >  taxon)

Returns the total number of deleterious mutational steps that occurred along

Parameters
taxon's lineage. (a change from parent to child taxon counts as a single step, regardless of the number of mutations that happened at that time point)
size_t emp::CountExcepts ( )
inline

How many exceptions are waiting to be dealt with?

template<typename taxon_t >
int emp::CountMuts ( Ptr< taxon_t >  taxon,
std::string  type = "substitution" 
)

Returns the total number of mutations of type

Parameters
typethat occurred along
taxon's lineage.
template<typename taxon_t >
int emp::CountMuts ( Ptr< taxon_t >  taxon,
emp::vector< std::string >  types 
)

Returns the total number of mutations of type

Parameters
typethat occurred along
taxon's lineage.
template<typename taxon_t >
int emp::CountMutSteps ( Ptr< taxon_t >  taxon,
std::string  type = "substitution" 
)

Returns the total number of times a mutation of type

Parameters
typethat along
taxon's lineage. (Different from CountMuts in that CountMuts sums them whereas CountMutSteps would count two simultaneous mutations of the same type as one event)
template<typename taxon_t >
int emp::CountMutSteps ( Ptr< taxon_t >  taxon,
emp::vector< std::string >  types 
)

Returns the total number of times a mutation of type

Parameters
typethat along
taxon's lineage. (Different from CountMuts in that CountMuts sums them whereas CountMutSteps would count two simultaneous mutations of the same type as one event)
template<typename TYPE >
static constexpr int emp::CountOnes ( TYPE  x)
static

A compile-time bit counter.

template<typename taxon_t >
int emp::CountPhenotypeChanges ( Ptr< taxon_t >  taxon)

Returns the total number of changes in phenotype that occurred along

Parameters
taxon's lineage.
template<typename taxon_t >
int emp::CountUniquePhenotypes ( Ptr< taxon_t >  taxon)

Returns the total number of unique phenotypes that occurred along

Parameters
taxon's lineage.
std::ofstream emp::debug_file ( "debug_file"  )
static void emp::DelayCall ( const std::function< void()> &  in_fun,
int  delay 
)
static

Call a function after a specified amount of time.

static void emp::Depricated ( const std::string &  name,
const std::string &  desc = "" 
)
static

Depricated() prints its contents exactly once to notify a user of a depricated function.

template<typename T >
std::set<T> emp::difference ( std::set< T > &  s1,
std::set< T > &  s2 
)

Compute the set difference of.

Parameters
s1and
s2(elements that are in S1 but no S2)
template<typename T >
std::set<T> emp::difference ( emp::vector< T >  s1,
emp::vector< T > &  s2 
)

Compute the set difference of.

Parameters
s1and
s2(elements that are in S1 but no S2)
template<typename T >
std::set<T> emp::difference ( std::set< T > &  s1,
emp::vector< T >  s2 
)

Compute the set difference of.

Parameters
s1and
s2(elements that are in S1 but not S2)
template<typename T >
std::set<T> emp::difference ( emp::vector< T >  s1,
std::set< T > &  s2 
)

Compute the set difference of.

Parameters
s1and
s2(elements that are in S1 but no S2)
Range<double> emp::DRange ( double  _l,
double  _u 
)
inline

Build a new range of type double.

template<typename ORG >
void emp::EcoSelect ( World< ORG > &  world,
const emp::vector< std::function< double(ORG &)> > &  extra_funs,
const emp::vector< double > &  pool_sizes,
size_t  t_size,
size_t  tourny_count = 1 
)
template<typename ORG >
void emp::EcoSelect ( World< ORG > &  world,
const emp::vector< typename World< ORG >::fun_calc_fitness_t > &  extra_funs,
double  pool_sizes,
size_t  t_size,
size_t  tourny_count = 1 
)

EcoSelect can be provided a single value if all pool sizes are identical.

template<typename ORG >
void emp::EliteSelect ( World< ORG > &  world,
size_t  e_count = 1,
size_t  copy_count = 1 
)

==ELITE== Selection picks a set of the most fit individuals from the population to move to the next generation. Find top e_count individuals and make copy_count copies of each.

Parameters
worldThe emp::World object with the organisms to be selected.
e_countHow many distinct organisms should be chosen, starting from the most fit.
copy_countHow many copies should be made of each elite organism?
static const std::string& emp::empty_string ( )
inlinestatic

Return a const reference to an empty string. This function is useful to implement other functions that need to return a const reference for efficiency, but also need a null response.

template<typename CONTAINER >
double emp::Entropy ( const CONTAINER &  weights)

Convert a vector of weights to probabilities and return the entropy of the system.

template<typename CONTAINER , typename WEIGHT_FUN >
double emp::Entropy ( const CONTAINER &  objs,
WEIGHT_FUN  fun,
double  total = 0.0 
)

Calculate the entropy in a container of arbitrary objects. Args are a container, a function to extract the weight of each member, and an (optional) total weight.

template<typename CONTAINER , typename CAT_FUN_X , typename CAT_FUN_Y , typename WEIGHT_FUN >
double emp::Entropy ( const CONTAINER &  objs,
CAT_FUN_X  funX,
CAT_FUN_Y  funY,
WEIGHT_FUN  funW 
)

Conitional Entropy: H(X|Y) Allow for entropy of arbitrary objects with a converter.

constexpr double emp::Entropy2 ( const double  p)

Calculate the entropy when their are two possibile states based on one state's probability.

static constexpr double emp::Exp ( double  exp)
static

A fast method of calculating e^x.

template<class MAP_T , class KEY_T >
auto emp::Find ( const MAP_T &  in_map,
const KEY_T &  key,
const typename MAP_T::mapped_type &  dval 
)
inline

Take any map, run find() member function, and return the result found (or default value if no results found).

constexpr size_t emp::find_bit ( const uint64_t &  val)
inline

Return the position of the first one bit (in a 64-bit unsigned int)

constexpr size_t emp::find_bit ( const uint32_t &  val)
inline

Return the position of the first one bit (in a 32-bit unsigned int)

std::string emp::FindExample ( const DFA dfa,
const size_t  min_size = 1 
)

Method to find an example string that satisfies a DFA.

template<typename T >
size_t emp::FindIndex ( const T &  v,
const std::function< bool(typename T::value_type, typename T::value_type)> &  fun 
)

Find the index with the "optimal" value (picks first in cases of a tie).

Parameters
vAny object allowing indexing (e.g. vector, array, etc.)
funComparison function; returns true if the first value os more optimal than second.
template<typename T >
size_t emp::FindMaxIndex ( const T &  v)

Find the index with the maximal value (picks first in cases of a tie).

template<typename T >
size_t emp::FindMinIndex ( const T &  v)

Find the index with the minimal value (picks first in cases of a tie).

template<class MAP_T , class KEY_T >
const auto& emp::FindRef ( const MAP_T &  in_map,
const KEY_T &  key,
const typename MAP_T::mapped_type &  dval 
)
inline

Take any map and element, run find() member function, and return a reference to the result found (or default value if no results found).

template<typename T >
int emp::FindValue ( const emp::vector< T >  vec,
const T &  val,
size_t  start_pos = 0 
)

Return the first position of a value in a vector (or -1 if none exists)

template<typename A , typename B >
std::multimap<B,A> emp::flip_map ( const std::map< A, B > &  src)

Take an std::map<A,B> and return the flipped map (now multimap to be safe): std::multimap<B,A>

template<typename A , typename B >
constexpr std::pair<B,A> emp::flip_pair ( const std::pair< A, B > &  p)

Take an std::pair<A,B> and return the flipped pair std::pair<B,A>

template<typename T >
T emp::from_string ( const std::string &  str)
inline

This function tries to convert a string into any type you're looking for... You just need to specify the out type as the template argument.

template<typename... Ts>
void emp::from_string ( const std::string &  str,
Ts &...  args 
)
inline

The from_string() function can also take multiple args instead of a return.

template<typename T >
emp::vector<T> emp::from_strings ( const emp::vector< std::string > &  string_v)
inline

The from_strings() function takes a vector of strings and convets them into a vector of the appropriate type.

template<typename TEST_T , typename... Ts>
constexpr int emp::get_type_index ( )
std::map<std::string, std::string> emp::get_type_to_string_map ( )

This function returns a std::map mapping typeid names to the appropriate strings to describe those types in Javscript. This is useful when using getValue() from within EM_ASM macros.

For example, say we have a templated function that takes a pointer to type T. We find out the appropriate string for type T: std::map<const char*, std::string> type_map = GetTypeToStringMap(); std::string type_string = type_map[typeid(T).name()];

Now we can pass type_string.c_str() into EM_ASM_ARGS: `EM_ASM_ARGS({ var value = getValue($0, $1); }, pointer, type_string.c_str();`

static const ExceptInfo& emp::GetEmptyExcept ( )
static

Function to generate an empty exception (returned when an exception is checked, but none exist.)

const ExceptInfo& emp::GetExcept ( const std::string &  id)
inline

Get the first waiting exception.

static std::multimap<std::string, ExceptInfo>& emp::GetExceptMap ( )
static

A map of all exceptions that have occurred and are awaiting to be dealt with.

emp::vector<std::string> emp::GetHSLMap ( size_t  map_size,
double  min_h = 0.0,
double  max_h = 360.0,
int  min_s = 100,
int  max_s = 100,
int  min_l = 50,
int  max_l = 50 
)

Generate a vector of color strings providing ranges of all of hue, satuation and luminosity.

const emp::vector<std::string>& emp::GetHueMap ( size_t  map_size,
double  min_h = 0.0,
double  max_h = 360.0,
int  s = 100,
int  l = 50 
)

Generate a vector of color strings with a specified range of hues, and fixed satuation and luminosity,

emp::vector<size_t> emp::GetPermutation ( Random random,
size_t  size 
)
inline

Return an emp::vector<int> numbered 0 through size-1 in a random order.

bool emp::GetPtrDebug ( )
template<typename T , size_t N>
constexpr size_t emp::GetSize ( T(&)  [N])

Determine the size of a built-in array.

double emp::GetTime ( )
inline

Get the current time, as provided by the web browser.

int emp::GetWindowInnerHeight ( )
inline

Determine with height of the current window.

int emp::GetWindowInnerWidth ( )
inline

Determine with width of the current window.

template<class MAP_T , class KEY_T >
bool emp::Has ( const MAP_T &  in_map,
const KEY_T &  key 
)
inline

Take any map type, and run find to determine if a key is present.

template<typename T >
bool emp::Has ( const emp::vector< T >  vec,
const T &  val 
)

Return whether a value exists in a vector.s.

template<typename T , typename H >
bool emp::Has ( const std::set< T, H > &  s,
const T &  val 
)

Test if an std::set has a particular element without modifying the set in any way.

template<typename T , typename H >
bool emp::Has ( const std::multiset< T, H > &  s,
const T &  val 
)

Test if an std::multiset has a particular element without modifying the set in any way.

template<typename T , typename H >
bool emp::Has ( const std::unordered_set< T, H > &  s,
const T &  val 
)

Test if an std::unordered_set has a particular element without modifying the set in any way.

template<typename T , typename H >
bool emp::Has ( const std::unordered_multiset< T, H > &  s,
const T &  val 
)

Test if an std::unordere_multiset has a particular element without modifying the set in any way.

bool emp::has_alphanumeric ( const std::string &  test_str)
inline

Determine if there are any letters or digits anywhere in a string.

bool emp::has_digit ( const std::string &  test_str)
inline

Determine if there are any digits in a string.

bool emp::has_idchar ( const std::string &  test_str)
inline

Determine if there are any letters, digit, or underscores anywhere in a string.

bool emp::has_letter ( const std::string &  test_str)
inline

Determine if there are any letters in a string.

bool emp::has_lower_letter ( const std::string &  test_str)
inline

Determine if there are any lowercase letters in a string.

static bool emp::has_one_of ( const std::string &  test_str,
const std::string &  char_set 
)
inlinestatic

Determine if a specified set of characters appears anywhere in a string.

template<typename TEST >
constexpr bool emp::has_type ( )
template<typename TEST , typename FIRST , typename... OTHERS>
constexpr bool emp::has_type ( )
template<typename TYPE1 >
constexpr bool emp::has_unique_first_type ( )
template<typename TYPE1 , typename TYPE2 , typename... TYPE_LIST>
constexpr bool emp::has_unique_first_type ( )
template<typename TYPE1 >
constexpr bool emp::has_unique_types ( )
template<typename TYPE1 , typename TYPE2 , typename... TYPE_LIST>
constexpr bool emp::has_unique_types ( )
bool emp::has_upper_letter ( const std::string &  test_str)
inline

Determine if there are any uppercase letters in a string.

bool emp::has_whitespace ( const std::string &  test_str)
inline

Determine if there is whitespace anywhere in a string.

bool emp::HasExcept ( )
inline

Are any exceptions waiting?

bool emp::HasExcept ( const std::string &  id)
inline

Are any exceptions of a particular type waiting?

template<typename T >
std::size_t emp::Hash ( const T &  x)
template<typename T >
T emp::HeapExtract ( emp::vector< T > &  v)

Extraxt maximum element from a heap.

template<typename T >
bool emp::Heapify ( emp::vector< T > &  v,
size_t  id 
)

Heapify an individual node in a vector.

template<typename T >
void emp::Heapify ( emp::vector< T > &  v)

Heapify all elements in a vector.

template<typename T >
void emp::HeapInsert ( emp::vector< T > &  v,
val 
)

Insert a new element into a heap.

static bool emp::Initialize ( )
static

Stub for when Emscripten is not in use.

static bool emp::InitializeAnim ( )
static

Stub for when Emscripten is not in use.

template<typename T >
void emp::insert ( std::set< T > &  s1,
const std::set< T > &  s2 
)

Insert the full contents of s2 into s1.

template<typename... Ts>
void emp::InternalError ( Ts &&...  msg)

Original library implementers must have made an error.

template<typename T >
constexpr double emp::InterpolateTable ( T &&  table,
double  pos,
double  tsize 
)

The following function takes a table and a position [0.0, 1.0) and intepolates a value.

template<typename T >
std::set<T> emp::intersection ( std::set< T >  s1,
std::set< T >  s2 
)

Compute the set intersection of.

Parameters
s1and
s2(elements that are in both S1 and S2)
template<typename T >
std::set<T> emp::intersection ( emp::vector< T >  s1,
emp::vector< T >  s2 
)

Compute the set intersection of.

Parameters
s1and
s2(elements that are in both S1 and S2)
template<typename T >
std::set<T> emp::intersection ( std::set< T >  s1,
emp::vector< T >  s2 
)

Compute the set intersection of.

Parameters
s1and
s2(elements that are in both S1 and S2)
template<typename T >
std::set<T> emp::intersection ( emp::vector< T >  s1,
std::set< T >  s2 
)

Compute the set intersection of.

Parameters
s1and
s2(elements that are in both S1 and S2)
template<typename TYPE >
static constexpr int emp::IntLog2 ( TYPE  x)
static

A compile-time int-log calculator (aka, significant bits)

template<typename TYPE >
static constexpr TYPE emp::IntPow ( TYPE  base,
TYPE  exp 
)
static

A fast method for calculating exponents for int types.

Range<int> emp::IntRange ( int  _l,
int  _u 
)
inline

Build a new range of type int.

bool emp::is_alphanumeric ( char  test_char)
inline

Determine if a character is a letter or digit.

static bool emp::is_composed_of ( const std::string &  test_str,
const std::string &  char_set 
)
inlinestatic

Determine if a string is composed only of a set of characters (represented as a string)

bool emp::is_digit ( char  test_char)
inline

Determine if a character is a digit.

bool emp::is_idchar ( char  test_char)
inline

Determine if a character is a letter, digit, or underscore.

bool emp::is_letter ( char  test_char)
inline

Determine if a character is a letter of any kind.

bool emp::is_lower_letter ( char  test_char)
inline

Determine if a character is a lowercase letter.

static bool emp::is_one_of ( char  test_char,
const std::string &  char_set 
)
inlinestatic

Determine if a character is in a set of characters (represented as a string)

template<typename T >
constexpr bool emp::is_ptr_type_v ( const T &  )
bool emp::is_upper_letter ( char  test_char)
inline

Determine if a character is an uppercase letter.

bool emp::is_valid ( char  test_char)
inline

If no functions are provided to is_valid(), always return false as base case.

template<typename... FUNS>
bool emp::is_valid ( char  test_char,
std::function< bool(char)>  fun1,
FUNS...  funs 
)
inline

Determine if a character passes any of the test functions provided.

template<typename... FUNS>
static bool emp::is_valid ( const std::string &  test_str,
FUNS...  funs 
)
inlinestatic

For a string to be valid, each character must pass at least one provided function.

bool emp::is_whitespace ( char  test_char)
inline

Determine if a character is whitespace.

template<size_t NUM_BITS1, size_t NUM_BITS2>
BitSet<NUM_BITS1+NUM_BITS2> emp::join ( const BitSet< NUM_BITS1 > &  in1,
const BitSet< NUM_BITS2 > &  in2 
)
std::string emp::left_justify ( std::string &  in_string)
inline

Remove all whitespace at the beginning of a string. Return the whitespace removed.

template<typename ORG >
void emp::LexicaseSelect ( World< ORG > &  world,
const emp::vector< std::function< double(ORG &)> > &  fit_funs,
size_t  repro_count = 1,
size_t  max_funs = 0 
)

==LEXICASE== Selection runs through multiple fitness functions in a random order for EACH offspring produced.

Parameters
worldThe emp::World object with the organisms to be selected.
fit_funsThe set of fitness functions to shuffle for each organism reproduced.
repro_countHow many rounds of repliction should we do. (default 1)
max_funsThe maximum number of fitness functions to use. (use 0 for all; default)
template<typename... Ts>
void emp::LibraryError ( Ts &&...  msg)

Library user has made an error in how they are using the library.

template<typename... Ts>
void emp::LibraryWarning ( Ts &&...  msg)

Library user has made an error in how they are using the library.

template<typename taxon_t >
int emp::LineageLength ( Ptr< taxon_t >  taxon)

Returns the total number of times a mutation of type

Parameters
typethat along
taxon's lineage. (Different from CountMuts in that CountMuts sums them whereas CountMutSteps would count two simultaneous mutations of the same type as one event)
static constexpr double emp::Ln ( double  x)
static

Compile-time natural log calculator.

Graph emp::load_graph_sym ( std::istream &  is,
bool  sub1 = false 
)

Helper function for loading symetric graphs from an input stream. sub1 indicates that verticies are numbered 1 to N instead of 0 to N-1.

Graph emp::load_graph_sym ( std::string  filename,
bool  sub1 = false 
)

Load a graph with a specified filename.

Graph emp::load_graph_table ( std::istream &  is)

Load a graph from a connection matrix. Format: #vertices followed by v^2 0's or 1's

Graph emp::load_graph_table ( std::string  filename)

Load a graph from a connection matrix in a file by the specified name.

static constexpr double emp::Log ( double  x,
double  base = 10.0 
)
static

Compile-time log calculator.

static constexpr double emp::Log10 ( double  x)
static

Compile-time log base 10 calculator.

static constexpr double emp::Log2 ( double  x)
static

Compile-time log base 2 calculator.

template<typename RETURN , typename... ARGS>
auto emp::make_action ( const std::function< RETURN(ARGS...)> &  in_fun,
const std::string &  name = "" 
)

Build an action object using this function.

template<typename CONTAINER >
ContainerDataFile<CONTAINER> emp::MakeContainerDataFile ( std::function< CONTAINER(void)>  fun,
const std::string &  filename,
const std::string &  b = "",
const std::string &  s = ",",
const std::string &  e = "\n" 
)

Convenience function for building a container data file.

Parameters
funis the function to call to update the container
template<typename VAL_TYPE , emp::data... EXTRA>
DataInterface* emp::MakeDataInterface ( )
template<typename T >
Range<T> emp::MakeRange ( _l,
_u 
)

Build a new range with auto-detected type.

template<typename TYPE >
static constexpr TYPE emp::MaskHigh ( std::size_t  num_bits)
static

Quick bit-mask generator for high bits.

template<typename TYPE >
static constexpr TYPE emp::MaskLow ( std::size_t  num_bits)
static

Quick bit-mask generator for low bits.

template<typename T >
constexpr T emp::Max ( in1)

Max of only one element is that element itself!

template<typename T , typename... Ts>
constexpr T emp::Max ( in1,
in2,
Ts...  extras 
)

Max of multiple elements is solved recursively.

template<typename T >
const T& emp::Max ( std::initializer_list< const T & >  lst)

A version of Max that allows a variable number of inputs to be compared.

template<typename T >
constexpr const T& emp::MaxRef ( const T &  in1)

MaxRef works like Max, but never copies any inputs; always treats as references. MaxRef of only one element returns reference to that element itself!

template<typename T , typename... Ts>
constexpr const T& emp::MaxRef ( const T &  in1,
const T &  in2,
const Ts &...  extras 
)

MaxRef of multiple elements returns reference to maximum value.

template<typename C , typename RET_TYPE , typename ARG_TYPE >
RET_TYPE emp::MaxResult ( std::function< RET_TYPE(ARG_TYPE)> &  fun,
C &  elements 
)

Run the provided function on every member of a container and return the MAXIMUM result.

template<typename T >
constexpr T emp::MaxValue ( )

Determine the maximum value for any type.

template<typename C >
emp::sfinae_decoy<double, typename C::value_type> emp::Mean ( C &  elements)

Calculate the mean of the values in a container If values are pointers, they will be automatically de-referenced Values must be numeric.

template<typename C , typename RET_TYPE , typename ARG_TYPE >
std::enable_if<std::is_scalar<RET_TYPE>::value, double>::type emp::MeanResult ( std::function< RET_TYPE(ARG_TYPE)> &  fun,
C &  elements 
)

Run the provided function on every member of a container and return the AVERAGE result. Function must return a scalar (i.e. numeric) type.

template<typename T1 , typename T2 , typename... Ts>
static DFA emp::MergeDFA ( T1 &&  in1,
T2 &&  in2,
Ts &&...  others 
)
static

Merge multiple automata (DFA, NFA, RegEx) into one DFA.

template<typename T1 >
static NFA emp::MergeNFA ( T1 &&  in)
static

Merge multiple automata into one NFA (base case, single converstion)

template<typename T1 , typename T2 , typename... Ts>
static NFA emp::MergeNFA ( T1 &&  in1,
T2 &&  in2,
Ts &&...  others 
)
static

Merge multiple automata (DFA, NFA, RegEx) into one NFA.

template<typename T >
constexpr T emp::Min ( in1)

Min of only one element is that element itself!

template<typename T , typename... Ts>
constexpr T emp::Min ( in1,
in2,
Ts...  extras 
)

Min of multiple elements is solved recursively.

template<typename T >
constexpr const T& emp::Min ( const T &  in1,
const T &  in2,
const T &  in3 
)

Return the minimum of three values.

template<typename T >
const T& emp::Min ( std::initializer_list< const T & >  lst)

A version of Min that allows a variable number of inputs to be compared.

template<typename T >
constexpr const T& emp::MinRef ( const T &  in1)

MinRef works like Min, but never copies any inputs; always treats as references. MinRef of only one element returns reference to that element itself!

template<typename T , typename... Ts>
constexpr const T& emp::MinRef ( const T &  in1,
const T &  in2,
const Ts &...  extras 
)

MinRef of multiple elements returns reference to minimum value.

template<typename C , typename RET_TYPE , typename ARG_TYPE >
RET_TYPE emp::MinResult ( std::function< RET_TYPE(ARG_TYPE)> &  fun,
C &  elements 
)

Run the provided function on every member of a container and return the MINIMUM result.

constexpr int emp::Mod ( int  in_val,
int  mod_val 
)
inline

% is actually remainder; Mod is a proper modulus command that handles negative #'s correctly

double emp::Mod ( double  in_val,
double  mod_val 
)
inline

Regular Mod doesn't work on doubles. Build one that does!

template<typename T , typename... ARGS>
Ptr<T> emp::NewArrayPtr ( size_t  array_size,
ARGS &&...  args 
)

Create a pointer to an array of objects.

template<typename T , typename... ARGS>
Ptr<T> emp::NewPtr ( ARGS &&...  args)

Create a new Ptr of the target type; use the args in the constructor.

template<typename... Ts>
void emp::Notify ( Ts &&...  args)

Send information to a program user (via standard error in native mode, or alter in Emscripten)

template<typename... Ts>
void emp::NotifyError ( Ts &&...  msg)

End user has done something resulting in an non-recoverable problem.

template<typename... Ts>
void emp::NotifyWarning ( Ts &&...  msg)

End user has done something possibly a problem.

static void emp::OnResize ( const std::function< void()> &  in_fun)
static

Provide a function to call whenever a window's size changes (no arguments).

static void emp::OnResize ( const std::function< void(int, int)> &  in_fun)
static

Provide a function to call whenever a window's size changes (new size as arguments)

static void emp::OpenWindow ( const std::string &  url)
static
template<typename T >
std::ostream& emp::operator<< ( std::ostream &  out,
const emp::Ptr< T > &  ptr 
)
template<typename T , typename... Ts>
std::istream& emp::operator>> ( std::istream &  is,
emp::Ptr< T > &  ptr 
)
template<std::size_t SIZE, typename T >
void emp::pass_array_to_cpp ( emp::array< T, SIZE > &  arr,
bool  recurse = false 
)

This function lets you pass an array from javascript to C++! It takes a reference to the array as an argument and populates it with the contents of emp.__outgoing_array.

Currently accepts arrays of ints, floats, doubles, chars, and std::strings The size of the passed array must be equal to the size of the array stored in emp.__outgoing_array

template<typename C , class = typename C::value_type>
void emp::pass_array_to_javascript ( values)

This function can be called to pass an array, vector, or other container with contiguously stored data into Javascript. The array will be stored in emp.__incoming_array. Currently supports arrays containing all of the types defined in get_type_to_string_map, which are also all of the types that emscripten supports getting via pointer. This function also supports nested arrays, and arrays of objects created with introspective tuple structs.

template<typename T >
void emp::pass_vector_to_cpp ( emp::vector< T > &  arr,
bool  recurse = false 
)

Same as pass_array_to_cpp, but lets you store values in a vector instead.

ExceptInfo emp::PopExcept ( const std::string &  id)
inline

Get and remove a waiting exception.

template<typename T >
static constexpr type_if<T, std::is_integral> emp::Pow ( base,
p 
)
static

A fast (O(log p)) integral-power command.

static constexpr double emp::Pow ( double  base,
double  exp 
)
static

A fast method for calculating exponents on doubles.

static constexpr double emp::Pow2 ( double  exp)
static

A fast 2^x command.

template<typename T >
void emp::Print ( const emp::vector< T > &  v,
std::ostream &  os = std::cout,
const std::string &  spacer = " " 
)

Print the contects of a vector.

template<typename T >
T emp::Product ( const emp::vector< T > &  v)

Multiply all of the contents of a vector.

BitVector emp::RandomBitVector ( Random random,
size_t  size,
double  p = 0.5 
)
inline

Generate a random BitVector of the specified size.

emp::vector<double> emp::RandomDoubleVector ( Random random,
size_t  size,
double  min,
double  max 
)
inline

Generate a random double vector in the specified range.

void emp::RandomizeBitVector ( BitVector bits,
Random random,
double  p = 0.5 
)
inline

Generate a random BitVector of the specified size.

template<typename T >
void emp::RandomizeVector ( emp::vector< T > &  vals,
Random random,
min,
max 
)
inline

Generate a random vector in the specified type and range.

template<typename ORG >
void emp::RandomSelect ( World< ORG > &  world,
size_t  r_count = 1,
size_t  copy_count = 1 
)

==RANDOM== Selection picks an organism with uniform-random probability form the populaiton.

Parameters
worldThe emp::World object with the organisms to be selected.
r_countHow many distinct organisms should be chosen?
copy_countHow many copies should be made of each chosen organism?
emp::vector<size_t> emp::RandomUIntVector ( Random random,
size_t  size,
size_t  min,
size_t  max 
)
inline

Generate a random size_t vector in the specified range.

template<typename T >
emp::vector<T> emp::RandomVector ( Random random,
size_t  size,
min,
max 
)
inline

Generate a random vector in the specified type and range.

static void emp::remove_chars ( std::string &  in_string,
std::string  chars 
)
inlinestatic

Remove instances of characters from file.

static void emp::remove_punctuation ( std::string &  in_string)
inlinestatic

Remove all characters from a string except letters, numbers, and whitespace.

static void emp::remove_whitespace ( std::string &  in_string)
inlinestatic

Remove all whitespace from anywhere within a string.

template<typename ORG >
void emp::ResourceSelect ( World< ORG > &  world,
const emp::vector< std::function< double(const ORG &)> > &  extra_funs,
emp::vector< emp::Resource > &  pools,
size_t  t_size,
size_t  tourny_count = 1,
double  frac = .0025,
double  max_bonus = 5,
double  cost = 0,
bool  use_base = true 
)
void emp::right_justify ( std::string &  in_string)
inline

Remove all whitespace at the end of a string.

template<typename ORG >
void emp::RouletteSelect ( World< ORG > &  world,
size_t  count = 1 
)

==ROULETTE== Selection (aka Fitness-Proportional Selection) chooses organisms to reproduce based on their current fitness.

Parameters
worldThe emp::World object with the organisms to be selected.
countHow many organims should be selected for replication? (with replacement)
template<typename ForwardIterator , typename OutputIterator , typename RNG >
void emp::sample_with_replacement ( ForwardIterator  first,
ForwardIterator  last,
OutputIterator  ofirst,
OutputIterator  olast,
RNG  rng 
)

Draw a sample (with replacement) from an input range, copying to the output range.

Draw a sample (with replacement) from an input range, copying to the output range.

template<typename T >
std::set<T> emp::set_union ( std::set< T >  s1,
std::set< T >  s2 
)

Compute the set union of.

Parameters
s1and
s2(elements that are in either S1 or S2)
template<typename T >
std::set<T> emp::set_union ( emp::vector< T >  s1,
emp::vector< T >  s2 
)

Compute the set union of.

Parameters
s1and
s2(elements that are in either S1 or S2)
template<typename T >
std::set<T> emp::set_union ( std::set< T >  s1,
emp::vector< T >  s2 
)

Compute the set union of.

Parameters
s1and
s2(elements that are in either S1 or S2)
template<typename T >
std::set<T> emp::set_union ( emp::vector< T >  s1,
std::set< T >  s2 
)

Compute the set union of.

Parameters
s1and
s2(elements that are in either S1 or S2)
static void emp::SetBackgroundColor ( const std::string  color)
static

Set the background color of this web page.

static void emp::SetColor ( const std::string  color)
static
static void emp::SetCursor ( const char *  type)
static
template<typename WORLD , typename ORG >
void emp::SetDefaultFitFun ( WORLD &  world)
template<typename WORLD , typename ORG >
void emp::SetDefaultGetGenomeFun ( WORLD &  world)
template<typename WORLD , typename ORG >
void emp::SetDefaultMutFun ( WORLD &  world)
template<typename WORLD , typename ORG >
void emp::SetDefaultPrintFun ( WORLD &  world)
template<typename ORG >
void emp::SetDiverseElites ( World< ORG > &  world,
TraitSet< ORG >  traits,
size_t  world_size 
)

This first version will setup a Diverse-Elites world and specify traits to use.

template<typename ORG >
void emp::SetDiverseElites ( World< ORG > &  world,
size_t  world_size 
)

Setup a Diverse-Elites world, given the provided world already has set of phenotypes.

template<typename ORG >
void emp::SetMapElites ( World< ORG > &  world,
TraitSet< ORG >  traits,
const emp::vector< size_t > &  trait_counts 
)

Set the population to use a MapElites structure. This means that organism placement has two key components: 1: Organism position is based on their phenotypic traits. 2: Organisms must have a higher fitness than the current resident of a position to steal it.

Note: Since organisms compete with their predecessors for space in the populations, synchronous generations do not make sense.

This for version will setup a MAP-Elites world; traits to use an how many bins for each (trait counts) must be provided.

template<typename ORG >
void emp::SetMapElites ( World< ORG > &  world,
TraitSet< ORG >  traits 
)

Setup a MAP-Elites world, given the provided set of traits. Requires world to already have a size; that size is respected when deciding trait bins.

template<typename ORG >
void emp::SetMapElites ( World< ORG > &  world,
const emp::vector< size_t > &  trait_counts 
)

Setup a MAP-Elites world, given the provided trait counts (number of bins). Requires world to already have a phenotypes that those counts are applied to.

template<typename ORG >
void emp::SetMapElites ( World< ORG > &  world)

Setup a MAP-Elites world, given the provided worlds already has size AND set of phenotypes. Requires world to already have a size; that size is respected when deciding trait bins.

template<typename ORG >
void emp::SetPools ( World< ORG > &  world,
size_t  num_pools,
size_t  pool_size,
bool  synchronous_gen = false 
)

Set the population to be a set of pools that are individually well mixed, but with limited migtation. Arguments are the number of pools, the size of each pool, and whether the generations should be synchronous (true) or not (false, default).

void emp::SetPtrDebug ( bool  _d = true)
template<typename C >
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value, double>::type emp::ShannonEntropy ( C &  elements)

Calculate Shannon Entropy of the members of the container passed.

template<typename C >
std::enable_if<emp::is_ptr_type<typename C::value_type>::value, double>::type emp::ShannonEntropy ( C &  elements)

Calculate Shannon Entropy of the members of the container when those members are pointers.

template<typename T >
void emp::Shuffle ( Random random,
emp::vector< T > &  v,
size_t  max_count 
)
inline

Randomly reorder all of the elements in a vector. If max_count is provided, just make sure that the first max_count entries are randomly drawn from entire vector.

template<typename T >
void emp::Shuffle ( Random random,
emp::vector< T > &  v 
)
inline
Graph emp::shuffle_graph ( const Graph in_graph,
Random random 
)

Take an existing graph, and build a new one that is isomorphic to it, but with randomized vertex IDs.

template<typename... Ts, int... Ps>
auto emp::shuffle_tuple ( const std::tuple< Ts... > &  tup,
IntPack< Ps... >   
)

Reorganize the entries in tuple; the provided int pack must specify the new ordering.

template<size_t NUM_BITS>
double emp::SimpleMatchCoeff ( const BitSet< NUM_BITS > &  in1,
const BitSet< NUM_BITS > &  in2 
)

Computes simple matching coefficient (https://en.wikipedia.org/wiki/Simple_matching_coefficient).

template<typename T >
emp::vector<T> emp::Slice ( emp::vector< T >  vec,
int  start,
int  stop 
)

Returns a vector containing a chunk of elements from

Parameters
vecstarting at
startand going up to but not including
stop.
static void emp::slice ( const std::string &  in_string,
emp::vector< std::string > &  out_set,
char  delim = '\n' 
)
inlinestatic

Cut up a string based on the provided delimitor; fill them in to the provided vector.

static emp::vector<std::string> emp::slice ( const std::string &  in_string,
char  delim = '\n' 
)
inlinestatic

Slice a string without passing in result vector (may be less efficient).

template<typename T , typename... Ts>
void emp::Sort ( emp::vector< T > &  v,
Ts...  args 
)

A quick shortcut for sorting a vector.

template<typename T >
static constexpr T emp::Square ( val)
static

A simple function to square a value.

template<typename C >
emp::sfinae_decoy<double, typename C::value_type> emp::StandardDeviation ( C &  elements)

Calculate the standard deviation of the values in a container If values are pointers, they will be automatically de-referenced Values must be numeric.

std::string emp::string_get ( const std::string &  in_string,
const char  delim,
size_t  start_pos = 0 
)
inline

Return a prefix of the input string (up to a specified delimeter), but do not modify it. If the delimeter is not found, return the entire input string.

std::string emp::string_get ( const std::string &  in_string,
const std::string &  delim_set,
size_t  start_pos = 0 
)
inline

Return a prefix of the input string (up to any of a specified set of delimeters), but do not modify it. If the delimeter is not found, return the entire input string.

std::string emp::string_get_line ( const std::string &  in_string,
size_t  start_pos = 0 
)
inline

Return a prefix of a string, up to the first newline (do not modify the original string)

static std::string emp::string_get_range ( const std::string &  in_string,
std::size_t  start_pos,
std::size_t  end_pos 
)
inlinestatic

Get a segment from the beginning of a string as another string, leaving original untouched.

std::string emp::string_get_word ( const std::string &  in_string,
size_t  start_pos = 0 
)
inline

Return a prefix of a string, up to the first whitespace (do not modify the original string)

std::string emp::string_pop ( std::string &  in_string,
const char  delim = ' ' 
)
inline

Remove a prefix of the input string (up to a specified delimeter) and return it. If the delimeter is not found, return the entire input string and clear it.

std::string emp::string_pop ( std::string &  in_string,
const std::string &  delim_set 
)
inline

Remove a prefix of the input string (up to any of a specified set of delimeters) and return it. If the delimeter is not found, return the entire input string and clear it.

static std::string emp::string_pop_fixed ( std::string &  in_string,
std::size_t  end_pos,
size_t  delim_size = 0 
)
inlinestatic

Pop a segment from the beginning of a string as another string, shortening original.

std::string emp::string_pop_line ( std::string &  in_string)
inline

Remove a prefix of a string, up to the first newline, and return it.

std::string emp::string_pop_word ( std::string &  in_string)
inline

Remove a prefix of a string, up to the first whitespace, and return it.

template<typename RETURN , typename... FUN_ARGS, typename... CALL_ARGS>
auto emp::SubsetCall ( std::function< RETURN(FUN_ARGS...)>  fun,
CALL_ARGS...  args 
) -> RETURN

Identify the number of parameters in a function and pass in correct number of argument.

template<typename C >
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename C::value_type>::value, typename C::value_type>::type emp::Sum ( C &  elements)

Calculate sum of the members of the container passed Only works on containers with a scalar member type

template<typename C >
std::enable_if<emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename emp::remove_ptr_type<typename C::value_type>::type >::value, typename emp::remove_ptr_type<typename C::value_type>::type >::type emp::Sum ( C &  elements)

Calculate sum of the values pointed at by pointers in a container Only works on containers of pointers to a scalar type

template<typename T >
T emp::Sum ( const emp::vector< T > &  v)

Sum up the contents of a vector.

template<typename T >
std::set<T> emp::symmetric_difference ( std::set< T >  s1,
std::set< T >  s2 
)

Compute the set symmetric_difference of.

Parameters
s1and
s2(elements that are in either S1 or S2 but not both)
template<typename T >
std::set<T> emp::symmetric_difference ( emp::vector< T >  s1,
emp::vector< T >  s2 
)

Compute the set symmetric_difference of.

Parameters
s1and
s2(elements that are in either S1 or S2 but not both)
template<typename T >
std::set<T> emp::symmetric_difference ( std::set< T >  s1,
emp::vector< T >  s2 
)

Compute the set symmetric_difference of.

Parameters
s1and
s2(elements that are in either S1 or S2 but not both)
template<typename T >
std::set<T> emp::symmetric_difference ( emp::vector< T >  s1,
std::set< T >  s2 
)

Compute the set symmetric_difference of.

Parameters
s1and
s2(elements that are in either S1 or S2 but not both)
template<template< typename... > class TEST, typename T >
constexpr bool emp::test_type ( )
template<template< typename... > class TEST, typename T >
constexpr bool emp::test_type_exist ( )
template<template< typename... > class TEST, typename T >
constexpr bool emp::test_type_value ( )
static std::string emp::text2html ( const std::string &  text)
static
static double emp::TimeFun ( std::function< void()>  test_fun)
inlinestatic

A function timer that takes a functor an identifies how long it takes to complete when run.

static const DFA& emp::to_DFA ( const DFA dfa)
inlinestatic

Converting DFA to DFA – no change needed.

static DFA emp::to_DFA ( const NFA nfa,
int  keep_invalid = false 
)
inlinestatic

Systematic conversion of NFA to DFA...

static DFA emp::to_DFA ( const RegEx regex)
static

Conversion of RegEx to DFA, via NFA intermediate.

static std::string emp::to_escaped_string ( char  value)
inlinestatic

Convert a single chararcter to one that uses a proper escape sequence (in a string) if needed.

static std::string emp::to_escaped_string ( const std::string &  value)
inlinestatic

Convert a full string to one that uses proper escape sequences, as needed.

template<typename Function >
function_traits<Function>::function emp::to_function ( Function lambda)
template<typename Function >
function_traits<Function>::pointer emp::to_function_pointer ( Function lambda)
template<typename LIT_TYPE >
std::string emp::to_literal ( const LIT_TYPE &  value)
inline

Take a value and convert it to a C++-style literal.

static std::string emp::to_literal ( char  value)
inlinestatic

Take a char and convert it to a C++-style literal.

static std::string emp::to_literal ( const std::string &  value)
inlinestatic

Take a string and convert it to a C++-style literal.

static std::string emp::to_lower ( std::string  value)
inlinestatic

Convert a string to all lowercase.

static const NFA& emp::to_NFA ( const NFA nfa)
inlinestatic

Converting NFA to MFA – no change needed.

static NFA emp::to_NFA ( const DFA dfa)
inlinestatic

Systematic up-conversion of DFA to NFA...

static NFA emp::to_NFA ( const RegEx regex,
size_t  stop_id = 1 
)
static

Simple conversion of RegEx to NFA (mostly implemented in RegEx)

static std::string emp::to_roman_numeral ( int  val,
const std::string &  prefix = "" 
)
inlinestatic
template<typename... ALL_TYPES>
std::string emp::to_string ( ALL_TYPES &&...  all_values)
inline

This function does its very best to convert everything it's to a string. Takes any number of arguments and returns a single string containing all of them concatenated. Objects can be any normal (POD) data type, container, or anything that can be passed into a stringstream.

static std::string emp::to_upper ( std::string  value)
inlinestatic

Convert a string to all uppercase.

bool emp::Toggle ( bool &  in_bool)
inline

Toggle an input bool.

template<typename T >
Ptr<T> emp::ToPtr ( T *  _in,
bool  own = false 
)

Convert a T* to a Ptr<T>. By default, don't track.

template<typename TYPE >
constexpr TYPE emp::ToRange ( const TYPE &  value,
const TYPE &  in_min,
const TYPE &  in_max 
)

Run both min and max on a value to put it into a desired range.

template<typename ORG >
void emp::TournamentSelect ( World< ORG > &  world,
size_t  t_size,
size_t  tourny_count = 1 
)

==TOURNAMENT== Selection creates a tournament with a random sub-set of organisms, finds the one with the highest fitness, and moves it to the next generation. User provides the world (with a fitness function), the tournament size, and (optionally) the number of tournaments to run.

Parameters
worldThe emp::World object with the organisms to be selected.
t_sizeHow many organisms should be placed in each tournament?
tourny_countHow many tournaments should be run? (with replacement of organisms)
template<typename T >
Ptr<T> emp::TrackPtr ( T *  _in,
bool  own = true 
)

Convert a T* to a Ptr<T> that we DO track.

constexpr size_t emp::tree_left ( size_t  id)

Tree manipulation in vectors.

constexpr size_t emp::tree_parent ( size_t  id)
constexpr size_t emp::tree_right ( size_t  id)
void emp::TriggerExcept ( const std::string &  in_id,
const std::string &  in_desc,
bool  in_error = true 
)
inline

Provide information about an exception that needs to be triggered.

template<typename R , typename... PARAMS, typename... ARGS>
auto emp::TruncateCall ( std::function< R(PARAMS...)>  fun,
ARGS &&...  args 
)
template<typename TUPLE_T >
constexpr int emp::tuple_size ( )
inline

Quick way to calculate tuple size.

template<int NUM_BITS>
constexpr uint32_t emp::UIntMaskFirst ( )

Create a series of a specified number of ones (at compile time) in a uint.

template<>
constexpr uint32_t emp::UIntMaskFirst< 0 > ( )

Create an empty bit mask (all zeros)

template<typename C >
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value, int>::type emp::UniqueCount ( C &  elements)

Count the number of unique elements in a container.

template<typename C >
std::enable_if<emp::is_ptr_type<typename C::value_type>::value, int>::type emp::UniqueCount ( C &  elements)

Count the number of unique elements in the container of pointers. (compares objects pointed to; pointers do not have to be identical)

static std::string emp::UniqueName ( const std::string &  prefix = "",
const std::string &  postfix = "" 
)
inlinestatic

A function that will always return a unique stringname (using UniqVal) with provided prefix and postfix.)

static size_t emp::UniqueVal ( )
static

A function that will always return a unique value (and trip an assert if it can't...)

template<typename C >
std::enable_if<!emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename C::value_type>::value, double>::type emp::Variance ( C &  elements)

Calculate variance of the members of the container passed Only works on containers with a scalar member type

template<typename C >
std::enable_if<emp::is_ptr_type<typename C::value_type>::value && std::is_scalar<typename emp::remove_ptr_type<typename C::value_type>::type >::value, double>::type emp::Variance ( C &  elements)

Calculate variance of the values pointed at by members of the container passed Only works on containers with a scalar member type

Variable Documentation

constexpr size_t emp::ByteCount[256]
Initial value:
= {
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7, 6, 7, 7, 8
}

How many bits are set to one in each possible byte?

constexpr const int32_t emp::cos_chart_1K[]
Initial value:
=
{ 1024, 1024, 1023, 1021, 1019, 1016, 1013, 1009, 1004, 999, 993, 987, 980, 972, 964, 955,
946, 936, 926, 915, 903, 891, 878, 865, 851, 837, 822, 807, 792, 775, 759, 742,
724, 706, 688, 669, 650, 630, 610, 590, 569, 548, 526, 505, 483, 460, 438, 415,
392, 369, 345, 321, 297, 273, 249, 224, 200, 175, 150, 125, 100, 75, 50, 25,
0, -24, -49, -74, -99, -124, -149, -174, -199, -223, -248, -272, -296, -320, -344, -368,
-391, -414, -437, -459, -482, -504, -525, -547, -568, -589, -609, -629, -649, -668, -687, -705,
-723, -741, -758, -774, -791, -806, -821, -836, -850, -864, -877, -890, -902, -914, -925, -935,
-945, -954, -963, -971, -979, -986, -992, -998,-1003,-1008,-1012,-1015,-1018,-1020,-1022,-1023,
-1023,-1023,-1022,-1020,-1018,-1015,-1012,-1008,-1003, -998, -992, -986, -979, -971, -963, -954,
-945, -935, -925, -914, -902, -890, -877, -864, -850, -836, -821, -806, -791, -774, -758, -741,
-723, -705, -687, -668, -649, -629, -609, -589, -568, -547, -525, -504, -482, -459, -437, -414,
-391, -368, -344, -320, -296, -272, -248, -223, -199, -174, -149, -124, -99, -74, -49, -24,
0, 25, 50, 75, 100, 125, 150, 175, 200, 224, 249, 273, 297, 321, 345, 369,
392, 415, 438, 460, 483, 505, 526, 548, 569, 590, 610, 630, 650, 669, 688, 706,
724, 742, 759, 775, 792, 807, 822, 837, 851, 865, 878, 891, 903, 915, 926, 936,
946, 955, 964, 972, 980, 987, 993, 999, 1004, 1009, 1013, 1016, 1019, 1021, 1023, 1024
}
constexpr const double emp::E = 2.71828

e

constexpr const double emp::log2_chart_1_2[]

Large table to log base-2 results.

constexpr const uint32_t emp::MAX_2BYTE = 65535

(2^16 - 1)

constexpr const uint32_t emp::MAX_3BYTE = 16777215

(2^24 - 1)

constexpr const uint32_t emp::MAX_4BYTE = 4294967295

(2^32 - 1)

constexpr const uint32_t emp::MAX_BYTE = 255

(2^8 - 1)

constexpr const uint32_t emp::MAX_UINT = 4294967295

(2^32 - 1)

constexpr const uint32_t emp::MAX_WORD = 65535

(2^16 - 1)

constexpr const int32_t emp::MIN_INT = -2147483648

(- 2^31)

constexpr const double emp::PHI = 1.61803398874

Golden ratio.

constexpr const double emp::PI = 3.14159265358979

pi

constexpr const double emp::pow2_chart_0_1[]

Table to provide results of Pow2 from 0 to 1.

constexpr const double emp::pow2_chart_bits[]
Initial value:
=
{
1.4142135623730951, 1.1892071150027210, 1.0905077326652577, 1.0442737824274138,
1.0218971486541166, 1.0108892860517005, 1.0054299011128027, 1.0027112750502025,
1.0013547198921082, 1.0006771306930664, 1.0003385080526823, 1.0001692397053021,
1.0000846162726944, 1.0000423072413958, 1.0000211533969647, 1.0000105766425498,
1.0000052883072919, 1.0000026441501502, 1.0000013220742012, 1.0000006610368821,
1.0000003305183864, 1.0000001652591795, 1.0000000826295863, 1.0000000413147923,
1.0000000206573960, 1.0000000103286979, 1.0000000051643489, 1.0000000025821745,
1.0000000012910872, 1.0000000006455436, 1.0000000003227718, 1.0000000001613858
}

Table to provide results of Pow2 for values of bits (0.1, 0.01, 0.001, etc, in binary)

constexpr const int32_t emp::sin_chart_1K[]
Initial value:
=
{ 0, 25, 50, 75, 100, 125, 150, 175, 200, 224, 249, 273, 297, 321, 345, 369,
392, 415, 438, 460, 483, 505, 526, 548, 569, 590, 610, 630, 650, 669, 688, 706,
724, 742, 759, 775, 792, 807, 822, 837, 851, 865, 878, 891, 903, 915, 926, 936,
946, 955, 964, 972, 980, 987, 993, 999, 1004, 1009, 1013, 1016, 1019, 1021, 1023, 1024,
1024, 1024, 1023, 1021, 1019, 1016, 1013, 1009, 1004, 999, 993, 987, 980, 972, 964, 955,
946, 936, 926, 915, 903, 891, 878, 865, 851, 837, 822, 807, 792, 775, 759, 742,
724, 706, 688, 669, 650, 630, 610, 590, 569, 548, 526, 505, 483, 460, 438, 415,
392, 369, 345, 321, 297, 273, 249, 224, 200, 175, 150, 125, 100, 75, 50, 25,
0, -24, -49, -74, -99, -124, -149, -174, -199, -223, -248, -272, -296, -320, -344, -368,
-391, -414, -437, -459, -482, -504, -525, -547, -568, -589, -609, -629, -649, -668, -687, -705,
-723, -741, -758, -774, -791, -806, -821, -836, -850, -864, -877, -890, -902, -914, -925, -935,
-945, -954, -963, -971, -979, -986, -992, -998,-1003,-1008,-1012,-1015,-1018,-1020,-1022,-1023,
-1023,-1023,-1022,-1020,-1018,-1015,-1012,-1008,-1003, -998, -992, -986, -979, -971, -963, -954,
-945, -935, -925, -914, -902, -890, -877, -864, -850, -836, -821, -806, -791, -774, -758, -741,
-723, -705, -687, -668, -649, -629, -609, -589, -568, -547, -525, -504, -482, -459, -437, -414,
-391, -368, -344, -320, -296, -272, -248, -223, -199, -174, -149, -124, -99, -74, -49, -24
}
constexpr const double emp::SQRT2 = 1.41421356237310

sqrt(2)

constexpr const int32_t emp::tan_chart_1K[]
Initial value:
=
{ 0, 25, 50, 76, 101, 126, 152, 178, 204, 230, 256, 283, 311, 338, 366, 395,
424, 454, 484, 515, 547, 580, 614, 648, 684, 721, 759, 799, 840, 883, 928, 975,
1024, 1076, 1130, 1187, 1248, 1312, 1381, 1454, 1533, 1617, 1708, 1808, 1916, 2034, 2165, 2310,
2472, 2655, 2862, 3100, 3376, 3700, 4088, 4560, 5148, 5901, 6903, 8302,10397,13882,20844,41713,
MIN_INT, -41712, -20843, -13881, -10396, -8301, -6902, -5900, -5147, -4559, -4087, -3699, -3375, -3099, -2861, -2654,
-2471,-2309,-2164,-2033,-1915,-1807,-1707,-1616,-1532,-1453,-1380,-1311,-1247,-1186,-1129,-1075,
-1023, -974, -927, -882, -839, -798, -758, -720, -683, -647, -613, -579, -546, -514, -483, -453,
-423, -394, -365, -337, -310, -282, -255, -229, -203, -177, -151, -125, -100, -75, -49, -24,
0, 25, 50, 76, 101, 126, 152, 178, 204, 230, 256, 283, 311, 338, 366, 395,
424, 454, 484, 515, 547, 580, 614, 648, 684, 721, 759, 799, 840, 883, 928, 975,
1024, 1076, 1130, 1187, 1248, 1312, 1381, 1454, 1533, 1617, 1708, 1808, 1916, 2034, 2165, 2310,
2472, 2655, 2862, 3100, 3376, 3700, 4088, 4560, 5148, 5901, 6903, 8302,10397,13882,20844,41713,
MIN_INT, -41712, -20843, -13881, -10396, -8301, -6902, -5900, -5147, -4559, -4087, -3699, -3375, -3099, -2861, -2654,
-2471,-2309,-2164,-2033,-1915,-1807,-1707,-1616,-1532,-1453,-1380,-1311,-1247,-1186,-1129,-1075,
-1023, -974, -927, -882, -839, -798, -758, -720, -683, -647, -613, -579, -546, -514, -483, -453,
-423, -394, -365, -337, -310, -282, -255, -229, -203, -177, -151, -125, -100, -75, -49, -24,
}
constexpr const int32_t MIN_INT
(- 2^31)
Definition: const.h:30
template<typename Needle , typename Haystack , template< typename, typename > class... Cmp>
constexpr bool emp::variadic_contains_v
Initial value:
{
variadic_contains<Needle, Haystack, Cmp...>::value}
template<typename Needle , typename Haystack , template< typename, typename > class... Cmp>
constexpr auto emp::variadic_index_of_v
static
Initial value:
= {
variadic_index_of<Needle, Haystack, Cmp...>::value}