gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::Scanner::like_ptr Class Reference

likelihood container for scanner plugins. More...

#include <factory_defs.hpp>

Inheritance diagram for Gambit::Scanner::like_ptr:
Collaboration diagram for Gambit::Scanner::like_ptr:

Public Member Functions

 like_ptr ()
 
 like_ptr (const like_ptr &in)
 
 like_ptr (void *in)
 
std::unordered_map< std::string, doubletransform (const std::vector< double > &vec)
 
std::vector< std::string > get_names () const
 
std::vector< doubleinverse_transform (const std::unordered_map< std::string, double > &physical)
 
double operator() (const std::vector< double > &vec)
 
double operator() (std::unordered_map< std::string, double > &map, const std::vector< double > &vec=std::vector< double >())
 

Private Types

typedef scan_ptr< double(std::unordered_map< std::string, double > &)> s_ptr
 

Private Attributes

std::unordered_map< std::string, doublemap
 

Detailed Description

likelihood container for scanner plugins.

Definition at line 311 of file factory_defs.hpp.

Member Typedef Documentation

◆ s_ptr

typedef scan_ptr<double (std::unordered_map<std::string, double> &)> Gambit::Scanner::like_ptr::s_ptr
private

Definition at line 314 of file factory_defs.hpp.

Constructor & Destructor Documentation

◆ like_ptr() [1/3]

Gambit::Scanner::like_ptr::like_ptr ( )
inline

Definition at line 318 of file factory_defs.hpp.

318 {}

◆ like_ptr() [2/3]

Gambit::Scanner::like_ptr::like_ptr ( const like_ptr in)
inline

Definition at line 319 of file factory_defs.hpp.

319 : s_ptr (in){}
scan_ptr< double(std::unordered_map< std::string, double > &)> s_ptr

◆ like_ptr() [3/3]

Gambit::Scanner::like_ptr::like_ptr ( void in)
inline

Definition at line 321 of file factory_defs.hpp.

321 : s_ptr(in) {}
scan_ptr< double(std::unordered_map< std::string, double > &)> s_ptr

Member Function Documentation

◆ get_names()

std::vector<std::string> Gambit::Scanner::like_ptr::get_names ( ) const
inline

Definition at line 329 of file factory_defs.hpp.

Referenced by scanner_plugin().

330  {
331  return (*this)->getPrior().getShownParameters();
332  }
Here is the caller graph for this function:

◆ inverse_transform()

std::vector<double> Gambit::Scanner::like_ptr::inverse_transform ( const std::unordered_map< std::string, double > &  physical)
inline

Definition at line 334 of file factory_defs.hpp.

Referenced by scanner_plugin().

335  {
336  return (*this)->getPrior().inverse_transform(physical);
337  }
Here is the caller graph for this function:

◆ operator()() [1/2]

double Gambit::Scanner::like_ptr::operator() ( const std::vector< double > &  vec)
inline

Definition at line 339 of file factory_defs.hpp.

References Gambit::Printers::get_point_id(), and combine_hdf5::rank.

340  {
341  int rank = (*this)->getRank();
342  (*this)->getPrior().transform(vec, map);
343  double ret_val = (*this)->operator()(map);
344  unsigned long long int id = Gambit::Printers::get_point_id();
345  (*this)->getPrinter().print(ret_val, (*this)->getPurpose(), rank, id);
346  if (vec.size() > 0 && (*this)->getPrinter().get_printUnitcube())
347  (*this)->getPrinter().print(vec, "unitCubeParameters", rank, id);
348  (*this)->getPrinter().print(id, "pointID", rank, id);
349  (*this)->getPrinter().print(rank, "MPIrank", rank, id);
350  (*this)->getPrinter().enable(); // Make sure printer is re-enabled (might have been disabled by invalid point error)
351 
352  return ret_val + (*this)->getPurposeOffset();
353  }
EXPORT_SYMBOLS unsigned long long int & get_point_id()
Returns unigue pointid;.
std::unordered_map< std::string, double > map
Here is the call graph for this function:

◆ operator()() [2/2]

double Gambit::Scanner::like_ptr::operator() ( std::unordered_map< std::string, double > &  map,
const std::vector< double > &  vec = std::vector<double>() 
)
inline

Definition at line 355 of file factory_defs.hpp.

References Gambit::Printers::get_point_id(), combine_hdf5::rank, and daFunk::vec().

356  {
357  int rank = (*this)->getRank();
358  (*this)->getPrior().transform(vec, map);
359  double ret_val = (*this)->operator()(map);
360  unsigned long long int id = Gambit::Printers::get_point_id();
361  (*this)->getPrinter().print(ret_val, (*this)->getPurpose(), rank, id);
362  if (vec.size() > 0 && (*this)->getPrinter().get_printUnitcube())
363  (*this)->getPrinter().print(vec, "unitCubeParameters", rank, id);
364  (*this)->getPrinter().print(id, "pointID", rank, id);
365  (*this)->getPrinter().print(rank, "MPIrank", rank, id);
366  (*this)->getPrinter().enable(); // Make sure printer is re-enabled (might have been disabled by invalid point error)
367  // Return the value of the function, offset by any offset set
368  return ret_val + (*this)->getPurposeOffset();
369  }
EXPORT_SYMBOLS unsigned long long int & get_point_id()
Returns unigue pointid;.
std::unordered_map< std::string, double > map
Here is the call graph for this function:

◆ transform()

std::unordered_map<std::string, double> Gambit::Scanner::like_ptr::transform ( const std::vector< double > &  vec)
inline

Definition at line 323 of file factory_defs.hpp.

Referenced by Gambit::PolyChord::LogLikeWrapper::LogLike(), and scanner_plugin().

324  {
325  (*this)->getPrior().transform(vec, map);
326  return map;
327  }
std::unordered_map< std::string, double > map
Here is the caller graph for this function:

Member Data Documentation

◆ map

std::unordered_map<std::string, double> Gambit::Scanner::like_ptr::map
private

Definition at line 315 of file factory_defs.hpp.


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