gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
daFunk::FunkFuncM< threadsafe, O, funcargs > Class Template Reference

#include <daFunk.hpp>

Inheritance diagram for daFunk::FunkFuncM< threadsafe, O, funcargs >:
Collaboration diagram for daFunk::FunkFuncM< threadsafe, O, funcargs >:

Public Member Functions

template<typename... Args>
 FunkFuncM (O *obj, double(O::*f)(funcargs...), Args... argss)
 
template<typename... Args>
 FunkFuncM (shared_ptr< O > obj, double(O::*f)(funcargs...), Args... argss)
 
double value (const std::vector< double > &data, size_t bindID)
 
template<size_t... Args>
double ppp (index_list< Args... >, std::tuple< typename std::remove_reference< funcargs >::type... > &my_input)
 
- Public Member Functions inherited from daFunk::FunkBase
 FunkBase ()
 
virtual ~FunkBase ()
 
template<typename... Args>
Funk set (std::string arg, Funk g, Args... args)
 
template<typename... Args>
Funk set (std::string arg, double x, Args... args)
 
template<typename... Args>
Funk set (std::string arg, std::string arg1, Args... args)
 
template<typename... Args>
Funk set ()
 
template<typename... Args>
shared_ptr< FunkBoundbind (Args... args)
 
const std::vector< std::string > & getArgs ()
 
std::size_t getNArgs ()
 
bool hasArg (std::string)
 
bool hasArgs ()
 
Funk help ()
 
template<typename... Args>
bool assert_args (Args... args)
 
virtual void resolve (std::map< std::string, size_t > datamap, size_t &datalen, size_t bindID, std::map< std::string, size_t > &argmap)
 
Singularities getSingl ()
 
Funk set_singularity (std::string arg, double pos, double width)
 
Funk print (std::string arg)
 
template<typename... Args>
shared_ptr< FunkIntegrate_gsl1dgsl_integration (Args... args)
 
PlainPtrs1 plain (std::string)
 
PlainPtrs2 plain (std::string, std::string)
 
PlainPtrs3 plain (std::string, std::string, std::string)
 
PlainPtrs4 plain (std::string, std::string, std::string, std::string)
 
template<typename T >
PlainPtr1 plain (std::string)
 
template<typename T >
PlainPtr2 plain (std::string, std::string)
 
template<typename T >
PlainPtr3 plain (std::string, std::string, std::string)
 
template<typename T >
PlainPtr4 plain (std::string, std::string, std::string, std::string)
 
template<>
Funk set ()
 

Private Member Functions

template<typename T , typename... Args>
void digest_input (T x, Args... argss)
 
template<typename... Args>
void digest_input (Funk f, Args... argss)
 
void digest_input ()
 

Private Attributes

std::tuple< typename std::remove_reference< funcargs >::type... > input
 
std::vector< double * > map
 
double(O::* ptr )(funcargs...)
 
shared_ptr< O > shared_obj
 
O * obj
 

Additional Inherited Members

- Protected Attributes inherited from daFunk::FunkBase
std::vector< Funkfunctions
 
ArgsType arguments
 
std::vector< std::vector< size_t > > indices
 
size_t datalen
 
Singularities singularities
 

Detailed Description

template<bool threadsafe, typename O, typename... funcargs>
class daFunk::FunkFuncM< threadsafe, O, funcargs >

Definition at line 779 of file daFunk.hpp.

Constructor & Destructor Documentation

◆ FunkFuncM() [1/2]

template<bool threadsafe, typename O , typename... funcargs>
template<typename... Args>
daFunk::FunkFuncM< threadsafe, O, funcargs >::FunkFuncM ( O *  obj,
double(O::*)(funcargs...)  f,
Args...  argss 
)
inline

Definition at line 783 of file daFunk.hpp.

References f.

783  : obj(obj)
784  {
785  ptr = f;
786  digest_input(argss...);
787  }
void digest_input()
Definition: daFunk.hpp:856
double(O::* ptr)(funcargs...)
Definition: daFunk.hpp:832

◆ FunkFuncM() [2/2]

template<bool threadsafe, typename O , typename... funcargs>
template<typename... Args>
daFunk::FunkFuncM< threadsafe, O, funcargs >::FunkFuncM ( shared_ptr< O >  obj,
double(O::*)(funcargs...)  f,
Args...  argss 
)
inline

Definition at line 790 of file daFunk.hpp.

References f.

790  : shared_obj(obj), obj(&*obj)
791  {
792  ptr = f;
793  digest_input(argss...);
794  }
void digest_input()
Definition: daFunk.hpp:856
shared_ptr< O > shared_obj
Definition: daFunk.hpp:833
double(O::* ptr)(funcargs...)
Definition: daFunk.hpp:832

Member Function Documentation

◆ digest_input() [1/3]

template<bool threadsafe, typename O , typename... funcargs>
template<typename T , typename... Args>
void daFunk::FunkFuncM< threadsafe, O, funcargs >::digest_input ( x,
Args...  argss 
)
inlineprivate

Definition at line 840 of file daFunk.hpp.

841  {
842  const int i = sizeof...(funcargs) - sizeof...(argss) - 1;
843  std::get<i>(input) = x;
844  digest_input(argss...);
845  }
void digest_input()
Definition: daFunk.hpp:856
std::tuple< typename std::remove_reference< funcargs >::type... > input
Definition: daFunk.hpp:830

◆ digest_input() [2/3]

template<bool threadsafe, typename O , typename... funcargs>
template<typename... Args>
void daFunk::FunkFuncM< threadsafe, O, funcargs >::digest_input ( Funk  f,
Args...  argss 
)
inlineprivate

Definition at line 847 of file daFunk.hpp.

References daFunk::joinArgs(), and daFunk::joinSingl().

848  {
849  const int i = sizeof...(funcargs) - sizeof...(argss) - 1;
850  map.push_back(&std::get<i>(input));
851  arguments = joinArgs(arguments, f->getArgs());
852  functions.push_back(f);
853  singularities = joinSingl(singularities, f->getSingl());
854  digest_input(argss...);
855  }
ArgsType arguments
Definition: daFunk.hpp:369
void digest_input()
Definition: daFunk.hpp:856
std::tuple< typename std::remove_reference< funcargs >::type... > input
Definition: daFunk.hpp:830
std::vector< Funk > functions
Definition: daFunk.hpp:368
ArgsType joinArgs(ArgsType args1, ArgsType args2)
Definition: daFunk.hpp:228
std::vector< double * > map
Definition: daFunk.hpp:831
Singularities singularities
Definition: daFunk.hpp:372
Singularities joinSingl(Singularities s1, Singularities s2)
Definition: daFunk.hpp:243
Here is the call graph for this function:

◆ digest_input() [3/3]

template<bool threadsafe, typename O , typename... funcargs>
void daFunk::FunkFuncM< threadsafe, O, funcargs >::digest_input ( )
inlineprivate

Definition at line 856 of file daFunk.hpp.

856 {};

◆ ppp()

template<bool threadsafe, typename O , typename... funcargs>
template<size_t... Args>
double daFunk::FunkFuncM< threadsafe, O, funcargs >::ppp ( index_list< Args... >  ,
std::tuple< typename std::remove_reference< funcargs >::type... > &  my_input 
)
inline

Definition at line 824 of file daFunk.hpp.

825  {
826  return (*obj.*ptr)(std::get<Args>(my_input)...);
827  }
double(O::* ptr)(funcargs...)
Definition: daFunk.hpp:832

◆ value()

template<bool threadsafe, typename O , typename... funcargs>
double daFunk::FunkFuncM< threadsafe, O, funcargs >::value ( const std::vector< double > &  data,
size_t  bindID 
)
inlinevirtual

Implements daFunk::FunkBase.

Definition at line 796 of file daFunk.hpp.

References f.

797  {
798  std::tuple<typename std::remove_reference<funcargs>::type...> my_input;
799  double result;
800  size_t i = 0;
801  #pragma omp critical(FunkFuncM_value)
802  {
803  for ( auto f = functions.begin(); f != functions.end(); ++f, ++i)
804  {
805  *map[i] = (*f)->value(data, bindID);
806  }
807  my_input = input;
808  }
809  if(threadsafe)
810  {
811  result = ppp(typename detail::range_builder<0, sizeof...(funcargs)>::type(), my_input);
812  }
813  else
814  {
815  #pragma omp critical (FunkFuncM_objectFunctionCall)
816  {
817  result = ppp(typename detail::range_builder<0, sizeof...(funcargs)>::type(), my_input);
818  }
819  }
820  return result;
821  }
std::tuple< typename std::remove_reference< funcargs >::type... > input
Definition: daFunk.hpp:830
std::vector< Funk > functions
Definition: daFunk.hpp:368
std::vector< double * > map
Definition: daFunk.hpp:831
double ppp(index_list< Args... >, std::tuple< typename std::remove_reference< funcargs >::type... > &my_input)
Definition: daFunk.hpp:824

Member Data Documentation

◆ input

template<bool threadsafe, typename O , typename... funcargs>
std::tuple<typename std::remove_reference<funcargs>::type...> daFunk::FunkFuncM< threadsafe, O, funcargs >::input
private

Definition at line 830 of file daFunk.hpp.

◆ map

template<bool threadsafe, typename O , typename... funcargs>
std::vector<double*> daFunk::FunkFuncM< threadsafe, O, funcargs >::map
private

Definition at line 831 of file daFunk.hpp.

◆ obj

template<bool threadsafe, typename O , typename... funcargs>
O* daFunk::FunkFuncM< threadsafe, O, funcargs >::obj
private

Definition at line 834 of file daFunk.hpp.

◆ ptr

template<bool threadsafe, typename O , typename... funcargs>
double(O::* daFunk::FunkFuncM< threadsafe, O, funcargs >::ptr) (funcargs...)
private

Definition at line 832 of file daFunk.hpp.

◆ shared_obj

template<bool threadsafe, typename O , typename... funcargs>
shared_ptr<O> daFunk::FunkFuncM< threadsafe, O, funcargs >::shared_obj
private

Definition at line 833 of file daFunk.hpp.


The documentation for this class was generated from the following file: