Hydra  4.0.1
A header-only templated C++ framework to perform data analysis on massively parallel platforms.
Functor Arithmetic

Functor base types and arithmetic operations. More...

Files

file  Argument.h
 
file  base_functor.h
 
file  Constant.h
 
file  Divide.h
 
file  FunctorArithmetic.h
 This file should be included in order to enable functor aritmethic in hydra.
 
file  Minus.h
 
file  Multiply.h
 
file  Sum.h
 
file  TagTraits.h
 

Data Structures

class  hydra::BaseFunctor< Functor, Signature, NPARAM >
 Base class for all functors in hydra. More...
 

Detailed Description

Functor base types and arithmetic operations.


Data Structure Documentation

◆ hydra::BaseFunctor

class hydra::BaseFunctor

template<typename Functor, typename Signature, size_t NPARAM>
class hydra::BaseFunctor< Functor, Signature, NPARAM >

Base class for all functors in hydra.

Template Parameters
Functoris "bare" c++ functor implementing the template<typename T> Evaluate(T x) method.
NPARAMnumber of parameters of the functor.
Examples:
dalitz_plot.C, and dalitz_plot.inl.
Inheritance diagram for hydra::BaseFunctor< Functor, Signature, NPARAM >:
Collaboration diagram for hydra::BaseFunctor< Functor, Signature, NPARAM >:

Public Types

enum  { arity =detail::signature_traits<Signature>::arity }
 
typedef detail::signature_traits< Signature >::argument_type argument_type
 
typedef void hydra_functor_type
 
typedef detail::signature_traits< Signature >::return_type return_type
 

Public Member Functions

__hydra_host__ __hydra_device__ BaseFunctor ()
 Default constructor. More...
 
 BaseFunctor (std::initializer_list< Parameter > init_parameters)
 Constructor taking a list of parameters. More...
 
 BaseFunctor (std::array< Parameter, NPARAM > const &init_parameters)
 Constructor taking std::array of parameters. More...
 
__hydra_host__ __hydra_device__ BaseFunctor (BaseFunctor< Functor, Signature, NPARAM > const &other)
 Copy constructor. More...
 
__hydra_host__ __hydra_device__ Functor & GetFunctor ()
 
__hydra_host__ __hydra_device__ GReal_t GetNorm () const
 
template<typename ... T>
__hydra_host__ __hydra_device__ std::enable_if<(!detail::is_valid_type_pack< argument_type, T... >::value), return_type >::type operator() (T...x) const
 
template<typename ... T>
__hydra_host__ __hydra_device__ std::enable_if< detail::is_valid_type_pack< argument_type, T... >::value, return_type >::type operator() (T...x) const
 Function call operator overload taking a pack of parameters convertible to the lambda signature. More...
 
template<typename T >
__hydra_host__ __hydra_device__ std::enable_if<(detail::is_tuple_type< typename std::decay< T >::type >::value) &&(!detail::is_tuple_of_function_arguments< typename std::decay< T >::type >::value) &&(hydra::thrust::detail::is_convertible< typename std::decay< T >::type, argument_type >::value), return_type >::type operator() (T x) const
 Unary function call operator overload taking a tuple containing the lambda arguments in any other. More...
 
template<typename T >
__hydra_host__ __hydra_device__ std::enable_if<(detail::is_tuple_type< typename std::decay< T >::type >::value) &&(detail::is_tuple_of_function_arguments< typename std::decay< T >::type >::value), return_type >::type operator() (T x) const
 Unary function call operator overload taking a tuple containing the lambda arguments in any other. More...
 
template<typename T1 , typename T2 >
__hydra_host__ __hydra_device__ std::enable_if<(detail::is_tuple_type< typename std::decay< T1 >::type >::value) &&(detail::is_tuple_of_function_arguments< typename std::decay< T1 >::type >::value) &&(detail::is_tuple_type< typename std::decay< T2 >::type >::value) &&(detail::is_tuple_of_function_arguments< typename std::decay< T2 >::type >::value), return_type >::type operator() (T1 x, T2 y) const
 Binary function call operator overload taking two tuples containing the lambda arguments in any other. More...
 
template<typename T1 , typename T2 >
__hydra_host__ __hydra_device__ std::enable_if<(!detail::is_tuple_type< typename std::decay< T1 >::type >::value) &&(detail::is_function_argument< typename std::decay< T1 >::type >::value) &&(detail::is_tuple_type< typename std::decay< T2 >::type >::value) &&(detail::is_tuple_of_function_arguments< typename std::decay< T2 >::type >::value), return_type >::type operator() (T1 x, T2 y) const
 Binary function call operator overload taking one tuple and a non-tuple, that containing put together would contain the lambda arguments in any order. More...
 
template<typename T1 , typename T2 >
__hydra_host__ __hydra_device__ std::enable_if<(!detail::is_tuple_type< typename std::decay< T1 >::type >::value) &&(detail::is_function_argument< typename std::decay< T1 >::type >::value) &&(detail::is_tuple_type< typename std::decay< T2 >::type >::value) &&(detail::is_tuple_of_function_arguments< typename std::decay< T2 >::type >::value), return_type >::type operator() (T2 y, T1 x) const
 Binary function call operator overload taking one tuple and a non-tuple, that containing put together would contain the lambda arguments in any other. More...
 
__hydra_host__ __hydra_device__ BaseFunctor< Functor, Signature, NPARAM > & operator= (BaseFunctor< Functor, Signature, NPARAM > const &other)
 Assignment operator. More...
 
void PrintRegisteredParameters ()
 Print registered parameters. More...
 
__hydra_host__ __hydra_device__ void SetNorm (GReal_t norm)
 
- Public Member Functions inherited from hydra::detail::Parameters< NPARAM >
 Parameters ()=default
 
 Parameters (std::initializer_list< hydra::Parameter > init_parameters)
 
 Parameters (std::array< hydra::Parameter, N > const &init_parameters)
 
__hydra_host__ __hydra_device__ Parameters (hydra::Parameter(&init_parameters)[N])
 
__hydra_host__ __hydra_device__ Parameters (Parameters< N > const &other)
 
void AddUserParameters (std::vector< hydra::Parameter * > &user_parameters)
 
__hydra_host__ __hydra_device__ size_t GetNumberOfParameters () const
 
__hydra_host__ __hydra_device__ const hydra::ParameterGetParameter (Int i) const
 
__hydra_host__ const hydra::ParameterGetParameter (const char *name) const
 
__hydra_host__ __hydra_device__ const hydra::ParameterGetParameters () const
 
size_t GetParametersKey ()
 
__hydra_host__ __hydra_device__ Parameters< N > & operator= (Parameters< N > const &other)
 
__hydra_host__ __hydra_device__ GReal_t operator[] (Int i) const
 
__hydra_host__ __hydra_device__ hydra::ParameterParameter (Int i)
 
__hydra_host__ hydra::ParameterParameter (const char *name)
 
void PrintParameters ()
 Print registered parameters. More...
 
__hydra_host__ __hydra_device__ void SetParameter (Int i, hydra::Parameter const &value)
 
__hydra_host__ __hydra_device__ void SetParameter (Int i, double value)
 
__hydra_host__ void SetParameter (const char *name, hydra::Parameter const &value)
 
__hydra_host__ void SetParameter (const char *name, double value)
 
__hydra_host__ void SetParameters (const std::vector< double > &parameters)
 Set parameters. More...
 
virtual void Update (void)
 This method offers an opportunity to redo calculations and update values that depends only on the functor parameters. More...
 

Protected Attributes

BaseFunctor< Functor, Signature, NPARAM > & _par
 

Additional Inherited Members

- Static Public Attributes inherited from hydra::detail::Parameters< NPARAM >
static const size_t parameter_count
 

Member Typedef Documentation

◆ argument_type

template<typename Functor, typename Signature, size_t NPARAM>
typedef detail::signature_traits<Signature>::argument_type hydra::BaseFunctor< Functor, Signature, NPARAM >::argument_type

◆ hydra_functor_type

template<typename Functor, typename Signature, size_t NPARAM>
typedef void hydra::BaseFunctor< Functor, Signature, NPARAM >::hydra_functor_type

◆ return_type

template<typename Functor, typename Signature, size_t NPARAM>
typedef detail::signature_traits<Signature>::return_type hydra::BaseFunctor< Functor, Signature, NPARAM >::return_type

Member Enumeration Documentation

◆ anonymous enum

template<typename Functor, typename Signature, size_t NPARAM>
anonymous enum
Enumerator
arity 

Constructor & Destructor Documentation

◆ BaseFunctor() [1/4]

template<typename Functor, typename Signature, size_t NPARAM>
__hydra_host__ __hydra_device__ hydra::BaseFunctor< Functor, Signature, NPARAM >::BaseFunctor ( )
inlineexplicit

Default constructor.

◆ BaseFunctor() [2/4]

template<typename Functor, typename Signature, size_t NPARAM>
hydra::BaseFunctor< Functor, Signature, NPARAM >::BaseFunctor ( std::initializer_list< Parameter init_parameters)
inline

Constructor taking a list of parameters.

Parameters
init_parametersstd::initializer_list<Parameter> with the parameters of the functor.

◆ BaseFunctor() [3/4]

template<typename Functor, typename Signature, size_t NPARAM>
hydra::BaseFunctor< Functor, Signature, NPARAM >::BaseFunctor ( std::array< Parameter, NPARAM > const &  init_parameters)
inline

Constructor taking std::array of parameters.

Parameters
init_parametersstd::array<Parameter,NPARAM> with the parameters of the functor.

◆ BaseFunctor() [4/4]

template<typename Functor, typename Signature, size_t NPARAM>
__hydra_host__ __hydra_device__ hydra::BaseFunctor< Functor, Signature, NPARAM >::BaseFunctor ( BaseFunctor< Functor, Signature, NPARAM > const &  other)
inline

Copy constructor.

Member Function Documentation

◆ GetFunctor()

template<typename Functor, typename Signature, size_t NPARAM>
__hydra_host__ __hydra_device__ Functor& hydra::BaseFunctor< Functor, Signature, NPARAM >::GetFunctor ( )
inline

◆ GetNorm()

template<typename Functor, typename Signature, size_t NPARAM>
__hydra_host__ __hydra_device__ GReal_t hydra::BaseFunctor< Functor, Signature, NPARAM >::GetNorm ( ) const
inline

◆ operator()() [1/7]

template<typename Functor, typename Signature, size_t NPARAM>
template<typename ... T>
__hydra_host__ __hydra_device__ std::enable_if< (!detail::is_valid_type_pack< argument_type, T...>::value), return_type>::type hydra::BaseFunctor< Functor, Signature, NPARAM >::operator() ( T...  x) const
inline

◆ operator()() [2/7]

template<typename Functor, typename Signature, size_t NPARAM>
template<typename ... T>
__hydra_host__ __hydra_device__ std::enable_if< detail::is_valid_type_pack< argument_type, T...>::value, return_type>::type hydra::BaseFunctor< Functor, Signature, NPARAM >::operator() ( T...  x) const
inline

Function call operator overload taking a pack of parameters convertible to the lambda signature.

◆ operator()() [3/7]

template<typename Functor, typename Signature, size_t NPARAM>
template<typename T >
__hydra_host__ __hydra_device__ std::enable_if< ( detail::is_tuple_type< typename std::decay<T>::type >::value ) && (!detail::is_tuple_of_function_arguments< typename std::decay<T>::type >::value) && ( hydra::thrust::detail::is_convertible< typename std::decay<T>::type, argument_type >::value ), return_type >::type hydra::BaseFunctor< Functor, Signature, NPARAM >::operator() ( x) const
inline

Unary function call operator overload taking a tuple containing the lambda arguments in any other.

◆ operator()() [4/7]

template<typename Functor, typename Signature, size_t NPARAM>
template<typename T >
__hydra_host__ __hydra_device__ std::enable_if< ( detail::is_tuple_type<typename std::decay<T>::type>::value ) && ( detail::is_tuple_of_function_arguments< typename std::decay<T>::type >::value), return_type>::type hydra::BaseFunctor< Functor, Signature, NPARAM >::operator() ( x) const
inline

Unary function call operator overload taking a tuple containing the lambda arguments in any other.

◆ operator()() [5/7]

template<typename Functor, typename Signature, size_t NPARAM>
template<typename T1 , typename T2 >
__hydra_host__ __hydra_device__ std::enable_if< ( detail::is_tuple_type<typename std::decay<T1>::type>::value ) && ( detail::is_tuple_of_function_arguments< typename std::decay<T1>::type >::value ) && ( detail::is_tuple_type<typename std::decay<T2>::type>::value ) && ( detail::is_tuple_of_function_arguments< typename std::decay<T2>::type >::value ) , return_type>::type hydra::BaseFunctor< Functor, Signature, NPARAM >::operator() ( T1  x,
T2  y 
) const
inline

Binary function call operator overload taking two tuples containing the lambda arguments in any other.

◆ operator()() [6/7]

template<typename Functor, typename Signature, size_t NPARAM>
template<typename T1 , typename T2 >
__hydra_host__ __hydra_device__ std::enable_if< (!detail::is_tuple_type< typename std::decay<T1>::type>::value ) && ( detail::is_function_argument< typename std::decay<T1>::type >::value ) && ( detail::is_tuple_type< typename std::decay<T2>::type>::value ) && ( detail::is_tuple_of_function_arguments< typename std::decay<T2>::type >::value ), return_type>::type hydra::BaseFunctor< Functor, Signature, NPARAM >::operator() ( T1  x,
T2  y 
) const
inline

Binary function call operator overload taking one tuple and a non-tuple, that containing put together would contain the lambda arguments in any order.

◆ operator()() [7/7]

template<typename Functor, typename Signature, size_t NPARAM>
template<typename T1 , typename T2 >
__hydra_host__ __hydra_device__ std::enable_if< (!detail::is_tuple_type< typename std::decay<T1>::type>::value ) && ( detail::is_function_argument< typename std::decay<T1>::type >::value ) && ( detail::is_tuple_type< typename std::decay<T2>::type>::value ) && ( detail::is_tuple_of_function_arguments< typename std::decay<T2>::type >::value ), return_type>::type hydra::BaseFunctor< Functor, Signature, NPARAM >::operator() ( T2  y,
T1  x 
) const
inline

Binary function call operator overload taking one tuple and a non-tuple, that containing put together would contain the lambda arguments in any other.

◆ operator=()

template<typename Functor, typename Signature, size_t NPARAM>
__hydra_host__ __hydra_device__ BaseFunctor<Functor, Signature, NPARAM>& hydra::BaseFunctor< Functor, Signature, NPARAM >::operator= ( BaseFunctor< Functor, Signature, NPARAM > const &  other)
inline

Assignment operator.

◆ PrintRegisteredParameters()

template<typename Functor, typename Signature, size_t NPARAM>
void hydra::BaseFunctor< Functor, Signature, NPARAM >::PrintRegisteredParameters ( )
inline

Print registered parameters.

◆ SetNorm()

template<typename Functor, typename Signature, size_t NPARAM>
__hydra_host__ __hydra_device__ void hydra::BaseFunctor< Functor, Signature, NPARAM >::SetNorm ( GReal_t  norm)
inline

Field Documentation

◆ _par

template<typename Functor, typename Signature, size_t NPARAM>
BaseFunctor<Functor, Signature, NPARAM>& hydra::BaseFunctor< Functor, Signature, NPARAM >::_par
protected