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

Redirection macros for generic observable and likelihood function macro definitions, for inclusion from the Core. More...

Include dependency graph for module_macros_incore.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

Rollcall macros (redirection within the Core).

Models and Modules define different versions of these redirections macros.

So we need to undef them in case they have already been defined. (by the time this header is included they should have done their job) We could just overwrite them, but this way avoids compiler warnings. These are called from within rollcall headers in each module to register module functions, their capabilities, return types, dependencies, and backend requirements.

#define START_MODULE   CORE_START_MODULE
 Registers the current MODULE. More...
 
#define START_CAPABILITY   CORE_START_CAPABILITY(MODULE, CAPABILITY, NOT_MODEL)
 Registers the current CAPABILITY of the current MODULE. More...
 
#define LONG_START_CAPABILITY(MODULE, CAPABILITY)   CORE_START_CAPABILITY(MODULE, CAPABILITY, NOT_MODEL)
 Long (all argument) version of START_CAPABILITY. More...
 
#define DECLARE_FUNCTION(TYPE, FLAG)   CORE_DECLARE_FUNCTION(MODULE, CAPABILITY, FUNCTION, TYPE, FLAG, NOT_MODEL)
 Registers the current FUNCTION of the current MODULE as a provider of the current CAPABILITY, returning a result of type TYPE. More...
 
#define LONG_DECLARE_FUNCTION(MODULE, CAPABILITY, FUNCTION, TYPE, FLAG)   CORE_DECLARE_FUNCTION(MODULE, CAPABILITY, FUNCTION, TYPE, FLAG, NOT_MODEL)
 Long (all argument) version of DECLARE_FUNCTION. More...
 
#define NEEDS_MANAGER(...)   CORE_NEEDS_MANAGER(__VA_ARGS__)
 Indicates that the current FUNCTION of the current MODULE must be managed by another function (in the same module or another) that calls it from within a loop. More...
 
#define DEPENDENCY(DEP, TYPE)   CORE_DEPENDENCY(DEP, TYPE, MODULE, FUNCTION, NOT_MODEL)
 Indicate that the current FUNCTION depends on the presence of another module function that can supply capability DEP, with return type TYPE. More...
 
#define LONG_DEPENDENCY(MODULE, FUNCTION, DEP, TYPE)   CORE_DEPENDENCY(DEP, TYPE, MODULE, FUNCTION, NOT_MODEL)
 Long (all argument) version of DEPENDENCY. More...
 
#define ALLOW_MODELS(...)   ALLOW_MODELS_AB(MODULE, FUNCTION, __VA_ARGS__)
 
#define ALLOWED_MODEL(MODULE, FUNCTION, MODEL)   CORE_ALLOWED_MODEL(MODULE,FUNCTION,MODEL,NOT_MODEL)
 Indicate that the current FUNCTION may only be used with specific model MODEL, or combinations given via ALLOW_MODEL_COMBINATION. More...
 
#define ALLOWED_MODEL_DEPENDENCE(MODULE, FUNCTION, MODEL)   CORE_ALLOW_MODEL_DEPENDENCE(MODULE,FUNCTION,MODEL,NOT_MODEL)
 Indicate that the current FUNCTION may be used with a specific model MODEL, but only in combination with others given via ALLOW_MODEL_COMBINATION. More...
 
#define ALLOW_MODEL_COMBINATION(...)   CORE_ALLOW_MODEL_COMBINATION(MODULE,FUNCTION,NOT_MODEL,(__VA_ARGS__))
 Indicate that the current FUNCTION may only be used with the specific model combination given, with other combinations passed in the same way, or with individual models speficied via ALLOW_MODEL(S). More...
 
#define MODEL_GROUP(GROUPNAME, GROUP)   CORE_MODEL_GROUP(MODULE,FUNCTION,GROUPNAME,GROUP,NOT_MODEL)
 Define a model GROUP of name GROUPNAME for use with ALLOW_MODEL_COMBINATION. More...
 
#define DECLARE_BACKEND_REQ(GROUP, REQUIREMENT, TAGS, TYPE, ARGS, IS_VARIABLE)   CORE_BACKEND_REQ(MODULE, CAPABILITY, FUNCTION, GROUP, REQUIREMENT, TAGS, TYPE, ARGS, IS_VARIABLE, NOT_MODEL)
 BACKEND_REQ indicates that the current FUNCTION requires one backend variable or function to be available from a capability group GROUP, and then declares a viable member of that group, with capability REQUIREMENT, type TYPE and (in the case of functions) arguments ARGS. More...
 
#define LONG_DECLARE_BACKEND_REQ(MODULE, CAPABILITY, FUNCTION, GROUP, REQUIREMENT, TAGS, TYPE, ARGS, IS_VARIABLE)   CORE_BACKEND_REQ(MODULE, CAPABILITY, FUNCTION, GROUP, REQUIREMENT, TAGS, TYPE, ARGS, IS_VARIABLE, NOT_MODEL)
 
#define BE_GROUP(GROUP)   CORE_BE_GROUP(GROUP,NOT_MODEL)
 Declare a backend group, from which one backend requirement must be activated. More...
 
#define ACTIVATE_BACKEND_REQ_FOR_MODELS(MODELS, TAGS)   CORE_BE_MODEL_RULE(MODELS,TAGS,NOT_MODEL)
 Define a rule that uses TAGS to determine which backend requirements of the current FUNCTION are explicitly activated when one or more models from the set MODELS are being scanned. More...
 
#define BACKEND_OPTION(BACKEND_AND_VERSIONS, TAGS)   LONG_BACKEND_OPTION(MODULE, CAPABILITY, FUNCTION, BACKEND_AND_VERSIONS,TAGS)
 Define a rule that uses TAGS to determine a set of backend requirements of the current FUNCTION that are permitted to be fulfilled by the indicated BACKEND_AND_VERSIONS. More...
 
#define LONG_BACKEND_OPTION(MODULE, CAPABILITY, FUNCTION, BACKEND_AND_VERSIONS, TAGS)   CORE_BACKEND_OPTION(MODULE, CAPABILITY, FUNCTION, BACKEND_AND_VERSIONS,TAGS, NOT_MODEL)
 
#define FORCE_SAME_BACKEND(...)   CORE_FORCE_SAME_BACKEND(NOT_MODEL,__VA_ARGS__)
 Define a rule that certain sets of backend requirements need to be resolved by the same backend. More...
 
#define START_CONDITIONAL_DEPENDENCY(TYPE)
 Indicate that the current FUNCTION may depend on the presence of another module function that can supply capability CONDITIONAL_DEPENDENCY, with return type TYPE. More...
 
#define ACTIVATE_DEP_BE(BACKEND_REQ, BACKEND, VERSTRING)   CORE_ACTIVATE_DEP_BE(BACKEND_REQ, BACKEND, VERSTRING, NOT_MODEL)
 Indicate that the current CONDITIONAL_DEPENDENCY should be activated if the backend requirement BACKEND_REQ of the current FUNCTION is filled by a backend function from BACKEND. More...
 
#define ACTIVATE_FOR_MODELS(...)   ACTIVATE_DEP_MODEL(MODULE, CAPABILITY, FUNCTION, CONDITIONAL_DEPENDENCY, NOT_MODEL, #__VA_ARGS__)
 Indicate that the current CONDITIONAL_DEPENDENCY should be activated if the model being scanned matches one of the models passed as an argument. More...
 
#define MODEL_CONDITIONAL_DEPENDENCY(DEP, TYPE, ...)
 Quick, one-line declaration of model-conditional dependencies. More...
 
#define CLASSLOAD_NEEDED(BACKEND, VERSION)   CORE_CLASSLOAD_NEEDED(BACKEND, VERSION, NOT_MODEL)
 Indicate that the current FUNCTION requires classes that must be loaded from BACKEND, version VERSION. More...
 

Detailed Description

Redirection macros for generic observable and likelihood function macro definitions, for inclusion from the Core.

Note here that FUNCTION is the actual module function name, whereas both CAPABILITY and all DEPs refer to the abstract physical quantities that functions may provide or require. Thus, the provides() methods expect a quantity input (i.e. corresponding to a CAPABILITY), the requires() methods expect a quantity input for the dependency but a function name input (i.e. corresponding to a FUNCTION) for the actual dependent function, and all other things operate on the basis of the function name, not the quantity that is calculated.


Authors (add name and date if you modify):

Author
Pat Scott (patsc.nosp@m.ott@.nosp@m.physi.nosp@m.cs.m.nosp@m.cgill.nosp@m..ca)
Date
2012 Nov
2013,14 Foreverrrrr
Author
Abram Krislock (abram.nosp@m..kri.nosp@m.slock.nosp@m.@fys.nosp@m.ik.su.nosp@m..se)
Date
2013 Jan, Feb
Author
Christoph Weniger (c.wen.nosp@m.iger.nosp@m.@uva..nosp@m.nl)
Date
2013 Jan, Feb, 2014 Jan
Author
Anders Kvellestad (ander.nosp@m.s.kv.nosp@m.elles.nosp@m.tad@.nosp@m.fys.u.nosp@m.io.n.nosp@m.o)
Date
2013 Nov
Author
Ben Farmer (b.far.nosp@m.mer@.nosp@m.imper.nosp@m.ial..nosp@m.ac.uk)
Date
2019 Jul

Definition in file module_macros_incore.hpp.

Macro Definition Documentation

◆ ACTIVATE_BACKEND_REQ_FOR_MODELS

#define ACTIVATE_BACKEND_REQ_FOR_MODELS (   MODELS,
  TAGS 
)    CORE_BE_MODEL_RULE(MODELS,TAGS,NOT_MODEL)

Define a rule that uses TAGS to determine which backend requirements of the current FUNCTION are explicitly activated when one or more models from the set MODELS are being scanned.

Declaring this rule makes backend requirements that match one or more TAGS conditional on the model being scanned. Backend requirements that do not match any such rule are considered unconditional, and are activated regardless of the model(s) being scanned. Note that all rules have immediate effect, so only apply to BACKEND_REQs of the current FUNCTION that have already been declared!

Definition at line 171 of file module_macros_incore.hpp.

◆ ACTIVATE_DEP_BE

#define ACTIVATE_DEP_BE (   BACKEND_REQ,
  BACKEND,
  VERSTRING 
)    CORE_ACTIVATE_DEP_BE(BACKEND_REQ, BACKEND, VERSTRING, NOT_MODEL)

Indicate that the current CONDITIONAL_DEPENDENCY should be activated if the backend requirement BACKEND_REQ of the current FUNCTION is filled by a backend function from BACKEND.

The versions of BACKEND that this applies to are passed in VERSTRING.

Definition at line 207 of file module_macros_incore.hpp.

◆ ACTIVATE_FOR_MODELS

#define ACTIVATE_FOR_MODELS (   ...)    ACTIVATE_DEP_MODEL(MODULE, CAPABILITY, FUNCTION, CONDITIONAL_DEPENDENCY, NOT_MODEL, #__VA_ARGS__)

Indicate that the current CONDITIONAL_DEPENDENCY should be activated if the model being scanned matches one of the models passed as an argument.

Definition at line 211 of file module_macros_incore.hpp.

◆ ALLOW_MODEL_COMBINATION

#define ALLOW_MODEL_COMBINATION (   ...)    CORE_ALLOW_MODEL_COMBINATION(MODULE,FUNCTION,NOT_MODEL,(__VA_ARGS__))

Indicate that the current FUNCTION may only be used with the specific model combination given, with other combinations passed in the same way, or with individual models speficied via ALLOW_MODEL(S).

If both this and ALLOW_MODEL(s) are absent, all models are allowed but no model parameters will be accessible from within the module funtion.

Definition at line 142 of file module_macros_incore.hpp.

◆ ALLOW_MODELS

#define ALLOW_MODELS (   ...)    ALLOW_MODELS_AB(MODULE, FUNCTION, __VA_ARGS__)

Definition at line 125 of file module_macros_incore.hpp.

◆ ALLOWED_MODEL

#define ALLOWED_MODEL (   MODULE,
  FUNCTION,
  MODEL 
)    CORE_ALLOWED_MODEL(MODULE,FUNCTION,MODEL,NOT_MODEL)

Indicate that the current FUNCTION may only be used with specific model MODEL, or combinations given via ALLOW_MODEL_COMBINATION.

If both this and ALLOW_MODEL_COMBINATION are absent, all models are allowed, but model parameters will not generally be accessible from within the module funtion.

Definition at line 131 of file module_macros_incore.hpp.

◆ ALLOWED_MODEL_DEPENDENCE

#define ALLOWED_MODEL_DEPENDENCE (   MODULE,
  FUNCTION,
  MODEL 
)    CORE_ALLOW_MODEL_DEPENDENCE(MODULE,FUNCTION,MODEL,NOT_MODEL)

Indicate that the current FUNCTION may be used with a specific model MODEL, but only in combination with others given via ALLOW_MODEL_COMBINATION.

Definition at line 135 of file module_macros_incore.hpp.

◆ BACKEND_OPTION

#define BACKEND_OPTION (   BACKEND_AND_VERSIONS,
  TAGS 
)    LONG_BACKEND_OPTION(MODULE, CAPABILITY, FUNCTION, BACKEND_AND_VERSIONS,TAGS)

Define a rule that uses TAGS to determine a set of backend requirements of the current FUNCTION that are permitted to be fulfilled by the indicated BACKEND_AND_VERSIONS.

If no versions are given, all versions of the stated backend are considered allowed. Declaring this rule makes all backend requirements that match the rule resolvable only by the backend-version pairs passed into BACKEND_OPTION. Additional options provided by subsequent calls to BACKEND_OPTION are added to the options provided by each previous declaration. In the case of multiple contradictory calls to BACKEND_OPTION, the rule defined by the latest call takes precedence. Note that all rules have immediate effect, so only apply to BACKEND_REQs of the current FUNCTION that have already been declared!

Definition at line 184 of file module_macros_incore.hpp.

◆ BE_GROUP

#define BE_GROUP (   GROUP)    CORE_BE_GROUP(GROUP,NOT_MODEL)

Declare a backend group, from which one backend requirement must be activated.

Definition at line 161 of file module_macros_incore.hpp.

◆ CLASSLOAD_NEEDED

#define CLASSLOAD_NEEDED (   BACKEND,
  VERSION 
)    CORE_CLASSLOAD_NEEDED(BACKEND, VERSION, NOT_MODEL)

Indicate that the current FUNCTION requires classes that must be loaded from BACKEND, version VERSION.

Definition at line 219 of file module_macros_incore.hpp.

◆ DECLARE_BACKEND_REQ

#define DECLARE_BACKEND_REQ (   GROUP,
  REQUIREMENT,
  TAGS,
  TYPE,
  ARGS,
  IS_VARIABLE 
)    CORE_BACKEND_REQ(MODULE, CAPABILITY, FUNCTION, GROUP, REQUIREMENT, TAGS, TYPE, ARGS, IS_VARIABLE, NOT_MODEL)

BACKEND_REQ indicates that the current FUNCTION requires one backend variable or function to be available from a capability group GROUP, and then declares a viable member of that group, with capability REQUIREMENT, type TYPE and (in the case of functions) arguments ARGS.

BACKEND_REQ also allows the user to specify a list of TAGS that apply to this specific group member, which can then be used for easily implementing rules for choosing between different members of the same GROUP. Note that GROUPs are automatically declared the first time that they are mentioned in a BACKEND_REQ statement.

Definition at line 155 of file module_macros_incore.hpp.

◆ DECLARE_FUNCTION

#define DECLARE_FUNCTION (   TYPE,
  FLAG 
)    CORE_DECLARE_FUNCTION(MODULE, CAPABILITY, FUNCTION, TYPE, FLAG, NOT_MODEL)

Registers the current FUNCTION of the current MODULE as a provider of the current CAPABILITY, returning a result of type TYPE.

Definition at line 106 of file module_macros_incore.hpp.

◆ DEPENDENCY

#define DEPENDENCY (   DEP,
  TYPE 
)    CORE_DEPENDENCY(DEP, TYPE, MODULE, FUNCTION, NOT_MODEL)

Indicate that the current FUNCTION depends on the presence of another module function that can supply capability DEP, with return type TYPE.

Definition at line 121 of file module_macros_incore.hpp.

◆ FORCE_SAME_BACKEND

#define FORCE_SAME_BACKEND (   ...)    CORE_FORCE_SAME_BACKEND(NOT_MODEL,__VA_ARGS__)

Define a rule that certain sets of backend requirements need to be resolved by the same backend.

The sets are identified by tags, any number of which can be passed to FORCE_SAME_BACKEND. All backend requirements with a given tag passed into FORCE_SAME_BACKEND will be forced by the dependency resolver to use functions from the same backend. Note that all rules have immediate effect, so only apply to BACKEND_REQs of the current FUNCTION that have already been declared!

Definition at line 194 of file module_macros_incore.hpp.

◆ LONG_BACKEND_OPTION

#define LONG_BACKEND_OPTION (   MODULE,
  CAPABILITY,
  FUNCTION,
  BACKEND_AND_VERSIONS,
  TAGS 
)    CORE_BACKEND_OPTION(MODULE, CAPABILITY, FUNCTION, BACKEND_AND_VERSIONS,TAGS, NOT_MODEL)

Definition at line 185 of file module_macros_incore.hpp.

◆ LONG_DECLARE_BACKEND_REQ

#define LONG_DECLARE_BACKEND_REQ (   MODULE,
  CAPABILITY,
  FUNCTION,
  GROUP,
  REQUIREMENT,
  TAGS,
  TYPE,
  ARGS,
  IS_VARIABLE 
)    CORE_BACKEND_REQ(MODULE, CAPABILITY, FUNCTION, GROUP, REQUIREMENT, TAGS, TYPE, ARGS, IS_VARIABLE, NOT_MODEL)

Definition at line 157 of file module_macros_incore.hpp.

◆ LONG_DECLARE_FUNCTION

#define LONG_DECLARE_FUNCTION (   MODULE,
  CAPABILITY,
  FUNCTION,
  TYPE,
  FLAG 
)    CORE_DECLARE_FUNCTION(MODULE, CAPABILITY, FUNCTION, TYPE, FLAG, NOT_MODEL)

Long (all argument) version of DECLARE_FUNCTION.

Definition at line 108 of file module_macros_incore.hpp.

◆ LONG_DEPENDENCY

#define LONG_DEPENDENCY (   MODULE,
  FUNCTION,
  DEP,
  TYPE 
)    CORE_DEPENDENCY(DEP, TYPE, MODULE, FUNCTION, NOT_MODEL)

Long (all argument) version of DEPENDENCY.

Definition at line 123 of file module_macros_incore.hpp.

◆ LONG_START_CAPABILITY

#define LONG_START_CAPABILITY (   MODULE,
  CAPABILITY 
)    CORE_START_CAPABILITY(MODULE, CAPABILITY, NOT_MODEL)

Long (all argument) version of START_CAPABILITY.

Definition at line 100 of file module_macros_incore.hpp.

◆ MODEL_CONDITIONAL_DEPENDENCY

#define MODEL_CONDITIONAL_DEPENDENCY (   DEP,
  TYPE,
  ... 
)
Value:
ACTIVATE_DEP_MODEL(MODULE, CAPABILITY, FUNCTION, DEP, NOT_MODEL, #__VA_ARGS__)
#define CAPABILITY
#define NOT_MODEL
#define MODULE
#define FUNCTION
#define CORE_START_CONDITIONAL_DEPENDENCY(MODULE, CAPABILITY, FUNCTION, CONDITIONAL_DEPENDENCY, TYPE, IS_MODEL)
Redirection of START_CONDITIONAL_DEPENDENCY(TYPE) when invoked from within the core.

Quick, one-line declaration of model-conditional dependencies.

Definition at line 214 of file module_macros_incore.hpp.

◆ MODEL_GROUP

#define MODEL_GROUP (   GROUPNAME,
  GROUP 
)    CORE_MODEL_GROUP(MODULE,FUNCTION,GROUPNAME,GROUP,NOT_MODEL)

Define a model GROUP of name GROUPNAME for use with ALLOW_MODEL_COMBINATION.

Definition at line 145 of file module_macros_incore.hpp.

◆ NEEDS_MANAGER

#define NEEDS_MANAGER (   ...)    CORE_NEEDS_MANAGER(__VA_ARGS__)

Indicates that the current FUNCTION of the current MODULE must be managed by another function (in the same module or another) that calls it from within a loop.

May be called with one or two arguments: LOOPMAN (capability of the required manager; required) and TYPE (type of the required manager; not required). Will provide a dependency pipe within the function if and only if TYPE is present and non-void.

Definition at line 116 of file module_macros_incore.hpp.

◆ START_CAPABILITY

#define START_CAPABILITY   CORE_START_CAPABILITY(MODULE, CAPABILITY, NOT_MODEL)

Registers the current CAPABILITY of the current MODULE.

Definition at line 98 of file module_macros_incore.hpp.

◆ START_CONDITIONAL_DEPENDENCY

#define START_CONDITIONAL_DEPENDENCY (   TYPE)
Value:
FUNCTION, CONDITIONAL_DEPENDENCY, TYPE, NOT_MODEL)
#define CAPABILITY
#define NOT_MODEL
#define MODULE
#define FUNCTION
#define CORE_START_CONDITIONAL_DEPENDENCY(MODULE, CAPABILITY, FUNCTION, CONDITIONAL_DEPENDENCY, TYPE, IS_MODEL)
Redirection of START_CONDITIONAL_DEPENDENCY(TYPE) when invoked from within the core.

Indicate that the current FUNCTION may depend on the presence of another module function that can supply capability CONDITIONAL_DEPENDENCY, with return type TYPE.

Definition at line 200 of file module_macros_incore.hpp.

◆ START_MODULE

#define START_MODULE   CORE_START_MODULE

Registers the current MODULE.

Definition at line 94 of file module_macros_incore.hpp.