gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
Gambit::Diver_1_0_0 Namespace Reference


struct  diverScanData
 Structure for passing likelihood and printer data through Diver to the objective function. More...


double objective (double params[], const int param_dim, int &fcall, bool &quit, const bool validvector, void *&context)
 Function to be minimised by Diver. More...

Function Documentation

◆ objective()

double Gambit::Diver_1_0_0::objective ( double  params[],
const int  param_dim,
int fcall,
bool &  quit,
const bool  validvector,
void *&  context 

Function to be minimised by Diver.

Definition at line 183 of file diver.cpp.

References Gambit::GreAT::data, Gambit::Scanner::Plugins::pluginInfo::early_shutdown_in_progress(), Gambit::Diver_1_0_0::diverScanData::likelihood_function, and Gambit::Scanner::Plugins::plugin_info.

Referenced by scanner_plugin().

184  {
185  // Return the worst possible likelihood if the point is outside the prior box.
186  if (not validvector) return std::numeric_limits<double>::max();
188  // Put the parameters into a C++ vector
189  std::vector<double> param_vec(params, params + param_dim);
191  // Retrieve the likelihood function from the context pointer and call it
192  diverScanData* data = static_cast<diverScanData*>(context);
193  double lnlike = data->likelihood_function(param_vec);
195  // Increment the number of function calls, tell Diver to continue and return the likelihood
196  fcall += 1;
198  // Check whether the calling code wants us to shut down early
201  return -lnlike;
203  }
greatScanData data
Definition: great.cpp:38
Scanner::like_ptr likelihood_function
Definition: diver.hpp:39
Structure for passing likelihood and printer data through Diver to the objective function.
Definition: diver.hpp:37
EXPORT_SYMBOLS pluginInfo plugin_info
Access Functor for plugin info.
Here is the call graph for this function:
Here is the caller graph for this function: