gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::Diver_1_0_4 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_4::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 184 of file diver.cpp.

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

Referenced by scanner_plugin().

185  {
186  // Return the worst possible likelihood if the point is outside the prior box.
187  if (not validvector) return std::numeric_limits<double>::max();
189  // Put the parameters into a C++ vector
190  std::vector<double> param_vec(params, params + param_dim);
192  // Retrieve the likelihood function from the context pointer and call it
193  diverScanData* data = static_cast<diverScanData*>(context);
194  double lnlike = data->likelihood_function(param_vec);
196  // Increment the number of function calls, tell Diver to continue and return the likelihood
197  fcall += 1;
199  // Check whether the calling code wants us to shut down early
202  return -lnlike;
204  }
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: